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 := HIGH
  31 
  32 ifneq ($(OPENJDK_TARGET_OS), solaris)
  33   BUILD_LIBFDLIBM_OPTIMIZATION := NONE








  34 endif
  35 
  36 ifneq ($(OPENJDK_TARGET_OS), macosx)
  37   $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \
  38       STATIC_LIBRARY := fdlibm, \
  39       OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
  40       SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \
  41       LANG := C, \
  42       OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
  43       CFLAGS := $(CFLAGS_JDKLIB) \
  44           -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \
  45       CFLAGS_windows_debug := -DLOGGING, \
  46       CFLAGS_aix := -qfloat=nomaf, \


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