Kaydet (Commit) ecddbece authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) Andras Timar

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
üst 4ad9285d
......@@ -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
......
......@@ -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)))
......
# -*- 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:
......@@ -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,\
......
......@@ -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
......
......@@ -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,\
......
......@@ -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))
......
......@@ -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
......
......@@ -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,\
......
......@@ -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 \
))
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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,\
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment