OSDN Git Service

2009-11-03 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / libobjc / Makefile.in
index f9a5685..788dfb5 100644 (file)
@@ -1,12 +1,12 @@
 # Makefile for GNU Objective C runtime library.
-# Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
+# Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
 #GCC is free software; you can redistribute it and/or modify
 #it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 2, or (at your option)
+#the Free Software Foundation; either version 3, or (at your option)
 #any later version.
 
 #GCC is distributed in the hope that it will be useful,
@@ -15,9 +15,8 @@
 #GNU General Public License for more details.
 
 #You should have received a copy of the GNU General Public License
-#along with GCC; see the file COPYING.  If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA.  */
+#along with GCC; see the file COPYING3.  If not see
+#<http://www.gnu.org/licenses/>.
 
 #This was cribbed from the libchill, libiberty and libstdc++
 #Makefile.in files.  Some of this stuff may be unnecessary and
@@ -33,18 +32,23 @@ VPATH = @glibcpp_srcdir@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 target_noncanonical = @target_noncanonical@
-gcc_version = @gcc_version@
+gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
+host_subdir = @host_subdir@
 top_srcdir = @top_srcdir@
-toplevel_srcdir = @toplevel_srcdir@
+multi_basedir = @multi_basedir@
 toolexecdir = @toolexecdir@
 # Toolexecdir is used only by toolexeclibdir
 toolexeclibdir = @toolexeclibdir@
 
 includedirname = @includedirname@
-libext = @libext@
+libsuffix = @libsuffix@
+
+extra_ldflags_libobjc = @extra_ldflags_libobjc@
 
 top_builddir = .
 
+-include ../boehm-gc/threads.mk
+
 libdir = $(exec_prefix)/lib
 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
 
@@ -71,9 +75,8 @@ RANLIB = @RANLIB@
 CC = @CC@
 CFLAGS = @CFLAGS@
 WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
-GTHREAD_FLAGS=@GTHREAD_FLAGS@
 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
-       $(GTHREAD_FLAGS) -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing
+       -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
 
 # Libtool
 # The following strings describe the version of the obj-C library 
@@ -82,20 +85,25 @@ ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
 # numbers.
 LIBOBJC_VERSION = @VERSION@
 LIBOBJC_GC_VERSION = @VERSION@
-LIBTOOL = @LIBTOOL@
+LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS)
 LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
 LIBTOOL_LINK    = $(LIBTOOL) --mode=link 
 LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
 LIBTOOL_CLEAN   = $(LIBTOOL) --mode=clean
 #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
 
-INCLUDES = -I$(srcdir)/objc  -I$(srcdir)/$(MULTISRCTOP)../gcc \
-  -I$(srcdir)/$(MULTISRCTOP)../gcc/config -I$(MULTIBUILDTOP)../../gcc \
-  -I$(srcdir)/$(MULTISRCTOP)../include
-
 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
 OBJC_THREAD_FILE=thr-objc
 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)
+
+INCLUDES = -I$(srcdir)/objc  -I$(srcdir)/$(MULTISRCTOP)../gcc \
+  -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
+  -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
+  -I$(srcdir)/$(MULTISRCTOP)../include \
+  $(OBJC_BOEHM_GC_INCLUDES)
+
 
 .SUFFIXES:
 .SUFFIXES: .c .m .lo
@@ -131,7 +139,7 @@ FLAGS_TO_PASS = \
        "libsubdir=$(libsubdir)" \
        "tooldir=$(tooldir)"
 
-all: libobjc$(libext).la $(OBJC_BOEHM_GC)
+all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
        : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
 
 # User-visible header files.
@@ -145,13 +153,13 @@ OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
 OBJS =    archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
          misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
          Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
-         $(OBJC_THREAD_FILE).lo
+         $(OBJC_THREAD_FILE).lo exception.lo
 
 OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
          init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
          NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
          sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
-         $(OBJC_THREAD_FILE)_gc.lo
+         $(OBJC_THREAD_FILE)_gc.lo exception_gc.lo
 
 runtime-info.h: 
        echo "" > tmp-runtime.m
@@ -253,17 +261,35 @@ $(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
        $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
                $(INCLUDES) $<
 
-doc: info dvi html
+exception.lo: exception.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
+               -fexceptions $(INCLUDES) $<
 
-libobjc$(libext).la: $(OBJS)
+exception_gc.lo: exception.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               -fexceptions $(INCLUDES) $<
+
+doc: info dvi pdf html
+
+# No install-html or install-pdf support
+.PHONY: install-html install-pdf install-info
+install-html:
+install-pdf:
+install-info:
+
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
+
+libobjc$(libsuffix).la: $(OBJS)
        $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
                -rpath $(toolexeclibdir) \
-               -version-info $(LIBOBJC_VERSION)
+               -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
+               $(LTLDFLAGS)
 
-libobjc_gc$(libext).la: $(OBJS_GC)
-       $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
+libobjc_gc$(libsuffix).la: $(OBJS_GC)
+       $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
                -rpath $(toolexeclibdir) \
-               -version-info $(LIBOBJC_GC_VERSION)
+               -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
+               $(LTLDFLAGS)
 
 #
 # FIXME -- The following part does not fit in the libtool context. 
@@ -296,6 +322,7 @@ libobjc.dll: libobjc_s.a libobjc_entry.o
 
 info:
 dvi:
+pdf:
 html:
 
 Makefile: Makefile.in config.status
@@ -306,17 +333,33 @@ config.status: configure
        CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
        CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
 
-${srcdir}/configure: configure.ac
+AUTOCONF = autoconf
+ACLOCAL = aclocal
+ACLOCAL_AMFLAGS = -I ../config -I ..
+aclocal_deps = \
+       $(srcdir)/../config/multi.m4 \
+       $(srcdir)/../config/override.m4 \
+       $(srcdir)/../config/proginstall.m4 \
+       $(srcdir)/../ltoptions.m4 \
+       $(srcdir)/../ltsugar.m4 \
+       $(srcdir)/../ltversion.m4 \
+       $(srcdir)/../lt~obsolete.m4 \
+       $(srcdir)/acinclude.m4
+
+$(srcdir)/configure: @MAINT@ configure.ac $(srcdir)/aclocal.m4
        rm -f config.cache
-       cd ${srcdir} && autoconf
+       cd $(srcdir) && $(AUTOCONF)
+
+$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
+       cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 
 install: install-libs install-headers
 
 install-libs: installdirs
-       $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
-       $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libext).la $(DESTDIR)$(toolexeclibdir);
+       $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
+       $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
        if [ "$(OBJC_BOEHM_GC)" ]; then \
-         $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libext).la \
+         $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
                                $(DESTDIR)$(toolexeclibdir);\
        fi
        $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
@@ -324,7 +367,7 @@ install-libs: installdirs
 
 # Copy Objective C headers to installation include directory.
 install-headers:
-       $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
+       $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
        for file in $(OBJC_H); do \
          realfile=$(srcdir)/objc/$${file}; \
          $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
@@ -333,9 +376,9 @@ install-headers:
 check uninstall install-strip dist installcheck installdirs:
 
 mostlyclean:
-       -$(LIBTOOL_CLEAN) rm -f libobjc$(libext).la libobjc_gc$(libext).la *.lo
+       -$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
        -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
-               fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
+               fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \
                *.toc *.tp *.vr *.html libobj.exp
        @$(MULTICLEAN) multi-clean DO=mostlyclean