Branch: Tag:

2007-06-09

2007-06-09 18:02:14 by Martin Stjernholm <mast@lysator.liu.se>

Fixed decay that broke the configure tests using rusage.c and threads.c.
Also added configure tests to make it more certain that this kind of thing
doesn't go by unnoticed in the future.

Rev: src/configure.in:1.1016
Rev: src/pike_threadlib.h:1.61
Rev: src/rusage.c:1.45
Rev: src/svalue.h:1.146
Rev: src/threads.c:1.253

1: - AC_REVISION("$Id: configure.in,v 1.1015 2007/06/09 17:32:01 mast Exp $") + AC_REVISION("$Id: configure.in,v 1.1016 2007/06/09 18:02:14 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.1015 2007/06/09 17:32:01 mast Exp $. + # Automatically generated by $Id: configure.in,v 1.1016 2007/06/09 18:02:14 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.1015 2007/06/09 17:32:01 mast Exp $. + # Automatically generated by $Id: configure.in,v 1.1016 2007/06/09 18:02:14 mast Exp $.   # POSIX-version. Do NOT edit.   cat   EOF
2355:    # rntcl-style    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.1015 2007/06/09 17:32:01 mast Exp $. + # Automatically generated by $Id: configure.in,v 1.1016 2007/06/09 18:02:14 mast Exp $.   # RNTCL-version. Do NOT edit.   sed -e "$PIKE_PATH_TRANSLATE"   EOF
2655:      #############################################################################    + AC_MSG_CHECKING(how to concatenate two symbols) + AC_CACHE_VAL(pike_cv_cpp_symbol_concat, [ +  AC_TRY_COMPILE([ + int AABB=0; + #define CONCAT(X,Y) X##Y +  ], [ +  return CONCAT(AA,BB); +  ], pike_cv_cpp_symbol_concat=ANSI, [ +  AC_TRY_COMPILE([ + int AABB=0; + #define CONCAT(X,Y) X/**/Y +  ], [ +  return CONCAT(AA,BB); +  ], pike_cv_cpp_symbol_concat=KR, [ +  pike_cv_cpp_symbol_concat=Unknown +  ]) +  ]) + ]) + AC_MSG_RESULT($pike_cv_cpp_symbol_concat) + case "$pike_cv_cpp_symbol_concat" in +  "ANSI") +  AC_DEFINE(HAVE_ANSI_CONCAT) +  ;; +  "KR") +  AC_DEFINE(HAVE_KR_CONCAT) +  ;; + esac +  + ############################################################################# +    # The AC_PROG_INSTALL test is broken if $INSTALL is specified by hand.   # The FreeBSD ports system does this...   # Workaround:
3034:      #############################################################################    + AC_MSG_CHECKING(for isgraph) + AC_CACHE_VAL(pike_cv_func_isgraph, [ AC_TRY_LINK([ + #include <ctype.h> + ], [ + return(!isgraph('A')); + ], pike_cv_func_isgraph=yes, pike_cv_func_isgraph=no) + ]) + AC_MSG_RESULT($pike_cv_func_isgraph) + if test "x$pike_cv_func_isgraph" = "xyes" ; then +  AC_DEFINE(HAVE_ISGRAPH) + else :; fi +  + ############################################################################# +    # Note: For function detection to work correctly with   # PIKE_FUNCS_NEED_DECLS (i.e. windows), it's necessary that   # AC_CHECK_HEADERS tests all potential header files for a function
4631:      #############################################################################    + 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 + #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,   [
6361:   fi      ############################################################################# -  - AC_MSG_CHECKING(for isgraph) - AC_CACHE_VAL(pike_cv_func_isgraph, [ AC_TRY_LINK([ - #include <ctype.h> - ], [ - return(!isgraph('A')); - ], pike_cv_func_isgraph=yes, pike_cv_func_isgraph=no) - ]) - AC_MSG_RESULT($pike_cv_func_isgraph) - if test "x$pike_cv_func_isgraph" = "xyes" ; then -  AC_DEFINE(HAVE_ISGRAPH) - else :; fi -  - ############################################################################# +    #   # __func__ is new in ISO C 9x   #
6612:      #############################################################################    - AC_MSG_CHECKING(how to concatenate two symbols) - AC_CACHE_VAL(pike_cv_cpp_symbol_concat, [ -  AC_TRY_COMPILE([ - int AABB=0; - #define CONCAT(X,Y) X##Y -  ], [ -  return CONCAT(AA,BB); -  ], pike_cv_cpp_symbol_concat=ANSI, [ -  AC_TRY_COMPILE([ - int AABB=0; - #define CONCAT(X,Y) X/**/Y -  ], [ -  return CONCAT(AA,BB); -  ], pike_cv_cpp_symbol_concat=KR, [ -  pike_cv_cpp_symbol_concat=Unknown -  ]) -  ]) - ]) - AC_MSG_RESULT($pike_cv_cpp_symbol_concat) - case "$pike_cv_cpp_symbol_concat" in -  "ANSI") -  AC_DEFINE(HAVE_ANSI_CONCAT) -  ;; -  "KR") -  AC_DEFINE(HAVE_KR_CONCAT) -  ;; - esac -  - ############################################################################# -  +    AC_MSG_CHECKING(how to set things nonblocking)   AC_CACHE_VAL(pike_cv_sys_nonblock,   [
7110:      #######################################################################    + AC_MSG_CHECKING(if rusage.c works in CONFIGURE_TEST mode) + AC_CACHE_VAL(pike_cv_configure_test_rusage_c, [ +  AC_TRY_RUN([ + #include <stdio.h> + #define CONFIGURE_TEST + #include "rusage.c" + int main() + { +  init_rusage(); +  return 0; + } +  ], pike_cv_configure_test_rusage_c=yes, +  pike_cv_configure_test_rusage_c=no, +  pike_cv_configure_test_rusage_c=unknown) + ]) + AC_MSG_RESULT($pike_cv_configure_test_rusage_c) + if test "x$pike_cv_configure_test_rusage_c" = xno; then +  AC_MSG_ERROR([ +  + rusage.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 threads.c works in CONFIGURE_TEST mode) + AC_CACHE_VAL(pike_cv_configure_test_threads_c, [ +  AC_TRY_RUN([ + #include <stdio.h> + #define CONFIGURE_TEST + #include "threads.c" + int main() + { +  return 0; + } +  ], pike_cv_configure_test_threads_c=yes, +  pike_cv_configure_test_threads_c=no, +  pike_cv_configure_test_threads_c=unknown) + ]) + AC_MSG_RESULT($pike_cv_configure_test_threads_c) + if test "x$pike_cv_configure_test_threads_c" = xno; then +  AC_MSG_ERROR([ +  + threads.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 cpu time is thread local)   AC_CACHE_VAL(pike_cv_thread_local_cpu_time, [    rm -f confdefs.out.2 2>/dev/null
7121:      #ifdef PIKE_THREADS    - #ifndef TOSTR - #define TOSTR(X) #X - #endif - #ifndef DEFINETOSTR - #define DEFINETOSTR(X) TOSTR(X) - #endif -  +    #define CONFIGURE_TEST      #include "port.c"
7171:    FILE *res = fopen ("confdefs.out.2", "w"); /* weird name to circumvent configure cleanups */    if (!res) return 2;    +  init_rusage();    really_low_th_init();       mt_init (&m);
7221:    ], [    pike_cv_thread_local_cpu_time=yes    ], [ -  if test -f confdefs.out.2; then +  if test -f confdefs.out.2 && test "x`cat confdefs.out.2`" != x; then    pike_cv_thread_local_cpu_time=`cat confdefs.out.2`    else -  AC_MSG_WARN([Test failed to compile. - Problems in port.c, rusage.c or threads.c with CONFIGURE_TEST is defined?]) +  AC_MSG_WARN([ +  + Test failed to compile or execute. + Problems in port.c, rusage.c or threads.c with CONFIGURE_TEST is defined? + ])    # Don't set pike_cv_thread_local_cpu_time here so that the    # failure doesn't get cached. -  result="unknown (compilation failed)" +  result="unknown (compilation or execution failed)"    fi    ], [    pike_cv_thread_local_cpu_time="unknown (cross compilation)"
8416:   OLD_CPPFLAGS="$CPPFLAGS"   CPPFLAGS="-I. -I$srcdir $CPPFLAGS"   AC_TRY_RUN([ - #include "global.h" +    #include "svalue.h"      int main()