public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: gcc-patches@gcc.gnu.org
Cc: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>,
	       Nicola Pero <nicola.pero@meta-innovation.com>,
	       Andrew Pinski <pinskia@gmail.com>
Subject: [build] Allow building libobjc_gc on Tru64 UNIX, Darwin
Date: Thu, 14 Apr 2011 17:00:00 -0000	[thread overview]
Message-ID: <yddbp08lqen.fsf@manam.CeBiTec.Uni-Bielefeld.DE> (raw)

I recently tried to build with --enable-libobjc-gc.  While this worked
out of the box on Solaris, I ran intro trouble on both Tru64 UNIX and
Darwin.

On Tru64 UNIX, one needs to compile with -pthread since the boehm-gc
headers include <pthread.h> which error out if -D_REENTRANT is missing.

On Darwin, the build stops with

make: *** No rule to make target `libobjc_gc.la', needed by `all'.  Stop.

This can be fixed by taking $(libsuffix) into account in OBJC_BOEHM_GC.

The following patch fixes both issues.  It was manually tested by fixing
the Makefile as below and successfully building libobjc_gc.la.  Full
bootstraps on alpha-dec-osf5.1b and i386-apple-darwin9.8.0 are in
progress.

Ok for mainline if both pass?

Btw., it would be considerably easier if --enable-libobjc-gc could be
enabled automatically if boehm-gc is configured.  Besides, it seems that
libobjc_gc isn't tested anywhere.

	Rainer


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

	* Makefile.in (OBJC_GCFLAGS): Move ...
	* configure.ac (enable_objc_gc): ... here.
	Add $(libsuffix) to OBJC_BOEHM_GC.
	* configure: Regenerate.

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)
 

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

             reply	other threads:[~2011-04-14 17:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14 17:00 Rainer Orth [this message]
2011-04-14 19:05 ` Nicola Pero
2011-04-15 17:03   ` Rainer Orth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yddbp08lqen.fsf@manam.CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=Ralf.Wildenhues@gmx.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nicola.pero@meta-innovation.com \
    --cc=pinskia@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).