< prev index next >

jdk/make/launcher/LauncherCommon.gmk

Print this page


   1 #
   2 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 105       $1_PLIST_FILE := Info-privileged.plist
 106         $1_CODESIGN := true
 107     else
 108       $1_PLIST_FILE := Info-cmdline.plist
 109     endif
 110 
 111     $1_CFLAGS += -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
 112     $1_LDFLAGS += -Wl,-all_load \
 113         -sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
 114     ifeq ($(STATIC_BUILD), true)
 115       $1_LDFLAGS += -exported_symbols_list \
 116               $(SUPPORT_OUTPUTDIR)/build-static/exported.symbols
 117       $1_LIBS += \
 118           $$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs/java.base -name "*.a") \
 119           $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libdt_socket.a \
 120           $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libjdwp.a \
 121           $(SUPPORT_OUTPUTDIR)/native/java.base/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) \
 122           -framework CoreFoundation \
 123           -framework Foundation \
 124           -framework SystemConfiguration \
 125           -lstdc++ -liconv
 126     else
 127       $1_LIBS += $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a
 128     endif
 129     $1_LIBS += -framework Cocoa -framework Security \
 130         -framework ApplicationServices
 131   endif
 132 
 133   ifeq ($(OPENJDK_TARGET_OS), aix)
 134     $1_LDFLAGS += -L$(SUPPORT_OUTPUTDIR)/native/java.base
 135     $1_LIBS += -ljli_static
 136   endif
 137 









 138   ifeq ($(USE_EXTERNAL_LIBZ), true)
 139     $1_LIBS += -lz
 140   endif
 141 
 142   ifeq ($$($1_WINDOWS_STATIC_LINK), true)
 143     $1_CFLAGS += $(filter-out -MD, $(CFLAGS_JDKEXE))
 144     $1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/jli_static.lib
 145   else
 146     $1_CFLAGS += $(CFLAGS_JDKEXE)
 147     $1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
 148   endif
 149 
 150   # The linker on older SuSE distros (e.g. on SLES 10) complains with:
 151   # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
 152   # if feeded with a version script which contains named tags.

 153   ifeq ($(USING_BROKEN_SUSE_LD),yes)
 154     ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous), )
 155       $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous
 156     else
 157       $1_MAPFILE :=
 158     endif
 159   else

 160     ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)), )
 161       $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
 162     else
 163       $1_MAPFILE :=
 164     endif
 165   endif
 166 
 167   $$(eval $$(call SetupNativeCompilation, BUILD_LAUNCHER_$1, \
 168       EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \
 169       OPTIMIZATION := $$($1_OPTIMIZATION), \
 170       CFLAGS := $$($1_CFLAGS) \
 171           $(LAUNCHER_CFLAGS) \
 172           $(VERSION_CFLAGS) \
 173           -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
 174           -DPROGNAME='"$1"' \
 175           $$($1_CFLAGS), \
 176       CFLAGS_linux := -fPIC, \
 177       CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
 178       CFLAGS_windows := $$($1_CFLAGS_windows), \
 179       LDFLAGS := $$(LDFLAGS_JDKEXE) \
 180           $$(ORIGIN_ARG) \
 181           $$($1_LDFLAGS), \
 182       LDFLAGS_linux := \
 183           -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
 184       LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
 185           -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \


 186       MAPFILE := $$($1_MAPFILE), \
 187       LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
 188       LIBS_unix := $$($1_LIBS_unix), \
 189       LIBS_linux := -lpthread -ljli $(LIBDL) -lc, \
 190       LIBS_solaris := -ljli -lthread $(LIBDL) -lc, \

 191       LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
 192           $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib advapi32.lib \
 193           $$($1_LIBS_windows), \
 194       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs, \
 195       OUTPUT_DIR := $$($1_OUTPUT_DIR), \
 196       PROGRAM := $1, \
 197       VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
 198       RC_FLAGS := $$(RC_FLAGS) \
 199           -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
 200           -D "JDK_INTERNAL_NAME=$1" \
 201           -D "JDK_FTYPE=0x1L" \
 202           $$($1_RC_FLAGS), \
 203       MANIFEST := $(JAVA_MANIFEST), \
 204       MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \
 205       CODESIGN := $$($1_CODESIGN), \
 206   ))
 207 
 208   $1 += $$(BUILD_LAUNCHER_$1)
 209   TARGETS += $$($1)
 210 
   1 #
   2 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 105       $1_PLIST_FILE := Info-privileged.plist
 106         $1_CODESIGN := true
 107     else
 108       $1_PLIST_FILE := Info-cmdline.plist
 109     endif
 110 
 111     $1_CFLAGS += -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
 112     $1_LDFLAGS += -Wl,-all_load \
 113         -sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
 114     ifeq ($(STATIC_BUILD), true)
 115       $1_LDFLAGS += -exported_symbols_list \
 116               $(SUPPORT_OUTPUTDIR)/build-static/exported.symbols
 117       $1_LIBS += \
 118           $$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs/java.base -name "*.a") \
 119           $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libdt_socket.a \
 120           $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libjdwp.a \
 121           $(SUPPORT_OUTPUTDIR)/native/java.base/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) \
 122           -framework CoreFoundation \
 123           -framework Foundation \
 124           -framework SystemConfiguration \
 125           -lstdc++ $(ICONV_LIBS)
 126     else
 127       $1_LIBS += $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a
 128     endif
 129     $1_LIBS += -framework Cocoa -framework Security \
 130         -framework ApplicationServices
 131   endif
 132 
 133   ifeq ($(OPENJDK_TARGET_OS), aix)
 134     $1_LDFLAGS += -L$(SUPPORT_OUTPUTDIR)/native/java.base
 135     $1_LIBS += -ljli_static
 136   endif
 137 
 138   ifeq ($(OPENJDK_TARGET_OS), bsd)
 139     ifeq ($(OPENJDK_TARGET_OS_ENV), bsd.netbsd)
 140       $1_LDFLAGS += -L$(SUPPORT_OUTPUTDIR)/native/java.base
 141       $1_LIBS += -ljli_static
 142     else
 143       $1_LIBS += -ljli
 144     endif
 145   endif
 146 
 147   ifeq ($(USE_EXTERNAL_LIBZ), true)
 148     $1_LIBS += -lz
 149   endif
 150 
 151   ifeq ($$($1_WINDOWS_STATIC_LINK), true)
 152     $1_CFLAGS += $(filter-out -MD, $(CFLAGS_JDKEXE))
 153     $1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/jli_static.lib
 154   else
 155     $1_CFLAGS += $(CFLAGS_JDKEXE)
 156     $1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
 157   endif
 158 
 159   # The linker on older SuSE distros (e.g. on SLES 10) complains with:
 160   # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
 161   # if feeded with a version script which contains named tags.
 162   $1_MAPFILE :=
 163   ifeq ($(USING_BROKEN_SUSE_LD),yes)
 164     ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous), )
 165       $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous


 166     endif
 167   else
 168     ifneq ($(OPENJDK_TARGET_OS), bsd)
 169       ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)), )
 170         $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
 171       endif

 172     endif
 173   endif
 174 
 175   $$(eval $$(call SetupNativeCompilation, BUILD_LAUNCHER_$1, \
 176       EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \
 177       OPTIMIZATION := $$($1_OPTIMIZATION), \
 178       CFLAGS := $$($1_CFLAGS) \
 179           $(LAUNCHER_CFLAGS) \
 180           $(VERSION_CFLAGS) \
 181           -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
 182           -DPROGNAME='"$1"' \
 183           $$($1_CFLAGS), \
 184       CFLAGS_linux := -fPIC, \
 185       CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
 186       CFLAGS_windows := $$($1_CFLAGS_windows), \
 187       LDFLAGS := $$(LDFLAGS_JDKEXE) \
 188           $$(ORIGIN_ARG) \
 189           $$($1_LDFLAGS), \
 190       LDFLAGS_linux := \
 191           -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
 192       LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
 193           -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
 194       LDFLAGS_bsd := \
 195           -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
 196       MAPFILE := $$($1_MAPFILE), \
 197       LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
 198       LIBS_unix := $$($1_LIBS_unix), \
 199       LIBS_linux := -lpthread -ljli $(LIBDL) -lc, \
 200       LIBS_solaris := -ljli -lthread $(LIBDL) -lc, \
 201       LIBS_bsd := -lpthread, \
 202       LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
 203           $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib advapi32.lib \
 204           $$($1_LIBS_windows), \
 205       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs, \
 206       OUTPUT_DIR := $$($1_OUTPUT_DIR), \
 207       PROGRAM := $1, \
 208       VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
 209       RC_FLAGS := $$(RC_FLAGS) \
 210           -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
 211           -D "JDK_INTERNAL_NAME=$1" \
 212           -D "JDK_FTYPE=0x1L" \
 213           $$($1_RC_FLAGS), \
 214       MANIFEST := $(JAVA_MANIFEST), \
 215       MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \
 216       CODESIGN := $$($1_CODESIGN), \
 217   ))
 218 
 219   $1 += $$(BUILD_LAUNCHER_$1)
 220   TARGETS += $$($1)
 221 
< prev index next >