rbb 99/11/10 05:40:52
Modified: src/lib/apr configure.in aclocal.m4 acconfig.h Log: Fix a problem with the configure script. AC_CHECK_SIZEOF is only meant to be used for built-in types. ssize_t is not a built-in type on all systems, so SIZEOF_SSIZE_T was consistently getting defined to 0 on all of my systems. This fixes that problem by re-writing AC_TRY_RUN (the default AC_TRY_RUN has issues that don't allow for getting the return code from the program) and using it to get the size of SSIZE_T. Revision Changes Path 1.24 +13 -1 apache-2.0/src/lib/apr/configure.in Index: configure.in =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- configure.in 1999/11/09 09:01:10 1.23 +++ configure.in 1999/11/10 13:40:51 1.24 @@ -56,7 +56,19 @@ AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(long double, 12) AC_CHECK_SIZEOF(long long, 8) -AC_CHECK_SIZEOF(ssize_t, 4) + +MY_TRY_RUN([ +#include <sys/types.h> +#include <stdlib.h> +#include <stdio.h> + +int main() { + return(sizeof(ssize_t)); +} +], +AC_DEFINE(SIZEOF_SSIZE_T, 4), +AC_DEFINE_UNQUOTED(SIZEOF_SSIZE_T, $?), +AC_DEFINE(SIZEOF_SSIZE_T, 4)) # Use /bin/sh if it exists, otherwise go looking for sh in the path if test ".$SH" = . -a -f /bin/sh; then 1.4 +42 -0 apache-2.0/src/lib/apr/aclocal.m4 Index: aclocal.m4 =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/aclocal.m4,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- aclocal.m4 1999/10/21 16:41:07 1.3 +++ aclocal.m4 1999/11/10 13:40:52 1.4 @@ -95,4 +95,46 @@ fi ])dnl +dnl ### AC_TRY_RUN had some problems actually using a programs return code, +dnl ### so I am re-working it here to be used in APR's configure script. +dnl MY_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE +dnl [, ACTION-IF-CROSS-COMPILING]]]) +AC_DEFUN(MY_TRY_RUN, +[if test "$cross_compiling" = yes; then + ifelse([$4], , + [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling +)dnl + AC_MSG_ERROR(can not run test program while cross compiling)], + [$4]) +else + MY_TRY_RUN_NATIVE([$1], [$2], [$3]) +fi +]) + +dnl Like AC_TRY_RUN but assumes a native-environment (non-cross) compiler. +dnl MY_TRY_RUN_NATIVE(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) +AC_DEFUN(MY_TRY_RUN_NATIVE, +[cat > conftest.$ac_ext <<EOF +[#]line __oline__ "configure" +#include "confdefs.h" +ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus +extern "C" void exit(int); +#endif +])dnl +[$1] +EOF +if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then +dnl Don't remove the temporary files here, so they can be examined. + ifelse([$2], , :, [$2]) +else +ifelse([$3], , , [ $3 + rm -fr conftest* +])dnl + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +fi +rm -fr conftest*]) + + 1.11 +1 -0 apache-2.0/src/lib/apr/acconfig.h Index: acconfig.h =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/acconfig.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- acconfig.h 1999/10/20 15:09:54 1.10 +++ acconfig.h 1999/11/10 13:40:52 1.11 @@ -42,6 +42,7 @@ #undef NEED_RLIM_T #undef USEBCOPY +#undef SIZEOF_SSIZE_T #undef APR_HAS_THREADS @BOTTOM@