Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update generated file with regard to the detection of borken makecontext: we don...
[simgrid.git] / configure
index a5e2e91..50e4bc9 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
-# From configure.ac Revision: 1.143 .
+# From configure.ac Revision: 1.149 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for simgrid 3.1.1-cvs.
+# Generated by GNU Autoconf 2.59 for simgrid 3.3-cvs.
 #
 # Report bugs to <simgrid-devel@lists.gforge.inria.fr>.
 #
@@ -424,8 +424,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='simgrid'
 PACKAGE_TARNAME='simgrid'
-PACKAGE_VERSION='3.1.1-cvs'
-PACKAGE_STRING='simgrid 3.1.1-cvs'
+PACKAGE_VERSION='3.3-cvs'
+PACKAGE_STRING='simgrid 3.3-cvs'
 PACKAGE_BUGREPORT='simgrid-devel@lists.gforge.inria.fr'
 
 ac_unique_file="include/gras.h"
@@ -955,7 +955,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures simgrid 3.1.1-cvs to adapt to many kinds of systems.
+\`configure' configures simgrid 3.3-cvs to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1022,7 +1022,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of simgrid 3.1.1-cvs:";;
+     short | recursive ) echo "Configuration of simgrid 3.3-cvs:";;
    esac
   cat <<\_ACEOF
 
@@ -1057,6 +1057,7 @@ Optional Packages:
   --with-tags[=TAGS]
                           include additional configurations [automatic]
   --with-pthread   Use pthread instead of ucontext.
+  --with-pthreads   Use pthread instead of ucontext.
   --with-context=ucontext/pthread   Use either (System V) swapcontext or pthread [default=auto].
 
 Some influential environment variables:
@@ -1172,7 +1173,7 @@ fi
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-simgrid configure 3.1.1-cvs
+simgrid configure 3.3-cvs
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1186,7 +1187,7 @@ cat >&5 <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by simgrid $as_me 3.1.1-cvs, which was
+It was created by simgrid $as_me 3.3-cvs, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -1924,7 +1925,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='simgrid'
- VERSION='3.1.1-cvs'
+ VERSION='3.3-cvs'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3732,7 +3733,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3735 "configure"' > conftest.$ac_ext
+  echo '#line 3736 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -5565,7 +5566,7 @@ fi
 
 
 # Provide some information about the compiler.
-echo "$as_me:5568:" \
+echo "$as_me:5569:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -6626,11 +6627,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6629: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6630: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6633: \$? = $ac_status" >&5
+   echo "$as_me:6634: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6894,11 +6895,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6897: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6898: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6901: \$? = $ac_status" >&5
+   echo "$as_me:6902: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6998,11 +6999,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7001: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7002: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7005: \$? = $ac_status" >&5
+   echo "$as_me:7006: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -9356,7 +9357,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9359 "configure"
+#line 9360 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9456,7 +9457,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9459 "configure"
+#line 9460 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11794,11 +11795,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11797: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11798: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11801: \$? = $ac_status" >&5
+   echo "$as_me:11802: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -11898,11 +11899,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11901: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11902: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11905: \$? = $ac_status" >&5
+   echo "$as_me:11906: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -13486,11 +13487,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13489: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13490: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13493: \$? = $ac_status" >&5
+   echo "$as_me:13494: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13590,11 +13591,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13593: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13594: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13597: \$? = $ac_status" >&5
+   echo "$as_me:13598: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -15813,11 +15814,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15816: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15817: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15820: \$? = $ac_status" >&5
+   echo "$as_me:15821: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16081,11 +16082,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16084: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16085: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16088: \$? = $ac_status" >&5
+   echo "$as_me:16089: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16185,11 +16186,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16188: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16189: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16192: \$? = $ac_status" >&5
+   echo "$as_me:16193: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -23624,7 +23625,7 @@ ucontext_t uc_main;
 
 void child(void *arg)
 {
-    if (arg != (void *)2147483648)
+    if (arg != (void *)12345)
         exit(1);
     if (swapcontext(&uc_child, &uc_main) != 0)
         exit(2);
@@ -23650,7 +23651,7 @@ int main(int argc, char *argv[])
     uc_child.uc_stack.ss_sp = (char *)stack+(32*1024);
     uc_child.uc_stack.ss_size = 32*1024;
     uc_child.uc_stack.ss_flags = 0;
-    makecontext(&uc_child, child, 2, (void *)2147483648);
+    makecontext(&uc_child, child, 2, (void *)12345);
 
     /* switch into the user context */
     if (swapcontext(&uc_main, &uc_child) != 0)
@@ -23940,6 +23941,12 @@ echo "$as_me:$LINENO: checking what kind of backend should we use" >&5
 echo $ECHO_N "checking what kind of backend should we use... $ECHO_C" >&6
 
 
+# Check whether --with-pthread or --without-pthread was given.
+if test "${with_pthread+set}" = set; then
+  withval="$with_pthread"
+  with_context=pthread
+fi;
+
 # Check whether --with-pthread or --without-pthread was given.
 if test "${with_pthread+set}" = set; then
   withval="$with_pthread"
@@ -23964,6 +23971,7 @@ fi
 case $with_context in
  ucontext) ;;
  pthread) ;;
+ pthreads) ;;
  windows) ;;
  auto) with_context=ucontext;;
  *) { { echo "$as_me:$LINENO: error: --with-context must be either ucontext or pthread" >&5
@@ -23977,7 +23985,7 @@ if test "x$with_context" = "xucontext" ; then
 echo "${ECHO_T}found working ucontext. Great!" >&6
 
 cat >>confdefs.h <<\_ACEOF
-#define USE_UCONTEXT 1
+#define CONTEXT_UCONTEXT 1
 _ACEOF
 
   else
@@ -23993,6 +24001,9 @@ echo "${ECHO_T}no working ucontext found. Try pthreads as a fallback" >&6
   fi
 fi
 
+if test "x$with_context" = "xpthreads"; then
+  with_context=pthread
+fi
 if test "x$with_context" = "xpthread"; then
 
 for ac_header in pthread.h
@@ -24222,7 +24233,7 @@ fi
 
 
 cat >>confdefs.h <<\_ACEOF
-#define USE_PTHREADS 1
+#define CONTEXT_THREADS 1
 _ACEOF
 
   echo "$as_me:$LINENO: result: You have pthreads. Let's use them." >&5
@@ -24683,74 +24694,16 @@ echo "${ECHO_T}${T_MD}Checking extra libraries dependencies...${T_ME}" >&6
 
 SIMGRID_DEP=""
 GRAS_DEP=""
-echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
-if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char pthread_create ();
-int
-main ()
-{
-pthread_create ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_pthread_pthread_create=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_pthread_pthread_create=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
-if test $ac_cv_lib_pthread_pthread_create = yes; then
-  SIMGRID_DEP="-lpthread"; GRAS_DEP="-lpthread"
+if test xpthread=xyes ; then
+  # if the pthreads are usable
+  if test "x$with_context" = "xpthread" ; then
+    # if we use them to implement the xbt_context
+    SIMGRID_DEP="-lpthread"
+  fi
+  # we need them in any case for the gras lib (which is multithreaded)
+  GRAS_DEP="-lpthread"
 fi
 
-
 echo "$as_me:$LINENO: checking for csdp" >&5
 echo $ECHO_N "checking for csdp... $ECHO_C" >&6
 sdp=no
@@ -24989,6 +24942,10 @@ echo $ECHO_N "checking for extra dependencies of libgras... $ECHO_C" >&6
 case $host_os in
   *mingw* ) GRAS_DEP="$GRAS_DEP -lws2_32" ; SIMGRID_DEP="$SIMGRID_DEP -lws2_32";
             AM_CFLAGS=-DDLL_EXPORT
+
+            cat >>confdefs.h <<\_ACEOF
+#define CONTEXT_THREADS 1
+_ACEOF
 ;;
 esac
 
@@ -26204,7 +26161,7 @@ _ASBOX
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by simgrid $as_me 3.1.1-cvs, which was
+This file was extended by simgrid $as_me 3.3-cvs, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -26267,7 +26224,7 @@ _ACEOF
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-simgrid config.status 3.1.1-cvs
+simgrid config.status 3.3-cvs
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"