rev 12062 : 8170153: PPC64/s390x/aarch64: Poor StrictMath performance due to non-optimized compilation
Reviewed-by: simonis

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