OSDN Git Service

In libobjc/:
[pf3gnuchains/gcc-fork.git] / libobjc / Makefile.in
index 7674769..ac042ac 100644 (file)
@@ -1,41 +1,56 @@
-#Makefile for GNU Objective C runtime library.
-#Copyright (C) 1993, 95-97, 1998 Free Software Foundation, Inc.
+# Makefile for GNU Objective C runtime library.
+# 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 GNU CC.
+#This file is part of GCC.
 
-#GNU CC is free software; you can redistribute it and/or modify
+#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.
 
-#GNU CC is distributed in the hope that it will be useful,
+#GCC is distributed in the hope that it will be useful,
 #but WITHOUT ANY WARRANTY; without even the implied warranty of
 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #GNU General Public License for more details.
 
 #You should have received a copy of the GNU General Public License
-#along with GNU CC; see the file COPYING.  If not, write to
-#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, 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
 #worthless.
 
-SHELL = /bin/sh
+SHELL = @SHELL@
+MAKEOVERRIDES=
 
 #### Start of system configuration section. ####
 
-srcdir = @srcdir@
-VPATH = @srcdir@
+srcdir = @glibcpp_srcdir@
+VPATH = @glibcpp_srcdir@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
-target_alias = @target_alias@
-gcc_version = @gcc_version@
-gcc_version_trigger = @gcc_version_trigger@
+target_noncanonical = @target_noncanonical@
+gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
+host_subdir = @host_subdir@
+top_srcdir = @top_srcdir@
+multi_basedir = @multi_basedir@
+toolexecdir = @toolexecdir@
+# Toolexecdir is used only by toolexeclibdir
+toolexeclibdir = @toolexeclibdir@
+
+includedirname = @includedirname@
+libsuffix = @libsuffix@
+
+extra_ldflags_libobjc = @extra_ldflags_libobjc@
+
+top_builddir = .
+
+-include ../boehm-gc/threads.mk
 
 libdir = $(exec_prefix)/lib
-libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
-incinstalldir = $(libsubdir)/include
+libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
 
 # Multilib support variables.
 MULTISRCTOP =
@@ -59,23 +74,44 @@ RANLIB = @RANLIB@
 
 CC = @CC@
 CFLAGS = @CFLAGS@
-ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS)
+WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
+ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
+       -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
+
+# Libtool
+# The following strings describe the version of the obj-C library 
+# begin compiled and compatibility issues.
+# Please refer to Libtool documentation about how to manage these 
+# numbers.
+LIBOBJC_VERSION = @VERSION@
+LIBOBJC_GC_VERSION = @VERSION@
+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
+
+OBJC_GCFLAGS=-DOBJC_WITH_GC=1
+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)../../gcc \
-  -I$(srcdir)/$(MULTISRCTOP)../include
+  -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
+  -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
+  -I$(srcdir)/$(MULTISRCTOP)../include \
+  $(OBJC_BOEHM_GC_INCLUDES)
 
-OBJC_GCFLAGS=-DOBJC_WITH_GC=1
-OBJC_THREAD_FILE=thr-@OBJC_THREAD_FILE@
 
 .SUFFIXES:
-.SUFFIXES: .c .m .o
+.SUFFIXES: .c .m .lo
 
-.c.o:
-       $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
+.c.lo:
+       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
 
-.m.o:
-       $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
+.m.lo:
+       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
 
 # Flags to pass to a recursive make.
 FLAGS_TO_PASS = \
@@ -83,6 +119,7 @@ FLAGS_TO_PASS = \
        "AR_FLAGS=$(AR_FLAGS)" \
        "CC=$(CC)" \
        "CFLAGS=$(CFLAGS)" \
+       "DESTDIR=$(DESTDIR)" \
        "LIBCFLAGS=$(LIBCFLAGS)" \
        "EXTRA_OFILES=$(EXTRA_OFILES)" \
        "HDEFINES=$(HDEFINES)" \
@@ -90,156 +127,239 @@ FLAGS_TO_PASS = \
        "INSTALL_DATA=$(INSTALL_DATA)" \
        "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
        "LDFLAGS=$(LDFLAGS)" \
