1 #
   2 # Copyright (c) 2011, 2015, 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 := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify/verify.lib
  27 
  28 ##########################################################################################
  29 # libfdlibm is statically linked with libjava below and not delivered into the
  30 # product on its own.
  31 
  32 BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
  33 
  34 ifneq ($(OPENJDK_TARGET_OS), solaris)
  35   BUILD_LIBFDLIBM_OPTIMIZATION := NONE
  36 endif
  37 
  38 LIBFDLIBM_SRC := $(JDK_TOPDIR)/src/java.base/share/native/libfdlibm
  39 LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC)
  40 
  41 ifneq ($(OPENJDK_TARGET_OS), macosx)
  42   $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \
  43       STATIC_LIBRARY := fdlibm, \
  44       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
  45       SRC := $(LIBFDLIBM_SRC), \
  46       OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
  47       CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
  48       CFLAGS_windows_debug := -DLOGGING, \
  49       CFLAGS_aix := -qfloat=nomaf, \
  50       DISABLED_WARNINGS_gcc := sign-compare, \
  51       DISABLED_WARNINGS_microsoft := 4146 4244 4018, \
  52       ARFLAGS := $(ARFLAGS), \
  53       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
  54       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  55 
  56 else
  57 
  58   # On macosx the old build does partial (incremental) linking of fdlibm instead of
  59   # a plain static library.
  60   $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \
  61       LIBRARY := fdlibm, \
  62       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
  63       SRC := $(LIBFDLIBM_SRC), \
  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     OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
  95     CFLAGS := $(CFLAGS_JDKLIB), \
  96     DISABLED_WARNINGS_microsoft := 4244 4267, \
  97     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \
  98     LDFLAGS := $(LDFLAGS_JDKLIB) \
  99         $(call SET_SHARED_LIBRARY_ORIGIN), \
 100     LIBS_unix := -ljvm -lc, \
 101     LIBS_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 ifeq ($(OPENJDK_TARGET_OS), linux)
 143   ifeq ($(OPENJDK_TARGET_CPU), x86_64)
 144     BUILD_LIBJAVA_Bits.c_CFLAGS := $(C_O_FLAG_NORM)
 145   endif
 146 endif
 147 
 148 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
 149     LIBRARY := java, \
 150     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 151     SRC := $(LIBJAVA_SRC_DIRS), \
 152     OPTIMIZATION := HIGH, \
 153     CFLAGS := $(CFLAGS_JDKLIB) \
 154         $(LIBJAVA_CFLAGS), \
 155     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 156     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
 157     LDFLAGS := $(LDFLAGS_JDKLIB) \
 158         $(call SET_SHARED_LIBRARY_ORIGIN), \
 159     LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \
 160     LDFLAGS_windows := -export:winFileHandleOpen -export:handleLseek \
 161         -export:getLastErrorString \
 162         -export:getErrorString -delayload:shell32.dll, \
 163     LIBS_unix := -ljvm -lverify, \
 164     LIBS_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
 165     LIBS_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \
 166     LIBS_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\
 167     LIBS_macosx := -lfdlibm \
 168         -framework CoreFoundation \
 169         -framework Foundation \
 170         -framework Security -framework SystemConfiguration, \
 171     LIBS_windows := jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
 172         shell32.lib delayimp.lib \
 173         advapi32.lib version.lib, \
 174     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 175     RC_FLAGS := $(RC_FLAGS) \
 176         -D "JDK_FNAME=java.dll" \
 177         -D "JDK_INTERNAL_NAME=java" \
 178         -D "JDK_FTYPE=0x2L", \
 179     REORDER := $(LIBJAVA_REORDER), \
 180     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava, \
 181     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 182 
 183 TARGETS += $(BUILD_LIBJAVA)
 184 
 185 $(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
 186 
 187 $(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
 188 
 189 ##########################################################################################
 190 
 191 BUILD_LIBZIP_EXCLUDES :=
 192 ifeq ($(USE_EXTERNAL_LIBZ), true)
 193   LIBZIP_EXCLUDES += zlib-1.2.8
 194 endif
 195 
 196 BUILD_LIBZIP_REORDER :=
 197 ifeq ($(OPENJDK_TARGET_OS), solaris)
 198   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 199     BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/make/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU)
 200   endif
 201 endif
 202 
 203 ifeq ($(LIBZIP_CAN_USE_MMAP), true)
 204   BUILD_LIBZIP_MMAP := -DUSE_MMAP
 205 endif
 206 
 207 $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
 208     LIBRARY := zip, \
 209     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 210     OPTIMIZATION := LOW, \
 211     SRC := $(JDK_TOPDIR)/src/java.base/share/native/libzip, \
 212     EXCLUDES := $(LIBZIP_EXCLUDES), \
 213     CFLAGS := $(CFLAGS_JDKLIB) \
 214         $(ZLIB_CPPFLAGS) \
 215         -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
 216         -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
 217         -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
 218     CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
 219     DISABLED_WARNINGS_gcc := parentheses, \
 220     DISABLED_WARNINGS_clang := dangling-else, \
 221     DISABLED_WARNINGS_microsoft := 4267, \
 222     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libzip/mapfile-vers, \
 223     REORDER := $(BUILD_LIBZIP_REORDER), \
 224     LDFLAGS := $(LDFLAGS_JDKLIB) \
 225         $(call SET_SHARED_LIBRARY_ORIGIN), \
 226     LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
 227         -export:ZIP_ReadEntry -export:ZIP_GetNextEntry \
 228         -export:ZIP_InflateFully -export:ZIP_CRC32, \
 229     LIBS_unix := -ljvm -ljava $(LIBZ), \
 230     LIBS_solaris := -lc, \
 231     LIBS_windows := jvm.lib $(WIN_JAVA_LIB), \
 232     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 233     RC_FLAGS := $(RC_FLAGS) \
 234         -D "JDK_FNAME=zip.dll" \
 235         -D "JDK_INTERNAL_NAME=zip" \
 236         -D "JDK_FTYPE=0x2L", \
 237     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libzip, \
 238     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 239 
 240 
 241 $(BUILD_LIBZIP): $(BUILD_LIBJAVA)
 242 
 243 TARGETS += $(BUILD_LIBZIP)
 244 
 245 ##########################################################################################
 246 
 247 ifeq ($(OPENJDK_TARGET_OS), aix)
 248   LIBJIMAGE_TOOLCHAIN := TOOLCHAIN_LINK_CXX
 249 endif # OPENJDK_TARGET_OS aix
 250 
 251 $(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \
 252     LIBRARY := jimage, \
 253     TOOLCHAIN := $(LIBJIMAGE_TOOLCHAIN), \
 254     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 255     OPTIMIZATION := LOW, \
 256     SRC := $(JDK_TOPDIR)/src/java.base/share/native/libjimage \
 257         $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjimage, \
 258     EXCLUDES := $(LIBJIMAGE_EXCLUDES), \
 259     CFLAGS := $(CFLAGS_JDKLIB) \
 260         $(JIMAGELIB_CPPFLAGS) \
 261         -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
 262         -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
 263         -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \
 264         -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
 265     CFLAGS_unix := -UDEBUG, \
 266     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
 267     LDFLAGS := $(LDFLAGS_JDKLIB) \
 268         $(call SET_SHARED_LIBRARY_ORIGIN), \
 269     LDFLAGS_windows := -export:JIMAGE_Open -export:JIMAGE_Close \
 270         -export:JIMAGE_PackageToModule \
 271         -export:JIMAGE_FindResource -export:JIMAGE_GetResource \
 272         -export:JIMAGE_ResourceIterator, \
 273     LIBS_unix := -ljvm -ldl $(LIBCXX), \
 274     LIBS_solaris := -lc, \
 275     LIBS_macosx := -lc++, \
 276     LIBS_windows := jvm.lib, \
 277     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 278     RC_FLAGS := $(RC_FLAGS) \
 279         -D "JDK_FNAME=jimage.dll" \
 280         -D "JDK_INTERNAL_NAME=jimage" \
 281         -D "JDK_FTYPE=0x2L", \
 282     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjimage, \
 283     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 284 
 285 $(BUILD_LIBJIMAGE): $(BUILD_LIBJAVA)
 286 
 287 TARGETS += $(BUILD_LIBJIMAGE)
 288 
 289 ##########################################################################################
 290 
 291 LIBJLI_SRC_DIRS := $(call FindSrcDirsForLib, java.base, jli)
 292 
 293 LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)
 294 
 295 ifeq ($(JVM_VARIANT_ZERO), true)
 296   ERGO_FAMILY := zero
 297 else
 298   ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
 299     ERGO_FAMILY := i586
 300   else
 301     ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
 302   endif
 303 endif
 304 LIBJLI_ALL_ERGO := $(wildcard $(addsuffix /ergo_*.c, $(LIBJLI_SRC_DIRS)))
 305 LIBJLI_EXCLUDE_ERGO := $(filter-out %/ergo_$(ERGO_FAMILY).c, $(LIBJLI_ALL_ERGO))
 306 # If all specialized ergo files are excluded, use generic ergo
 307 ifeq ($(LIBJLI_ALL_ERGO), $(LIBJLI_EXCLUDE_ERGO))
 308   LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
 309 endif
 310 LIBJLI_EXCLUDE_FILES += $(notdir $(LIBJLI_EXCLUDE_ERGO))
 311 
 312 ifeq ($(OPENJDK_TARGET_OS), macosx)
 313   LIBJLI_EXCLUDE_FILES += java_md_solinux.c ergo.c ergo_i586.c
 314 
 315   BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
 316   BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
 317 
 318   LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
 319 endif
 320 
 321 ifeq ($(OPENJDK_TARGET_OS), windows)
 322   # Staticically link with c runtime on windows.
 323   LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
 324   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
 325   # Supply the name of the C runtime lib.
 326   LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"'
 327   ifneq ($(MSVCP_DLL), )
 328     LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"'
 329   endif
 330 else
 331   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
 332 endif
 333 
 334 LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS))
 335 
 336 # Append defines depending on target platform
 337 LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
 338 
 339 ifneq ($(USE_EXTERNAL_LIBZ), true)
 340   LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
 341   LIBJLI_EXTRA_FILES += \
 342       $(addprefix $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8/, \
 343           inflate.c \
 344           inftrees.c \
 345           inffast.c \
 346           zadler32.c \
 347           zcrc32.c \
 348           zutil.c \
 349       )
 350 endif
 351 
 352 $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
 353     LIBRARY := jli, \
 354     OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
 355     SRC := $(LIBJLI_SRC_DIRS), \
 356     EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 357     EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 358     OPTIMIZATION := HIGH, \
 359     CFLAGS := $(LIBJLI_CFLAGS), \
 360     DISABLED_WARNINGS_solstudio := \
 361         E_ASM_DISABLES_OPTIMIZATION \
 362         E_STATEMENT_NOT_REACHED, \
 363     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \
 364     LDFLAGS := $(LDFLAGS_JDKLIB) \
 365         $(call SET_SHARED_LIBRARY_ORIGIN), \
 366     LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 367     LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 368     LDFLAGS_windows := \
 369         -export:JLI_Launch \
 370         -export:JLI_ManifestIterate \
 371         -export:JLI_SetTraceLauncher \
 372         -export:JLI_ReportErrorMessage \
 373         -export:JLI_ReportErrorMessageSys \
 374         -export:JLI_ReportMessage \
 375         -export:JLI_ReportExceptionDescription \
 376         -export:JLI_MemAlloc \
 377         -export:JLI_CmdToArgs \
 378         -export:JLI_GetStdArgc \
 379         -export:JLI_GetStdArgs \
 380         -export:JLI_List_new \
 381         -export:JLI_List_add \
 382         -export:JLI_StringDup \
 383         -export:JLI_MemFree \
 384         -export:JLI_InitArgProcessing \
 385         -export:JLI_PreprocessArg \
 386         -export:JLI_GetAppArgIndex, \
 387     LIBS_unix := $(LIBZ), \
 388     LIBS_linux := $(LIBDL) -lc -lpthread, \
 389     LIBS_solaris := $(LIBDL) -lc, \
 390     LIBS_aix := $(LIBDL),\
 391     LIBS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
 392     LIBS_windows := advapi32.lib comctl32.lib user32.lib, \
 393     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 394     RC_FLAGS := $(RC_FLAGS) \
 395         -D "JDK_FNAME=jli.dll" \
 396         -D "JDK_INTERNAL_NAME=jli" \
 397         -D "JDK_FTYPE=0x2L", \
 398     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli, \
 399     DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 400 
 401 TARGETS += $(BUILD_LIBJLI)
 402 
 403 # On windows, the static library has the same suffix as the import library created by
 404 # with the shared library, so the static library is given a different name. No harm
 405 # in doing it for all platform to reduce complexity.
 406 ifeq ($(OPENJDK_TARGET_OS), windows)
 407   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 408       STATIC_LIBRARY := jli_static, \
 409       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
 410       SRC := $(LIBJLI_SRC_DIRS), \
 411       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 412       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 413       OPTIMIZATION := HIGH, \
 414       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
 415       ARFLAGS := $(ARFLAGS), \
 416       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
 417       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 418 
 419   TARGETS += $(BUILD_LIBJLI_STATIC)
 420 
 421 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 422   #
 423   # On macosx they do partial (incremental) linking of libjli_static.a
 424   # code it here...rather than add support to NativeCompilation
 425   # as this is first time I see it
 426   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 427       LIBRARY := jli_static, \
 428       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
 429       SRC := $(LIBJLI_SRC_DIRS), \
 430       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 431       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 432       OPTIMIZATION := HIGH, \
 433       CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
 434       LDFLAGS := -nostdlib -r, \
 435       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
 436       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 437 
 438   ifeq ($(STATIC_BUILD), true)
 439     TARGETS += $(BUILD_LIBJLI_STATIC)
 440   else
 441     $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a: $(BUILD_LIBJLI_STATIC)
 442         $(call install-file)
 443 
 444     TARGETS += $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a
 445   endif
 446 
 447 else ifeq ($(OPENJDK_TARGET_OS), aix)
 448   # AIX also requires a static libjli because the compiler doesn't support '-rpath'
 449   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 450       STATIC_LIBRARY := jli_static, \
 451       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
 452       SRC := $(LIBJLI_SRC_DIRS), \
 453       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 454       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 455       OPTIMIZATION := HIGH, \
 456       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
 457       ARFLAGS := $(ARFLAGS), \
 458       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
 459 
 460   TARGETS += $(BUILD_LIBJLI_STATIC)
 461 
 462 endif