]> granicus.if.org Git - gc/commitdiff
Fix pthread_start compilation if single-obj-compilation (Linux)
authorIvan Maidanski <ivmai@mail.ru>
Thu, 8 Jun 2017 08:40:36 +0000 (11:40 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 8 Jun 2017 08:40:36 +0000 (11:40 +0300)
* Makefile.am [SINGLE_GC_OBJ && PTHREAD_START_STANDALONE] (AM_CPPFLAGS):
Add -DGC_PTHREAD_START_STANDALONE.
* Makefile.am [SINGLE_GC_OBJ && PTHREAD_START_STANDALONE]
(libgc_la_SOURCES): Add pthread_start.c entry.
* Makefile.am: Add bank lines (to improve readability).
* configure.ac [*-*-*linux*]: Add AM_CONDITIONAL(PTHREAD_START_STANDALONE).

Makefile.am
configure.ac

index 3c87ce9bd954121dd33223b65528ced4b0d14ca4..c2c5402a26914def9faa2f31581c046b572dd132 100644 (file)
@@ -55,9 +55,18 @@ pkgconfig_DATA = bdw-gc.pc
 # ---------
 
 lib_LTLIBRARIES += libgc.la
+
 if SINGLE_GC_OBJ
+
 libgc_la_SOURCES = extra/gc.c
+
+if PTHREAD_START_STANDALONE
+AM_CPPFLAGS += -DGC_PTHREAD_START_STANDALONE
+libgc_la_SOURCES += pthread_start.c
+endif
+
 else
+
 EXTRA_DIST += extra/gc.c
 libgc_la_SOURCES = \
     allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
@@ -72,6 +81,7 @@ if WIN32_THREADS
 libgc_la_SOURCES += win32_threads.c
 else
 if PTHREADS
+# Not Cygwin or MinGW.
 libgc_la_SOURCES += pthread_start.c pthread_support.c
 if DARWIN_THREADS
 libgc_la_SOURCES += darwin_stop_world.c
@@ -93,6 +103,7 @@ if ENABLE_DISCLAIM
 libgc_la_SOURCES += fnlz_mlc.c
 endif
 
+# End of !SINGLE_GC_OBJ
 endif
 
 if USE_INTERNAL_LIBATOMIC_OPS
index ed2ee6424ad29aa76b35f300ca391de41510a0cb..65b977e003e9a05faf98a37e6e1bc1f3039663ed 100644 (file)
@@ -346,17 +346,20 @@ AM_CONDITIONAL(THREAD_LOCAL_ALLOC,
 
 compiler_suncc=no
 case "$host" in
-   powerpc-*-darwin*)
+  *-*-*linux*)
+      AM_CONDITIONAL(PTHREAD_START_STANDALONE, test x$THREADS = xposix)
+      ;;
+  powerpc-*-darwin*)
       powerpc_darwin=true
       ;;
-   *-*-solaris*)
+  *-*-solaris*)
       if test "$GCC" != yes; then
         # Solaris SunCC
         compiler_suncc=yes
         CFLAGS="-O $CFLAGS"
       fi
       ;;
-   *-*-wince*)
+  *-*-wince*)
       if test "$enable_gc_debug" != "no"; then
         AC_DEFINE([GC_READ_ENV_FILE], 1,
                   [Read environment variables from the GC 'env' file.])