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