+       "LIBTOOL=$(LIBTOOL)" \
        "LOADLIBES=$(LOADLIBES)" \
        "PICFLAG=$(PICFLAG)" \
        "RANLIB=$(RANLIB)" \
-       "SHELL=$(SHELL)"
-
-all: libobjc.a @OBJC_BOEHM_GC@
-       $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
-
-# User-visible header files.
-
-OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
-        NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
-        thr.h
+       "SHELL=$(SHELL)" \
+       "prefix=$(prefix)" \
+       "exec_prefix=$(exec_prefix)" \
+       "libdir=$(libdir)" \
+       "libsubdir=$(libsubdir)" \
+       "tooldir=$(tooldir)"
+
+all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
+       : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
+
+# User-visible header files, from the objc/ directory
+
+OBJC_H = \
+  objc.h \
+  objc-exception.h \
+  \
+  NXConstStr.h \
+  Object.h \
+  Protocol.h \
+  encoding.h \
+  hash.h \
+  message.h \
+  objc-api.h \
+  objc-decls.h \
+  objc-list.h \
+  sarray.h \
+  thr.h \
+  typedstream.h
+
+# User-visible header files containing deprecated APIs, from the
+# objc/deprecated directory
+
+OBJC_DEPRECATED_H = \
+  MetaClass.h \
+  Object.h \
+  STR.h \
+  objc_error.h \
+  objc_unexpected_exception.h \
+  struct_objc_class.h \
+  struct_objc_protocol.h \
+  struct_objc_selector.h \
+  typedstream.h 
 
 # Modules that comprise the runtime library.
 
-OBJS =    archive.o class.o encoding.o gc.o hash.o init.o linking.o \
-         misc.o nil_method.o NXConstStr.o Object.o objects.o \
-         Protocol.o sarray.o selector.o sendmsg.o thr.o \
-         $(OBJC_THREAD_FILE).o
-
-OBJS_GC = archive_gc.o class_gc.o encoding_gc.o gc_gc.o hash_gc.o \
-         init_gc.o linking_gc.o misc_gc.o nil_method_gc.o \
-         NXConstStr_gc.o Object_gc.o objects_gc.o Protocol_gc.o \
-         sarray_gc.o selector_gc.o sendmsg_gc.o thr_gc.o \
-         $(OBJC_THREAD_FILE)_gc.o
-
-runtime-info.h: $(MULTIBUILDTOP)../../gcc/cc1obj
-               echo "" > tmp-runtime
-               echo "/* This file is automatically generated */" > $@
-               $< -print-objc-runtime-info tmp-runtime >> $@
-               rm -f tmp-runtime
-
-archive_gc.o:  archive.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-class_gc.o:    class.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-encoding_gc.o: encoding.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-gc.o:          gc.c
-               $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-gc_gc.o:       gc.c
-               $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-                       $(INCLUDES) $<
-
-hash_gc.o:     hash.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-init_gc.o:     init.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-linking.o:     linking.m
-               $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-linking_gc.o:  linking.m
-               $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-                       $(INCLUDES) $<
-
-misc_gc.o:     misc.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-nil_method_gc.o: nil_method.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+OBJS =  \
+   NXConstStr.lo \
+   Object.lo \
+   Protocol.lo \
+   archive.lo \
+   class.lo \
+   encoding.lo \
+   error.lo \
+   gc.lo \
+   hash.lo \
+   init.lo \
+   linking.lo \
+   memory.lo \
+   nil_method.lo \
+   objects.lo \
+   sarray.lo \
+   selector.lo \
+   sendmsg.lo \
+   thr.lo \
+   exception.lo
+
+OBJS_GC = \
+   NXConstStr_gc.lo \
+   Object_gc.lo \
+   Protocol_gc.lo \
+   archive_gc.lo \
+   class_gc.lo \
+   encoding_gc.lo \
+   error_gc.lo \
+   gc_gc.lo \
+   hash_gc.lo \
+   init_gc.lo \
+   linking_gc.lo \
+   memory_gc.lo \
+   nil_method_gc.lo \
+   objects_gc.lo \
+   sarray_gc.lo \
+   selector_gc.lo \
+   sendmsg_gc.lo \
+   thr_gc.lo \
+   exception_gc.lo
+
+runtime-info.h: 
+       echo "" > tmp-runtime.m
+       echo "/* This file is automatically generated */" > $@
+       $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
+       rm -f tmp-runtime.m tmp-runtime.s
+
+archive_gc.lo: archive.c
+       $(LIBTOOL_COMPILE) $(CC) -Wno-deprecated-declarations -c -o $@ $(ALL_CFLAGS) \
+               $(OBJC_GCFLAGS) $(INCLUDES) $<
+
+archive.lo: archive.c
+       $(LIBTOOL_COMPILE) $(CC) -Wno-deprecated-declarations -c $(ALL_CFLAGS) \
+               $(INCLUDES) $<
+
+class_gc.lo: class.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+encoding_gc.lo: encoding.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+error_gc.lo: error.c
+       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+gc.lo: gc.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+
+gc_gc.lo: gc.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+hash_gc.lo: hash.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+init_gc.lo: init.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+linking.lo: linking.m
+       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
+               $(INCLUDES) $<
+
+linking_gc.lo: linking.m
+       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
+               $(OBJC_GCFLAGS) $(INCLUDES) $<
+
+memory_gc.lo: memory.c
+       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+nil_method_gc.lo: nil_method.c
+       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+NXConstStr.lo: NXConstStr.m
+       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
+               $(INCLUDES) $<
+
+NXConstStr_gc.lo: NXConstStr.m
+       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
+               $(OBJC_GCFLAGS) $(INCLUDES) $<
+
+# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
+Object.lo: Object.m
+       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -Wno-deprecated-declarations \
+               -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+
+# -Wno-deprecated-declarations is for the objc/typedstream.h functions.
+Object_gc.lo: Object.m
+       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -Wno-deprecated-declarations \
+               -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+
+objects_gc.lo: objects.c
+       $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+Protocol.lo: Protocol.m
+       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
+               $(INCLUDES) $<
+
+Protocol_gc.lo: Protocol.m
+       $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
+               $(OBJC_GCFLAGS) $(INCLUDES) $<
+
+sarray_gc.lo: sarray.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+selector_gc.lo: selector.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+sendmsg.lo: sendmsg.c runtime-info.h
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+
+sendmsg_gc.lo: sendmsg.c runtime-info.h
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
+
+thr_gc.lo: thr.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               $(INCLUDES) $<
 
