1 #
   2 # Copyright (c) 2011, 2016, 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 # Hook to include the corresponding custom file, if present.
  29 $(eval $(call IncludeCustomExtension, jdk, lib/CoreLibraries.gmk))
  30 
  31 
  32 ##########################################################################################
  33 # libfdlibm is statically linked with libjava below and not delivered into the
  34 # product on its own.
  35 
  36 BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
  37 
  38 ifneq ($(OPENJDK_TARGET_OS), solaris)
  39   BUILD_LIBFDLIBM_OPTIMIZATION := NONE
  40 endif
  41 
  42 LIBFDLIBM_SRC := $(JDK_TOPDIR)/src/java.base/share/native/libfdlibm
  43 LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC)
  44 
  45 ifneq ($(OPENJDK_TARGET_OS), macosx)
  46   $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \
  47       STATIC_LIBRARY := fdlibm, \
  48       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
  49       SRC := $(LIBFDLIBM_SRC), \
  50       OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
  51       CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
  52       CFLAGS_windows_debug := -DLOGGING, \
  53       CFLAGS_aix := -qfloat=nomaf, \
  54       DISABLED_WARNINGS_gcc := sign-compare, \
  55       DISABLED_WARNINGS_microsoft := 4146 4244 4018, \
  56       ARFLAGS := $(ARFLAGS), \
  57       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
  58   ))
  59 
  60 else
  61 
  62   # On macosx the old build does partial (incremental) linking of fdlibm instead of
  63   # a plain static library.
  64   $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \
  65       LIBRARY := fdlibm, \
  66       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
  67       SRC := $(LIBFDLIBM_SRC), \
  68       CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
  69       LDFLAGS := -nostdlib -r -arch x86_64, \
  70       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
  71   ))
  72 
  73   BUILD_LIBFDLIBM := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
  74   $(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC)
  75         $(call install-file)
  76 
  77 endif
  78 
  79 ##########################################################################################
  80 
  81 ifeq ($(OPENJDK_TARGET_OS), solaris)
  82   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
  83     BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/make/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU)
  84   endif
  85 endif
  86 
  87 LIBVERIFY_OPTIMIZATION := HIGH
  88 ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
  89   ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
  90     LIBVERIFY_OPTIMIZATION := LOW
  91   endif
  92 endif
  93 
  94 $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
  95     LIBRARY := verify, \
  96     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  97     SRC := $(JDK_TOPDIR)/src/java.base/share/native/libverify, \
  98     OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
  99     CFLAGS := $(CFLAGS_JDKLIB), \
 100     DISABLED_WARNINGS_microsoft := 4244 4267, \
 101     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \
 102     LDFLAGS := $(LDFLAGS_JDKLIB) \
 103         $(call SET_SHARED_LIBRARY_ORIGIN), \
 104     LIBS_unix := -ljvm -lc, \
 105     LIBS_windows := jvm.lib, \
 106     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 107     RC_FLAGS := $(RC_FLAGS) \
 108         -D "JDK_FNAME=verify.dll" \
 109         -D "JDK_INTERNAL_NAME=verify" \
 110         -D "JDK_FTYPE=0x2L", \
 111     REORDER := $(BUILD_LIBVERIFY_REORDER), \
 112     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify, \
 113 ))
 114 
 115 TARGETS += $(BUILD_LIBVERIFY)
 116 
 117 ##########################################################################################
 118 
 119 LIBJAVA_SRC_DIRS := $(call FindSrcDirsForLib, java.base, java)
 120 
 121 LIBJAVA_CFLAGS := $(addprefix -I, $(LIBJAVA_SRC_DIRS)) \
 122     -I$(JDK_TOPDIR)/src/java.base/share/native/libfdlibm \
 123     -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
 124     -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
 125 
 126 # Make it possible to override this variable
 127 LIBJAVA_MAPFILE ?= $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers
 128 
 129 ifeq ($(OPENJDK_TARGET_OS), macosx)
 130   BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
 131   BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
 132 endif
 133 
 134 ifeq ($(OPENJDK_TARGET_OS), solaris)
 135   ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 136     LIBJAVA_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU)
 137   endif
 138 endif
 139 
 140 ifeq ($(OPENJDK_TARGET_OS), linux)
 141   ifeq ($(OPENJDK_TARGET_CPU), x86_64)
 142     BUILD_LIBJAVA_Bits.c_CFLAGS := $(C_O_FLAG_NORM)
 143   endif
 144 endif
 145 
 146 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
 147     LIBRARY := java, \
 148     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 149     SRC := $(LIBJAVA_SRC_DIRS), \
 150     OPTIMIZATION := HIGH, \
 151     CFLAGS := $(CFLAGS_JDKLIB) \
 152         $(LIBJAVA_CFLAGS), \
 153     System.c_CFLAGS := $(VERSION_CFLAGS), \
 154     jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
 155     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
 156     MAPFILE := $(LIBJAVA_MAPFILE), \
 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 ))
 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 ))
 239 
 240 $(BUILD_LIBZIP): $(BUILD_LIBJAVA)
 241 
 242 TARGETS += $(BUILD_LIBZIP)
 243 
 244 ##########################################################################################
 245 
 246 ifeq ($(OPENJDK_TARGET_OS), aix)
 247   LIBJIMAGE_TOOLCHAIN := TOOLCHAIN_LINK_CXX
 248 endif # OPENJDK_TARGET_OS aix
 249 
 250 $(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \
 251     LIBRARY := jimage, \
 252     TOOLCHAIN := $(LIBJIMAGE_TOOLCHAIN), \
 253     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 254     OPTIMIZATION := LOW, \
 255     SRC := $(JDK_TOPDIR)/src/java.base/share/native/libjimage \
 256         $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjimage, \
 257     EXCLUDES := $(LIBJIMAGE_EXCLUDES), \
 258     CFLAGS := $(CFLAGS_JDKLIB) \
 259         $(JIMAGELIB_CPPFLAGS) \
 260         -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \
 261         -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
 262         -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \
 263         -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
 264     CFLAGS_unix := -UDEBUG, \
 265     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
 266     LDFLAGS := $(LDFLAGS_JDKLIB) \
 267         $(call SET_SHARED_LIBRARY_ORIGIN), \
 268     LDFLAGS_windows := -export:JIMAGE_Open -export:JIMAGE_Close \
 269         -export:JIMAGE_PackageToModule \
 270         -export:JIMAGE_FindResource -export:JIMAGE_GetResource \
 271         -export:JIMAGE_ResourceIterator, \
 272     LIBS_unix := -ljvm $(LIBDL) $(LIBCXX), \
 273     LIBS_solaris := -lc, \
 274     LIBS_macosx := -lc++, \
 275     LIBS_windows := jvm.lib, \
 276     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 277     RC_FLAGS := $(RC_FLAGS) \
 278         -D "JDK_FNAME=jimage.dll" \
 279         -D "JDK_INTERNAL_NAME=jimage" \
 280         -D "JDK_FTYPE=0x2L", \
 281     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjimage, \
 282 ))
 283 
 284 $(BUILD_LIBJIMAGE): $(BUILD_LIBJAVA)
 285 
 286 TARGETS += $(BUILD_LIBJIMAGE)
 287 
 288 ##########################################################################################
 289 
 290 LIBJLI_SRC_DIRS := $(call FindSrcDirsForLib, java.base, jli)
 291 
 292 LIBJLI_CFLAGS := $(CFLAGS_JDKLIB)
 293 
 294 ifeq ($(JVM_VARIANT_ZERO), true)
 295   ERGO_FAMILY := zero
 296 else
 297   ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
 298     ERGO_FAMILY := i586
 299   else
 300     ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
 301   endif
 302 endif
 303 LIBJLI_ALL_ERGO := $(wildcard $(addsuffix /ergo_*.c, $(LIBJLI_SRC_DIRS)))
 304 LIBJLI_EXCLUDE_ERGO := $(filter-out %/ergo_$(ERGO_FAMILY).c, $(LIBJLI_ALL_ERGO))
 305 # If all specialized ergo files are excluded, use generic ergo
 306 ifeq ($(LIBJLI_ALL_ERGO), $(LIBJLI_EXCLUDE_ERGO))
 307   LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
 308 endif
 309 LIBJLI_EXCLUDE_FILES += $(notdir $(LIBJLI_EXCLUDE_ERGO))
 310 
 311 ifeq ($(OPENJDK_TARGET_OS), macosx)
 312   LIBJLI_EXCLUDE_FILES += java_md_solinux.c ergo.c ergo_i586.c
 313 
 314   BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
 315   BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
 316 
 317   LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
 318 endif
 319 
 320 ifeq ($(OPENJDK_TARGET_OS), windows)
 321   # Staticically link with c runtime on windows.
 322   LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
 323   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
 324   # Supply the name of the C runtime lib.
 325   LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"'
 326   ifneq ($(MSVCP_DLL), )
 327     LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"'
 328   endif
 329 else
 330   LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
 331 endif
 332 
 333 LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS))
 334 
 335 # Append defines depending on target platform
 336 LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
 337 
 338 ifneq ($(USE_EXTERNAL_LIBZ), true)
 339   LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
 340   LIBJLI_EXTRA_FILES += \
 341       $(addprefix $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8/, \
 342           inflate.c \
 343           inftrees.c \
 344           inffast.c \
 345           zadler32.c \
 346           zcrc32.c \
 347           zutil.c \
 348       )
 349 endif
 350 
 351 $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
 352     LIBRARY := jli, \
 353     OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
 354     SRC := $(LIBJLI_SRC_DIRS), \
 355     EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 356     EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 357     OPTIMIZATION := HIGH, \
 358     CFLAGS := $(LIBJLI_CFLAGS), \
 359     DISABLED_WARNINGS_solstudio := \
 360         E_ASM_DISABLES_OPTIMIZATION \
 361         E_STATEMENT_NOT_REACHED, \
 362     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \
 363     LDFLAGS := $(LDFLAGS_JDKLIB) \
 364         $(call SET_SHARED_LIBRARY_ORIGIN), \
 365     LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 366     LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
 367     LDFLAGS_windows := \
 368         -export:JLI_Launch \
 369         -export:JLI_ManifestIterate \
 370         -export:JLI_SetTraceLauncher \
 371         -export:JLI_ReportErrorMessage \
 372         -export:JLI_ReportErrorMessageSys \
 373         -export:JLI_ReportMessage \
 374         -export:JLI_ReportExceptionDescription \
 375         -export:JLI_MemAlloc \
 376         -export:JLI_CmdToArgs \
 377         -export:JLI_GetStdArgc \
 378         -export:JLI_GetStdArgs \
 379         -export:JLI_List_new \
 380         -export:JLI_List_add \
 381         -export:JLI_StringDup \
 382         -export:JLI_MemFree \
 383         -export:JLI_InitArgProcessing \
 384         -export:JLI_PreprocessArg \
 385         -export:JLI_GetAppArgIndex, \
 386     LIBS_unix := $(LIBZ), \
 387     LIBS_linux := $(LIBDL) -lc -lpthread, \
 388     LIBS_solaris := $(LIBDL) -lc, \
 389     LIBS_aix := $(LIBDL),\
 390     LIBS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
 391     LIBS_windows := advapi32.lib comctl32.lib user32.lib, \
 392     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
 393     RC_FLAGS := $(RC_FLAGS) \
 394         -D "JDK_FNAME=jli.dll" \
 395         -D "JDK_INTERNAL_NAME=jli" \
 396         -D "JDK_FTYPE=0x2L", \
 397     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli, \
 398 ))
 399 
 400 TARGETS += $(BUILD_LIBJLI)
 401 
 402 # On windows, the static library has the same suffix as the import library created by
 403 # with the shared library, so the static library is given a different name. No harm
 404 # in doing it for all platform to reduce complexity.
 405 ifeq ($(OPENJDK_TARGET_OS), windows)
 406   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 407       STATIC_LIBRARY := jli_static, \
 408       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
 409       SRC := $(LIBJLI_SRC_DIRS), \
 410       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 411       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 412       OPTIMIZATION := HIGH, \
 413       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
 414       ARFLAGS := $(ARFLAGS), \
 415       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
 416   ))
 417 
 418   TARGETS += $(BUILD_LIBJLI_STATIC)
 419 
 420 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 421   #
 422   # On macosx they do partial (incremental) linking of libjli_static.a
 423   # code it here...rather than add support to NativeCompilation
 424   # as this is first time I see it
 425   $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
 426       LIBRARY := jli_static, \
 427       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
 428       SRC := $(LIBJLI_SRC_DIRS), \
 429       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
 430       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
 431       OPTIMIZATION := HIGH, \
 432       CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
 433       LDFLAGS := -nostdlib -r, \
 434       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
 435   ))
 436 
 437   ifeq ($(STATIC_BUILD), true)
 438     TARGETS += $(BUILD_LIBJLI_STATIC)
 439   else
 440     $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a: $(BUILD_LIBJLI_STATIC)
 441         $(call install-file)
 442 
 443     TARGETS += $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static.a
 444   endif
 445 
 446 else ifneq ($(filter $(OPENJDK_TARGET_OS_ENV), aix bsd.netbsd), )
 447   # AIX and NetBSD also requires a static libjli because the compiler doesn't
 448   # 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