--------------------- PatchSet 11489 Date: 2007/06/23 21:31:59 Author: hno Branch: SQUID_2_6 Tag: (none) Log: MFC: Make AC_CHECK_.._SYSTYPE wrappers around the default calls to allow cross-compiling Our custom AC_CHECK_.._SYSTYPE macros relied on AC_TRY_RUN which fails in cross-compiling. Rewrote to be wrappers around the standard calls instead which allows for crosscompiling, and makes them behave more common. Merged changes: 2007/06/11 22:02:56 hno +9 -32 Make AC_CHECK_.._SYSTYPE wrappers around the default calls to allow cross-compiling Members: acinclude.m4:1.9->1.9.2.1 Index: squid/acinclude.m4 =================================================================== RCS file: /cvsroot/squid/squid/acinclude.m4,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -r1.9 -r1.9.2.1 --- squid/acinclude.m4 24 May 2006 11:20:10 -0000 1.9 +++ squid/acinclude.m4 23 Jun 2007 21:31:59 -0000 1.9.2.1 @@ -8,15 +8,10 @@ dnl AC_CHECK_SIZEOF_SYSTYPE(TYPE [, CROSS-SIZE]) AC_DEFUN([AC_CHECK_SIZEOF_SYSTYPE], -[changequote(<<, >>)dnl -dnl The name to #define. -define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl -dnl The cache variable name. -define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl -changequote([, ])dnl -AC_MSG_CHECKING(size of $1) -AC_CACHE_VAL(AC_CV_NAME, -[AC_TRY_RUN([ +[ +AC_REQUIRE([AC_HEADER_STDC])dnl +AC_CHECK_SIZEOF($1, , +[ #include #if STDC_HEADERS #include @@ -31,29 +26,15 @@ #if HAVE_SYS_BITYPES_H #include #endif -int main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", (int)sizeof($1)); - return(0); -} -], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl -AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [Size of ] AC_TYPE_NAME) -undefine([AC_TYPE_NAME])dnl -undefine([AC_CV_NAME])dnl ]) +])dnl dnl AC_CHECK_SYSTYPE(TYPE, DEFAULT) AC_DEFUN([AC_CHECK_SYSTYPE], [AC_REQUIRE([AC_HEADER_STDC])dnl -AC_MSG_CHECKING(for $1) -AC_CACHE_VAL(ac_cv_type_$1, -[AC_EGREP_CPP(dnl -changequote(<<,>>)dnl -<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl -changequote([,]), [ +AC_CHECK_TYPE($1, , +[AC_DEFINE_UNQUOTED($1, $2, [Define to '$2' if not defined])], +[ /* What a mess.. many systems have added the (now standard) bit types * in their own ways, so we need to scan a wide variety of headers to * find them.. @@ -72,9 +53,5 @@ #if HAVE_SYS_BITYPES_H #include #endif -], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl -AC_MSG_RESULT($ac_cv_type_$1) -if test $ac_cv_type_$1 = no; then - AC_DEFINE($1, $2, [Have ] $2 [ datatype]) -fi ]) +])dnl