diff options
author | Tor Lillqvist <tml@iki.fi> | 2011-06-13 21:04:34 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2011-06-13 21:08:22 +0300 |
commit | 6b7cfa4d01aa64ba7153b33aa0287f25ea3e90c7 (patch) | |
tree | 6beb2a31d28490421e02e288f284ade542965a46 | |
parent | 9f0af81b02616c78423228b34e1f18a8dc9840eb (diff) |
More experimental iOS work
-rw-r--r-- | solenv/gbuild/platform/ios.mk | 80 |
1 files changed, 19 insertions, 61 deletions
diff --git a/solenv/gbuild/platform/ios.mk b/solenv/gbuild/platform/ios.mk index 43b88a1a8a33..0b26612d0c12 100644 --- a/solenv/gbuild/platform/ios.mk +++ b/solenv/gbuild/platform/ios.mk @@ -72,7 +72,6 @@ gb_CFLAGS := \ -Wendif-labels \ -Wextra \ -Wshadow \ - -fPIC \ -fmessage-length=0 \ -fno-common \ -fno-strict-aliasing \ @@ -216,25 +215,9 @@ endef # LinkTarget class -define gb_LinkTarget__get_rpath_for_layer -$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS))) -endef - -gb_LinkTarget__RPATHS := \ - URELIB:@__________________________________________________URELIB/ \ - UREBIN: \ - OOO:@__________________________________________________OOO/ \ - BRAND: \ - SDKBIN: \ - NONEBIN: \ - -define gb_LinkTarget__get_installname -$(if $(2),-install_name '$(2)$(1)',) -endef - gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) -gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) $(gb_COMPILEROPTFLAGS) +gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) $(gb_OBJCXXFLAGS) $(gb_COMPILEROPTFLAGS) gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) $(gb_COMPILEROPTFLAGS) ifeq ($(gb_SYMBOL),$(true)) @@ -259,35 +242,19 @@ $(if $(filter Executable,$(1)),\ $$(call gb_Library_get_layer,$(2))) endef -# FIXME the DYLIB_FILE mess is only necessary because -# solver layout is different from installation layout define gb_LinkTarget__command_dynamiclink -$(call gb_Helper_abbreviate_dirs,\ +$(call gb_LinkTarget__comm_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ - DYLIB_FILE=`$(gb_MKTEMP)` && \ - $(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ - $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \ - $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ - $(subst \d,$$,$(RPATH)) $(LDFLAGS) \ - $(patsubst lib%.dylib,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) > $${DYLIB_FILE} && \ $(gb_CXX) \ - $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ - $(subst \d,$$,$(RPATH)) $(LDFLAGS) \ - $(call gb_LinkTarget__get_liblinkflags,$(LINKED_LIBS)) \ + $(LDFLAGS) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ - $(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_target,$(object))) \ - $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \ - $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \ - -o $(1) \ - `cat $${DYLIB_FILE}` && \ - $(if $(filter Library CppunitTest,$(TARGETTYPE)),\ - $(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl Library $(LAYER) $(1) && \ - ln -sf $(1) $(patsubst %.dylib,%.jnilib,$(1)) &&) \ - rm -f $${DYLIB_FILE}) + -Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \ + $(patsubst lib%.a,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \ + -o $(1)) endef # parameters: 1-linktarget 2-cobjects 3-cxxobjects @@ -306,7 +273,7 @@ endef define gb_LinkTarget__command $(call gb_Output_announce,$(2),$(true),LNK,4) -$(if $(filter Library CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2))) +$(if $(filter Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2))) $(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) endef @@ -314,10 +281,9 @@ endef # Library class gb_Library_DEFS := -gb_Library_TARGETTYPEFLAGS := -dynamiclib -single_module gb_Library_SYSPRE := lib gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_ -gb_Library_PLAINEXT := .dylib +gb_Library_PLAINEXT := .a gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT) gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT) @@ -345,20 +311,16 @@ gb_Library_FILENAMES := \ gb_Library_LAYER := \ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ - $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \ - $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \ - $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \ - $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \ - -define gb_Library_get_rpath -$(call gb_LinkTarget__get_installname,$(call gb_Library_get_filename,$(1)),$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))) -endef + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \ define gb_Library_Library_platform -$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1)) +$(call gb_LinkTarget_get_target,$(2)) : $(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Library_get_layer,$(1)) endef @@ -384,19 +346,15 @@ gb_Executable_EXT := gb_Executable_TARGETTYPEFLAGS := -bind_at_load gb_Executable_LAYER := \ - $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \ - $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \ + $(foreach exe,$(gb_Executable_UREBIN),$(exe):OOO) \ + $(foreach exe,$(gb_Executable_SDK),$(exe):OOO) \ $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \ - $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \ - $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \ - + $(foreach exe,$(gb_Executable_BRAND),$(exe):OOO) \ + $(foreach exe,$(gb_Executable_NONE),$(exe):OOO) \ -define gb_Executable_get_rpath -$(call gb_LinkTarget__get_installname,$(1),$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1)))) -endef define gb_Executable_Executable_platform -$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Executable_get_rpath,$(1)) +$(call gb_LinkTarget_get_target,$(2)) : $(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Executable_get_layer,$(1)) endef @@ -411,7 +369,7 @@ gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT) gb_CppunitTest_get_libfilename = $(gb_CppunitTest_get_filename) define gb_CppunitTest_CppunitTest_platform -$(call gb_LinkTarget_get_target,$(2)) : RPATH := +$(call gb_LinkTarget_get_target,$(2)) : $(call gb_LinkTarget_get_target,$(2)) : LAYER := NONE endef |