-NXConstStr.o:  NXConstStr.m
-               $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+# -Wno-deprecated-declarations is to silence warnings from using 
+# _objc_unexpected_exception.
+exception.lo: exception.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
+               -fexceptions -Wno-deprecated-declarations $(INCLUDES) $<
+
+exception_gc.lo: exception.c
+       $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+               -fexceptions -Wno-deprecated-declarations $(INCLUDES) $<
+
+doc: info dvi pdf html
 
-NXConstStr_gc.o: NXConstStr.m
-               $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-                       $(INCLUDES) $<
+# 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))
 
-Object.o:      Object.m
-               $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-Object_gc.o:   Object.m
-               $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-                       $(INCLUDES) $<
-
-objects_gc.o:  objects.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-Protocol.o:    Protocol.m
-               $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-Protocol_gc.o: Protocol.m
-               $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-                       $(INCLUDES) $<
-
-sarray_gc.o:   sarray.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-selector_gc.o: selector.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-sendmsg.o:     sendmsg.c runtime-info.h
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-
-sendmsg_gc.o:  sendmsg.c runtime-info.h
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-thr_gc.o:      thr.c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-$(OBJC_THREAD_FILE)_gc.o: $(OBJC_THREAD_FILE).c
-               $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
-
-doc: info dvi html
-
-libobjc.a: $(OBJS)
-       $(AR) $(AR_FLAGS) $@ $(OBJS)
-       $(RANLIB) $@
-
-libobjc_gc.a: $(OBJS_GC)
-       $(AR) $(AR_FLAGS) $@ $(OBJS_GC)
-       $(RANLIB) $@
-
-libobjc_s.a: libobjc.a
-       mv libobjc.a libobjc_s.a
-
-# Create a relocatable DLL
-libobjc.dll: libobjc_s.a libobjc_entry.o
-       $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \
-               -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
-       $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
-               --base-file libobjc.base --output-exp libobjc.exp
-       $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \
-               -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
-       $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
-               --base-file libobjc.base --output-exp libobjc.exp
-       $(GCC_FOR_TARGET) libobjc.exp -mdll \
-               -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32
-       $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \
-               --output-lib libobjc.a
-
-info: objc-features.info
-dvi: objc-features.dvi
-html: objc-features_toc.html
-
-objc-features.info: $(srcdir)/objc-features.texi
-       makeinfo $(srcdir)/objc-features.texi
-
-objc-features.dvi: $(srcdir)/objc-features.texi
-       texi2dvi $(srcdir)/objc-features.texi
-
-objc-features_toc.html: objc-features.texi
-       texi2html -split_node $(srcdir)/objc-features.texi
+libobjc$(libsuffix).la: $(OBJS)
+       $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
+               -rpath $(toolexeclibdir) \
+               -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) \
+               $(LTLDFLAGS)
+
+libobjc_gc$(libsuffix).la: $(OBJS_GC)
+       $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) $(OBJC_BOEHM_GC_LIBS) \
+               -rpath $(toolexeclibdir) \
+               -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) \
+               $(LTLDFLAGS)
+
+info:
+dvi:
+pdf:
+html:
 
 Makefile: Makefile.in config.status
        $(SHELL) config.status
