diff mbox

[build] Allow building libobjc_gc on Tru64 UNIX, Darwin

Message ID yddr593a212.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth April 15, 2011, 4:54 p.m. UTC
Nicola,

>> Ok for mainline if both pass?
>
> Yes.
>
> [and by the way, I think you're fixing PR libobjc/32037 in the process. :-)]

indeed, thanks for checking.  Testing revealed that I'd been lazy with
quoting.  I'm including the patch I've installed, which encloses
OBJC_BOEHM_GC in configure.ac in single quotes.

>> Btw., it would be considerably easier if --enable-libobjc-gc could be
>> enabled automatically if boehm-gc is configured.
>
> Yes.

I've filed

libobjc/48626	--enable-objc-gc should be automatic

>> Besides, it seems that libobjc_gc isn't tested anywhere.
>
> Yes.

and

libobjc/48627	libobjc_gc should be tested

just in case.

	Rainer


2011-04-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR libobjc/32037
	* Makefile.in (OBJC_GCFLAGS): Move ...
	* configure.ac (enable_objc_gc): ... here.
	Add $(libsuffix) to OBJC_BOEHM_GC.
	* configure: Regenerate.
diff mbox

Patch

diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in
--- a/libobjc/Makefile.in
+++ b/libobjc/Makefile.in
@@ -93,7 +93,7 @@  LIBTOOL_INSTALL = $(LIBTOOL) --mode=inst
 LIBTOOL_CLEAN   = $(LIBTOOL) --mode=clean
 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
 
-OBJC_GCFLAGS=-DOBJC_WITH_GC=1
+OBJC_GCFLAGS=@OBJC_GCFLAGS@
 OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
 OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@
 OBJC_BOEHM_GC_LIBS=../boehm-gc/libgcjgc_convenience.la $(thread_libs_and_flags)
diff --git a/libobjc/configure.ac b/libobjc/configure.ac
--- a/libobjc/configure.ac
+++ b/libobjc/configure.ac
@@ -1,6 +1,6 @@ 
 # Process this file with autoconf to produce a configure script.
 #   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
-#   2005, 2006, 2009 Free Software Foundation, Inc.
+#   2005, 2006, 2009, 2011 Free Software Foundation, Inc.
 #   Originally contributed by Dave Love (d.love@dl.ac.uk).
 #
 #This file is part of GCC.
@@ -63,15 +63,25 @@  AC_ARG_ENABLE(objc-gc,
                           the GNU Objective-C runtime.],
 [case $enable_objc_gc in
   no)
+    OBJC_GCFLAGS=''
     OBJC_BOEHM_GC=''
     OBJC_BOEHM_GC_INCLUDES=''
     ;;
   *)
-    OBJC_BOEHM_GC=libobjc_gc.la
+    OBJC_GCFLAGS='-DOBJC_WITH_GC=1'
+    OBJC_BOEHM_GC='libobjc_gc$(libsuffix).la'
     OBJC_BOEHM_GC_INCLUDES='-I$(top_srcdir)/../boehm-gc/include -I../boehm-gc/include'
+    case "${host}" in
+      alpha*-dec-osf*)
+        # boehm-gc headers include <pthread.h>, which needs to be compiled
+	# with -pthread on Tru64 UNIX.
+        OBJC_GCFLAGS="${OBJC_GCFLAGS} -pthread"
+	;;
+    esac
     ;;
 esac],
-[OBJC_BOEHM_GC=''; OBJC_BOEHM_GC_INCLUDES=''])
+[OBJC_GCFLAGS=''; OBJC_BOEHM_GC=''; OBJC_BOEHM_GC_INCLUDES=''])
+AC_SUBST(OBJC_GCFLAGS)
 AC_SUBST(OBJC_BOEHM_GC)
 AC_SUBST(OBJC_BOEHM_GC_INCLUDES)