summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-09-28 00:18:12 +0200
committerMichael Stahl <mstahl@redhat.com>2012-09-28 16:49:07 +0200
commitcee32aae398283c38b42c73add694e9d074a5d62 (patch)
tree6b24d1825a8ecab75c160db1734f7660c8759621
parentb05430409b3eb3a4b8649895788e025fc9a0d9a0 (diff)
gbuild: clean up Mac OS X framework handling:
There are currently 3 different mechanisms being used for frameworks, which is of course intolerable so we invent a 4th one and standardize on it: gb_LinkTarget_use_darwin_frameworks (This doesn't mean using add_libs or externals was wrong, it was just inconsistent... and i don't see an obvious benefit of using externals here) Change-Id: I5de9020402c87e7236c6a358c47f02fa56642d3d
-rw-r--r--Library_merged.mk18
-rw-r--r--RepositoryExternal.mk90
-rw-r--r--apple_remote/Library_AppleRemote.mk17
-rw-r--r--avmedia/Library_avmediaQuickTime.mk8
-rw-r--r--canvas/Library_cairocanvas.mk4
-rw-r--r--connectivity/Library_macabdrv1.mk6
-rw-r--r--extensions/Library_OOoSpotlightImporter.mk8
-rw-r--r--extensions/Library_pl.mk8
-rw-r--r--fpicker/Library_fps_aqua.mk6
-rw-r--r--lingucomponent/Library_MacOSXSpell.mk5
-rw-r--r--sal/Library_sal.mk6
-rw-r--r--sfx2/Library_sfx.mk6
-rw-r--r--shell/Library_localebe.mk6
-rw-r--r--shell/Library_macbe.mk6
-rw-r--r--slideshow/Library_OGLTrans.mk2
-rw-r--r--solenv/gbuild/CppunitTest.mk1
-rw-r--r--solenv/gbuild/Executable.mk1
-rw-r--r--solenv/gbuild/Library.mk1
-rw-r--r--solenv/gbuild/platform/IOS_ARM_GCC.mk16
-rw-r--r--solenv/gbuild/platform/macosx.mk20
-rw-r--r--vcl/Library_vcl.mk20
21 files changed, 77 insertions, 178 deletions
diff --git a/Library_merged.mk b/Library_merged.mk
index 8914e598e5fc..847e5474e576 100644
--- a/Library_merged.mk
+++ b/Library_merged.mk
@@ -131,12 +131,12 @@ $(eval $(call gb_Library_use_libraries,merged,\
AppleRemote \
objc \
))
-$(eval $(call gb_Library_use_externals,merged,\
- carbon \
- cocoa \
- corefoundation \
- coreservices \
- quicktime \
+$(eval $(call gb_Library_use_system_darwin_frameworks,merged,\
+ Carbon \
+ Cocoa \
+ CoreFoundation \
+ CoreServices \
+ QuickTime \
))
endif
@@ -162,9 +162,9 @@ $(eval $(call gb_Library_use_externals,merged,\
endif
ifeq ($(OS),IOS)
-$(eval $(call gb_Library_use_externals,merged,\
- corefoundation \
- uikit \
+$(eval $(call gb_Library_use_system_darwin_frameworks,merged,\
+ CoreFoundation \
+ UIKit \
))
endif
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index d653b208dba2..2f79d77ec35d 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -2002,96 +2002,6 @@ endef
endif # GUIBASE=unx
-# MacOSX-only frameworks ############################################
-# (in alphabetical order)
-
-define gb_LinkTarget__use_carbon
-$(call gb_LinkTarget_add_libs,$(1), \
- -framework Carbon \
-)
-
-endef
-
-define gb_LinkTarget__use_cocoa
-$(call gb_LinkTarget_add_libs,$(1), \
- -framework Cocoa \
-)
-
-endef
-
-define gb_LinkTarget__use_iokit
-$(call gb_LinkTarget_add_libs,$(1), \
- -framework IOKit \
-)
-
-endef
-
-define gb_LinkTarget__use_qtkit
-$(call gb_LinkTarget_add_libs,$(1), \
- -framework QTKit \
-)
-
-endef
-
-define gb_LinkTarget__use_quicktime
-$(call gb_LinkTarget_add_libs,$(1), \
- -framework QuickTime \
-)
-
-endef
-
-# Common MacOSX and iOS frameworks
-
-define gb_LinkTarget__use_corefoundation
-$(call gb_LinkTarget_add_libs,$(1), \
- -framework CoreFoundation \
-)
-
-endef
-
-define gb_LinkTarget__use_coregraphics
-$(call gb_Library_add_libs,$(1), \
- -framework CoreGraphics \
-)
-
-endef
-
-define gb_LinkTarget__use_coreservices
-$(call gb_Library_add_libs,$(1), \
- -framework CoreServices \
-)
-
-endef
-
-define gb_LinkTarget__use_coretext
-$(call gb_Library_add_libs,$(1), \
- -framework CoreText \
-)
-
-endef
-
-define gb_LinkTarget__use_foundation
-$(call gb_LinkTarget_add_libs,$(1), \
- -framework Foundation \
-)
-
-endef
-
-define gb_LinkTarget__use_systemconfiguration
-$(call gb_LinkTarget_add_libs,$(1), \
- -framework SystemConfiguration \
-)
-
-endef
-
-# iOS-only frameworks
-
-define gb_LinkTarget__use_uikit
-$(call gb_LinkTarget_add_libs,$(1), \
- -framework UIKit \
-)
-
-endef
ifeq (,$(filter DESKTOP,$(BUILD_TYPE)))
diff --git a/apple_remote/Library_AppleRemote.mk b/apple_remote/Library_AppleRemote.mk
index 37a19282e043..c5fdbef72b08 100644
--- a/apple_remote/Library_AppleRemote.mk
+++ b/apple_remote/Library_AppleRemote.mk
@@ -1,4 +1,3 @@
-
# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*-
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
@@ -33,16 +32,10 @@ $(eval $(call gb_Library_use_package,AppleRemote,\
apple_remote_inc \
))
-$(eval $(call gb_Library_use_externals,AppleRemote,\
- cocoa \
- carbon \
- iokit \
-))
-
-$(eval $(call gb_Library_add_libs,AppleRemote,\
- -framework Cocoa \
- -framework Carbon \
- -framework IOKit \
+$(eval $(call gb_Library_use_system_darwin_frameworks,AppleRemote,\
+ Cocoa \
+ Carbon \
+ IOKit \
))
$(eval $(call gb_Library_add_objcobjects,AppleRemote,\
@@ -55,3 +48,5 @@ $(eval $(call gb_Library_add_objcobjects,AppleRemote,\
apple_remote/source/MultiClickRemoteBehavior \
apple_remote/source/RemoteMainController \
))
+
+# vim: set noet sw=4 ts=4:
diff --git a/avmedia/Library_avmediaQuickTime.mk b/avmedia/Library_avmediaQuickTime.mk
index 1daa4aafbe10..7906a37c9665 100644
--- a/avmedia/Library_avmediaQuickTime.mk
+++ b/avmedia/Library_avmediaQuickTime.mk
@@ -49,10 +49,10 @@ $(eval $(call gb_Library_use_libraries,avmediaQuickTime,\
$(eval $(call gb_Library_add_standard_system_libs,avmediaQuickTime))
-$(eval $(call gb_Library_use_externals,avmediaQuickTime,\
- cocoa \
- qtkit \
- quicktime \
+$(eval $(call gb_Library_use_system_darwin_frameworks,avmediaQuickTime,\
+ Cocoa \
+ QTKit \
+ QuickTime \
))
$(eval $(call gb_Library_add_objcxxobjects,avmediaQuickTime,\
diff --git a/canvas/Library_cairocanvas.mk b/canvas/Library_cairocanvas.mk
index a30333a3069f..1bfb26f86c8c 100644
--- a/canvas/Library_cairocanvas.mk
+++ b/canvas/Library_cairocanvas.mk
@@ -43,8 +43,8 @@ $(eval $(call gb_Library_add_cxxflags,cairocanvas,\
$(gb_OBJCXXFLAGS) \
))
-$(eval $(call gb_Library_add_libs,cairocanvas,\
- -framework Cocoa \
+$(eval $(call gb_Library_use_system_darwin_frameworks,cairocanvas,\
+ Cocoa \
))
endif
diff --git a/connectivity/Library_macabdrv1.mk b/connectivity/Library_macabdrv1.mk
index bfb78473a161..feb754356a51 100644
--- a/connectivity/Library_macabdrv1.mk
+++ b/connectivity/Library_macabdrv1.mk
@@ -29,9 +29,9 @@ $(eval $(call gb_Library_Library,macabdrv1))
$(eval $(call gb_Library_use_sdk_api,macabdrv1))
-$(eval $(call gb_Library_add_libs,macabdrv1,\
- -framework Carbon \
- -framework AddressBook \
+$(eval $(call gb_Library_use_system_darwin_frameworks,macabdrv1,\
+ Carbon \
+ AddressBook \
))
$(eval $(call gb_Library_use_libraries,macabdrv1,\
diff --git a/extensions/Library_OOoSpotlightImporter.mk b/extensions/Library_OOoSpotlightImporter.mk
index 112c7a6bbbed..ef48cb3253fe 100644
--- a/extensions/Library_OOoSpotlightImporter.mk
+++ b/extensions/Library_OOoSpotlightImporter.mk
@@ -38,10 +38,10 @@ $(eval $(call gb_Library_add_objcobjects,OOoSpotlightImporter,\
extensions/source/macosx/spotlight/main \
))
-$(eval $(call gb_Library_add_ldflags,OOoSpotlightImporter,\
- -framework CoreFoundation \
- -framework Foundation \
- -framework CoreServices \
+$(eval $(call gb_Library_use_system_darwin_frameworks,OOoSpotlightImporter,\
+ CoreFoundation \
+ Foundation \
+ CoreServices \
))
$(eval $(call gb_Library_use_external,OOoSpotlightImporter,zlib))
diff --git a/extensions/Library_pl.mk b/extensions/Library_pl.mk
index 45b1b75d58b7..34b147320771 100644
--- a/extensions/Library_pl.mk
+++ b/extensions/Library_pl.mk
@@ -84,10 +84,10 @@ $(eval $(call gb_Library_add_objcxxobjects,pl,\
extensions/source/plugin/aqua/sysplug \
))
-$(eval $(call gb_Library_use_externals,pl,\
- cocoa \
- carbon \
- corefoundation \
+$(eval $(call gb_Library_use_system_darwin_frameworks,pl,\
+ Cocoa \
+ Carbon \
+ CoreFoundation \
))
else # GUIBASE!=aqua
diff --git a/fpicker/Library_fps_aqua.mk b/fpicker/Library_fps_aqua.mk
index 2c7665855779..1f1d3e4f2fd9 100644
--- a/fpicker/Library_fps_aqua.mk
+++ b/fpicker/Library_fps_aqua.mk
@@ -35,9 +35,9 @@ $(eval $(call gb_Library_use_packages,fps_aqua,\
$(eval $(call gb_Library_use_sdk_api,fps_aqua))
-$(eval $(call gb_Library_add_libs,fps_aqua,\
- -framework Cocoa \
- -framework CoreFoundation \
+$(eval $(call gb_Library_use_system_darwin_frameworks,fps_aqua,\
+ Cocoa \
+ CoreFoundation \
))
$(eval $(call gb_Library_use_libraries,fps_aqua,\
diff --git a/lingucomponent/Library_MacOSXSpell.mk b/lingucomponent/Library_MacOSXSpell.mk
index 57d5a65568d1..b2bcd1952396 100644
--- a/lingucomponent/Library_MacOSXSpell.mk
+++ b/lingucomponent/Library_MacOSXSpell.mk
@@ -49,8 +49,11 @@ $(eval $(call gb_Library_use_libraries,MacOSXSpell,\
$(eval $(call gb_Library_add_standard_system_libs,MacOSXSpell))
+$(eval $(call gb_Library_use_system_darwin_frameworks,MacOSXSpell,\
+ Cocoa \
+))
+
$(eval $(call gb_Library_use_externals,MacOSXSpell,\
- cocoa \
hunspell \
))
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index f5b3b3d4e689..c42728ff9ac1 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -87,9 +87,9 @@ $(eval $(call gb_Library_use_libraries,sal,\
$(eval $(call gb_Library_add_standard_system_libs,sal))
ifeq ($(OS),MACOSX)
-$(eval $(call gb_Library_use_externals,sal,\
- carbon \
- corefoundation \
+$(eval $(call gb_Library_use_system_darwin_frameworks,sal,\
+ Carbon \
+ CoreFoundation \
))
endif
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 23badc19286e..c384a1b98046 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -280,8 +280,10 @@ ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_objcxxobjects,sfx,\
sfx2/source/appl/shutdowniconaqua \
))
-$(eval $(call gb_Library_use_libraries,sfx,\
- objc \
+$(eval $(call gb_Library_add_libs,sfx,\
+ -lobjc \
+))
+$(eval $(call gb_Library_use_system_darwin_frameworks,sfx,\
Cocoa \
))
endif
diff --git a/shell/Library_localebe.mk b/shell/Library_localebe.mk
index 96022b731a24..0cefa0b8908f 100644
--- a/shell/Library_localebe.mk
+++ b/shell/Library_localebe.mk
@@ -30,9 +30,9 @@ $(eval $(call gb_Library_Library,localebe1))
$(eval $(call gb_Library_use_sdk_api,localebe1))
ifeq ($(OS),MACOSX)
-$(eval $(call gb_Library_use_externals,localebe1,\
- corefoundation \
- coreservices \
+$(eval $(call gb_Library_use_system_darwin_frameworks,localebe1,\
+ CoreFoundation \
+ CoreServices \
))
endif
diff --git a/shell/Library_macbe.mk b/shell/Library_macbe.mk
index 236cc6ce6e0a..6746fc0bffb8 100644
--- a/shell/Library_macbe.mk
+++ b/shell/Library_macbe.mk
@@ -29,9 +29,9 @@ $(eval $(call gb_Library_Library,macbe1))
$(eval $(call gb_Library_use_sdk_api,macbe1))
-$(eval $(call gb_Library_use_externals,macbe1,\
- cocoa \
- systemconfiguration \
+$(eval $(call gb_Library_use_system_darwin_frameworks,macbe1,\
+ Cocoa \
+ SystemConfiguration \
))
$(eval $(call gb_Library_use_libraries,macbe1,\
diff --git a/slideshow/Library_OGLTrans.mk b/slideshow/Library_OGLTrans.mk
index 380f935d9e0e..c3c2b6d768c0 100644
--- a/slideshow/Library_OGLTrans.mk
+++ b/slideshow/Library_OGLTrans.mk
@@ -74,7 +74,7 @@ $(eval $(call gb_Library_add_objcxxobjects,OGLTrans,\
, $(gb_LinkTarget_EXCEPTIONFLAGS) \
))
-$(eval $(call gb_Library_use_libraries,OGLTrans,\
+$(eval $(call gb_Library_use_system_darwin_frameworks,OGLTrans,\
Cocoa \
GLUT \
OpenGL \
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index ee844de24330..02af2fbda472 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -342,6 +342,7 @@ $(eval $(foreach method,\
set_ldflags \
add_libs \
add_standard_system_libs \
+ use_system_darwin_frameworks \
use_sdk_api \
use_udk_api \
use_internal_api \
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index 1ddedfdad41b..243e3cda7b24 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -106,6 +106,7 @@ $(eval $(foreach method,\
set_ldflags \
add_libs \
add_standard_system_libs \
+ use_system_darwin_frameworks \
set_library_path_flags \
add_api \
use_api \
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 10ca542b58c5..131806f8d273 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -186,6 +186,7 @@ $(eval $(foreach method,\
set_x64 \
add_libs \
add_standard_system_libs \
+ use_system_darwin_frameworks \
set_library_path_flags \
add_api \
use_api \
diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk
index 491d0cb9bb0d..a36d6a36182d 100644
--- a/solenv/gbuild/platform/IOS_ARM_GCC.mk
+++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk
@@ -136,11 +136,9 @@ gb_LinkTarget_OBJCXXFLAGS += -g
gb_LinkTarget_OBJCFLAGS += -g
endif
-# FIXME framework handling very hackish
define gb_LinkTarget__get_liblinkflags
-$(patsubst lib%.a,-l%,$(foreach lib,$(filter-out $(gb_Library__FRAMEWORKS) $(gb_Library_UNOLIBS_OOO),$(1)),$(call gb_Library_get_filename,$(lib)))) \
-$(foreach lib,$(filter $(gb_Library_UNOLIBS_OOO),$(1)),$(SOLARVER)/$(INPATH)/lib/$(lib)$(gb_Library_UNOEXT)) \
-$(addprefix -framework ,$(filter $(gb_Library__FRAMEWORKS),$(1)))
+$(patsubst lib%.a,-l%,$(foreach lib,$(filter-out $(gb_Library_UNOLIBS_OOO),$(1)),$(call gb_Library_get_filename,$(lib)))) \
+$(foreach lib,$(filter $(gb_Library_UNOLIBS_OOO),$(1)),$(SOLARVER)/$(INPATH)/lib/$(lib)$(gb_Library_UNOEXT))
endef
define gb_LinkTarget__get_layer
@@ -190,6 +188,10 @@ $(call gb_Output_announce,$(2),$(true),LNK,4)
$(call gb_LinkTarget__command_staticlink,$(1))
endef
+define gb_LinkTarget_use_system_darwin_frameworks
+$(call gb_LinkTarget_add_libs,$(1),$(foreach fw,$(2),-framework $(fw)))
+endef
+
# Library class
@@ -203,12 +205,6 @@ gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT)
gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
-gb_Library__FRAMEWORKS := \
- Foundation \
- CoreFoundation \
- CoreGraphics \
- CoreText \
-
gb_Library_PLAINLIBS_NONE += \
objc \
m \
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 8317c40f9f06..17e7aab47ccb 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -168,12 +168,6 @@ gb_LinkTarget_OBJCFLAGS += -g
gb_LinkTarget_OBJCXXFLAGS += -g
endif
-# FIXME framework handling very hackish
-define gb_LinkTarget__get_liblinkflags
-$(patsubst lib%.dylib,-l%,$(foreach lib,$(filter-out $(gb_Library__FRAMEWORKS),$(1)),$(call gb_Library_get_filename,$(lib)))) \
-$(addprefix -framework ,$(filter $(gb_Library__FRAMEWORKS),$(1)))
-endef
-
define gb_LinkTarget__get_layer
$(if $(filter Executable,$(1)),\
$$(call gb_Executable_get_layer,$(2)),\
@@ -201,7 +195,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
- $(call gb_LinkTarget__get_liblinkflags,$(LINKED_LIBS)) \
+ $(patsubst lib%.dylib,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
@@ -246,6 +240,10 @@ $(if $(filter Library Bundle CppunitTest Executable,$(TARGETTYPE)),$(call gb_Lin
$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1)))
endef
+define gb_LinkTarget_use_system_darwin_frameworks
+$(call gb_LinkTarget_add_libs,$(1),$(foreach fw,$(2),-framework $(fw)))
+endef
+
# Library class
@@ -261,16 +259,8 @@ gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT)
gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
-gb_Library__FRAMEWORKS := \
- Cocoa \
- GLUT \
- OpenGL \
-
gb_Library_PLAINLIBS_NONE += \
- GLUT \
- Cocoa \
objc \
- OpenGL \
m \
pthread \
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index ce6d41e4a107..194ef1c4bdd0 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -362,8 +362,8 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/aqua/source/gdi/coretext/salgdi \
))
-$(eval $(call gb_Library_use_externals,vcl,\
- coretext \
+$(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\
+ CoreText \
))
else # ATSUI
@@ -443,11 +443,11 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
$(eval $(call gb_Library_use_libraries,vcl,\
AppleRemote \
))
-$(eval $(call gb_Library_use_externals,vcl,\
- $(if $(filter 64,$(BITNESS_OVERRIDE)),,quicktime) \
- cocoa \
- carbon \
- corefoundation \
+$(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\
+ $(if $(filter 64,$(BITNESS_OVERRIDE)),,QuickTime) \
+ Cocoa \
+ Carbon \
+ CoreFoundation \
))
$(eval $(call gb_Library_use_libraries,vcl,\
@@ -610,9 +610,9 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/ios/source/window/salmenu \
vcl/ios/source/window/salobj \
))
-$(eval $(call gb_Library_use_externals,vcl,\
- uikit \
- corefoundation \
+$(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\
+ UIKit \
+ CoreFoundation \
))
endif