1 #
   2 # Copyright (c) 2011, 2013, 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
  23 # questions.
  24 #
  25 
  26 WIN_VERIFY_LIB := $(JDK_OUTPUTDIR)/objs/libverify/verify.lib
  27 
  28 ##########################################################################################
  29 
  30 BUILD_LIBFDLIBM_OPTIMIZATION := NONE
  31 
  32 ifeq ($(OPENJDK_TARGET_OS), solaris)
  33   BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
  34 endif
  35 
  36 ifeq ($(OPENJDK_TARGET_OS), linux)
  37   ifeq ($(OPENJDK_TARGET_CPU), ppc64)
  38     BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
  39   else ifeq ($(OPENJDK_TARGET_CPU), ppc64le)
  40     BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
  41   endif
  42 endif
  43 
  44 ifneq ($(OPENJDK_TARGET_OS), macosx)
  45   # Unfortunately, '-ffp-contract' is only available since gcc 4.6. For ppc64le
  46   # that's no problem since ppc64le support only appeared in gcc 4.8.3. But on
  47   # ppc64 (big endian) we traditionally compiled with gcc 4.3 which only knows
  48   # '-mno-fused-madd'. However, that's still not enough to get the float
  49   # computations right - we additionally have to supply '-fno-strict-aliasing'.
  50   $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \
  51       STATIC_LIBRARY := fdlibm, \
  52       OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
  53       SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \
  54       LANG := C, \
  55       OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
  56       CFLAGS := $(CFLAGS_JDKLIB) \
  57           -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \
  58       CFLAGS_windows_debug := -DLOGGING, \
  59       CFLAGS_aix := -qfloat=nomaf, \
  60       CFLAGS_linux_ppc64 := -mno-fused-madd -fno-strict-aliasing, \
  61       CFLAGS_linux_ppc64le := -ffp-contract=off, \
  62       ARFLAGS := $(ARFLAGS), \
  63       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \
  64       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  65 
  66 else
  67 
  68   # On macosx the old build does partial (incremental) linking of fdlibm instead of
  69   # a plain static library.
  70   $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \
  71       LIBRARY := fdlibm, \
  72       OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \
  73       SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \
  74       LANG := C, \
  75       CFLAGS := $(CFLAGS_JDKLIB) \
  76           -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \
  77       LDFLAGS := -nostdlib -r -arch x86_64, \
  78       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \
  79       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  80 
  81   BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
  82   $(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC)
  83         $(call install-file)
  84 
  85 endif
  86 
  87 BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
  88 
  89 ##########################################################################################
  90 
  91 BUILD_LIBVERIFY_SRC := check_code.c check_format.c
  92 
  93 ifeq ($(OPENJDK_TARGET_OS), solaris)
  94   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
  95     BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/make/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU)
  96   endif
  97 endif
  98 
  99 LIBVERIFY_OPTIMIZATION := HIGH
 100 ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
 101   ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
 102     LIBVERIFY_OPTIMIZATION := LOW
 103   endif
 104 endif
 105 
 106 $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
 107     LIBRARY := verify, \
 108     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 109     SRC := $(JDK_TOPDIR)/src/share/native/common, \
 110     INCLUDE_FILES := $(BUILD_LIBVERIFY_SRC), \
 111     LANG := C, \
 112     OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
 113     CFLAGS := $(CFLAGS_JDKLIB), \
 114     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \
 115     LDFLAGS := $(LDFLAGS_JDKLIB) \
 116         $(call SET_SHARED_LIBRARY_ORIGIN), \
 117     LDFLAGS_SUFFIX_posix := -ljvm -lc, \
 118     LDFLAGS_SUFFIX_windows := jvm.lib, \
 119     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 120     RC_FLAGS := $(RC_FLAGS) \
 121         -D "JDK_FNAME=verify.dll" \
 122         -D "JDK_INTERNAL_NAME=verify" \
 123         -D "JDK_FTYPE=0x2L", \
 124     REORDER := $(BUILD_LIBVERIFY_REORDER), \
 125     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libverify, \
 126     DEBUG_SYMBOLS := true))
 127 
 128 BUILD_LIBRARIES += $(BUILD_LIBVERIFY)
 129 
 130 ##########################################################################################
 131 
 132 LIBJAVA_SRC_DIRS := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/lang \
 133     $(JDK_TOPDIR)/src/share/native/java/lang \
 134     $(JDK_TOPDIR)/src/share/native/java/lang/reflect \
 135     $(JDK_TOPDIR)/src/share/native/java/io \
 136     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \
 137     $(JDK_TOPDIR)/src/share/native/java/nio \
 138     $(JDK_TOPDIR)/src/share/native/java/security \
 139     $(JDK_TOPDIR)/src/share/native/common \
 140     $(JDK_TOPDIR)/src/share/native/sun/misc \
 141     $(JDK_TOPDIR)/src/share/native/sun/reflect \
 142     $(JDK_TOPDIR)/src/share/native/java/util \
 143     $(JDK_TOPDIR)/src/share/native/java/util/concurrent/atomic \
 144     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \
 145     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/util
 146 
 147 ifeq ($(OPENJDK_TARGET_OS), windows)
 148   LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/util/locale/provider
 149 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 150   LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/util/locale/provider
 151 endif
 152 
 153 ifeq ($(OPENJDK_TARGET_OS), windows)
 154   LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/provider \
 155       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/io
 156 endif
 157 
 158 LIBJAVA_CFLAGS := $(foreach dir, $(LIBJAVA_SRC_DIRS), -I$(dir)) \
 159     -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include \
 160     -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
 161 
 162 LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
 163     -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
 164     -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \
 165      -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"'
 166 
 167 ifneq (, $(JDK_UPDATE_VERSION))
 168   LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
 169 endif
 170 
 171 LIBJAVA_EXCLUDE_FILES := check_code.c check_format.c jspawnhelper.c
 172 
 173 ifneq ($(OPENJDK_TARGET_OS), macosx)
 174   LIBJAVA_EXCLUDE_FILES += java_props_macosx.c
 175 else
 176   BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
 177   BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
 178 endif
 179 
 180 ifeq ($(OPENJDK_TARGET_OS), windows)
 181   LIBJAVA_EXCLUDE_FILES += \
 182       UNIXProcess_md.c \
 183       UnixFileSystem_md.c \
 184       FileSystemPreferences.c
 185 else
 186   LIBJAVA_EXCLUDE_FILES += \
 187       ProcessImpl_md.c \
 188       WinNTFileSystem_md.c \
 189       dirent_md.c \
 190       WindowsPreferences.c \
 191       sun/security/provider/WinCAPISeedGenerator.c \
 192       sun/io/Win32ErrorMode.c
 193 endif
 194 
 195 ifeq ($(OPENJDK_TARGET_OS), solaris)
 196   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 197     LIBJAVA_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU)
 198   endif
 199 endif
 200 
 201 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
 202     LIBRARY := java, \
 203     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 204     SRC := $(LIBJAVA_SRC_DIRS), \
 205     EXCLUDES := fdlibm/src zip, \
 206     EXCLUDE_FILES := $(LIBJAVA_EXCLUDE_FILES), \
 207     LANG := C, \
 208     OPTIMIZATION := HIGH, \
 209     CFLAGS := $(CFLAGS_JDKLIB) \
 210         $(LIBJAVA_CFLAGS), \
 211     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
 212     LDFLAGS := $(LDFLAGS_JDKLIB) \
 213         $(call SET_SHARED_LIBRARY_ORIGIN), \
 214     LDFLAGS_SUFFIX_posix := -ljvm -lverify, \
 215     LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \
 216     LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
 217     LDFLAGS_SUFFIX_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\
 218     LDFLAGS_SUFFIX_macosx := -L$(JDK_OUTPUTDIR)/objs/ -lfdlibm \
 219         -framework CoreFoundation \
 220         -framework Foundation \
 221         -framework Security -framework SystemConfiguration, \
 222     LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \
 223         -export:getErrorString \
 224         jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
 225         shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
 226         advapi32.lib version.lib, \
 227     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 228     RC_FLAGS := $(RC_FLAGS) \
 229         -D "JDK_FNAME=java.dll" \
 230         -D "JDK_INTERNAL_NAME=java" \
 231         -D "JDK_FTYPE=0x2L", \
 232     REORDER := $(LIBJAVA_REORDER), \
 233     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjava, \
 234     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 235 
 236 BUILD_LIBRARIES += $(BUILD_LIBJAVA)
 237 
 238 $(BUILD_LIBJAVA): $(LIBJLI_BINARY)
 239 
 240 $(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
 241 
 242 $(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
 243 
 244 ##########################################################################################
 245 
 246 BUILD_LIBZIP_EXCLUDES :=
 247 ifeq ($(USE_EXTERNAL_LIBZ), true)
 248   LIBZ := -lz
 249   LIBZIP_EXCLUDES += zlib-1.2.8
 250 else
 251   ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
 252 endif
 253 
 254 BUILD_LIBZIP_REORDER :=
 255 ifeq ($(OPENJDK_TARGET_OS), solaris)
 256   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 257     BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/make/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU)
 258   endif
 259 endif
 260 
 261 ifeq ($(LIBZIP_CAN_USE_MMAP), true)
 262   BUILD_LIBZIP_MMAP := -DUSE_MMAP
 263 endif
 264 
 265 $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
 266     LIBRARY := zip, \
 267     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 268     LANG := C, \
 269     OPTIMIZATION := LOW, \
 270     SRC := $(JDK_TOPDIR)/src/share/native/java/util/zip, \
 271     EXCLUDES := $(LIBZIP_EXCLUDES), \
 272     CFLAGS := $(CFLAGS_JDKLIB) \
 273         $(ZLIB_CPPFLAGS) \
 274         -I$(JDK_TOPDIR)/src/share/native/java/io \
 275         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io, \
 276     CFLAGS_posix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
 277     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libzip/mapfile-vers, \
 278     REORDER := $(BUILD_LIBZIP_REORDER), \
 279     LDFLAGS := $(LDFLAGS_JDKLIB) \
 280         $(call SET_SHARED_LIBRARY_ORIGIN) \
 281         $(EXPORT_ZIP_FUNCS), \
 282     LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
 283         -export:ZIP_ReadEntry -export:ZIP_GetNextEntry -export:ZIP_CRC32 jvm.lib \
 284         $(WIN_JAVA_LIB), \
 285     LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \
 286     LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \
 287     LDFLAGS_SUFFIX_aix := -ljvm -ljava $(LIBZ),\
 288     LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \
 289     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 290     RC_FLAGS := $(RC_FLAGS) \
 291         -D "JDK_FNAME=zip.dll" \
 292         -D "JDK_INTERNAL_NAME=zip" \
 293         -D "JDK_FTYPE=0x2L", \
 294     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libzip, \
 295     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 296 
 297 
 298 $(BUILD_LIBZIP): $(BUILD_LIBJAVA)
 299 
 300 BUILD_LIBRARIES += $(BUILD_LIBZIP)
 301 
 302 ##########################################################################################
 303 
 304 $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \
 305     LIBRARY := unpack, \
 306     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 307     SRC := $(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack, \
 308     EXCLUDE_FILES := main.cpp, \
 309     LANG := C++, \
 310     OPTIMIZATION := LOW, \
 311     CFLAGS := $(CXXFLAGS_JDKLIB) \
 312         -DNO_ZLIB -DUNPACK_JNI -DFULL, \
 313     CFLAGS_release := -DPRODUCT, \
 314     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \
 315     LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
 316         $(call SET_SHARED_LIBRARY_ORIGIN), \
 317     LDFLAGS_windows := -map:$(JDK_OUTPUTDIR)/objs/unpack.map -debug \
 318         jvm.lib $(WIN_JAVA_LIB), \
 319     LDFLAGS_SUFFIX_posix := -ljvm $(LIBCXX) -ljava -lc, \
 320     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libunpack, \
 321     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 322     RC_FLAGS := $(RC_FLAGS) \
 323         -D "JDK_FNAME=unpack.dll" \
 324         -D "JDK_INTERNAL_NAME=unpack" \
 325         -D "JDK_FTYPE=0x2L", \
 326     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 327 
 328 $(BUILD_LIBUNPACK): $(BUILD_LIBJAVA)
 329 
 330 BUILD_LIBRARIES += $(BUILD_LIBUNPACK)
 331 
 332 ifeq ($(OPENJDK_TARGET_OS), windows)
 333   $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(BUILD_LIBUNPACK)
 334         $(ECHO) Copying $(@F)
 335         $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.map, $<) $@
 336 
 337   $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(BUILD_LIBUNPACK)
 338         $(ECHO) Copying $(@F)
 339         $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.pdb, $<) $@
 340 endif
 341 
 342 ##########################################################################################
 343 
 344 BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/share/bin $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin
 345 LIBJLI_CFLAGS := $(CFLAGS_JDKLIB) $(foreach dir, $(BUILD_LIBJLI_SRC_DIRS), -I$(dir))
 346 
 347 BUILD_LIBJLI_FILES := \
 348     java.c \
 349     splashscreen_stubs.c \
 350     parse_manifest.c \
 351     version_comp.c \
 352     wildcard.c \
 353     jli_util.c
 354 
 355 ifeq ($(JVM_VARIANT_ZERO), true)
 356   ERGO_FAMILY := zero
 357 else
 358   ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
 359     ERGO_FAMILY := i586
 360   else
 361     ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
 362   endif
 363 endif
 364 
 365 ifeq ($(OPENJDK_TARGET_OS), macosx)
 366   LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin
 367   BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/bin
 368   BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c
 369 
 370   BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
 371   BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
 372 endif
 373 
 374 ifeq ($(OPENJDK_TARGET_OS), windows)
 375   BUILD_LIBJLI_FILES += java_md.c \
 376       cmdtoargs.c
 377   # Staticically link with c runtime on windows.
 378   LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
 379 else ifneq ($(OPENJDK_TARGET_OS), macosx)
 380 
 381   BUILD_LIBJLI_FILES += java_md_common.c
 382   BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c
 383 
 384   ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
 385 
 386   # if the architecture specific ergo file exists then
 387   # use it, else use the generic definitions from ergo.c
 388   ifneq ($(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(ERGO_ARCH_FILE)), )
 389     BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
 390   else # !ERGO_ARCH_FILE
 391     LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
 392   endif # ERGO_ARCH_FILE
 393 endif #WINDOWS
 394 
 395 # Append defines depending on target platform
 396 LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
 397 
 398 ifeq ($(OPENJDK_TARGET_OS), macosx)
 399   LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
 400 endif
 401 
 402 ifneq ($(USE_EXTERNAL_LIBZ), true)
 403   BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
 404   LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
 405   BUILD_LIBJLI_FILES += \
 406       inflate.c \
 407       inftrees.c \
 408       inffast.c \
 409       zadler32.c \
 410       zcrc32.c \
 411       zutil.c
 412 endif
 413 
 414 ifeq ($(OPENJDK_TARGET_OS), windows)
 415   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
 416 else
 417   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
 418 endif
 419 
 420 $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
 421     LIBRARY := jli, \
 422     OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
 423     SRC := $(BUILD_LIBJLI_SRC_DIRS), \
 424     INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
 425     LANG := C, \
 426     OPTIMIZATION := HIGH, \
 427     CFLAGS := $(LIBJLI_CFLAGS), \
 428     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \
 429     LDFLAGS := $(LDFLAGS_JDKLIB) \
 430         $(call SET_SHARED_LIBRARY_ORIGIN), \
 431     LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 432     LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 433     LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
 434     LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \
 435     LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \
 436     LDFLAGS_SUFFIX_aix := $(LIBZ) $(LIBDL),\
 437     LDFLAGS_SUFFIX_macosx := $(LIBZ), \
 438     LDFLAGS_SUFFIX_windows := \
 439         -export:JLI_Launch \
 440         -export:JLI_ManifestIterate \
 441         -export:JLI_SetTraceLauncher \
 442         -export:JLI_ReportErrorMessage \
 443         -export:JLI_ReportErrorMessageSys \
 444         -export:JLI_ReportMessage \
 445         -export:JLI_ReportExceptionDescription \
 446         -export:JLI_MemAlloc \
 447         -export:JLI_CmdToArgs \
 448         -export:JLI_GetStdArgc \
 449         -export:JLI_GetStdArgs \
 450         advapi32.lib \
 451         comctl32.lib \
 452         user32.lib, \
 453     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 454     RC_FLAGS := $(RC_FLAGS) \
 455         -D "JDK_FNAME=jli.dll" \
 456         -D "JDK_INTERNAL_NAME=jli" \
 457         -D "JDK_FTYPE=0x2L", \
 458     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli, \
 459     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 460 
 461 BUILD_LIBRARIES += $(BUILD_LIBJLI)
 462 
 463 # On windows, the static library has the same suffix as the import library created by
 464 # with the shared library, so the static library is given a different name. No harm
 465 # in doing it for all platform to reduce complexity.
 466 ifeq ($(OPENJDK_TARGET_OS), windows)
 467   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 468       STATIC_LIBRARY := jli_static, \
 469       OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
 470       SRC := $(BUILD_LIBJLI_SRC_DIRS), \
 471       INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
 472       LANG := C, \
 473       OPTIMIZATION := HIGH, \
 474       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
 475       ARFLAGS := $(ARFLAGS), \
 476       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \
 477       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 478 
 479   BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC)
 480 
 481 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 482   #
 483   # On macosx they do partial (incremental) linking of libjli_static.a
 484   # code it here...rather than add support to NativeCompilation
 485   # as this is first time I see it
 486   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 487       LIBRARY := jli_static, \
 488       OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
 489       SRC := $(BUILD_LIBJLI_SRC_DIRS), \
 490       INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
 491       LANG := C, \
 492       OPTIMIZATION := HIGH, \
 493       CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
 494       LDFLAGS := -nostdlib -r, \
 495       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \
 496       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 497 
 498   $(JDK_OUTPUTDIR)/objs/libjli_static.a: $(BUILD_LIBJLI_STATIC)
 499         $(call install-file)
 500 
 501   BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
 502 
 503 else ifeq ($(OPENJDK_TARGET_OS), aix)
 504   # AIX also requires a static libjli because the compiler doesn't support '-rpath'
 505   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
 506       STATIC_LIBRARY:=jli_static,\
 507       OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
 508       SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
 509       INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
 510       LANG:=C,\
 511       OPTIMIZATION:=HIGH, \
 512       CFLAGS:=$(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS),\
 513       ARFLAGS:=$(ARFLAGS),\
 514       OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static))
 515 
 516   BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
 517 
 518 endif
 519 
 520 ##########################################################################################
 521 
 522 $(eval $(call SetupNativeCompilation,BUILD_LIBNPT, \
 523     LIBRARY := npt, \
 524     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 525     SRC := $(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
 526     LANG := C, \
 527     OPTIMIZATION := LOW, \
 528     CFLAGS := $(CFLAGS_JDKLIB) \
 529         -I$(JDK_TOPDIR)/src/share/npt \
 530         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
 531     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnpt/mapfile-vers, \
 532     LDFLAGS := $(LDFLAGS_JDKLIB) \
 533         $(call SET_SHARED_LIBRARY_ORIGIN), \
 534     LDFLAGS_macosx := -liconv, \
 535     LDFLAGS_SUFFIX_windows := -export:nptInitialize -export:nptTerminate, \
 536     LDFLAGS_SUFFIX_solaris := -lc, \
 537     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 538     RC_FLAGS := $(RC_FLAGS) \
 539         -D "JDK_FNAME=npt.dll" \
 540         -D "JDK_INTERNAL_NAME=npt" \
 541         -D "JDK_FTYPE=0x2L", \
 542     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnpt, \
 543     DEBUG_SYMBOLS := true))
 544 
 545 BUILD_LIBRARIES += $(BUILD_LIBNPT)