This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patches to build libobjc.so
- To: law at cygnus dot com
- Subject: Re: Patches to build libobjc.so
- From: nicola at brainstorm dot co dot uk
- Date: Fri, 28 Apr 2000 18:30:09 +0100 (BST)
- cc: gcc-patches at gcc dot gnu dot org
> I just checked the FSF records -- nothing for libobjc from you yet.
>
> We'll evaluate the changes as soon as we can once your assignment is recorded.
OK - if I can do anything to speed up burocracy, please tell me.
--
I realized one of the patches I sent you was the wrong one - I took the
occasion to send in attach the correct one.
--- ../../egcs-20000417/libobjc/Makefile.in.old Tue Apr 18 13:36:29 2000
+++ ./Makefile.in Fri Apr 28 12:08:28 2000
@@ -63,6 +63,22 @@
ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) \
-DIN_GCC -DIN_TARGET_LIBS
+
+# 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 = 1:0:0
+LIBOBJC_GC_VERSION = 1:0:0
+# @LIBTOOL@ does not get it right, so we hack it in - FIXME
+LIBTOOL = ./libtool
+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
+
#
# Define the cc1obj in terms of the CC that is passed on from higher
# level make. This is needed to make sure we can create runtime-info.h
@@ -77,15 +93,16 @@
OBJC_GCFLAGS=-DOBJC_WITH_GC=1
OBJC_THREAD_FILE=thr-@OBJC_THREAD_FILE@
+OBJC_BOEHM_GC=@OBJC_BOEHM_GC@
.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 = \
@@ -100,6 +117,7 @@
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"LDFLAGS=$(LDFLAGS)" \
+ "LIBTOOL=$(LIBTOOL)" \
"LOADLIBES=$(LOADLIBES)" \
"PICFLAG=$(PICFLAG)" \
"RANLIB=$(RANLIB)" \
@@ -110,7 +128,7 @@
"libsubdir=$(libsubdir)" \
"tooldir=$(tooldir)"
-all: libobjc.a @OBJC_BOEHM_GC@
+all: libobjc.la $(OBJC_BOEHM_GC)
$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
# User-visible header files.
@@ -121,16 +139,16 @@
# 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
+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
+
+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
runtime-info.h:
echo "" > tmp-runtime
@@ -138,94 +156,117 @@
$(CC1OBJ) -print-objc-runtime-info tmp-runtime >> $@
rm -f tmp-runtime
-archive_gc.o: archive.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+archive_gc.lo: archive.c
+ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
-class_gc.o: class.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+class_gc.lo: class.c
+ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
-encoding_gc.o: encoding.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+encoding_gc.lo: encoding.c
+ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
-gc.o: gc.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+gc.lo: gc.c
+ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-gc_gc.o: gc.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+gc_gc.lo: gc.c
+ $(LIBTOOL_COMPILE) $(CC) -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) $<
+hash_gc.lo: hash.c
+ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
-linking.o: linking.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+init_gc.lo: init.c
+ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
-linking_gc.o: linking.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+linking.lo: linking.m
+ $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
$(INCLUDES) $<
-misc_gc.o: misc.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+linking_gc.lo: linking.m
+ $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
+ $(OBJC_GCFLAGS) $(INCLUDES) $<
-nil_method_gc.o: nil_method.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+misc_gc.lo: misc.c
+ $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
-NXConstStr.o: NXConstStr.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+nil_method_gc.lo: nil_method.c
+ $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
-NXConstStr_gc.o: NXConstStr.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+NXConstStr.lo: NXConstStr.m
+ $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
$(INCLUDES) $<
-Object.o: Object.m
- $(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) $<
-Object_gc.o: Object.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+Object.lo: Object.m
+ $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
$(INCLUDES) $<
-objects_gc.o: objects.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+Object_gc.lo: Object.m
+ $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
+ $(OBJC_GCFLAGS) $(INCLUDES) $<
-Protocol.o: Protocol.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+objects_gc.lo: objects.c
+ $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
-Protocol_gc.o: Protocol.m
- $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+Protocol.lo: Protocol.m
+ $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \
$(INCLUDES) $<
-sarray_gc.o: sarray.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(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.o: selector.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+selector_gc.lo: selector.c
+ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
-sendmsg.o: sendmsg.c runtime-info.h
- $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
+sendmsg.lo: sendmsg.c runtime-info.h
+ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $<
-sendmsg_gc.o: sendmsg.c runtime-info.h
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+sendmsg_gc.lo: sendmsg.c runtime-info.h
+ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
+ $(INCLUDES) $<
-thr_gc.o: thr.c
- $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) $(INCLUDES) $<
+thr_gc.lo: thr.c
+ $(LIBTOOL_COMPILE) $(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) $<
+$(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
+ $(LIBTOOL_COMPILE) $(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.la: $(OBJS)
+ $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) -rpath $(libsubdir) \
+ -version-info $(LIBOBJC_VERSION)
+
+libobjc_gc.la: $(OBJS_GC)
+ $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) -rpath $(libsubdir) \
+ -version-info $(LIBOBJC_GC_VERSION)
-libobjc_s.a: libobjc.a
+#
+# FIXME -- The following part does not fit in the libtool context.
+# Libtool is supposed to [going to] be able to create a win 32 DLL
+# without extra code but since I don't have a win machine to test
+# if it already works, I leave the old code here.
+#
+libobjc_s.a: libobjc.la
mv libobjc.a libobjc_s.a
# Create a relocatable DLL
@@ -242,6 +283,11 @@
-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
@@ -271,25 +317,11 @@
install: install-libs copy-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
+ $(LIBTOOL_INSTALL) $(INSTALL_DATA) libobjc.la $(libsubdir)/libobjc.la;
+ if [ "$(OBJC_BOEHM_GC)" ]; then \
+ $(LIBTOOL_INSTALL) $(INSTALL_DATA) libobjc_gc.la \
+ $(libsubdir)/libobjc_gc.la;\
+ fi
# Copy Objective C headers to installation include directory.
copy-headers:
@@ -305,7 +337,8 @@
check uninstall install-strip dist installcheck installdirs:
mostlyclean:
- -rm -f runtime-info.h tmp-runtime.s *.o libobjc* xforward \
+ -$(LIBTOOL_CLEAN) rm -f libobjc.la libobjc_gc.la *.lo
+ -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
*.toc *.tp *.vr *.html libobj.exp
@$(MULTICLEAN) multi-clean DO=mostlyclean