OSDN Git Service

* g++.dg/other/first-global.C: Add -fpie for darwin.
[pf3gnuchains/gcc-fork.git] / boehm-gc / configure
index 3f2f5d8..c13c8ec 100755 (executable)
@@ -1351,6 +1351,13 @@ else
 fi
 
 
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+   && test "x${with_multisubdir}" != x ; then
+   cross_compiling=maybe
+fi
+
           ac_config_commands="$ac_config_commands default-1"
 
 
@@ -4773,7 +4780,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 4776 "configure"' > conftest.$ac_ext
+  echo '#line 4783 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -5444,6 +5451,33 @@ _ACEOF
        { echo "$as_me:$LINENO: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&5
 echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;}
        ;;
+      *-*-kfreebsd*-gnu)
+       cat >>confdefs.h <<\_ACEOF
+#define GC_FREEBSD_THREADS 1
+_ACEOF
+
+       INCLUDES="$INCLUDES -pthread"
+       THREADDLLIBS=-pthread
+       cat >>confdefs.h <<\_ACEOF
+#define _REENTRANT 1
+_ACEOF
+
+         if test "${enable_parallel_mark}" = yes; then
+         cat >>confdefs.h <<\_ACEOF
+#define PARALLEL_MARK 1
+_ACEOF
+
+       fi
+       cat >>confdefs.h <<\_ACEOF
+#define THREAD_LOCAL_ALLOC 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_COMPILER_TLS 1
+_ACEOF
+
+               ;;
      *-*-freebsd*)
        { echo "$as_me:$LINENO: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5
 echo "$as_me: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&2;}
@@ -5707,7 +5741,7 @@ echo "${ECHO_T}$ac_cv_member_ppc_thread_state_t_r0" >&6
 if test $ac_cv_member_ppc_thread_state_t_r0 = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAS_PPC_THREAD_STATE_R0
+#define HAS_PPC_THREAD_STATE_R0 1
 _ACEOF
 
 fi
@@ -5818,7 +5852,7 @@ echo "${ECHO_T}$ac_cv_member_ppc_thread_state_t___r0" >&6
 if test $ac_cv_member_ppc_thread_state_t___r0 = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAS_PPC_THREAD_STATE___R0
+#define HAS_PPC_THREAD_STATE___R0 1
 _ACEOF
 
 fi
@@ -5929,7 +5963,7 @@ echo "${ECHO_T}$ac_cv_member_ppc_thread_state64_t_r0" >&6
 if test $ac_cv_member_ppc_thread_state64_t_r0 = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAS_PPC_THREAD_STATE64_R0
+#define HAS_PPC_THREAD_STATE64_R0 1
 _ACEOF
 
 fi
@@ -6040,16 +6074,16 @@ echo "${ECHO_T}$ac_cv_member_ppc_thread_state64_t___r0" >&6
 if test $ac_cv_member_ppc_thread_state64_t___r0 = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAS_PPC_THREAD_STATE64___R0
+#define HAS_PPC_THREAD_STATE64___R0 1
 _ACEOF
 
 fi
 
     ;;
   i?86*-*-darwin*)
