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         jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
 209         shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
 210         advapi32.lib version.lib, \
 211     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 212     RC_FLAGS := $(RC_FLAGS) \
 213         -D "JDK_FNAME=java.dll" \
 214         -D "JDK_INTERNAL_NAME=java" \
 215         -D "JDK_FTYPE=0x2L", \
 216     REORDER := $(LIBJAVA_REORDER), \
 217     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjava, \
 218     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 219 
 220 BUILD_LIBRARIES += $(BUILD_LIBJAVA)
 221 
 222 $(BUILD_LIBJAVA): $(LIBJLI_BINARY)
 223 
 224 $(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
 225 
 226 $(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
 227 
 228 ##########################################################################################
 229 
 230 BUILD_LIBZIP_EXCLUDES :=
 231 ifeq ($(USE_EXTERNAL_LIBZ), true)
 232   LIBZ := -lz
 233   LIBZIP_EXCLUDES += zlib-1.2.8
 234 else
 235   ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
 236 endif
 237 
 238 BUILD_LIBZIP_REORDER :=
 239 ifeq ($(OPENJDK_TARGET_OS), solaris)
 240   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 241     BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/make/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU)
 242   endif
 243 endif
 244 
 245 ifeq ($(LIBZIP_CAN_USE_MMAP), true)
 246   BUILD_LIBZIP_MMAP := -DUSE_MMAP
 247 endif
 248 
 249 $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
 250     LIBRARY := zip, \
 251     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 252     LANG := C, \
 253     OPTIMIZATION := LOW, \
 254     SRC := $(JDK_TOPDIR)/src/share/native/java/util/zip, \
 255     EXCLUDES := $(LIBZIP_EXCLUDES), \
 256     CFLAGS := $(CFLAGS_JDKLIB) \
 257         $(ZLIB_CPPFLAGS) \
 258         -I$(JDK_TOPDIR)/src/share/native/java/io \
 259         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io, \
 260     CFLAGS_posix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
 261     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libzip/mapfile-vers, \
 262     REORDER := $(BUILD_LIBZIP_REORDER), \
 263     LDFLAGS := $(LDFLAGS_JDKLIB) \
 264         $(call SET_SHARED_LIBRARY_ORIGIN) \
 265         $(EXPORT_ZIP_FUNCS), \
 266     LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
 267         -export:ZIP_ReadEntry -export:ZIP_GetNextEntry -export:ZIP_CRC32 jvm.lib \
 268         $(WIN_JAVA_LIB), \
 269     LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \
 270     LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \
 271     LDFLAGS_SUFFIX_aix := -ljvm -ljava $(LIBZ),\
 272     LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \
 273     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 274     RC_FLAGS := $(RC_FLAGS) \
 275         -D "JDK_FNAME=zip.dll" \
 276         -D "JDK_INTERNAL_NAME=zip" \
 277         -D "JDK_FTYPE=0x2L", \
 278     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libzip, \
 279     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 280 
 281 
 282 $(BUILD_LIBZIP): $(BUILD_LIBJAVA)
 283 
 284 BUILD_LIBRARIES += $(BUILD_LIBZIP)
 285 
 286 ##########################################################################################
 287 
 288 $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \
 289     LIBRARY := unpack, \
 290     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 291     SRC := $(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack, \
 292     EXCLUDE_FILES := main.cpp, \
 293     LANG := C++, \
 294     OPTIMIZATION := LOW, \
 295     CFLAGS := $(CXXFLAGS_JDKLIB) \
 296         -DNO_ZLIB -DUNPACK_JNI -DFULL, \
 297     CFLAGS_release := -DPRODUCT, \
 298     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \
 299     LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
 300         $(call SET_SHARED_LIBRARY_ORIGIN), \
 301     LDFLAGS_windows := -map:$(JDK_OUTPUTDIR)/objs/unpack.map -debug \
 302         jvm.lib $(WIN_JAVA_LIB), \
 303     LDFLAGS_SUFFIX_posix := -ljvm $(LIBCXX) -ljava -lc, \
 304     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libunpack, \
 305     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 306     RC_FLAGS := $(RC_FLAGS) \
 307         -D "JDK_FNAME=unpack.dll" \
 308         -D "JDK_INTERNAL_NAME=unpack" \
 309         -D "JDK_FTYPE=0x2L", \
 310     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 311 
 312 $(BUILD_LIBUNPACK): $(BUILD_LIBJAVA)
 313 
 314 BUILD_LIBRARIES += $(BUILD_LIBUNPACK)
 315 
 316 ifeq ($(OPENJDK_TARGET_OS), windows)
 317   $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(BUILD_LIBUNPACK)
 318         $(ECHO) Copying $(@F)
 319         $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.map, $<) $@
 320 
 321   $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(BUILD_LIBUNPACK)
 322         $(ECHO) Copying $(@F)
 323         $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.pdb, $<) $@
 324 endif
 325 
 326 ##########################################################################################
 327 
 328 BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/share/bin $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin
 329 LIBJLI_CFLAGS := $(CFLAGS_JDKLIB) $(foreach dir, $(BUILD_LIBJLI_SRC_DIRS), -I$(dir))
 330 
 331 BUILD_LIBJLI_FILES := \
 332     java.c \
 333     splashscreen_stubs.c \
 334     parse_manifest.c \
 335     version_comp.c \
 336     wildcard.c \
 337     jli_util.c
 338 
 339 ifeq ($(JVM_VARIANT_ZERO), true)
 340   ERGO_FAMILY := zero
 341 else
 342   ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
 343     ERGO_FAMILY := i586
 344   else
 345     ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
 346   endif
 347 endif
 348 
 349 ifeq ($(OPENJDK_TARGET_OS), macosx)
 350   LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin
 351   BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/bin
 352   BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c
 353 
 354   BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
 355   BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
 356 endif
 357 
 358 ifeq ($(OPENJDK_TARGET_OS), windows)
 359   BUILD_LIBJLI_FILES += java_md.c \
 360       cmdtoargs.c
 361   # Staticically link with c runtime on windows.
 362   LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
 363 else ifneq ($(OPENJDK_TARGET_OS), macosx)
 364 
 365   BUILD_LIBJLI_FILES += java_md_common.c
 366   BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c
 367 
 368   ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
 369 
 370   # if the architecture specific ergo file exists then
 371   # use it, else use the generic definitions from ergo.c
 372   ifneq ($(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(ERGO_ARCH_FILE)), )
 373     BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
 374   else # !ERGO_ARCH_FILE
 375     LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
 376   endif # ERGO_ARCH_FILE
 377 endif #WINDOWS
 378 
 379 # Append defines depending on target platform
 380 LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
 381 
 382 ifeq ($(OPENJDK_TARGET_OS), macosx)
 383   LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
 384 endif
 385 
 386 ifneq ($(USE_EXTERNAL_LIBZ), true)
 387   BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
 388   LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
 389   BUILD_LIBJLI_FILES += \
 390       inflate.c \
 391       inftrees.c \
 392       inffast.c \
 393       zadler32.c \
 394       zcrc32.c \
 395       zutil.c
 396 endif
 397 
 398 ifeq ($(OPENJDK_TARGET_OS), windows)
 399   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
 400 else
 401   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
 402 endif
 403 
 404 $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
 405     LIBRARY := jli, \
 406     OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
 407     SRC := $(BUILD_LIBJLI_SRC_DIRS), \
 408     INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
 409     LANG := C, \
 410     OPTIMIZATION := HIGH, \
 411     CFLAGS := $(LIBJLI_CFLAGS), \
 412     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \
 413     LDFLAGS := $(LDFLAGS_JDKLIB) \
 414         $(call SET_SHARED_LIBRARY_ORIGIN), \
 415     LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 416     LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 417     LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
 418     LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \
 419     LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \
 420     LDFLAGS_SUFFIX_aix := $(LIBZ) $(LIBDL),\
 421     LDFLAGS_SUFFIX_macosx := $(LIBZ), \
 422     LDFLAGS_SUFFIX_windows := \
 423         -export:JLI_Launch \
 424         -export:JLI_ManifestIterate \
 425         -export:JLI_SetTraceLauncher \
 426         -export:JLI_ReportErrorMessage \
 427         -export:JLI_ReportErrorMessageSys \
 428         -export:JLI_ReportMessage \
 429         -export:JLI_ReportExceptionDescription \
 430         -export:JLI_MemAlloc \
 431         -export:JLI_CmdToArgs \
 432         -export:JLI_GetStdArgc \
 433         -export:JLI_GetStdArgs \
 434         advapi32.lib \
 435         comctl32.lib \
 436         user32.lib, \
 437     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 438     RC_FLAGS := $(RC_FLAGS) \
 439         -D "JDK_FNAME=jli.dll" \
 440         -D "JDK_INTERNAL_NAME=jli" \
 441         -D "JDK_FTYPE=0x2L", \
 442     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli, \
 443     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 444 
 445 BUILD_LIBRARIES += $(BUILD_LIBJLI)
 446 
 447 # On windows, the static library has the same suffix as the import library created by
 448 # with the shared library, so the static library is given a different name. No harm
 449 # in doing it for all platform to reduce complexity.
 450 ifeq ($(OPENJDK_TARGET_OS), windows)
 451   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 452       STATIC_LIBRARY := jli_static, \
 453       OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
 454       SRC := $(BUILD_LIBJLI_SRC_DIRS), \
 455       INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
 456       LANG := C, \
 457       OPTIMIZATION := HIGH, \
 458       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
 459       ARFLAGS := $(ARFLAGS), \
 460       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \
 461       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 462 
 463   BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC)
 464 
 465 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 466   #
 467   # On macosx they do partial (incremental) linking of libjli_static.a
 468   # code it here...rather than add support to NativeCompilation
 469   # as this is first time I see it
 470   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 471       LIBRARY := jli_static, \
 472       OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
 473       SRC := $(BUILD_LIBJLI_SRC_DIRS), \
 474       INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
 475       LANG := C, \
 476       OPTIMIZATION := HIGH, \
 477       CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
 478       LDFLAGS := -nostdlib -r, \
 479       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \
 480       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 481 
 482   $(JDK_OUTPUTDIR)/objs/libjli_static.a: $(BUILD_LIBJLI_STATIC)
 483         $(call install-file)
 484 
 485   BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
 486 
 487 else ifeq ($(OPENJDK_TARGET_OS), aix)
 488   # AIX also requires a static libjli because the compiler doesn't support '-rpath'
 489   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
 490       STATIC_LIBRARY:=jli_static,\
 491       OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
 492       SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
 493       INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
 494       LANG:=C,\
 495       OPTIMIZATION:=HIGH, \
 496       CFLAGS:=$(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS),\
 497       ARFLAGS:=$(ARFLAGS),\
 498       OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static))
 499 
 500   BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
 501 
 502 endif
 503 
 504 ##########################################################################################
 505 
 506 $(eval $(call SetupNativeCompilation,BUILD_LIBNPT, \
 507     LIBRARY := npt, \
 508     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 509     SRC := $(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
 510     LANG := C, \
 511     OPTIMIZATION := LOW, \
 512     CFLAGS := $(CFLAGS_JDKLIB) \
 513         -I$(JDK_TOPDIR)/src/share/npt \
 514         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
 515     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnpt/mapfile-vers, \
 516     LDFLAGS := $(LDFLAGS_JDKLIB) \
 517         $(call SET_SHARED_LIBRARY_ORIGIN), \
 518     LDFLAGS_macosx := -liconv, \
 519     LDFLAGS_SUFFIX_windows := -export:nptInitialize -export:nptTerminate, \
 520     LDFLAGS_SUFFIX_solaris := -lc, \
 521     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
 522     RC_FLAGS := $(RC_FLAGS) \
 523         -D "JDK_FNAME=npt.dll" \
 524         -D "JDK_INTERNAL_NAME=npt" \
 525         -D "JDK_FTYPE=0x2L", \
 526     OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnpt, \
 527     DEBUG_SYMBOLS := true))
 528 
 529 BUILD_LIBRARIES += $(BUILD_LIBNPT)