re PR middle-end/42229 (cancel_loop_tree: bad read causes ice)
[gcc.git] / boehm-gc / configure.ac
index d4dd16b9e06fa10db94dc4f9b3742fe0ab8c90a7..363263ec277880a31e41403a42099b281a039d68 100644 (file)
@@ -15,7 +15,7 @@
 
 dnl Process this file with autoconf to produce configure.
 
-AC_PREREQ(2.59)
+AC_PREREQ(2.64)
 AC_INIT
 AC_CONFIG_SRCDIR(gcj_mlc.c)
 # This works around the fact that libtool configuration may change LD
@@ -49,7 +49,7 @@ m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
 m4_define([_AC_ARG_VAR_PRECIOUS],[])
 AC_PROG_CC
 AC_PROG_CXX
-m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 AM_PROG_CC_C_O
 
@@ -84,6 +84,13 @@ case "${host}" in
     ;;
 esac
 
+dnl Add for mingw targets GC_BUILD option
+case "${host}" in
+  *-*-mingw*)
+    gc_cflags="${gc_cflags} -DGC_BUILD=1"
+    ;;
+esac
+
 dnl gc_cflags="${gc_cflags} -fno-builtin"
 
 GC_CFLAGS=${gc_cflags}
@@ -173,8 +180,12 @@ case "$THREADS" in
        THREADLIBS=-pthread
        ;;
      *-*-solaris*)
-       AC_DEFINE(GC_SOLARIS_THREADS,1,[support for Solaris (thr_) threads])
        AC_DEFINE(GC_SOLARIS_PTHREADS,1,[support for Solaris pthreads])
+       # Need to use alternate thread library, otherwise gctest hangs
+       # on Solaris 8.
+       multi_os_directory=`$CC -print-multi-os-directory`
+       THREADLIBS="-L/usr/lib/lwp/$multi_os_directory \
+                   -R/usr/lib/lwp/$multi_os_directory -lpthread -lthread -lrt"
        ;;
      *-*-irix*)
        AC_DEFINE(GC_IRIX_THREADS,1,[support for Irix pthreads])
@@ -300,6 +311,14 @@ case "$host" in
     ;;
 esac
 
+# extra LD Flags which are required for targets
+case "${host}" in
+  *-*-darwin*)
+    extra_ldflags_libgc=-Wl,-single_module
+    ;;
+esac
+AC_SUBST(extra_ldflags_libgc)
+
 AC_SUBST(EXTRA_TEST_LIBS)
 
 target_all=libgcjgc.la
@@ -535,5 +554,5 @@ fi
 
 AC_CONFIG_HEADERS([include/gc_config.h include/gc_ext_config.h])
 
-AC_CONFIG_FILES(Makefile include/Makefile)
+AC_CONFIG_FILES(Makefile include/Makefile threads.mk)
 AC_OUTPUT