@@ -249,48 +369,57 @@ config.status: configure
        CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
        CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
 
-${srcdir}/configure: configure.in
+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 copy-headers
+install: install-libs install-headers
 
 install-libs: installdirs
-       -if test -f libobjc.a ; then \
-         rm -f $(libsubdir)/libobjc.a; \
-         $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \
-         chmod a-x $(libsubdir)/libobjc.a; \
-       else true; fi
-       -if test -f libobjc_gc.a ; then \
-         rm -f $(libsubdir)/libobjc_gc.a; \
-         $(INSTALL_DATA) libobjc_gc.a $(libsubdir)/libobjc_gc.a; \
-         chmod a-x $(libsubdir)/libobjc_gc.a; \
-       else true; fi
-       -if test -f libobjc_s.a ; then \
-         rm -f $(libsubdir)/libobjc_s.a; \
-         $(INSTALL_DATA) libobjc_s.a $(libsubdir)/libobjc_s.a; \
-         chmod a-x $(libsubdir)/libobjc_s.a; \
-       else true; fi
-         -if test -f libobjc.dll ; then \
-         rm -f $(bindir)/libobjc.dll; \
-         $(INSTALL_DATA) libobjc.dll $(bindir)/libobjc.dll; \
-       else true; fi
+       $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
+       $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libsuffix).la $(DESTDIR)$(toolexeclibdir);
+       if [ "$(OBJC_BOEHM_GC)" ]; then \
+         $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libsuffix).la \
+                               $(DESTDIR)$(toolexeclibdir);\
+       fi
+       $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
+       @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
 
 # Copy Objective C headers to installation include directory.
-copy-headers:
-       -rm -rf $(incinstalldir)/objc
-       -mkdir $(incinstalldir)/objc
+install-headers:
+       $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
        for file in $(OBJC_H); do \
          realfile=$(srcdir)/objc/$${file}; \
-         cp $${realfile} $(incinstalldir)/objc; \
-         chmod a+r $(incinstalldir)/objc/$${file}; \
+         $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
+       done
+       $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
+       for file in $(OBJC_DEPRECATED_H); do \
+         realfile=$(srcdir)/objc/deprecated/$${file}; \
+         $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
        done
 
 check uninstall install-strip dist installcheck installdirs:
 
 mostlyclean:
-       -rm -f runtime-info.h tmp-runtime.s *.o libobjc* xforward \
-               fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
+       -$(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 *.pdf *.fn *.info *.ky *.log *.pg \
                *.toc *.tp *.vr *.html libobj.exp
        @$(MULTICLEAN) multi-clean DO=mostlyclean
 
@@ -306,3 +435,7 @@ maintainer-clean realclean: distclean
 
 .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
        install-strip dist installcheck installdirs 
+
+# Don't export variables to the environment, in order to not confuse
+# configure.
+.NOEXPORT: