summaryrefslogtreecommitdiff
path: root/Objective-C
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-01-26 13:47:19 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-01-26 13:47:19 +0100
commitf0e4f94c62369793651b5260e1c9101e09f7fc59 (patch)
tree6e1ab6661e421e122ec9001f21e24a709aefb748 /Objective-C
parent9dc31e07ac9162ee094f34db7357c2a729d29874 (diff)
Link statically against libffi, unbreak the build system on Mac OS X again.
darcs-hash:8acaf95eba0b3e8b415cfc4f2dc26532912ccce8
Diffstat (limited to 'Objective-C')
-rw-r--r--Objective-C/GNUmakefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/Objective-C/GNUmakefile b/Objective-C/GNUmakefile
index 11d87ae..124f2a8 100644
--- a/Objective-C/GNUmakefile
+++ b/Objective-C/GNUmakefile
@@ -30,8 +30,18 @@ libobjcl_OBJC_FILES = libobjcl.m objc_support.m objc-runtime-apple.m objc-runtim
LIBRARIES_DEPEND_UPON = $(FND_LIBS) $(GUI_LIBS) $(OBJC_LIBS) $(SYSTEM_LIBS) $(CONFIG_SYSTEM_LIBS)
ifdef USE_LIBFFI
-ADDITIONAL_LDFLAGS = -Wl,-rpath $(CURDIR)/../libffi/.libs -L../libffi/.libs -lffi
-ADDITIONAL_OBJCFLAGS += -DUSE_LIBFFI
+#ifneq ($(COMMON_MAKE_LOADED),)
+## FIXME: The use of -rpath presupposes GNU ld.
+#ADDITIONAL_LDFLAGS = -Wl,-rpath $(CURDIR)/../libffi/.libs -L../libffi/.libs -lffi
+#else # Mac OS X
+#ADDITIONAL_LDFLAGS = -L$(CURDIR)/../libffi/.libs -lffi
+#endif
+
+# FIXME: For now, we statically link against libffi. We are not certain
+# that this is a good idea. Linking dynamically, on the other hand, is
+# hard in general (that's one of the reasons libtool exists, after all).
+ADDITIONAL_LDFLAGS = ../libffi/.libs/libffi.a
+ADDITIONAL_OBJCFLAGS += -DUSE_LIBFFI -I../libffi/include
libobjcl_OBJC_FILES += libffi_support.m
FFI_DEPS += ../libffi/.libs/libffi.a
FFI_CLEAN += libffi_clean
@@ -57,7 +67,8 @@ obj/libobjcl.dylib: $(FFI_DEPS) obj/libobjcl.dylib.$(VERSION)
obj/libobjcl.dylib.$(VERSION): $(libobjcl_OBJ_FILES)
make -p obj
- gcc -dynamiclib -current_version $(VERSION) -flat_namespace -undefined warning -install_name libobjcl.dylib.$(VERSION) -o $@ $(libobjcl_OBJ_FILES) -fnext-runtime -framework AppKit -framework Foundation -lm $(ADDITIONAL_LDFLAGS) $(ADDITIONAL_OBJCFLAGS)
+ gcc -dynamiclib -current_version $(VERSION) -flat_namespace -undefined warning -install_name $(CURDIR)/obj/libobjcl.dylib.$(VERSION) -o $@ $(libobjcl_OBJ_FILES) -fnext-runtime -framework AppKit -framework Foundation -lm $(ADDITIONAL_LDFLAGS) $(ADDITIONAL_OBJCFLAGS)
+# sh ../libffi/libtool --mode=link -module -no-fast-install -avoid-version -version-info $(VERSION) -R $(CURDIR)/../libffi/.libs -L../libffi/.libs -lffi -o $@ $(libobjcl_OBJ_FILES)
obj/%.o: %.m
mkdir -p obj