< prev index next >

jdk/make/lib/CoreLibraries.gmk

Print this page




  57   # On macosx the old build does partial (incremental) linking of fdlibm instead of
  58   # a plain static library.
  59   $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \
  60       LIBRARY := fdlibm, \
  61       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
  62       SRC := $(LIBFDLIBM_SRC), \
  63       LANG := C, \
  64       CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
  65       LDFLAGS := -nostdlib -r -arch x86_64, \
  66       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
  67       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  68 
  69   BUILD_LIBFDLIBM := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
  70   $(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC)
  71         $(call install-file)
  72 
  73 endif
  74 
  75 ##########################################################################################
  76 
  77 BUILD_LIBVERIFY_SRC := check_code.c check_format.c
  78 
  79 ifeq ($(OPENJDK_TARGET_OS), solaris)
  80   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
  81     BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/make/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU)
  82   endif
  83 endif
  84 
  85 LIBVERIFY_OPTIMIZATION := HIGH
  86 ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
  87   ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
  88     LIBVERIFY_OPTIMIZATION := LOW
  89   endif
  90 endif
  91 
  92 $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
  93     LIBRARY := verify, \
  94     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  95     SRC := $(JDK_TOPDIR)/src/java.base/share/native/libverify, \
  96     LANG := C, \
  97     OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
  98     CFLAGS := $(CFLAGS_JDKLIB), \
  99     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \
 100     LDFLAGS := $(LDFLAGS_JDKLIB) \
 101         $(call SET_SHARED_LIBRARY_ORIGIN), \
 102     LDFLAGS_SUFFIX_unix := -ljvm -lc, \
 103     LDFLAGS_SUFFIX_windows := jvm.lib, \
 104     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 105     RC_FLAGS := $(RC_FLAGS) \
 106         -D "JDK_FNAME=verify.dll" \
 107         -D "JDK_INTERNAL_NAME=verify" \
 108         -D "JDK_FTYPE=0x2L", \
 109     REORDER := $(BUILD_LIBVERIFY_REORDER), \
 110     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify, \
 111     DEBUG_SYMBOLS := true))
 112 
 113 TARGETS += $(BUILD_LIBVERIFY)
 114 
 115 ##########################################################################################
 116 
 117 LIBJAVA_SRC_DIRS := $(call FindSrcDirsForLib, java.base, java)
 118 
 119 ifeq ($(OPENJDK_TARGET_OS), macosx)
 120   LIBJAVA_EXCLUDE_FILES += $(JDK_TOPDIR)/src/java.base/unix/native/libjava/HostLocaleProviderAdapter_md.c
 121 endif
 122 
 123 LIBJAVA_CFLAGS := $(addprefix -I, $(LIBJAVA_SRC_DIRS)) \
 124     -I$(JDK_TOPDIR)/src/java.base/share/native/libfdlibm \
 125     -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
 126     -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
 127 
 128 LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
 129     -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
 130     -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \
 131      -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"'
 132 
 133 ifneq (, $(JDK_UPDATE_VERSION))
 134   LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
 135 endif
 136 
 137 ifneq ($(OPENJDK_TARGET_OS), macosx)
 138   LIBJAVA_EXCLUDE_FILES += java_props_macosx.c
 139 else
 140   BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
 141   BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
 142 endif
 143 
 144 ifeq ($(OPENJDK_TARGET_OS), solaris)
 145   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 146     LIBJAVA_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU)
 147   endif
 148 endif
 149 
 150 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
 151     LIBRARY := java, \
 152     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 153     SRC := $(LIBJAVA_SRC_DIRS), \
 154     EXCLUDES := fdlibm/src zip prefs, \
 155     EXCLUDE_FILES := $(LIBJAVA_EXCLUDE_FILES), \
 156     LANG := C, \
 157     OPTIMIZATION := HIGH, \
 158     CFLAGS := $(CFLAGS_JDKLIB) \
 159         $(LIBJAVA_CFLAGS), \
 160     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
 161     LDFLAGS := $(LDFLAGS_JDKLIB) \
 162         $(call SET_SHARED_LIBRARY_ORIGIN), \
 163     LDFLAGS_SUFFIX_unix := -ljvm -lverify, \
 164     LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \
 165     LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
 166     LDFLAGS_SUFFIX_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\
 167     LDFLAGS_SUFFIX_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/ -lfdlibm \
 168         -framework CoreFoundation \
 169         -framework Foundation \
 170         -framework Security -framework SystemConfiguration, \
 171     LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \
 172         -export:getLastErrorString \
 173         jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
 174         shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
 175         advapi32.lib, \


 230         jvm.lib $(WIN_JAVA_LIB), \
 231     LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \
 232     LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \
 233     LDFLAGS_SUFFIX_aix := -ljvm -ljava $(LIBZ),\
 234     LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \
 235     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 236     RC_FLAGS := $(RC_FLAGS) \
 237         -D "JDK_FNAME=zip.dll" \
 238         -D "JDK_INTERNAL_NAME=zip" \
 239         -D "JDK_FTYPE=0x2L", \
 240     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libzip, \
 241     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 242 
 243 
 244 $(BUILD_LIBZIP): $(BUILD_LIBJAVA)
 245 
 246 TARGETS += $(BUILD_LIBZIP)
 247 
 248 ##########################################################################################
 249 
 250 BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/java.base/share/native/libjli \
 251     $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli
 252 
 253 LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)
 254 
 255 BUILD_LIBJLI_FILES := \
 256     java.c \
 257     splashscreen_stubs.c \
 258     parse_manifest.c \
 259     version_comp.c \
 260     wildcard.c \
 261     jli_util.c
 262 
 263 ifeq ($(JVM_VARIANT_ZERO), true)
 264   ERGO_FAMILY := zero
 265 else
 266   ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
 267     ERGO_FAMILY := i586
 268   else
 269     ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
 270   endif
 271 endif







 272 
 273 ifeq ($(OPENJDK_TARGET_OS), macosx)
 274   BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/java.base/macosx/native/libjli
 275   BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c
 276 
 277   BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
 278   BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c


 279 endif
 280 
 281 ifeq ($(OPENJDK_TARGET_OS), windows)
 282   BUILD_LIBJLI_FILES += java_md.c \
 283       cmdtoargs.c
 284   # Staticically link with c runtime on windows.
 285   LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
 286 else ifneq ($(OPENJDK_TARGET_OS), macosx)
 287 
 288   BUILD_LIBJLI_FILES += java_md_common.c
 289   BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c
 290 
 291   ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
 292 
 293   # if the architecture specific ergo file exists then
 294   # use it, else use the generic definitions from ergo.c
 295   ifneq ($(wildcard $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli/$(ERGO_ARCH_FILE)), )
 296     BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
 297   else # !ERGO_ARCH_FILE
 298     LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
 299   endif # ERGO_ARCH_FILE
 300 endif #WINDOWS
 301 
 302 LIBJLI_CFLAGS += $(foreach dir, $(BUILD_LIBJLI_SRC_DIRS), -I$(dir))
 303 
 304 # Append defines depending on target platform
 305 LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
 306 
 307 ifeq ($(OPENJDK_TARGET_OS), macosx)
 308   LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
 309 endif
 310 
 311 ifneq ($(USE_EXTERNAL_LIBZ), true)
 312   BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
 313   LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
 314   BUILD_LIBJLI_FILES += \

 315       inflate.c \
 316       inftrees.c \
 317       inffast.c \
 318       zadler32.c \
 319       zcrc32.c \
 320       zutil.c
 321 endif
 322 
 323 ifeq ($(OPENJDK_TARGET_OS), windows)
 324   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
 325 else
 326   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
 327 endif
 328 
 329 $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
 330     LIBRARY := jli, \
 331     OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
 332     SRC := $(BUILD_LIBJLI_SRC_DIRS), \
 333     INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \

 334     LANG := C, \
 335     OPTIMIZATION := HIGH, \
 336     CFLAGS := $(LIBJLI_CFLAGS), \
 337     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \
 338     LDFLAGS := $(LDFLAGS_JDKLIB) \
 339         $(call SET_SHARED_LIBRARY_ORIGIN), \
 340     LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 341     LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 342     LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
 343     LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \
 344     LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \
 345     LDFLAGS_SUFFIX_aix := $(LIBZ) $(LIBDL),\
 346     LDFLAGS_SUFFIX_macosx := $(LIBZ), \
 347     LDFLAGS_SUFFIX_windows := \
 348         -export:JLI_Launch \
 349         -export:JLI_ManifestIterate \
 350         -export:JLI_SetTraceLauncher \
 351         -export:JLI_ReportErrorMessage \
 352         -export:JLI_ReportErrorMessageSys \
 353         -export:JLI_ReportMessage \


 359         advapi32.lib \
 360         comctl32.lib \
 361         user32.lib, \
 362     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 363     RC_FLAGS := $(RC_FLAGS) \
 364         -D "JDK_FNAME=jli.dll" \
 365         -D "JDK_INTERNAL_NAME=jli" \
 366         -D "JDK_FTYPE=0x2L", \
 367     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli, \
 368     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 369 
 370 TARGETS += $(BUILD_LIBJLI)
 371 
 372 # On windows, the static library has the same suffix as the import library created by
 373 # with the shared library, so the static library is given a different name. No harm
 374 # in doing it for all platform to reduce complexity.
 375 ifeq ($(OPENJDK_TARGET_OS), windows)
 376   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 377       STATIC_LIBRARY := jli_static, \
 378       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
 379       SRC := $(BUILD_LIBJLI_SRC_DIRS), \
 380       INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \

 381       LANG := C, \
 382       OPTIMIZATION := HIGH, \
 383       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
 384       ARFLAGS := $(ARFLAGS), \
 385       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
 386       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 387 
 388   TARGETS += $(BUILD_LIBJLI_STATIC)
 389 
 390 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 391   #
 392   # On macosx they do partial (incremental) linking of libjli_static.a
 393   # code it here...rather than add support to NativeCompilation
 394   # as this is first time I see it
 395   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 396       LIBRARY := jli_static, \
 397       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
 398       SRC := $(BUILD_LIBJLI_SRC_DIRS), \
 399       INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \

 400       LANG := C, \
 401       OPTIMIZATION := HIGH, \
 402       CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
 403       LDFLAGS := -nostdlib -r, \
 404       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
 405       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 406 
 407   $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a: $(BUILD_LIBJLI_STATIC)
 408         $(call install-file)
 409 
 410   TARGETS += $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a
 411 
 412 else ifeq ($(OPENJDK_TARGET_OS), aix)
 413   # AIX also requires a static libjli because the compiler doesn't support '-rpath'
 414   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
 415       STATIC_LIBRARY:=jli_static,\
 416       OUTPUT_DIR:=$(SUPPORT_OUTPUTDIR)/native/$(MODULE),\
 417       SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
 418       INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
 419       LANG:=C,\
 420       OPTIMIZATION:=HIGH, \
 421       CFLAGS:=$(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS),\
 422       ARFLAGS:=$(ARFLAGS),\
 423       OBJECT_DIR:=$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))

 424 
 425   TARGETS += $(BUILD_LIBJLI_STATIC)
 426 
 427 endif
 428 


  57   # On macosx the old build does partial (incremental) linking of fdlibm instead of
  58   # a plain static library.
  59   $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \
  60       LIBRARY := fdlibm, \
  61       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
  62       SRC := $(LIBFDLIBM_SRC), \
  63       LANG := C, \
  64       CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
  65       LDFLAGS := -nostdlib -r -arch x86_64, \
  66       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
  67       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  68 
  69   BUILD_LIBFDLIBM := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
  70   $(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC)
  71         $(call install-file)
  72 
  73 endif
  74 
  75 ##########################################################################################
  76 


  77 ifeq ($(OPENJDK_TARGET_OS), solaris)
  78   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
  79     BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/make/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU)
  80   endif
  81 endif
  82 
  83 LIBVERIFY_OPTIMIZATION := HIGH
  84 ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
  85   ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
  86     LIBVERIFY_OPTIMIZATION := LOW
  87   endif
  88 endif
  89 
  90 $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
  91     LIBRARY := verify, \
  92     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  93     SRC := $(JDK_TOPDIR)/src/java.base/share/native/libverify, \
  94     LANG := C, \
  95     OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
  96     CFLAGS := $(CFLAGS_JDKLIB), \
  97     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \
  98     LDFLAGS := $(LDFLAGS_JDKLIB) \
  99         $(call SET_SHARED_LIBRARY_ORIGIN), \
 100     LDFLAGS_SUFFIX_unix := -ljvm -lc, \
 101     LDFLAGS_SUFFIX_windows := jvm.lib, \
 102     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 103     RC_FLAGS := $(RC_FLAGS) \
 104         -D "JDK_FNAME=verify.dll" \
 105         -D "JDK_INTERNAL_NAME=verify" \
 106         -D "JDK_FTYPE=0x2L", \
 107     REORDER := $(BUILD_LIBVERIFY_REORDER), \
 108     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify, \
 109     DEBUG_SYMBOLS := true))
 110 
 111 TARGETS += $(BUILD_LIBVERIFY)
 112 
 113 ##########################################################################################
 114 
 115 LIBJAVA_SRC_DIRS := $(call FindSrcDirsForLib, java.base, java)
 116 




 117 LIBJAVA_CFLAGS := $(addprefix -I, $(LIBJAVA_SRC_DIRS)) \
 118     -I$(JDK_TOPDIR)/src/java.base/share/native/libfdlibm \
 119     -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
 120     -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
 121 
 122 LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
 123     -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
 124     -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \
 125      -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"'
 126 
 127 ifneq (, $(JDK_UPDATE_VERSION))
 128   LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
 129 endif
 130 
 131 ifeq ($(OPENJDK_TARGET_OS), macosx)


 132   BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
 133   BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
 134 endif
 135 
 136 ifeq ($(OPENJDK_TARGET_OS), solaris)
 137   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 138     LIBJAVA_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU)
 139   endif
 140 endif
 141 
 142 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
 143     LIBRARY := java, \
 144     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 145     SRC := $(LIBJAVA_SRC_DIRS), \


 146     LANG := C, \
 147     OPTIMIZATION := HIGH, \
 148     CFLAGS := $(CFLAGS_JDKLIB) \
 149         $(LIBJAVA_CFLAGS), \
 150     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
 151     LDFLAGS := $(LDFLAGS_JDKLIB) \
 152         $(call SET_SHARED_LIBRARY_ORIGIN), \
 153     LDFLAGS_SUFFIX_unix := -ljvm -lverify, \
 154     LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \
 155     LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
 156     LDFLAGS_SUFFIX_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\
 157     LDFLAGS_SUFFIX_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/ -lfdlibm \
 158         -framework CoreFoundation \
 159         -framework Foundation \
 160         -framework Security -framework SystemConfiguration, \
 161     LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \
 162         -export:getLastErrorString \
 163         jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
 164         shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
 165         advapi32.lib, \


 220         jvm.lib $(WIN_JAVA_LIB), \
 221     LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \
 222     LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \
 223     LDFLAGS_SUFFIX_aix := -ljvm -ljava $(LIBZ),\
 224     LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \
 225     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 226     RC_FLAGS := $(RC_FLAGS) \
 227         -D "JDK_FNAME=zip.dll" \
 228         -D "JDK_INTERNAL_NAME=zip" \
 229         -D "JDK_FTYPE=0x2L", \
 230     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libzip, \
 231     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 232 
 233 
 234 $(BUILD_LIBZIP): $(BUILD_LIBJAVA)
 235 
 236 TARGETS += $(BUILD_LIBZIP)
 237 
 238 ##########################################################################################
 239 
 240 LIBJLI_SRC_DIRS := $(call FindSrcDirsForLib, java.base, jli)

 241 
 242 LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)
 243 








 244 ifeq ($(JVM_VARIANT_ZERO), true)
 245   ERGO_FAMILY := zero
 246 else
 247   ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
 248     ERGO_FAMILY := i586
 249   else
 250     ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
 251   endif
 252 endif
 253 LIBJLI_ALL_ERGO := $(wildcard $(addsuffix /ergo_*.c, $(LIBJLI_SRC_DIRS)))
 254 LIBJLI_EXCLUDE_ERGO := $(filter-out %/ergo_$(ERGO_FAMILY).c, $(LIBJLI_ALL_ERGO))
 255 # If all specialized ergo files are excluded, use generic ergo
 256 ifeq ($(LIBJLI_ALL_ERGO), $(LIBJLI_EXCLUDE_ERGO))
 257   LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
 258 endif
 259 LIBJLI_EXCLUDE_FILES += $(LIBJLI_EXCLUDE_ERGO)
 260 
 261 ifeq ($(OPENJDK_TARGET_OS), macosx)
 262   LIBJLI_EXCLUDE_FILES += java_md_solinux.c ergo.c

 263 
 264   BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
 265   BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
 266 
 267   LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
 268 endif
 269 
 270 ifeq ($(OPENJDK_TARGET_OS), windows)


 271   # Staticically link with c runtime on windows.
 272   LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
 273   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
 274 else
 275   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
 276 endif











 277 
 278 LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS))
 279 
 280 # Append defines depending on target platform
 281 LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
 282 




 283 ifneq ($(USE_EXTERNAL_LIBZ), true)

 284   LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
 285   LIBJLI_EXTRA_FILES += \
 286       $(addprefix $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8/, \
 287           inflate.c \
 288           inftrees.c \
 289           inffast.c \
 290           zadler32.c \
 291           zcrc32.c \
 292           zutil.c \
 293       )





 294 endif
 295 
 296 $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
 297     LIBRARY := jli, \
 298     OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
 299     SRC := $(LIBJLI_SRC_DIRS), \
 300     EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 301     EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 302     LANG := C, \
 303     OPTIMIZATION := HIGH, \
 304     CFLAGS := $(LIBJLI_CFLAGS), \
 305     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \
 306     LDFLAGS := $(LDFLAGS_JDKLIB) \
 307         $(call SET_SHARED_LIBRARY_ORIGIN), \
 308     LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 309     LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 310     LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
 311     LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \
 312     LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \
 313     LDFLAGS_SUFFIX_aix := $(LIBZ) $(LIBDL),\
 314     LDFLAGS_SUFFIX_macosx := $(LIBZ), \
 315     LDFLAGS_SUFFIX_windows := \
 316         -export:JLI_Launch \
 317         -export:JLI_ManifestIterate \
 318         -export:JLI_SetTraceLauncher \
 319         -export:JLI_ReportErrorMessage \
 320         -export:JLI_ReportErrorMessageSys \
 321         -export:JLI_ReportMessage \


 327         advapi32.lib \
 328         comctl32.lib \
 329         user32.lib, \
 330     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 331     RC_FLAGS := $(RC_FLAGS) \
 332         -D "JDK_FNAME=jli.dll" \
 333         -D "JDK_INTERNAL_NAME=jli" \
 334         -D "JDK_FTYPE=0x2L", \
 335     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli, \
 336     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 337 
 338 TARGETS += $(BUILD_LIBJLI)
 339 
 340 # On windows, the static library has the same suffix as the import library created by
 341 # with the shared library, so the static library is given a different name. No harm
 342 # in doing it for all platform to reduce complexity.
 343 ifeq ($(OPENJDK_TARGET_OS), windows)
 344   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 345       STATIC_LIBRARY := jli_static, \
 346       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
 347       SRC := $(LIBJLI_SRC_DIRS), \
 348       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 349       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 350       LANG := C, \
 351       OPTIMIZATION := HIGH, \
 352       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
 353       ARFLAGS := $(ARFLAGS), \
 354       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
 355       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 356 
 357   TARGETS += $(BUILD_LIBJLI_STATIC)
 358 
 359 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 360   #
 361   # On macosx they do partial (incremental) linking of libjli_static.a
 362   # code it here...rather than add support to NativeCompilation
 363   # as this is first time I see it
 364   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 365       LIBRARY := jli_static, \
 366       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
 367       SRC := $(LIBJLI_SRC_DIRS), \
 368       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 369       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 370       LANG := C, \
 371       OPTIMIZATION := HIGH, \
 372       CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
 373       LDFLAGS := -nostdlib -r, \
 374       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
 375       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 376 
 377   $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a: $(BUILD_LIBJLI_STATIC)
 378         $(call install-file)
 379 
 380   TARGETS += $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a
 381 
 382 else ifeq ($(OPENJDK_TARGET_OS), aix)
 383   # AIX also requires a static libjli because the compiler doesn't support '-rpath'
 384   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
 385       STATIC_LIBRARY := jli_static,\
 386       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE),\
 387       SRC := $(LIBJLI_SRC_DIRS), \
 388       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 389       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 390       LANG := C,\
 391       OPTIMIZATION := HIGH, \
 392       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS),\
 393       ARFLAGS := $(ARFLAGS),\
 394       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
 395 
 396   TARGETS += $(BUILD_LIBJLI_STATIC)
 397 
 398 endif
 399 
< prev index next >