< prev index next >

make/common/modules/LauncherCommon.gmk

Print this page
rev 59383 : [mq]: final


  23 # questions.
  24 #
  25 
  26 include JdkNativeCompilation.gmk
  27 include Modules.gmk
  28 include ProcessMarkdown.gmk
  29 include ToolsJdk.gmk
  30 
  31 # Tell the compiler not to export any functions unless declared so in
  32 # the source code. On Windows, this is the default and cannot be changed.
  33 # On Mac, we have always exported all symbols, probably due to oversight
  34 # and/or misunderstanding. To emulate this, don't hide any symbols
  35 # by default.
  36 # On AIX/xlc we need at least xlc 13.1 for the symbol hiding (see JDK-8214063)
  37 # Also provide an override for non-conformant libraries.
  38 ifeq ($(TOOLCHAIN_TYPE), gcc)
  39   LAUNCHER_CFLAGS += -fvisibility=hidden
  40   LDFLAGS_JDKEXE += -Wl,--exclude-libs,ALL
  41 else ifeq ($(TOOLCHAIN_TYPE), clang)
  42   LAUNCHER_CFLAGS += -fvisibility=hidden
  43 else ifeq ($(TOOLCHAIN_TYPE), solstudio)
  44   LAUNCHER_CFLAGS += -xldscope=hidden
  45 endif
  46 
  47 LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher
  48 LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/launcher \
  49     -I$(TOPDIR)/src/java.base/share/native/libjli \
  50     -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
  51     -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli \
  52     #
  53 GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
  54 MACOSX_PLIST_DIR := $(TOPDIR)/src/java.base/macosx/native/launcher
  55 JAVA_MANIFEST := $(TOPDIR)/src/java.base/windows/native/launcher/java.manifest
  56 
  57 ################################################################################
  58 # Build standard launcher.
  59 
  60 # Setup make rules for building a standard launcher.
  61 #
  62 # Parameter 1 is the name of the rule. This name is used as variable prefix,
  63 # and the targets generated are listed in a variable by that name. It is also
  64 # used as the name of the executable.


 126           -lstdc++ -liconv
 127     endif
 128   endif
 129 
 130   ifeq ($(USE_EXTERNAL_LIBZ), true)
 131     $1_LIBS += -lz
 132   endif
 133 
 134   $1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli)
 135 
 136   $$(eval $$(call SetupJdkExecutable, BUILD_LAUNCHER_$1, \
 137       NAME := $1, \
 138       EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \
 139       OPTIMIZATION := $$($1_OPTIMIZATION), \
 140       CFLAGS := $$(CFLAGS_JDKEXE) \
 141           $$(LAUNCHER_CFLAGS) \
 142           $$(VERSION_CFLAGS) \
 143           -DLAUNCHER_NAME='"$$(LAUNCHER_NAME)"' \
 144           -DPROGNAME='"$1"' \
 145           $$($1_CFLAGS), \
 146       CFLAGS_solaris := -KPIC, \
 147       CFLAGS_windows := $$($1_CFLAGS_windows), \
 148       DISABLED_WARNINGS_gcc := unused-function, \
 149       LDFLAGS := $$(LDFLAGS_JDKEXE) \
 150           $$(call SET_EXECUTABLE_ORIGIN) \
 151           $$($1_LDFLAGS), \
 152       LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
 153           -L$(call FindLibDirForModule, java.base), \
 154       LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
 155           -L$(call FindLibDirForModule, java.base), \
 156       LDFLAGS_solaris := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
 157           -L$(call FindLibDirForModule, java.base), \
 158       LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
 159       LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
 160       LIBS_linux := -ljli -lpthread $(LIBDL), \
 161       LIBS_macosx := -ljli -framework Cocoa -framework Security \
 162           -framework ApplicationServices, \
 163       LIBS_solaris := -ljli -lthread $(LIBDL), \
 164       LIBS_aix := -ljli_static, \
 165       LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
 166           $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \
 167       OUTPUT_DIR := $$($1_OUTPUT_DIR), \
 168       VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
 169       EXTRA_RC_FLAGS := $$($1_EXTRA_RC_FLAGS), \
 170       MANIFEST := $(JAVA_MANIFEST), \
 171       MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \
 172   ))
 173 
 174   $1 += $$(BUILD_LAUNCHER_$1)
 175   TARGETS += $$($1)
 176 
 177   ifeq ($(call isTargetOs, aix), true)
 178     $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
 179   endif
 180 
 181   ifeq ($(call isTargetOs, windows), true)
 182     $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \
 183         $$($1_WINDOWS_JLI_LIB)




  23 # questions.
  24 #
  25 
  26 include JdkNativeCompilation.gmk
  27 include Modules.gmk
  28 include ProcessMarkdown.gmk
  29 include ToolsJdk.gmk
  30 
  31 # Tell the compiler not to export any functions unless declared so in
  32 # the source code. On Windows, this is the default and cannot be changed.
  33 # On Mac, we have always exported all symbols, probably due to oversight
  34 # and/or misunderstanding. To emulate this, don't hide any symbols
  35 # by default.
  36 # On AIX/xlc we need at least xlc 13.1 for the symbol hiding (see JDK-8214063)
  37 # Also provide an override for non-conformant libraries.
  38 ifeq ($(TOOLCHAIN_TYPE), gcc)
  39   LAUNCHER_CFLAGS += -fvisibility=hidden
  40   LDFLAGS_JDKEXE += -Wl,--exclude-libs,ALL
  41 else ifeq ($(TOOLCHAIN_TYPE), clang)
  42   LAUNCHER_CFLAGS += -fvisibility=hidden


  43 endif
  44 
  45 LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher
  46 LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/launcher \
  47     -I$(TOPDIR)/src/java.base/share/native/libjli \
  48     -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
  49     -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli \
  50     #
  51 GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
  52 MACOSX_PLIST_DIR := $(TOPDIR)/src/java.base/macosx/native/launcher
  53 JAVA_MANIFEST := $(TOPDIR)/src/java.base/windows/native/launcher/java.manifest
  54 
  55 ################################################################################
  56 # Build standard launcher.
  57 
  58 # Setup make rules for building a standard launcher.
  59 #
  60 # Parameter 1 is the name of the rule. This name is used as variable prefix,
  61 # and the targets generated are listed in a variable by that name. It is also
  62 # used as the name of the executable.


 124           -lstdc++ -liconv
 125     endif
 126   endif
 127 
 128   ifeq ($(USE_EXTERNAL_LIBZ), true)
 129     $1_LIBS += -lz
 130   endif
 131 
 132   $1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli)
 133 
 134   $$(eval $$(call SetupJdkExecutable, BUILD_LAUNCHER_$1, \
 135       NAME := $1, \
 136       EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \
 137       OPTIMIZATION := $$($1_OPTIMIZATION), \
 138       CFLAGS := $$(CFLAGS_JDKEXE) \
 139           $$(LAUNCHER_CFLAGS) \
 140           $$(VERSION_CFLAGS) \
 141           -DLAUNCHER_NAME='"$$(LAUNCHER_NAME)"' \
 142           -DPROGNAME='"$1"' \
 143           $$($1_CFLAGS), \

 144       CFLAGS_windows := $$($1_CFLAGS_windows), \
 145       DISABLED_WARNINGS_gcc := unused-function, \
 146       LDFLAGS := $$(LDFLAGS_JDKEXE) \
 147           $$(call SET_EXECUTABLE_ORIGIN) \
 148           $$($1_LDFLAGS), \
 149       LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
 150           -L$(call FindLibDirForModule, java.base), \
 151       LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
 152           -L$(call FindLibDirForModule, java.base), \


 153       LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
 154       LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
 155       LIBS_linux := -ljli -lpthread $(LIBDL), \
 156       LIBS_macosx := -ljli -framework Cocoa -framework Security \
 157           -framework ApplicationServices, \

 158       LIBS_aix := -ljli_static, \
 159       LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
 160           $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \
 161       OUTPUT_DIR := $$($1_OUTPUT_DIR), \
 162       VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
 163       EXTRA_RC_FLAGS := $$($1_EXTRA_RC_FLAGS), \
 164       MANIFEST := $(JAVA_MANIFEST), \
 165       MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \
 166   ))
 167 
 168   $1 += $$(BUILD_LAUNCHER_$1)
 169   TARGETS += $$($1)
 170 
 171   ifeq ($(call isTargetOs, aix), true)
 172     $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli_static)
 173   endif
 174 
 175   ifeq ($(call isTargetOs, windows), true)
 176     $$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \
 177         $$($1_WINDOWS_JLI_LIB)


< prev index next >