-    echo "$as_me:$LINENO: checking for i386_thread_state_t.eax" >&5
-echo $ECHO_N "checking for i386_thread_state_t.eax... $ECHO_C" >&6
-if test "${ac_cv_member_i386_thread_state_t_eax+set}" = set; then
+    echo "$as_me:$LINENO: checking for x86_thread_state32_t.eax" >&5
+echo $ECHO_N "checking for x86_thread_state32_t.eax... $ECHO_C" >&6
+if test "${ac_cv_member_x86_thread_state32_t_eax+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -6058,12 +6092,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <mach/thread_status.h>
+#include <sys/cdefs.h>
+      #include <mach/thread_status.h>
 
 int
 main ()
 {
-static i386_thread_state_t ac_aggr;
+static x86_thread_state32_t ac_aggr;
 if (ac_aggr.eax)
 return 0;
   ;
@@ -6092,7 +6127,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_i386_thread_state_t_eax=yes
+  ac_cv_member_x86_thread_state32_t_eax=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -6103,12 +6138,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <mach/thread_status.h>
+#include <sys/cdefs.h>
+      #include <mach/thread_status.h>
 
 int
 main ()
 {
-static i386_thread_state_t ac_aggr;
+static x86_thread_state32_t ac_aggr;
 if (sizeof ac_aggr.eax)
 return 0;
   ;
@@ -6137,30 +6173,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_i386_thread_state_t_eax=yes
+  ac_cv_member_x86_thread_state32_t_eax=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_i386_thread_state_t_eax=no
+ac_cv_member_x86_thread_state32_t_eax=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_i386_thread_state_t_eax" >&5
-echo "${ECHO_T}$ac_cv_member_i386_thread_state_t_eax" >&6
-if test $ac_cv_member_i386_thread_state_t_eax = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state32_t_eax" >&5
+echo "${ECHO_T}$ac_cv_member_x86_thread_state32_t_eax" >&6
+if test $ac_cv_member_x86_thread_state32_t_eax = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAS_I386_THREAD_STATE_EAX
+#define HAS_X86_THREAD_STATE32_EAX 1
 _ACEOF
 
 fi
 
-    echo "$as_me:$LINENO: checking for i386_thread_state_t.__eax" >&5
-echo $ECHO_N "checking for i386_thread_state_t.__eax... $ECHO_C" >&6
-if test "${ac_cv_member_i386_thread_state_t___eax+set}" = set; then
+    echo "$as_me:$LINENO: checking for x86_thread_state32_t.__eax" >&5
+echo $ECHO_N "checking for x86_thread_state32_t.__eax... $ECHO_C" >&6
+if test "${ac_cv_member_x86_thread_state32_t___eax+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -6169,12 +6205,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <mach/thread_status.h>
+#include <sys/cdefs.h>
+      #include <mach/thread_status.h>
 
 int
 main ()
 {
-static i386_thread_state_t ac_aggr;
+static x86_thread_state32_t ac_aggr;
 if (ac_aggr.__eax)
 return 0;
   ;
@@ -6203,7 +6240,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_i386_thread_state_t___eax=yes
+  ac_cv_member_x86_thread_state32_t___eax=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -6214,12 +6251,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <mach/thread_status.h>
+#include <sys/cdefs.h>
+      #include <mach/thread_status.h>
 
 int
 main ()
 {
-static i386_thread_state_t ac_aggr;
+static x86_thread_state32_t ac_aggr;
 if (sizeof ac_aggr.__eax)
 return 0;
   ;
@@ -6248,28 +6286,256 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_i386_thread_state_t___eax=yes
+  ac_cv_member_x86_thread_state32_t___eax=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_i386_thread_state_t___eax=no
+ac_cv_member_x86_thread_state32_t___eax=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_i386_thread_state_t___eax" >&5
-echo "${ECHO_T}$ac_cv_member_i386_thread_state_t___eax" >&6
-if test $ac_cv_member_i386_thread_state_t___eax = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state32_t___eax" >&5
+echo "${ECHO_T}$ac_cv_member_x86_thread_state32_t___eax" >&6
+if test $ac_cv_member_x86_thread_state32_t___eax = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAS_I386_THREAD_STATE___EAX
+#define HAS_X86_THREAD_STATE32___EAX 1
 _ACEOF
 
 fi
 
     ;;
+  x86_64-*-darwin*)
+    echo "$as_me:$LINENO: checking for x86_thread_state64_t.rax" >&5
+echo $ECHO_N "checking for x86_thread_state64_t.rax... $ECHO_C" >&6
+if test "${ac_cv_member_x86_thread_state64_t_rax+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/cdefs.h>
+      #include <mach/thread_status.h>
+
+int
+main ()
+{
+static x86_thread_state64_t ac_aggr;
+if (ac_aggr.rax)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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_objext'
+  { (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_member_x86_thread_state64_t_rax=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/cdefs.h>
+      #include <mach/thread_status.h>
+
+int
+main ()
+{
+static x86_thread_state64_t ac_aggr;
+if (sizeof ac_aggr.rax)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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_objext'
+  { (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_member_x86_thread_state64_t_rax=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_x86_thread_state64_t_rax=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state64_t_rax" >&5
+echo "${ECHO_T}$ac_cv_member_x86_thread_state64_t_rax" >&6
+if test $ac_cv_member_x86_thread_state64_t_rax = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_X86_THREAD_STATE64_RAX 1
+_ACEOF
+
+fi
+
+    echo "$as_me:$LINENO: checking for x86_thread_state64_t.__rax" >&5
+echo $ECHO_N "checking for x86_thread_state64_t.__rax... $ECHO_C" >&6
+if test "${ac_cv_member_x86_thread_state64_t___rax+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/cdefs.h>
+      #include <mach/thread_status.h>
+
+int
+main ()
+{
+static x86_thread_state64_t ac_aggr;
+if (ac_aggr.__rax)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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_objext'
+  { (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_member_x86_thread_state64_t___rax=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/cdefs.h>
+      #include <mach/thread_status.h>
+
+int
+main ()
+{
+static x86_thread_state64_t ac_aggr;
+if (sizeof ac_aggr.__rax)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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_objext'
+  { (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_member_x86_thread_state64_t___rax=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_x86_thread_state64_t___rax=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state64_t___rax" >&5
+echo "${ECHO_T}$ac_cv_member_x86_thread_state64_t___rax" >&6
+if test $ac_cv_member_x86_thread_state64_t___rax = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_X86_THREAD_STATE64___RAX 1
+_ACEOF
+
+fi
+
+     ;;
   *) ;;
 esac
 
@@ -6560,11 +6826,9 @@ LIBS="$oldLIBS"
 
 # Configuration of machine-dependent code
 #
-# We don't set NO_EXECUTE_PERMISSION by default because gcj (and
-# anything else that creates trampolines in gc-allocated memory)
-# always needs exec permission.  The exceptions to this are IA-64 and
-# some variations of Power PC, where trampolines don't contain
-# executable code.
+# Set NO_EXECUTE_PERMISSION by default because gcj already uses
+# ffi_closure_{alloc,free} which takes care of allocating trampolines
+# in executable memory.
 #
 echo "$as_me:$LINENO: checking which machine-dependent code should be used" >&5
 echo $ECHO_N "checking which machine-dependent code should be used... $ECHO_C" >&6
@@ -6625,14 +6889,14 @@ _ACEOF
     machdep="sparc_mach_dep.lo"
     ;;
  ia64-*-*)
+    machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
+    ;;
+esac
 
 cat >>confdefs.h <<\_ACEOF
 #define NO_EXECUTE_PERMISSION 1
 _ACEOF
 
-    machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
-    ;;
-esac
 if test x"$machdep" = x; then
 echo "$as_me:$LINENO: result: $machdep" >&5
 echo "${ECHO_T}$machdep" >&6
@@ -7358,19 +7622,6 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 
-if test -n "${with_cross_host}"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define NO_SIGSET 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define NO_DEBUGGING 1
-_ACEOF
-
-fi
-
 # Check whether --enable-gc-debug or --disable-gc-debug was given.
 if test "${enable_gc_debug+set}" = set; then
   enableval="$enable_gc_debug"