[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFA/make] Extend Framework support
From: |
David Ayers |
Subject: |
[RFA/make] Extend Framework support |
Date: |
Wed, 10 Mar 2004 17:14:19 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 |
Hello everyone,
unless someone objects, I'd like to check this in soon.
It adds support to pass -F <standard GNUstep framework directories> on
platforms/compilers which support it (ie Apple). The actual check I'm
using is the OBJC_RUNTIME_LIB but in fact it should be fixed to test the
compiler features during configure. OTOH the check that's currently in
native-library.make tests FOUNDATION_LIB which is just peculiar. I
thought, as this is actually a compiler/linker feature, OBJC_RUNTIME_LIB
is "closer" to the right thing.
I'll be using the new variable HAVE_FRAMEWORK_SUPPORT in GSWeb (and
Auxiliary/gsweb(_wo).make) to determine -F and -framework flags as
opposed to -l/-L.
This has been tested on apple-apple-apple and gnu-gnu-gnu (well at least
variants there of but I'm pretty confident). I'd be grateful, if Nicola
could scan it quickly to see if I took the "correct" approach, but I
won't hold my breath if you're busy.
* config.make.in (HAVE_FRAMEWORK_SUPPORT): New variable.
* common.make (GS_FRAMEWORK_PATH, GNUSTEP_FRAMEWORKS_DIRS,
GNUSTEP_FRAMEWORKS_FLAGS): New variables. Use new
GNUSTEP_FRAMEWORKS_DIRS to un/set GNUSTEP_FRAMEWORKS_FLAGS.
* rules.make (ALL_OBJCFLAGS, ALL_CFLAGS, ALL_LIB_DIRS): Use
new GNUSTEP_FRAMEWORKS_FLAGS.
* native-library.make: Use HAVE_FRAMEWORK_SUPPORT in favor
of (FOUNDATION_LIB).
Cheers,
David
? make.patch.txt
? make.patch.txt.gz
Index: common.make
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/make/common.make,v
retrieving revision 1.142
diff -u -r1.142 common.make
--- common.make 9 Mar 2004 17:38:18 -0000 1.142
+++ common.make 10 Mar 2004 15:46:19 -0000
@@ -245,6 +245,9 @@
endif
+# Currently framework installation doesn't honor GNUSTEP_FLATTENED
+GS_FRAMEWORK_PATH = $(dir)/Library/Frameworks
+
# First, we add paths based on GNUSTEP_USER_ROOT.
# Please note that the following causes GS_HEADER_PATH to be evaluated
@@ -252,6 +255,7 @@
# effect we wanted.
GNUSTEP_HEADERS_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_HEADER_PATH))
GNUSTEP_LIBRARIES_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_LIBRARY_PATH))
+GNUSTEP_FRAMEWORKS_DIRS = $(foreach
dir,$(GNUSTEP_USER_ROOT),$(GS_FRAMEWORK_PATH))
# Second, if GNUSTEP_LOCAL_ROOT is different from GNUSTEP_USER_ROOT
# (which has already been added), we add the paths based on
@@ -259,6 +263,7 @@
ifneq ($(GNUSTEP_LOCAL_ROOT), $(GNUSTEP_USER_ROOT))
GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_LOCAL_ROOT),$(GS_HEADER_PATH))
GNUSTEP_LIBRARIES_DIRS += $(foreach
dir,$(GNUSTEP_LOCAL_ROOT),$(GS_LIBRARY_PATH))
+GNUSTEP_FRAMEWORKS_DIRS += $(foreach
dir,$(GNUSTEP_LOCAL_ROOT),$(GS_FRAMEWORK_PATH))
endif
# Third, if GNUSTEP_NETWORK_ROOT is different from GNUSTEP_USER_ROOT and
@@ -268,6 +273,7 @@
ifneq ($(GNUSTEP_NETWORK_ROOT), $(GNUSTEP_LOCAL_ROOT))
GNUSTEP_HEADERS_DIRS += $(foreach
dir,$(GNUSTEP_NETWORK_ROOT),$(GS_HEADER_PATH))
GNUSTEP_LIBRARIES_DIRS += $(foreach
dir,$(GNUSTEP_NETWORK_ROOT),$(GS_LIBRARY_PATH))
+GNUSTEP_FRAMEWORKS_DIRS += $(foreach
dir,$(GNUSTEP_NETWORK_ROOT),$(GS_FRAMEWORK_PATH))
endif
endif
@@ -279,6 +285,7 @@
ifneq ($(GNUSTEP_SYSTEM_ROOT), $(GNUSTEP_NETWORK_ROOT))
GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_HEADER_PATH))
GNUSTEP_LIBRARIES_DIRS += $(foreach
dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_LIBRARY_PATH))
+GNUSTEP_FRAMEWORKS_DIRS += $(foreach
dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_FRAMEWORK_PATH))
endif
endif
endif
@@ -307,10 +314,19 @@
$(addprefix -I,$(foreach dir,$(GNUSTEP_HEADERS_DIRS),$(remove_if_empty)))
GNUSTEP_LIBRARIES_FLAGS = \
$(addprefix -L,$(foreach dir,$(GNUSTEP_LIBRARIES_DIRS),$(remove_if_empty)))
+ GNUSTEP_FRAMEWORKS_FLAGS = \
+ $(addprefix -F,$(foreach dir,$(GNUSTEP_FRAMEWORKS_DIRS),$(remove_if_empty)))
else
# Default case, just add -I / -L
GNUSTEP_HEADERS_FLAGS = $(addprefix -I,$(GNUSTEP_HEADERS_DIRS))
GNUSTEP_LIBRARIES_FLAGS = $(addprefix -L,$(GNUSTEP_LIBRARIES_DIRS))
+ GNUSTEP_FRAMEWORKS_FLAGS = $(addprefix -F,$(GNUSTEP_FRAMEWORKS_DIRS))
+endif
+
+# The above is more readable if we don't clutter it with an extra
+# ifeq, so we'll reset the variable here for the common case.
+ifneq ($(HAVE_FRAMEWORK_SUPPORT), yes)
+GNUSTEP_FRAMEWORKS_FLAGS=
endif
ifeq ($(FOUNDATION_LIB), fd)
Index: config.make.in
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/make/config.make.in,v
retrieving revision 1.57
diff -u -r1.57 config.make.in
--- config.make.in 18 Feb 2004 16:55:11 -0000 1.57
+++ config.make.in 10 Mar 2004 15:46:19 -0000
@@ -122,6 +122,24 @@
#
AUTO_DEPENDENCIES = @AUTO_DEPENDENCIES@
+#
+# Whether the compiler suports framework options -framework/-F.
+# FIXME: This should be replaced by a real configure test.
+# Currently only the Apple compiler is known to support them.
+# As it will generally only work on Darwin if the Apple
+# runtime is also in use, we'll use that test for now.
+#
+ifeq ($(OBJC_RUNTIME_LIB), apple)
+ HAVE_FRAMEWORK_SUPPORT=yes
+else
+ifeq ($(OBJC_RUNTIME_LIB), nx)
+ HAVE_FRAMEWORK_SUPPORT=yes
+else
+ HAVE_FRAMEWORK_SUPPORT=no
+endif
+endif
+
+
## Local variables:
## mode: makefile
## End:
Index: native-library.make
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/make/native-library.make,v
retrieving revision 1.2
diff -u -r1.2 native-library.make
--- native-library.make 3 Nov 2003 22:41:04 -0000 1.2
+++ native-library.make 10 Mar 2004 15:46:19 -0000
@@ -33,7 +33,7 @@
# This will be converted into -lMyLibrary link flag on unix/windows, and
# into -framework MyLibrary link flag on apple.
-ifeq ($(FOUNDATION_LIB), apple)
+ifeq ($(HAVE_FRAMEWORK_SUPPORT), yes)
FRAMEWORK_NAME = $(NATIVE_LIBRARY_NAME)
include $(GNUSTEP_MAKEFILES)/framework.make
Index: rules.make
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/make/rules.make,v
retrieving revision 1.162
diff -u -r1.162 rules.make
--- rules.make 9 Mar 2004 17:30:42 -0000 1.162
+++ rules.make 10 Mar 2004 15:46:20 -0000
@@ -235,14 +235,16 @@
$(AUXILIARY_INCLUDE_DIRS) \
$(DERIVED_SOURCES_HEADERS_FLAG) \
-I. $(SYSTEM_INCLUDES) \
- $(GNUSTEP_HEADERS_FLAGS)
+ $(GNUSTEP_HEADERS_FLAGS) \
+ $(GNUSTEP_FRAMEWORKS_FLAGS)
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(ADDITIONAL_CFLAGS) \
$(AUXILIARY_CFLAGS) $(ADDITIONAL_INCLUDE_DIRS) \
$(AUXILIARY_INCLUDE_DIRS) \
$(DERIVED_SOURCES_HEADERS_FLAG) \
-I. $(SYSTEM_INCLUDES) \
- $(GNUSTEP_HEADERS_FLAGS)
+ $(GNUSTEP_HEADERS_FLAGS) \
+ $(GNUSTEP_FRAMEWORKS_FLAGS)
# if you need, you can define ADDITIONAL_CCFLAGS to add C++ specific flags
ALL_CCFLAGS = $(ADDITIONAL_CCFLAGS) $(AUXILIARY_CCFLAGS)
@@ -266,6 +268,7 @@
ALL_LIB_DIRS = $(ADDITIONAL_FRAMEWORK_DIRS) $(AUXILIARY_FRAMEWORK_DIRS) \
$(ADDITIONAL_LIB_DIRS) $(AUXILIARY_LIB_DIRS) \
$(GNUSTEP_LIBRARIES_FLAGS) \
+ $(GNUSTEP_FRAMEWORKS_FLAGS) \
$(SYSTEM_LIB_DIR)
# We use .plist (property-list files, see gnustep-base) in quite a few
- [RFA/make] Extend Framework support,
David Ayers <=