dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet ChangeLog,1.2334,1.2335 configure.in,1.


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet ChangeLog,1.2334,1.2335 configure.in,1.118,1.119
Date: Wed, 07 May 2003 19:04:28 -0400

Update of /cvsroot/dotgnu-pnet/pnet
In directory subversions:/tmp/cvs-serv21499

Modified Files:
        ChangeLog configure.in 
Log Message:


Implement a better sizeof check that should work more smoothly in
cross-compile environments.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.2334
retrieving revision 1.2335
diff -C2 -r1.2334 -r1.2335
*** ChangeLog   7 May 2003 22:50:08 -0000       1.2334
--- ChangeLog   7 May 2003 23:04:25 -0000       1.2335
***************
*** 5,8 ****
--- 5,11 ----
        a reference to the "Bug Tracking" system.
  
+       * configure.in: implement a better sizeof check that should work
+       more smoothly in cross-compile environments.
+ 
  2003-05-07  Rhys Weatherley  <address@hidden>
  

Index: configure.in
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/configure.in,v
retrieving revision 1.118
retrieving revision 1.119
diff -C2 -r1.118 -r1.119
*** configure.in        3 May 2003 01:09:05 -0000       1.118
--- configure.in        7 May 2003 23:04:25 -0000       1.119
***************
*** 230,242 ****
  AC_CHECK_HEADERS(sys/select.h netdb.h sys/cygwin.h dirent.h sys/utime.h 
utime.h)
  
  dnl Checks for typedefs, structures, and compiler characteristics.
  AC_C_CONST
! AC_CHECK_SIZEOF(int, 4)
! AC_CHECK_SIZEOF(long, 4)
! AC_CHECK_SIZEOF(long long, 8)
! AC_CHECK_SIZEOF(float, 4)
! AC_CHECK_SIZEOF(double, 8)
! AC_CHECK_SIZEOF(long double, 12)
! AC_CHECK_SIZEOF(void *, 4)
  
  dnl Check for computed goto support in the compiler.
--- 230,268 ----
  AC_CHECK_HEADERS(sys/select.h netdb.h sys/cygwin.h dirent.h sys/utime.h 
utime.h)
  
+ dnl A macro that helps detect the size of types in a cross-compile 
environment.
+ AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
+ [changequote(<<, >>)dnl
+ dnl The name to #define.
+ define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
+ dnl The cache variable name.
+ define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
+ changequote([, ])dnl
+ AC_MSG_CHECKING(size of $1)
+ AC_CACHE_VAL(AC_CV_NAME,
+ [for ac_size in 4 8 1 2 12 16 $2 ; do # List sizes in rough order of 
prevalence.
+   AC_TRY_COMPILE([#include "confdefs.h"
+ #include <sys/types.h>
+ ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
+   if test x$AC_CV_NAME != x ; then break; fi
+ done
+ ])
+ if test x$AC_CV_NAME = x ; then
+   AC_CV_NAME=0
+ fi
+ AC_MSG_RESULT($AC_CV_NAME)
+ AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type 
$1])
+ undefine([AC_TYPE_NAME])dnl
+ undefine([AC_CV_NAME])dnl
+ ])
+ 
  dnl Checks for typedefs, structures, and compiler characteristics.
  AC_C_CONST
! AC_COMPILE_CHECK_SIZEOF(int, 4)
! AC_COMPILE_CHECK_SIZEOF(long, 4)
! AC_COMPILE_CHECK_SIZEOF(long long, 8)
! AC_COMPILE_CHECK_SIZEOF(float, 4)
! AC_COMPILE_CHECK_SIZEOF(double, 8)
! AC_COMPILE_CHECK_SIZEOF(long double, 12)
! AC_COMPILE_CHECK_SIZEOF(void *, 4)
  
  dnl Check for computed goto support in the compiler.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]