Branch: Tag:

2007-06-17

2007-06-17 02:40:44 by Martin Stjernholm <mast@lysator.liu.se>

Moved down the tests using port.c as far as possible to ensure
prerequisite tests have been made (specifically the IEEE float tests
when compiling on windows).

Rev: src/configure.in:1.1022

1: - AC_REVISION("$Id: configure.in,v 1.1021 2007/06/10 23:16:49 mast Exp $") + AC_REVISION("$Id: configure.in,v 1.1022 2007/06/17 02:40:44 mast Exp $")   AC_INIT(interpret.c)   AC_CONFIG_HEADER(machine.h)   
2308:    # MinGW system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1021 2007/06/10 23:16:49 mast Exp $. + # Automatically generated by $Id: configure.in,v 1.1022 2007/06/17 02:40:44 mast Exp $.   # MinGW-version. Do NOT edit.   posix_name="`cat`"   posix_prefix="/"
2346:    # Native POSIX system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1021 2007/06/10 23:16:49 mast Exp $. + # Automatically generated by $Id: configure.in,v 1.1022 2007/06/17 02:40:44 mast Exp $.   # POSIX-version. Do NOT edit.   cat   EOF
2355:    # rntcl-style    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1021 2007/06/10 23:16:49 mast Exp $. + # Automatically generated by $Id: configure.in,v 1.1022 2007/06/17 02:40:44 mast Exp $.   # RNTCL-version. Do NOT edit.   sed -e "$PIKE_PATH_TRANSLATE"   EOF
4676:      #############################################################################    - AC_MSG_CHECKING(if port.c works in CONFIGURE_TEST mode) - AC_CACHE_VAL(pike_cv_configure_test_port_c, [ -  AC_TRY_RUN([ - #include <stdio.h> -  - #define CONFIGURE_TEST - /* The following headers can cause problems in this mode, and they easily -  get indirectly included unless we do this. */ - #define STRALLOC_H - #define SVALUE_H - #define ARRAY_H -  - #include "port.c" -  - int main() - { -  return 0; - } -  ], pike_cv_configure_test_port_c=yes, -  pike_cv_configure_test_port_c=no, -  pike_cv_configure_test_port_c=unknown) - ]) - AC_MSG_RESULT($pike_cv_configure_test_port_c) - if test "x$pike_cv_configure_test_port_c" = xno; then -  AC_MSG_ERROR([ -  - port.c does not work in CONFIGURE_TEST mode. This is an internal - problem in Pike. configure aborted since further configure tests will - be unreliable. - ]) -  exit 1 - fi -  - ############################################################################# -  - AC_MSG_CHECKING(if gettimeofday takes two arguments) - AC_CACHE_VAL(pike_cv_func_gettimeofday_has_two_args, - [ -  AC_TRY_RUN([ - #if TIME_WITH_SYS_TIME - # include <sys/time.h> - # include <time.h> - #else - # if HAVE_SYS_TIME_H - # include <sys/time.h> - # else - # if HAVE_TIME_H - # include <time.h> - # endif - # endif - #endif -  - #ifndef HAVE_STRUCT_TIMEVAL - struct timeval - { -  long tv_sec; -  long tv_usec; - }; - #endif -  - int main() { -  struct timeval tv; -  gettimeofday(&tv,(void *)0); -  exit(0); - } -  ], [ pike_cv_func_gettimeofday_has_two_args=yes -  ], [ pike_cv_func_gettimeofday_has_two_args=no -  ], [ -  AC_TRY_LINK([ - #if TIME_WITH_SYS_TIME - # include <sys/time.h> - # include <time.h> - #else - # if HAVE_SYS_TIME_H - # include <sys/time.h> - # else - # if HAVE_TIME_H - # include <time.h> - # endif - # endif - #endif -  - #ifndef HAVE_STRUCT_TIMEVAL - struct timeval - { -  long tv_sec; -  long tv_usec; - }; - #endif -  ], [ - { -  struct timeval tv; -  gettimeofday(&tv,(void *)0); -  exit(0); - } -  ], [ pike_cv_func_gettimeofday_has_two_args=yes ], [pike_cv_func_gettimeofday_has_two_args=no]) -  ]) - ]) -  - if test $pike_cv_func_gettimeofday_has_two_args = yes; then -  AC_DEFINE(GETTIMEOFDAY_TAKES_TWO_ARGS) - fi -  - AC_MSG_RESULT($pike_cv_func_gettimeofday_has_two_args) -  - if test "x$ac_cv_func_gethrvtime" = xyes; then -  AC_MSG_CHECKING(if gethrvtime really works) -  AC_CACHE_VAL(pike_cv_func_gethrvtime_works, [ -  AC_TRY_RUN([ - #include <stdio.h> -  - #define CONFIGURE_TEST - /* The following headers can cause problems in this mode, and they easily -  get indirectly included unless we do this. */ - #define STRALLOC_H - #define SVALUE_H - #define ARRAY_H -  - #include "port.c" -  - int main() - { -  time_t start = TIME (0), now; -  hrtime_t vt = gethrvtime(), next_vt; -  if (start == (time_t) -1) return 1; /* Normal time doesn't work. */ -  do { /* Take some cpu time. */ -  now = TIME (0); -  next_vt = gethrvtime(); -  if (next_vt < vt) return 2; /* Shouldn't go backward. */ -  vt = next_vt; -  } while (now != (time_t) -1 && now <= start + 1); -  if (now == (time_t) -1) return 3; /* Normal time does not work. */ -  if (vt <= 0) return 4; /* Should have accounted for some cpu time. */ -  return 0; - } -  ], pike_cv_func_gethrvtime_works=yes, -  pike_cv_func_gethrvtime_works=no, -  pike_cv_func_gethrvtime_works=no) -  ]) -  AC_MSG_RESULT($pike_cv_func_gethrvtime_works) -  if test "x$pike_cv_func_gethrvtime_works" = xyes; then -  AC_DEFINE(HAVE_WORKING_GETHRVTIME) -  fi - fi -  +    # if test "x$ac_cv_func_gethrtime" != "xyes"; then   # AC_MSG_CHECKING(if we can make gethrtime by the RDTSC instruction)   # AC_CACHE_VAL(pike_cv_own_gethrtime_rdtsc, [
4984:      AC_MSG_RESULT($pike_cv_struct_tm_has___tm_gmtoff)    + ############################################################################# +    AC_MSG_CHECKING(for USHRT_MAX definition)      AC_CACHE_VAL(pike_cv_ushrt_max_is_defined,[
7151:    AC_DEFINE(HAVE_UNION_INIT)   fi    + ############################################################################# +  + AC_MSG_CHECKING(if port.c works in CONFIGURE_TEST mode) + AC_CACHE_VAL(pike_cv_configure_test_port_c, [ +  AC_TRY_RUN([ + #include <stdio.h> +  + #define CONFIGURE_TEST + /* The following headers can cause problems in this mode, and they easily +  get indirectly included unless we do this. */ + #define STRALLOC_H + #define SVALUE_H + #define ARRAY_H +  + #include "port.c" +  + int main() + { +  return 0; + } +  ], pike_cv_configure_test_port_c=yes, +  pike_cv_configure_test_port_c=no, +  pike_cv_configure_test_port_c=unknown) + ]) + AC_MSG_RESULT($pike_cv_configure_test_port_c) + if test "x$pike_cv_configure_test_port_c" = xno; then +  AC_MSG_ERROR([ +  + port.c does not work in CONFIGURE_TEST mode. This is an internal + problem in Pike. configure aborted since further configure tests will + be unreliable. + ]) +  exit 1 + fi +  + ############################################################################# +  + AC_MSG_CHECKING(if gettimeofday takes two arguments) + AC_CACHE_VAL(pike_cv_func_gettimeofday_has_two_args, + [ +  AC_TRY_RUN([ + #if TIME_WITH_SYS_TIME + # include <sys/time.h> + # include <time.h> + #else + # if HAVE_SYS_TIME_H + # include <sys/time.h> + # else + # if HAVE_TIME_H + # include <time.h> + # endif + # endif + #endif +  + #ifndef HAVE_STRUCT_TIMEVAL + struct timeval + { +  long tv_sec; +  long tv_usec; + }; + #endif +  + int main() { +  struct timeval tv; +  gettimeofday(&tv,(void *)0); +  exit(0); + } +  ], [ pike_cv_func_gettimeofday_has_two_args=yes +  ], [ pike_cv_func_gettimeofday_has_two_args=no +  ], [ +  AC_TRY_LINK([ + #if TIME_WITH_SYS_TIME + # include <sys/time.h> + # include <time.h> + #else + # if HAVE_SYS_TIME_H + # include <sys/time.h> + # else + # if HAVE_TIME_H + # include <time.h> + # endif + # endif + #endif +  + #ifndef HAVE_STRUCT_TIMEVAL + struct timeval + { +  long tv_sec; +  long tv_usec; + }; + #endif +  ], [ + { +  struct timeval tv; +  gettimeofday(&tv,(void *)0); +  exit(0); + } +  ], [ pike_cv_func_gettimeofday_has_two_args=yes ], [pike_cv_func_gettimeofday_has_two_args=no]) +  ]) + ]) +  + if test $pike_cv_func_gettimeofday_has_two_args = yes; then +  AC_DEFINE(GETTIMEOFDAY_TAKES_TWO_ARGS) + fi +  + AC_MSG_RESULT($pike_cv_func_gettimeofday_has_two_args) +  + if test "x$ac_cv_func_gethrvtime" = xyes; then +  AC_MSG_CHECKING(if gethrvtime really works) +  AC_CACHE_VAL(pike_cv_func_gethrvtime_works, [ +  AC_TRY_RUN([ + #include <stdio.h> +  + #define CONFIGURE_TEST + /* The following headers can cause problems in this mode, and they easily +  get indirectly included unless we do this. */ + #define STRALLOC_H + #define SVALUE_H + #define ARRAY_H +  + #include "port.c" +  + int main() + { +  time_t start = TIME (0), now; +  hrtime_t vt = gethrvtime(), next_vt; +  if (start == (time_t) -1) return 1; /* Normal time doesn't work. */ +  do { /* Take some cpu time. */ +  now = TIME (0); +  next_vt = gethrvtime(); +  if (next_vt < vt) return 2; /* Shouldn't go backward. */ +  vt = next_vt; +  } while (now != (time_t) -1 && now <= start + 1); +  if (now == (time_t) -1) return 3; /* Normal time does not work. */ +  if (vt <= 0) return 4; /* Should have accounted for some cpu time. */ +  return 0; + } +  ], pike_cv_func_gethrvtime_works=yes, +  pike_cv_func_gethrvtime_works=no, +  pike_cv_func_gethrvtime_works=no) +  ]) +  AC_MSG_RESULT($pike_cv_func_gethrvtime_works) +  if test "x$pike_cv_func_gethrvtime_works" = xyes; then +  AC_DEFINE(HAVE_WORKING_GETHRVTIME) +  fi + fi +    #######################################################################      AC_MSG_CHECKING(if rusage.c works in CONFIGURE_TEST mode)