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 defalt: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include NativeCompilation.gmk
  31 
  32 # Setup the java compilers for the JDK build.
  33 include Setup.gmk
  34 
  35 # Copy files (can now depend on $(COPY_FILES))
  36 include CopyFiles.gmk
  37 
  38 # Prepare the find cache. Only used if running on windows.
  39 $(eval $(call FillCacheFind,$(JDK_TOPDIR)/src))
  40 
  41 # Build tools
  42 include Tools.gmk
  43 
  44 # Include the javah generated headers.
  45 CFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers
  46 CXXFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers
  47 
  48 # Put the libraries here. Different locations for different target apis.
  49 ifeq ($(OPENJDK_TARGET_OS_API),posix)
  50     INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
  51 else
  52     INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/bin
  53 endif
  54 
  55 BUILD_LIBRARIES=
  56 
  57 # Absolute paths to lib files on windows for use in LDFLAGS. Should figure out a more
  58 # elegant solution to this.
  59 WIN_VERIFY_LIB := $(JDK_OUTPUTDIR)/objs/libverify/verify.lib
  60 WIN_JAVA_LIB := $(JDK_OUTPUTDIR)/objs/libjava/java.lib
  61 WIN_AWT_LIB := $(JDK_OUTPUTDIR)/objs/libawt/awt.lib
  62 
  63 # Use this variable to set DEBUG_SYMBOLS true on windows for all libraries, but
  64 # not on other platforms.
  65 ifeq ($(OPENJDK_TARGET_OS), windows)
  66     WINDOWS_ONLY := true
  67 endif
  68 
  69 #
  70 # TODO replace with X_FLAGS / X_LIBS
  71 #   and add them to configure
  72 #
  73 OPENWIN_LIB:=$(OPENWIN_HOME)/lib
  74 
  75 ##########################################################################################
  76 
  77 BUILD_LIBFDLIBM_OPTIMIZATION:=HIGH
  78 
  79 ifneq ($(OPENJDK_TARGET_OS), solaris)
  80       BUILD_LIBFDLIBM_OPTIMIZATION:=NONE
  81 endif
  82 
  83 ifneq ($(OPENJDK_TARGET_OS),macosx)
  84 $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM,\
  85                 STATIC_LIBRARY:=fdlibm,\
  86                 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
  87                 SRC:=$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src,\
  88                 LANG:=C,\
  89                 OPTIMIZATION:=$(BUILD_LIBFDLIBM_OPTIMIZATION), \
  90                 CFLAGS:=$(CFLAGS_JDKLIB) \
  91                         -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include,\
  92                 CFLAGS_windows_debug:=-DLOGGING,\
  93                 ARFLAGS:=$(ARFLAGS),\
  94                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm))
  95 
  96 else
  97 
  98 # On macosx the old build does partial (incremental) linking of fdlibm instead of
  99 # a plain static library.
 100 $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC,\
 101                 LIBRARY:=fdlibm,\
 102                 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm,\
 103                 SRC:=$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src,\
 104                 LANG:=C,\
 105                 CFLAGS:=$(CFLAGS_JDKLIB) \
 106                         -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include,\
 107                 LDFLAGS:=-nostdlib -r -arch x86_64,\
 108                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm))
 109 
 110 BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
 111 $(BUILD_LIBFDLIBM) : $(BUILD_LIBFDLIBM_MAC)
 112         $(call install-file)
 113 
 114 endif
 115 BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
 116 
 117 ##########################################################################################
 118 
 119 BUILD_LIBVERIFY_SRC:=check_code.c check_format.c
 120 
 121 ifeq ($(OPENJDK_TARGET_OS), solaris)
 122         ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 123                 BUILD_LIBVERIFY_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU)
 124         endif
 125 endif
 126 
 127 LIBVERIFY_OPTIMIZATION:=HIGH
 128 ifneq ($(findstring $(OPENJDK_TARGET_OS),solaris linux),)
 129     ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
 130         LIBVERIFY_OPTIMIZATION:=LOW
 131     endif
 132 endif
 133 
 134 
 135 $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY,\
 136                 LIBRARY:=verify, \
 137                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 138                 SRC:=$(JDK_TOPDIR)/src/share/native/common,\
 139                 INCLUDE_FILES:=$(BUILD_LIBVERIFY_SRC),\
 140                 LANG:=C,\
 141                 OPTIMIZATION:=$(LIBVERIFY_OPTIMIZATION), \
 142                 CFLAGS:=$(CFLAGS_JDKLIB),\
 143                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libverify/mapfile-vers, \
 144                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
 145                          $(call SET_SHARED_LIBRARY_ORIGIN), \
 146                 LDFLAGS_SUFFIX_posix:=-ljvm -lc,\
 147                 LDFLAGS_SUFFIX_windows:=jvm.lib,\
 148                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 149                 RC_FLAGS:=$(RC_FLAGS) \
 150                           -D "JDK_FNAME=verify.dll" \
 151                           -D "JDK_INTERNAL_NAME=verify" \
 152                           -D "JDK_FTYPE=0x2L",\
 153                 REORDER:=$(BUILD_LIBVERIFY_REORDER),\
 154                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libverify,\
 155                 DEBUG_SYMBOLS:=true))
 156 
 157 BUILD_LIBRARIES += $(BUILD_LIBVERIFY)
 158 
 159 ##########################################################################################
 160 
 161 LIBJAVA_SRC_DIRS:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/lang \
 162                 $(JDK_TOPDIR)/src/share/native/java/lang \
 163                 $(JDK_TOPDIR)/src/share/native/java/lang/ref \
 164                 $(JDK_TOPDIR)/src/share/native/java/lang/reflect \
 165                 $(JDK_TOPDIR)/src/share/native/java/io \
 166                 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \
 167                 $(JDK_TOPDIR)/src/share/native/java/nio \
 168                 $(JDK_TOPDIR)/src/share/native/java/security \
 169                 $(JDK_TOPDIR)/src/share/native/common \
 170                 $(JDK_TOPDIR)/src/share/native/sun/misc \
 171                 $(JDK_TOPDIR)/src/share/native/sun/reflect \
 172                 $(JDK_TOPDIR)/src/share/native/java/util \
 173                 $(JDK_TOPDIR)/src/share/native/java/util/concurrent/atomic \
 174                 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \
 175                 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/util
 176 
 177 ifneq ($(OPENJDK_TARGET_OS),macosx)
 178     LIBJAVA_SRC_DIRS+=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/util/locale/provider
 179 else
 180     LIBJAVA_SRC_DIRS+=$(JDK_TOPDIR)/src/macosx/native/sun/util/locale/provider
 181 endif
 182 
 183 ifeq ($(OPENJDK_TARGET_OS),windows)
 184     LIBJAVA_SRC_DIRS+=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/provider \
 185                 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/io
 186 endif
 187 
 188 LIBJAVA_CFLAGS:=$(foreach dir,$(LIBJAVA_SRC_DIRS),-I$(dir)) \
 189                   -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include \
 190                   -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
 191 
 192 LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
 193                   -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
 194                   -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \
 195                   -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"' 
 196 
 197 ifneq (,$(JDK_UPDATE_VERSION))
 198         LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
 199 endif
 200 
 201 LIBJAVA_EXCLUDE_FILES:=check_code.c check_format.c
 202 
 203 ifneq ($(OPENJDK_TARGET_OS),macosx)
 204         LIBJAVA_EXCLUDE_FILES += java_props_macosx.c
 205 else
 206         BUILD_LIBJAVA_java_props_md.c_CFLAGS:=-x objective-c
 207 endif
 208 
 209 ifeq ($(OPENJDK_TARGET_OS),windows)
 210         LIBJAVA_EXCLUDE_FILES += \
 211                 UNIXProcess_md.c \
 212                 UnixFileSystem_md.c \
 213                 FileSystemPreferences.c
 214 else
 215         LIBJAVA_EXCLUDE_FILES += \
 216                 ProcessImpl_md.c \
 217                 WinNTFileSystem_md.c \
 218                 dirent_md.c \
 219                 WindowsPreferences.c \
 220                 sun/security/provider/WinCAPISeedGenerator.c \
 221                 sun/io/Win32ErrorMode.c
 222 endif
 223 
 224 ifeq ($(OPENJDK_TARGET_OS), solaris)
 225     ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 226         LIBJAVA_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU)
 227     endif
 228 endif
 229 
 230 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA,\
 231                 LIBRARY:=java,\
 232                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 233                 SRC:=$(LIBJAVA_SRC_DIRS),\
 234                 EXCLUDES:=fdlibm/src zip, \
 235                 EXCLUDE_FILES:=$(LIBJAVA_EXCLUDE_FILES), \
 236                 LANG:=C,\
 237                 OPTIMIZATION:=HIGH, \
 238                 CFLAGS:=$(CFLAGS_JDKLIB) \
 239                         $(LIBJAVA_CFLAGS),\
 240                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjava/mapfile-vers, \
 241                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
 242                          $(call SET_SHARED_LIBRARY_ORIGIN), \
 243                 LDFLAGS_SUFFIX_posix:=-ljvm -lverify, \
 244                 LDFLAGS_SUFFIX_solaris:=-lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc,\
 245                 LDFLAGS_SUFFIX_linux:=$(LIBDL) $(BUILD_LIBFDLIBM),\
 246                 LDFLAGS_SUFFIX_macosx:=-L$(JDK_OUTPUTDIR)/objs/ -lfdlibm \
 247                                          -framework CoreFoundation \
 248                                          -framework Security -framework SystemConfiguration, \
 249                 LDFLAGS_SUFFIX_windows:=-export:winFileHandleOpen -export:handleLseek \
 250                                         jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
 251                                         shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
 252                                         advapi32.lib,\
 253                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 254                 RC_FLAGS:=$(RC_FLAGS)\
 255                           -D "JDK_FNAME=java.dll" \
 256                           -D "JDK_INTERNAL_NAME=java" \
 257                           -D "JDK_FTYPE=0x2L",\
 258                 REORDER:=$(LIBJAVA_REORDER), \
 259                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjava,\
 260                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
 261 
 262 BUILD_LIBRARIES += $(BUILD_LIBJAVA)
 263 
 264 $(BUILD_LIBJAVA) : $(LIBJLI_BINARY)
 265 
 266 $(BUILD_LIBJAVA) : $(BUILD_LIBVERIFY)
 267 
 268 $(BUILD_LIBJAVA) : $(BUILD_LIBFDLIBM)
 269 
 270 ##########################################################################################
 271 
 272 BUILD_LIBMLIB_SRC:=$(JDK_TOPDIR)/src/share/native/sun/awt/medialib
 273 BUILD_LIBMLIB_CFLAGS:=-D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
 274                         -I$(BUILD_LIBMLIB_SRC) \
 275                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/medialib 
 276 
 277 BUILD_LIBMLIB_LDLIBS:=
 278 BUILD_LIBMLIB_IMAGE_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libmlib_image/mapfile-vers
 279 
 280 BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
 281 
 282 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
 283         BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
 284 endif
 285 
 286 ifneq ($(OPENJDK_TARGET_OS), windows)
 287         BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
 288 endif
 289 
 290 $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE,\
 291                 LIBRARY:=mlib_image,\
 292                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 293                 SRC:=$(BUILD_LIBMLIB_SRC),\
 294                 EXCLUDE_FILES:=awt_ImagingLib.c mlib_c_ImageBlendTable.c,\
 295                 LANG:=C,\
 296                 OPTIMIZATION:=HIGHEST, \
 297                 CFLAGS:=$(CFLAGS_JDKLIB) \
 298                         $(BUILD_LIBMLIB_CFLAGS),\
 299                 MAPFILE:=$(BUILD_LIBMLIB_IMAGE_MAPFILE), \
 300                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
 301                          $(call SET_SHARED_LIBRARY_ORIGIN),\
 302                 LDFLAGS_SUFFIX:=$(BUILD_LIBMLIB_LDLIBS) \
 303                                 $(LDFLAGS_JDKLIB_SUFFIX),\
 304                 LDFLAGS_SUFFIX_solaris:=-lc, \
 305                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 306                 RC_FLAGS:=$(RC_FLAGS)\
 307                           -D "JDK_FNAME=mlib_image.dll" \
 308                           -D "JDK_INTERNAL_NAME=mlib_image" \
 309                           -D "JDK_FTYPE=0x2L",\
 310                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libmlib_image,\
 311                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
 312 
 313 $(BUILD_LIBMLIB_IMAGE) : $(BUILD_LIBJAVA)
 314 
 315 BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE)
 316 
 317 ##########################################################################################
 318 
 319 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH),solaris-sparc)
 320 
 321 BUILD_LIBMLIB_IMAGE_V_FILES:=\
 322         mlib_v_ImageLookUp.c \
 323         mlib_ImageCreate.c \
 324         mlib_ImageAffine.c \
 325         mlib_ImageConvMxN.c \
 326         mlib_ImageConvKernelConvert.c \
 327         mlib_sys.c \
 328         mlib_ImageLookUp_64.c \
 329         mlib_ImageLookUp_Bit.c \
 330         mlib_ImageColorTrue2Index.c \
 331         mlib_c_ImageThresh1_U8.c \
 332         mlib_v_ImageLookUpS16S16Func.c \
 333         mlib_v_ImageLookUpS16S32Func.c \
 334         mlib_v_ImageLookUpS16U16Func.c \
 335         mlib_v_ImageLookUpS16U8Func.c \
 336         mlib_v_ImageLookUpS32S16Func.c \
 337         mlib_v_ImageLookUpS32S32Func.c \
 338         mlib_v_ImageLookUpS32U16Func.c \
 339         mlib_v_ImageLookUpS32U8Func.c \
 340         mlib_v_ImageLookUpSIS16S16Func.c \
 341         mlib_v_ImageLookUpSIS16S32Func.c \
 342         mlib_v_ImageLookUpSIS16U16Func.c \
 343         mlib_v_ImageLookUpSIS16U8Func.c \
 344         mlib_v_ImageLookUpSIS32S16Func.c \
 345         mlib_v_ImageLookUpSIS32S32Func.c \
 346         mlib_v_ImageLookUpSIS32U16Func.c \
 347         mlib_v_ImageLookUpSIS32U8Func.c \
 348         mlib_v_ImageLookUpSIU16S16Func.c \
 349         mlib_v_ImageLookUpSIU16S32Func.c \
 350         mlib_v_ImageLookUpSIU16U16Func.c \
 351         mlib_v_ImageLookUpSIU16U8Func.c \
 352         mlib_v_ImageLookUpSIU8S16Func.c \
 353         mlib_v_ImageLookUpSIU8S32Func.c \
 354         mlib_v_ImageLookUpSIU8U16Func.c \
 355         mlib_v_ImageLookUpSIU8U8Func.c \
 356         mlib_v_ImageLookUpU16S16Func.c \
 357         mlib_v_ImageLookUpU16S32Func.c \
 358         mlib_v_ImageLookUpU16U16Func.c \
 359         mlib_v_ImageLookUpU16U8Func.c \
 360         mlib_v_ImageLookUpU8S16Func.c \
 361         mlib_v_ImageLookUpU8S32Func.c \
 362         mlib_v_ImageLookUpU8U16Func.c \
 363         mlib_v_ImageLookUpU8U8Func.c \
 364         mlib_v_ImageAffineIndex_BC.c \
 365         mlib_v_ImageAffine_BC.c \
 366         mlib_v_ImageAffine_BC_S16.c \
 367         mlib_v_ImageAffine_BC_U16.c \
 368         mlib_v_ImageAffine_BL.c \
 369         mlib_v_ImageAffine_BL_S16.c \
 370         mlib_v_ImageAffine_BL_U16.c \
 371         mlib_v_ImageAffine_NN.c \
 372         mlib_v_ImageFilters.c \
 373         mlib_ImageAffineEdge.c \
 374         mlib_ImageAffine_BC_D64.c \
 375         mlib_ImageAffine_BC_F32.c \
 376         mlib_ImageAffine_BC_S32.c \
 377         mlib_ImageAffine_BL_D64.c \
 378         mlib_ImageAffine_BL_F32.c \
 379         mlib_ImageAffine_BL_S32.c \
 380         mlib_ImageAffine_NN.c \
 381         mlib_ImageAffine_NN_Bit.c \
 382         mlib_ImageFilters.c \
 383         mlib_ImageScanPoly.c \
 384         mlib_ImageConv_8nw.c \
 385         mlib_ImageConv_8ext.c \
 386         mlib_ImageConv_16nw.c \
 387         mlib_ImageConv_16ext.c \
 388         mlib_ImageConv_u16nw.c \
 389         mlib_ImageConv_u16ext.c \
 390         mlib_ImageConv_32nw.c \
 391         mlib_ImageConv_F32nw.c \
 392         mlib_ImageConvMxN_Fp.c \
 393         mlib_ImageConvMxN_ext.c \
 394         mlib_ImageConv_D64nw.c \
 395         mlib_ImageClipping.c \
 396         mlib_ImageConvCopyEdge_Bit.c \
 397         mlib_ImageConvClearEdge_Bit.c \
 398         mlib_ImageConv2x2_f.c \
 399         mlib_ImageConvClearEdge_Fp.c \
 400         mlib_v_ImageConvMxN_8.c \
 401         mlib_v_ImageConvClearEdge.c \
 402         mlib_v_ImageConvCopyEdge.c \
 403         mlib_v_ImageConvMxN_8ext.c \
 404         mlib_v_ImageConvVersion.c \
 405         mlib_v_ImageConv_8nw.c \
 406         mlib_ImageConvCopyEdge_Fp.c \
 407         mlib_v_ImageChannelInsert_1.c \
 408         mlib_v_ImageChannelExtract_43.c \
 409         mlib_v_ImageChannelExtract_1.c \
 410         mlib_ImageCopy_Bit.c \
 411         mlib_v_ImageCopy_f.c \
 412         mlib_ImageUtils.c \
 413         mlib_ImageDivTables.c
 414 
 415 BUILD_LIBMLIB_V_CFLAGS := $(filter-out -DMLIB_NO_LIBSUNMATH,$(BUILD_LIBMLIB_CFLAGS))
 416 
 417 $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V,\
 418                 LIBRARY:=mlib_image_v, \
 419                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 420                 SRC:=$(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
 421                      $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib,\
 422                 LANG:=C,\
 423                 INCLUDE_FILES:=$(BUILD_LIBMLIB_IMAGE_V_FILES),\
 424                 OPTIMIZATION:=HIGHEST, \
 425                 CFLAGS:=-xarch=sparcvis \
 426                       $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il\
 427                       $(BUILD_LIBMLIB_V_CFLAGS) \
 428                       $(CFLAGS_JDKLIB), \
 429                 MAPFILE:=$(BUILD_LIBMLIB_IMAGE_MAPFILE), \
 430                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
 431                          $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \
 432                          $(call SET_SHARED_LIBRARY_ORIGIN),\
 433                 LDFLAGS_SUFFIX_solaris:=-lc,\
 434                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libmlib_image_v))
 435 
 436 $(BUILD_LIBMLIB_IMAGE_V): $(BUILD_LIBJAVA)
 437 
 438 BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE_V)
 439 
 440 endif
 441 
 442 ##########################################################################################
 443 
 444 LIBAWT_DIRS:=\
 445         $(JDK_TOPDIR)/src/share/native/sun/awt \
 446         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
 447         $(JDK_TOPDIR)/src/share/native/sun/awt/image \
 448         $(JDK_TOPDIR)/src/share/native/sun/awt/image/gif \
 449         $(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
 450         $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
 451         $(JDK_TOPDIR)/src/share/native/sun/awt/debug \
 452         $(JDK_TOPDIR)/src/share/native/sun/awt/utility \
 453         $(JDK_TOPDIR)/src/share/native/sun/java2d \
 454         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
 455         $(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
 456         $(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
 457         $(JDK_TOPDIR)/src/share/native/sun/awt/image \
 458         $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
 459         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
 460         $(JDK_TOPDIR)/src/share/native/sun/font
 461 
 462 ifeq ($(OPENJDK_TARGET_OS),windows)
 463     LIBAWT_DIRS+=\
 464         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
 465         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \
 466         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d
 467     LIBAWT_CFLAGS+=-I$(DXSDK_INCLUDE_PATH)
 468 else
 469     LIBAWT_DIRS+=\
 470         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11
 471 endif
 472 
 473 LIBAWT_CFLAGS+=-D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \
 474         $(X_CFLAGS) \
 475         $(foreach dir,$(LIBAWT_DIRS),-I$(dir))
 476 
 477 LIBAWT_FILES:=\
 478         gifdecoder.c \
 479         imageInitIDs.c \
 480         img_globals.c \
 481         SurfaceData.c \
 482         Region.c \
 483         BufImgSurfaceData.c \
 484         Disposer.c \
 485         Trace.c \
 486         GraphicsPrimitiveMgr.c \
 487         Blit.c \
 488         BlitBg.c \
 489         ScaledBlit.c \
 490         FillRect.c \
 491         FillSpans.c \
 492         FillParallelogram.c \
 493         DrawParallelogram.c \
 494         DrawLine.c \
 495         DrawRect.c \
 496         DrawPolygons.c \
 497         DrawPath.c \
 498         FillPath.c \
 499         ProcessPath.c \
 500         MaskBlit.c \
 501         MaskFill.c \
 502         TransformHelper.c \
 503         AlphaMath.c \
 504         AlphaMacros.c \
 505         AnyByte.c \
 506         ByteBinary1Bit.c \
 507         ByteBinary2Bit.c \
 508         ByteBinary4Bit.c \
 509         ByteIndexed.c \
 510         ByteGray.c \
 511         Index8Gray.c \
 512         Index12Gray.c \
 513         AnyShort.c \
 514         Ushort555Rgb.c \
 515         Ushort565Rgb.c \
 516         Ushort4444Argb.c \
 517         Ushort555Rgbx.c \
 518         UshortGray.c \
 519         UshortIndexed.c \
 520         Any3Byte.c \
 521         ThreeByteBgr.c \
 522         AnyInt.c \
 523         IntArgb.c \
 524         IntArgbPre.c \
 525         IntArgbBm.c \
 526         IntRgb.c \
 527         IntBgr.c \
 528         IntRgbx.c \
 529         Any4Byte.c \
 530         FourByteAbgr.c \
 531         FourByteAbgrPre.c \
 532         BufferedMaskBlit.c \
 533         BufferedRenderPipe.c \
 534         ShapeSpanIterator.c \
 535         SpanClipRenderer.c \
 536         awt_ImageRep.c \
 537         awt_ImagingLib.c \
 538         awt_Mlib.c \
 539         awt_parseImage.c \
 540         DataBufferNative.c \
 541         dither.c \
 542         debug_assert.c \
 543         debug_mem.c \
 544         debug_trace.c \
 545         debug_util.c
 546 
 547 ifneq (,$(filter $(OPENJDK_TARGET_OS), solaris linux))
 548         LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c
 549 endif
 550 
 551 ifeq ($(OPENJDK_TARGET_OS),macosx)
 552         LIBAWT_FILES += awt_LoadLibrary.c img_colors.c
 553         LIBAWT_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/apple/resources
 554         LIBAWT_FILES += awt_LoadLibrary.c MacOSXResourceBundle.m
 555         LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
 556 
 557         LIBAWT_MacOSXResourceBundle.m_CFLAGS:=-O0
 558 endif
 559 
 560 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
 561         LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
 562         LIBAWT_CFLAGS += -xarch=sparcvis
 563         LIBAWT_CFLAGS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il
 564         LIBAWT_CFLAGS += \
 565             -I$(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
 566             -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/medialib \
 567             -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
 568 
 569         LIBAWT_DIRS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
 570                        $(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
 571 
 572         LIBAWT_FILES += \
 573                 vis_FuncArray.c           \
 574                 java2d_Mlib.c             \
 575                 mlib_ImageCreate.c        \
 576                 mlib_ImageZoom_NN.c       \
 577                 mlib_ImageCopy_Bit.c      \
 578                 mlib_sys.c                \
 579                 mlib_v_ImageClear.c       \
 580                 mlib_v_ImageClear_f.c     \
 581                 mlib_v_ImageConstXor.c    \
 582                 mlib_v_ImageCopy.c        \
 583                 mlib_v_ImageCopy_f.c      \
 584                 mlib_v_ImageXor.c         \
 585                 mlib_v_ImageZoom_NN_f.c   \
 586                 vis_Interp.c              \
 587                 vis_AlphaMacros.c         \
 588                 vis_AlphaMaskBlit.c       \
 589                 vis_AlphaMaskFill.c       \
 590                 vis_ByteGray.c            \
 591                 vis_ByteGray_FromRgb.c    \
 592                 vis_ByteGray_Mask.c       \
 593                 vis_ByteIndexed.c         \
 594                 vis_DrawLine.c            \
 595                 vis_FourByteAbgr.c        \
 596                 vis_IntArgb.c             \
 597                 vis_IntArgbPre.c          \
 598                 vis_IntArgbPre_Mask.c     \
 599                 vis_IntBgr.c              \
 600                 vis_IntRgb.c              \
 601                 vis_IntRgbx.c             \
 602                 vis_SrcMaskFill.c         \
 603                 vis_SrcOverMaskBlit.c     \
 604                 vis_SrcOverMaskFill.c     \
 605                 vis_FourByteAbgrPre.c     \
 606                 vis_GlyphList.c           \
 607                 vis_GlyphListXor.c        \
 608                 vis_IntArgbBm.c           \
 609                 vis_ThreeByteBgr.c        \
 610                 vis_UshortGray.c          \
 611                 vis_UshortGray_FromRgb.c  \
 612                 vis_XorBlit.c             \
 613                 mlib_v_ImageCopy_blk.s
 614 
 615         ifeq ($(OPENJDK_TARGET_CPU),sparcv9)
 616                 LIBAWT_ASFLAGS=-P -xarch=v9a
 617         else
 618                 LIBAWT_ASFLAGS=-P -xarch=v8plusa
 619         endif
 620 else
 621         LIBAWT_FILES += MapAccelFunc.c
 622 endif
 623 
 624 ifneq ($(OPENJDK_TARGET_OS),solaris)
 625         LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
 626 endif
 627 
 628 LIBAWT_LANG:=C
 629 
 630 ifeq ($(OPENJDK_TARGET_OS),windows)
 631         LIBAWT_FILES += AccelGlyphCache.c \
 632                         ShaderList.c \
 633                         CmdIDList.cpp \
 634                         Hashtable.cpp \
 635                         GDIHashtable.cpp \
 636                         Devices.cpp \
 637                         ObjectList.cpp \
 638                         GDIBlitLoops.cpp \
 639                         GDIRenderer.cpp \
 640                         GDIWindowSurfaceData.cpp \
 641                         WindowsFlags.cpp \
 642                         WPrinterJob.cpp \
 643                         awt_%.cpp \
 644                         D3DBlitLoops.cpp \
 645                         D3DBufImgOps.cpp \
 646                         D3DContext.cpp \
 647                         D3DGlyphCache.cpp \
 648                         D3DGraphicsDevice.cpp \
 649                         D3DMaskBlit.cpp \
 650                         D3DMaskCache.cpp \
 651                         D3DMaskFill.cpp \
 652                         D3DPipelineManager.cpp \
 653                         D3DPaints.cpp \
 654                         D3DRenderer.cpp \
 655                         D3DRenderQueue.cpp \
 656                         D3DResourceManager.cpp \
 657                         D3DSurfaceData.cpp \
 658                         D3DTextRenderer.cpp \
 659                         D3DVertexCacher.cpp \
 660                         ShellFolder2.cpp \
 661                         ThemeReader.cpp \
 662                         ComCtl32Util.cpp \
 663                         DllUtil.cpp \
 664                         initIDs.cpp \
 665                         MouseInfo.cpp \
 666                         rect.c \
 667                         OGLBlitLoops.c \
 668                         OGLBufImgOps.c \
 669                         OGLContext.c \
 670                         OGLFuncs.c \
 671                         OGLMaskBlit.c \
 672                         OGLMaskFill.c \
 673                         OGLPaints.c \
 674                         OGLRenderQueue.c \
 675                         OGLRenderer.c \
 676                         OGLSurfaceData.c \
 677                         OGLTextRenderer.c \
 678                         OGLVertexCache.c \
 679                         WGLGraphicsConfig.c \
 680                         WGLSurfaceData.c
 681         LIBAWT_LANG:=C++
 682         LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
 683         ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
 684                 LIBAWT_CFLAGS += -DMLIB_OS64BIT
 685         endif
 686 
 687         ifdef OPENJDK
 688                 LIBAWT_RC_FLAGS:=-i "$(JDK_TOPDIR)/src/windows/resource/icons"
 689         else
 690                 LIBAWT_RC_FLAGS:=-i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
 691         endif
 692         LIBAWT_VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/native/sun/windows/awt.rc
 693 endif
 694 
 695 ifeq ($(MILESTONE), internal)
 696         LIBAWT_CFLAGS += -DINTERNAL_BUILD
 697 endif
 698 
 699 LIBAWT_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt/mapfile-vers
 700 ifeq ($(OPENJDK_TARGET_OS),linux)
 701         LIBAWT_MAPFILE:=
 702 endif
 703 
 704 $(eval $(call SetupNativeCompilation,BUILD_LIBAWT,\
 705                 LIBRARY:=awt,\
 706                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 707                 SRC:=$(LIBAWT_DIRS),\
 708                 INCLUDE_FILES:=$(LIBAWT_FILES),\
 709                 LANG:=$(LIBAWT_LANG),\
 710                 OPTIMIZATION:=LOW, \
 711                 CFLAGS:=$(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS),\
 712                 ASFLAGS:=$(LIBAWT_ASFLAGS),\
 713                 MAPFILE:=$(LIBAWT_MAPFILE), \
 714                 LDFLAGS:=$(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN),\
 715                 LDFLAGS_solaris:=-R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR),\
 716                 LDFLAGS_SUFFIX_linux:=-ljvm $(LIBM) $(LIBDL) -ljava,\
 717                 LDFLAGS_SUFFIX_solaris:=-ljvm $(LIBM) $(LIBDL) -ljava -lc,\
 718                 LDFLAGS_SUFFIX_macosx:=-lmlib_image -ljvm $(LIBM) \
 719                                        -framework Cocoa \
 720                                        -framework OpenGL \
 721                                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
 722                                        -framework JavaNativeFoundation \
 723                                        -framework JavaRuntimeSupport \
 724                                        -framework ApplicationServices \
 725                                        -framework AudioToolbox \
 726                                        -ljava,\
 727                 LDFLAGS_SUFFIX_windows:=kernel32.lib user32.lib gdi32.lib winspool.lib \
 728                                         imm32.lib ole32.lib uuid.lib shell32.lib \
 729                                         comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
 730                                         delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib \
 731                                         -DELAYLOAD:user32.dll -DELAYLOAD:gdi32.dll \
 732                                         -DELAYLOAD:shell32.dll -DELAYLOAD:winmm.dll \
 733                                         -DELAYLOAD:winspool.drv -DELAYLOAD:imm32.dll \
 734                                         -DELAYLOAD:ole32.dll -DELAYLOAD:comdlg32.dll \
 735                                         -DELAYLOAD:comctl32.dll -DELAYLOAD:shlwapi.dll,\
 736                 VERSIONINFO_RESOURCE:=$(LIBAWT_VERSIONINFO_RESOURCE),\
 737                 RC_FLAGS:=$(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
 738                           -D "JDK_FNAME=awt.dll" \
 739                           -D "JDK_INTERNAL_NAME=awt" \
 740                           -D "JDK_FTYPE=0x2L",\
 741                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt,\
 742                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
 743 
 744 $(BUILD_LIBAWT) : $(BUILD_LIBJAVA)
 745 
 746 ifeq ($(OPENJDK_TARGET_OS), macosx)
 747 $(BUILD_LIBAWT) : $(BUILD_LIBMLIB_IMAGE)
 748 endif
 749 
 750 BUILD_LIBRARIES += $(BUILD_LIBAWT)
 751 
 752 ##########################################################################################
 753 
 754 # TODO!!
 755 # Even though this variable as a general name, it is
 756 # only used on macos, in fontpath.c, as prefix for where to find fonts.
 757 #
 758 # It's used for libawt_headless _and_ libawt_xawt
 759 #
 760 X11_PATH:=/usr/X11R6
 761 
 762 ifneq ($(OPENJDK_TARGET_OS), windows)
 763 ifndef BUILD_HEADLESS_ONLY
 764 
 765 LIBAWT_XAWT_DIRS:=\
 766                 $(JDK_TOPDIR)/src/share/native/sun/awt/debug \
 767                 $(JDK_TOPDIR)/src/share/native/sun/awt/utility \
 768                 $(JDK_TOPDIR)/src/share/native/sun/font \
 769                 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
 770                 $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
 771                 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
 772                 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
 773                 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 \
 774                 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/xawt \
 775 
 776 LIBAWT_XAWT_CFLAGS:=-DXAWT -DXAWT_HACK \
 777         -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
 778         $(CUPS_CFLAGS) \
 779         $(foreach dir,$(LIBAWT_XAWT_DIRS),-I$(dir)) \
 780         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
 781         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
 782         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
 783         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
 784         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
 785         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
 786         -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
 787         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga
 788 
 789 ifeq ($(OPENJDK_TARGET_OS),solaris)
 790         LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
 791 endif
 792 
 793 ifeq ($(MILESTONE),internal)
 794         LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
 795 endif
 796 
 797 LIBAWT_XAWT_FILES:=\
 798         XlibWrapper.c \
 799         XWindow.c \
 800         XToolkit.c \
 801         X11Color.c \
 802         X11SurfaceData.c \
 803         awt_GraphicsEnv.c \
 804         awt_InputMethod.c \
 805         robot_common.c \
 806         awt_Robot.c \
 807         list.c \
 808         multiVis.c \
 809         initIDs.c \
 810         awt_util.c \
 811         awt_Desktop.c \
 812         awt_UNIXToolkit.c \
 813         X11FontScaler_md.c \
 814         X11TextRenderer_md.c \
 815         fontpath.c \
 816         awt_Insets.c \
 817         awt_Event.c \
 818         X11Renderer.c \
 819         X11PMBlitLoops.c \
 820         OGLBlitLoops.c \
 821         OGLBufImgOps.c \
 822         OGLContext.c \
 823         OGLFuncs.c \
 824         OGLMaskBlit.c \
 825         OGLMaskFill.c \
 826         OGLPaints.c \
 827         OGLRenderQueue.c \
 828         OGLRenderer.c \
 829         OGLSurfaceData.c \
 830         OGLTextRenderer.c \
 831         OGLVertexCache.c \
 832         GLXGraphicsConfig.c \
 833         GLXSurfaceData.c \
 834         AccelGlyphCache.c \
 835         awt_Font.c \
 836         multi_font.c \
 837         awt_AWTEvent.c \
 838         awt_DrawingSurface.c \
 839         jawt.c \
 840         CUPSfuncs.c \
 841         debug_assert.c \
 842         debug_mem.c \
 843         debug_trace.c \
 844         debug_util.c \
 845         awt_Plugin.c \
 846         gnome_interface.c \
 847         gtk2_interface.c \
 848         swing_GTKEngine.c \
 849         swing_GTKStyle.c \
 850         rect.c \
 851         sun_awt_X11_GtkFileDialogPeer.c \
 852         XRSurfaceData.c \
 853         XRBackendNative.c
 854 
 855 LIBAWT_XAWT_LDFLAGS_SUFFIX:=$(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi  -ljava -ljvm -lc
 856 
 857 ifeq ($(OPENJDK_TARGET_OS), linux)
 858         # To match old build, add this to LDFLAGS instead of suffix.
 859         LIBAWT_XAWT_LDFLAGS += -lpthread
 860 endif
 861 
 862 ifeq ($(OPENJDK_TARGET_OS), macosx)
 863         LIBAWT_XAWT_LDFLAGS_SUFFIX += -lpthread
 864 endif
 865 
 866 # On macosx, the shared library origin is set twice for this lib.
 867 $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT,\
 868                 LIBRARY:=awt_xawt,\
 869                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 870                 SRC:=$(LIBAWT_XAWT_DIRS),\
 871                 INCLUDE_FILES:=$(LIBAWT_XAWT_FILES),\
 872                 LANG:=C,\
 873                 OPTIMIZATION:=LOW, \
 874                 CFLAGS:=$(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
 875                         $(X_CFLAGS),\
 876                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt_xawt/mapfile-vers, \
 877                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
 878                          $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS),\
 879                 LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_ORIGIN) \
 880                                $(call SET_SHARED_LIBRARY_ORIGIN,/..),\
 881                 LDFLAGS_solaris:=-L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
 882                                  -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
 883                                  -R$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
 884                                  -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
 885                                  -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
 886                                  $(call SET_SHARED_LIBRARY_ORIGIN) \
 887                                  $(call SET_SHARED_LIBRARY_ORIGIN,/..),\
 888                 LDFLAGS_macosx:=$(call SET_SHARED_LIBRARY_ORIGIN) \
 889                                 $(call SET_SHARED_LIBRARY_ORIGIN). \
 890                                 $(call SET_SHARED_LIBRARY_ORIGIN) \
 891                                 $(call SET_SHARED_LIBRARY_ORIGIN).,\
 892                 LDFLAGS_SUFFIX:=$(LIBAWT_XAWT_LDFLAGS_SUFFIX),\
 893                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 894                 RC_FLAGS:=$(RC_FLAGS)\
 895                           -D "JDK_FNAME=xawt.dll" \
 896                           -D "JDK_INTERNAL_NAME=xawt" \
 897                           -D "JDK_FTYPE=0x2L",\
 898                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_xawt))
 899 
 900 $(BUILD_LIBAWT_XAWT) : $(BUILD_LIBJAVA)
 901 
 902 $(BUILD_LIBAWT_XAWT) : $(BUILD_LIBAWT)
 903 
 904 BUILD_LIBRARIES += $(BUILD_LIBAWT_XAWT)
 905 
 906 endif
 907 endif
 908 
 909 ##########################################################################################
 910 
 911 BUILD_LIBZIP_EXCLUDES :=
 912 ifeq ($(USE_EXTERNAL_LIBZ),true)
 913     LIBZ := -lz
 914     LIBZIP_EXCLUDES += zlib-1.2.5
 915 else
 916     ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
 917 endif
 918 
 919 BUILD_LIBZIP_REORDER :=
 920 ifeq ($(OPENJDK_TARGET_OS), solaris)
 921     ifneq ($(OPENJDK_TARGET_CPU), x86_64)
 922         BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU)
 923     endif
 924 endif
 925 
 926 ifeq ($(LIBZIP_CAN_USE_MMAP), true)
 927      BUILD_LIBZIP_MMAP := -DUSE_MMAP
 928 endif
 929 
 930 $(eval $(call SetupNativeCompilation,BUILD_LIBZIP,\
 931                 LIBRARY:=zip,\
 932                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 933                 LANG:=C,\
 934                 OPTIMIZATION:=LOW, \
 935                 SRC:=$(JDK_TOPDIR)/src/share/native/java/util/zip,\
 936                 EXCLUDES:=$(LIBZIP_EXCLUDES),\
 937                 CFLAGS:=$(CFLAGS_JDKLIB) \
 938                         $(ZLIB_CPPFLAGS) \
 939                         -I$(JDK_TOPDIR)/src/share/native/java/io \
 940                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io,\
 941                 CFLAGS_posix:=$(BUILD_LIBZIP_MMAP) -UDEBUG,\
 942                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libzip/mapfile-vers, \
 943                 REORDER:=$(BUILD_LIBZIP_REORDER), \
 944                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
 945                          $(call SET_SHARED_LIBRARY_ORIGIN) \
 946                          $(EXPORT_ZIP_FUNCS), \
 947                 LDFLAGS_windows:=-export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
 948                                 -export:ZIP_ReadEntry -export:ZIP_GetNextEntry jvm.lib \
 949                                 $(WIN_JAVA_LIB),\
 950                 LDFLAGS_SUFFIX_linux:=-ljvm -ljava $(LIBZ),\
 951                 LDFLAGS_SUFFIX_solaris:=-ljvm -ljava $(LIBZ) -lc,\
 952                 LDFLAGS_SUFFIX_macosx:=$(LIBZ) -ljava -ljvm,\
 953                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 954                 RC_FLAGS:=$(RC_FLAGS)\
 955                           -D "JDK_FNAME=zip.dll" \
 956                           -D "JDK_INTERNAL_NAME=zip" \
 957                           -D "JDK_FTYPE=0x2L",\
 958                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libzip,\
 959                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
 960 
 961 $(BUILD_LIBZIP) : $(BUILD_LIBJAVA)
 962 
 963 BUILD_LIBRARIES += $(BUILD_LIBZIP)
 964 
 965 ##########################################################################################
 966 
 967 $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK,\
 968                 LIBRARY:=unpack, \
 969                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 970                 SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
 971                 EXCLUDE_FILES:=main.cpp,\
 972                 LANG:=C++,\
 973                 OPTIMIZATION:=LOW, \
 974                 CFLAGS:=$(CXXFLAGS_JDKLIB) \
 975                          -DNO_ZLIB -DUNPACK_JNI -DFULL,\
 976                 CFLAGS_release:=-DPRODUCT,\
 977                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers, \
 978                 LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
 979                          $(call SET_SHARED_LIBRARY_ORIGIN),\
 980                 LDFLAGS_windows:=-map:$(JDK_OUTPUTDIR)/objs/unpack.map -debug \
 981                                 jvm.lib $(WIN_JAVA_LIB),\
 982                 LDFLAGS_SUFFIX_posix:=-ljvm $(LIBCXX) -ljava -lc,\
 983                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libunpack,\
 984                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 985                 RC_FLAGS:=$(RC_FLAGS)\
 986                           -D "JDK_FNAME=unpack.dll" \
 987                           -D "JDK_INTERNAL_NAME=unpack" \
 988                           -D "JDK_FTYPE=0x2L",\
 989                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
 990 
 991 $(BUILD_LIBUNPACK) : $(BUILD_LIBJAVA)
 992 
 993 BUILD_LIBRARIES += $(BUILD_LIBUNPACK)
 994 
 995 ifeq ($(OPENJDK_TARGET_OS),windows)
 996     $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(BUILD_LIBUNPACK)
 997         $(ECHO) Copying $(@F)
 998         $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.map,$<) $@
 999 
1000     $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(BUILD_LIBUNPACK)
1001         $(ECHO) Copying $(@F)
1002         $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.pdb,$<) $@
1003 endif
1004 
1005 ##########################################################################################
1006 
1007 LIBATTACH_EXCLUDE_FILES:=
1008 ifneq ($(OPENJDK_TARGET_OS),solaris)
1009     LIBATTACH_EXCLUDE_FILES+=SolarisVirtualMachine.c
1010 endif
1011 ifneq ($(OPENJDK_TARGET_OS),linux)
1012     LIBATTACH_EXCLUDE_FILES+=LinuxVirtualMachine.c
1013 endif
1014 ifneq ($(OPENJDK_TARGET_OS),macosx)
1015     LIBATTACH_EXCLUDE_FILES+=BsdVirtualMachine.c
1016 endif
1017 
1018 $(eval $(call SetupNativeCompilation,BUILD_LIBATTACH,\
1019                 LIBRARY:=attach, \
1020                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1021                 SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tools/attach,\
1022                 EXCLUDE_FILES:=$(LIBATTACH_EXCLUDE_FILES),\
1023                 LANG:=C,\
1024                 OPTIMIZATION:=LOW, \
1025                 CFLAGS:=$(CFLAGS_JDKLIB),\
1026                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libattach/mapfile-$(OPENJDK_TARGET_OS), \
1027                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1028                 RC_FLAGS:=$(RC_FLAGS) \
1029                           -D "JDK_FNAME=attach.dll" \
1030                           -D "JDK_INTERNAL_NAME=attach" \
1031                           -D "JDK_FTYPE=0x2L",\
1032                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1033                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1034                 LDFLAGS_solaris:=-ldoor,\
1035                 LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
1036                 LDFLAGS_SUFFIX_windows:=$(WIN_JAVA_LIB) advapi32.lib psapi.lib,\
1037                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libattach,\
1038                 DEBUG_SYMBOLS:=true))
1039 
1040 $(BUILD_LIBATTACH) : $(BUILD_LIBJAVA)
1041 
1042 BUILD_LIBRARIES += $(BUILD_LIBATTACH)
1043 
1044 ##########################################################################################
1045 
1046 $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET,\
1047                 LIBRARY:=dt_socket,\
1048                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1049                 SRC:=$(JDK_TOPDIR)/src/share/transport/socket \
1050                         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket,\
1051                 LANG:=C,\
1052                 OPTIMIZATION:=LOW, \
1053                 CFLAGS:=$(CFLAGS_JDKLIB) -DUSE_MMAP \
1054                         -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
1055                         -I$(JDK_TOPDIR)/src/share/transport/socket \
1056                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket \
1057                         -I$(JDK_TOPDIR)/src/share/back/export \
1058                         -I$(JDK_TOPDIR)/src/share/back,\
1059                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libdt_socket/mapfile-vers, \
1060                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1061                          $(call SET_SHARED_LIBRARY_ORIGIN), \
1062                 LDFLAGS_SUFFIX_linux:=-lpthread,\
1063                 LDFLAGS_SUFFIX_solaris:=-lnsl -lsocket -lc,\
1064                 LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX) -export:jdwpTransport_OnLoad ws2_32.lib,\
1065                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1066                 RC_FLAGS:=$(RC_FLAGS)\
1067                           -D "JDK_FNAME=dt_socket.dll" \
1068                           -D "JDK_INTERNAL_NAME=dt_socket" \
1069                           -D "JDK_FTYPE=0x2L",\
1070                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libdt_socket,\
1071                 DEBUG_SYMBOLS:=true))
1072 
1073 $(BUILD_LIBDT_SOCKET) : $(BUILD_LIBJAVA)
1074 
1075 BUILD_LIBRARIES += $(BUILD_LIBDT_SOCKET)
1076 
1077 ##########################################################################################
1078 
1079 ifeq ($(OPENJDK_TARGET_OS),windows)
1080 
1081   $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SHMEM,\
1082                 LIBRARY:=dt_shmem,\
1083                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1084                 SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/tools/jdi \
1085                         $(JDK_TOPDIR)/src/share/transport/shmem \
1086                         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem,\
1087                 LANG:=C,\
1088                 OPTIMIZATION:=LOW, \
1089                 CFLAGS:=$(CFLAGS_JDKLIB) -DUSE_MMAP\
1090                         -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
1091                         -I$(JDK_TOPDIR)/src/share/transport/shmem \
1092                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem \
1093                         -I$(JDK_TOPDIR)/src/share/back/export, \
1094                 LDFLAGS:=$(LDFLAGS_JDKLIB),\
1095                 LDFLAGS_windows:=-export:jdwpTransport_OnLoad,\
1096                 LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
1097                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1098                 RC_FLAGS:=$(RC_FLAGS)\
1099                           -D "JDK_FNAME=dt_shmem.dll" \
1100                           -D "JDK_INTERNAL_NAME=dt_shmem" \
1101                           -D "JDK_FTYPE=0x2L",\
1102                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libdt_shmem,\
1103                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
1104 
1105   BUILD_LIBRARIES += $(BUILD_LIBDT_SHMEM)
1106 
1107 endif # OPENJDK_TARGET_OS
1108 
1109 ##########################################################################################
1110 # JDWP_LOGGING causes log messages to be compiled into the library.
1111 $(eval $(call SetupNativeCompilation,BUILD_LIBJDWP,\
1112                 LIBRARY:=jdwp, \
1113                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1114                 SRC:=$(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back,\
1115                 LANG:=C,\
1116                 OPTIMIZATION:=LOW, \
1117                 CFLAGS:=$(CFLAGS_JDKLIB) -DJDWP_LOGGING\
1118                  -I$(JDK_TOPDIR)/src/share/transport/export \
1119                  -I$(JDK_TOPDIR)/src/share/back/export \
1120                  -I$(JDK_TOPDIR)/src/share/npt \
1121                  -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
1122                  -I$(JDK_TOPDIR)/src/share/back \
1123                  -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back \
1124                  -I$(JDK_OUTPUTDIR)/gensrc_jdwp_headers,\
1125                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjdwp/mapfile-vers, \
1126                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1127                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1128                 LDFLAGS_SUFFIX_linux:=$(LIBDL),\
1129                 LDFLAGS_SUFFIX_solaris:=$(LIBDL) -lc,\
1130                 LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX),\
1131                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1132                 RC_FLAGS:=$(RC_FLAGS)\
1133                           -D "JDK_FNAME=jdwp.dll" \
1134                           -D "JDK_INTERNAL_NAME=jdwp" \
1135                           -D "JDK_FTYPE=0x2L",\
1136                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjdwp,\
1137                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
1138 
1139 $(BUILD_LIBJDWP) : $(BUILD_LIBJAVA)
1140 
1141 BUILD_LIBRARIES += $(BUILD_LIBJDWP)
1142 
1143 ##########################################################################################
1144 
1145 LIBJAAS_MAPFILE:=
1146 ifneq ($(OPENJDK_TARGET_OS),solaris)
1147    LIBJAAS_EXCLUDE_FILES:=Solaris.c
1148 else
1149    # only on solaris...wonder why
1150    LIBJAAS_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjaas/mapfile-vers
1151 endif
1152 
1153 LIBJAAS_NAME:=jaas_unix
1154 ifeq ($(OPENJDK_TARGET_OS), windows)
1155      LIBJAAS_NAME:=jaas_nt
1156 endif
1157 
1158 $(eval $(call SetupNativeCompilation,BUILD_LIBJAAS,\
1159                 LIBRARY:=$(LIBJAAS_NAME),\
1160                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1161                 SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/security/auth/module,\
1162                 LANG:=C,\
1163                 OPTIMIZATION:=LOW, \
1164                 CFLAGS:=$(CFLAGS_JDKLIB),\
1165                 MAPFILE:=$(LIBJAAS_MAPFILE),\
1166                 LDFLAGS:=$(filter-out -ljava,$(LDFLAGS_JDKLIB)) \
1167                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1168                 LDFLAGS_windows:=netapi32.lib user32.lib mpr.lib advapi32.lib,\
1169                 LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX),\
1170                 LDFLAGS_SUFFIX_solaris:=-lc,\
1171                 EXCLUDE_FILES:=$(LIBJAAS_EXCLUDE_FILES),\
1172                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1173                 RC_FLAGS:=$(RC_FLAGS) \
1174                           -D "JDK_FNAME=$(LIBJAAS_NAME).dll" \
1175                           -D "JDK_INTERNAL_NAME=$(LIBJAAS_NAME)" \
1176                           -D "JDK_FTYPE=0x2L",\
1177                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjaas,\
1178                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
1179 
1180 $(BUILD_LIBJAAS) : $(BUILD_LIBJAVA)
1181 
1182 BUILD_LIBRARIES += $(BUILD_LIBJAAS)
1183 
1184 ##########################################################################################
1185 
1186 $(eval $(call SetupNativeCompilation,BUILD_LIBJSDT,\
1187                 LIBRARY:=jsdt,\
1188                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1189                 SRC:=$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace\
1190                         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tracing/dtrace,\
1191                 LANG:=C,\
1192                 OPTIMIZATION:=LOW, \
1193                 CFLAGS:=$(CFLAGS_JDKLIB)\
1194                         -I$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace,\
1195                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsdt/mapfile-vers, \
1196                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1197                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1198                 LDFLAGS_SUFFIX_linux:=$(LIBDL),\
1199                 LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL),\
1200                 LDFLAGS_SUFFIX_macosx:=                         $(LIBDL),\
1201                 LDFLAGS_SUFFIX_solaris:=-lc,\
1202                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1203                 RC_FLAGS:=$(RC_FLAGS)\
1204                           -D "JDK_FNAME=jsdt.dll" \
1205                           -D "JDK_INTERNAL_NAME=jsdt" \
1206                           -D "JDK_FTYPE=0x2L",\
1207                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsdt, \
1208                 DEBUG_SYMBOLS:=true))
1209 
1210 $(BUILD_LIBJSDT) : $(BUILD_LIBJAVA)
1211 
1212 BUILD_LIBRARIES += $(BUILD_LIBJSDT)
1213 
1214 ##########################################################################################
1215 
1216 ifdef OPENJDK
1217     # TODO: Update awt lib path when awt is converted
1218     $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS,\
1219                 LIBRARY:=lcms,\
1220                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1221                 SRC:=$(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms,\
1222                 LANG:=C,\
1223                 OPTIMIZATION:=HIGHEST, \
1224                 CFLAGS:=$(filter-out -xc99=%none,$(CFLAGS_JDKLIB)) \
1225                         $(SHARED_LIBRARY_FLAGS) \
1226                         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
1227                         -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug,\
1228                 CFLAGS_solaris:=-xc99=no_lib,\
1229                 CFLAGS_windows:=-DCMS_IS_WINDOWS_,\
1230                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/liblcms/mapfile-vers, \
1231                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1232                          $(call SET_SHARED_LIBRARY_ORIGIN), \
1233                 LDFLAGS_solaris:=/usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2,\
1234                 LDFLAGS_windows:=$(WIN_AWT_LIB) $(WIN_JAVA_LIB),\
1235                 LDFLAGS_SUFFIX_solaris:=-lawt -ljava -ljvm -lc,\
1236                 LDFLAGS_SUFFIX_macosx:=$(LIBM) -lawt -ljava -ljvm,\
1237                 LDFLAGS_SUFFIX_linux:=-lm -lawt -ljava -ljvm,\
1238                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1239                 RC_FLAGS:=$(RC_FLAGS)\
1240                           -D "JDK_FNAME=lcms.dll" \
1241                           -D "JDK_INTERNAL_NAME=lcms" \
1242                           -D "JDK_FTYPE=0x2L",\
1243                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/liblcms,\
1244                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
1245 
1246     BUILD_LIBRARIES += $(BUILD_LIBLCMS)
1247 
1248     $(BUILD_LIBLCMS) : $(BUILD_LIBAWT)
1249 endif
1250 
1251 ##########################################################################################
1252 
1253 ifdef OPENJDK
1254     BUILD_LIBJPEG_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers
1255 else
1256     BUILD_LIBJPEG_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers-closed
1257     BUILD_LIBJPEG_CLOSED_SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
1258     BUILD_LIBJPEG_CLOSED_INCLUDES:=-I$(BUILD_LIBJPEG_CLOSED_SRC)
1259 endif
1260 
1261 BUILD_LIBJPEG_REORDER:=
1262 ifeq ($(OPENJDK_TARGET_OS), solaris)
1263     ifneq ($(OPENJDK_TARGET_CPU), x86_64)
1264         BUILD_LIBJPEG_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
1265     endif
1266 endif
1267 
1268 # Suppress gcc warnings like "variable might be clobbered by 'longjmp'
1269 # or 'vfork'": this warning indicates that some variable is placed to
1270 # a register by optimized compiler and it's value might be lost on longjmp().
1271 # Recommended way to avoid such warning is to declare the variable as
1272 # volatile to prevent the optimization. However, this approach does not
1273 # work because we have to declare all variables as volatile in result.
1274 #ifndef CROSS_COMPILE_ARCH
1275 #    CC_43_OR_NEWER:=\
1276 #        $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
1277 #              \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
1278 #    ifeq ($(CC_43_OR_NEWER),1)
1279 #        BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
1280 #    endif
1281 #endif
1282 
1283 $(eval $(call SetupNativeCompilation,BUILD_LIBJPEG,\
1284                 LIBRARY:=jpeg, \
1285                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1286                 SRC:=$(BUILD_LIBJPEG_CLOSED_SRC) \
1287                      $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\
1288                 LANG:=C,\
1289                 OPTIMIZATION:=HIGHEST, \
1290                 CFLAGS:=$(CFLAGS_JDKLIB) \
1291                         $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
1292                         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\
1293                 MAPFILE:=$(BUILD_LIBJPEG_MAPFILE), \
1294                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1295                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1296                 LDFLAGS_windows:=$(WIN_JAVA_LIB) jvm.lib,\
1297                 LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
1298                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1299                 RC_FLAGS:=$(RC_FLAGS)\
1300                           -D "JDK_FNAME=jpeg.dll" \
1301                           -D "JDK_INTERNAL_NAME=jpeg" \
1302                           -D "JDK_FTYPE=0x2L",\
1303                 REORDER:=$(BUILD_LIBJPEG_REORDER),\
1304                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjpeg,\
1305                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
1306 
1307 $(BUILD_LIBJPEG) : $(BUILD_LIBJAVA)
1308 
1309 BUILD_LIBRARIES += $(BUILD_LIBJPEG)
1310 
1311 ##########################################################################################
1312 
1313 ifndef OPENJDK
1314     FONT_HEADERS:=-I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k
1315     BUILD_LIBFONTMANAGER_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers
1316     LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
1317 else
1318     FONT_HEADERS:=$(FREETYPE2_CFLAGS)
1319     BUILD_LIBFONTMANAGER_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk
1320     BUILD_LIBFONTMANAGER_FONTLIB:=$(FREETYPE2_LIBS)
1321 endif
1322 
1323 LIBFONTMANAGER_OPTIMIZATION:=HIGH
1324 
1325 ifeq ($(OPENJDK_TARGET_OS),windows)
1326     LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
1327                                     X11TextRenderer.c
1328     LIBFONTMANAGER_OPTIMIZATION:=LOW
1329 else
1330     LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
1331                                     lcdglyph.c
1332 endif
1333 
1334 BUILD_LIBFONTMANAGER_CFLAGS_COMMON:=\
1335                         $(X_CFLAGS) \
1336                         -DLE_STANDALONE -DHEADLESS \
1337                         $(FONT_HEADERS) \
1338                         -I$(JDK_TOPDIR)/src/share/native/sun/font \
1339                         -I$(JDK_TOPDIR)/src/share/native/sun/font/layout \
1340                         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
1341                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
1342                         -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
1343                         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
1344                         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
1345                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
1346                         -I$(JDK_TOPDIR)/src/share/native/sun/java2d
1347 
1348 # Turn off aliasing with GCC for ExtensionSubtables.cpp
1349 ifeq ($(OPENJDK_TARGET_OS), linux)
1350     BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS:=-fno-strict-aliasing
1351 endif
1352 
1353 $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER,\
1354                 LIBRARY:=fontmanager, \
1355                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1356                 SRC:=$(JDK_TOPDIR)/src/share/native/sun/font\
1357                      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font,\
1358                 EXCLUDE_FILES:=$(LIBFONTMANAGER_EXCLUDE_FILES) \
1359                                AccelGlyphCache.c,\
1360                 LANG:=C++,\
1361                 CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON),\
1362                 CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON),\
1363                 OPTIMIZATION:=$(LIBFONTMANAGER_OPTIMIZATION), \
1364                 CFLAGS_windows= -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
1365                                 -DCC_NOEX, \
1366                 MAPFILE:=$(BUILD_LIBFONTMANAGER_MAPFILE), \
1367                 LDFLAGS:=$(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
1368                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1369                 LDFLAGS_SUFFIX:=$(BUILD_LIBFONTMANAGER_FONTLIB),\
1370                 LDFLAGS_SUFFIX_linux:=-lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc,\
1371                 LDFLAGS_SUFFIX_solaris:=-lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm,\
1372                 LDFLAGS_SUFFIX_macosx:=-lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
1373                                        -ljava -ljvm,\
1374                 LDFLAGS_SUFFIX_windows:=$(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
1375                                         $(WIN_AWT_LIB),\
1376                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1377                 RC_FLAGS:=$(RC_FLAGS)\
1378                           -D "JDK_FNAME=fontmanager.dll" \
1379                           -D "JDK_INTERNAL_NAME=fontmanager" \
1380                           -D "JDK_FTYPE=0x2L",\
1381                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfontmanager,\
1382                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
1383 
1384 $(BUILD_LIBFONTMANAGER) : $(BUILD_LIBAWT)
1385 
1386 ifneq (,$(findstring $(OPENJDK_TARGET_OS),solaris macosx))
1387 $(BUILD_LIBFONTMANAGER) : $(BUILD_LIBAWT_XAWT)
1388 endif
1389 
1390 BUILD_LIBRARIES += $(BUILD_LIBFONTMANAGER)
1391 
1392 ##########################################################################################
1393 
1394 ifndef OPENJDK
1395 
1396 #    ifeq ($(OPENJDK_TARGET_OS), linux)
1397 #        ifeq ("$(CC_VER_MAJOR)", "3")
1398 #            OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
1399 #        endif                           
1400 #    endif
1401 #
1402 # The resulting size of the t2k lib file is (at least on linux) dependant on the order of 
1403 # the input .o files. Because of this the new build will differ in size to the old build.
1404     BUILD_LIBT2K_CFLAGS_COMMON:=-I$(JDK_TOPDIR)/src/share/native/sun/font \
1405                             -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
1406                             -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \
1407                             -I$(JDK_TOPDIR)/src/share/share/native/sun/font \
1408                             -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
1409                             -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
1410                             -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
1411                             -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
1412                             -I$(JDK_TOPDIR)/src/share/native/sun/java2d
1413 
1414     $(eval $(call SetupNativeCompilation,BUILD_LIBT2K,\
1415                 LIBRARY:=t2k, \
1416                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1417                 SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/font \
1418                      $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
1419                      $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints,\
1420                 EXCLUDE_FILES:=orion.c,\
1421                 LANG:=C++,\
1422                 OPTIMIZATION:=HIGH, \
1423                 CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON),\
1424                 CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON),\
1425                 CFLAGS_windows=-DCC_NOEX, \
1426                 CXXFLAGS_windows=-DCC_NOEX, \
1427                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libt2k/mapfile-vers, \
1428                 LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
1429                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1430                 LDFLAGS_windows:=user32.lib $(JDK_OUTPUTDIR)/objs/libfontmanager/fontmanager.lib,\
1431                 LDFLAGS_SUFFIX_posix:=$(LIBM) $(LIBCXX) -lfontmanager -ljava -ljvm -lc,\
1432                 LDFLAGS_SUFFIX_solaris:=-lawt -lawt_xawt,\
1433                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1434                 RC_FLAGS:=$(RC_FLAGS)\
1435                           -D "JDK_FNAME=t2k.dll" \
1436                           -D "JDK_INTERNAL_NAME=t2k" \
1437                           -D "JDK_FTYPE=0x2L",\
1438                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libt2k,\
1439                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
1440 
1441     # t2k is linked against fontmanager
1442     $(BUILD_LIBT2K) : $(BUILD_LIBFONTMANAGER)
1443 
1444     BUILD_LIBRARIES += $(BUILD_LIBT2K)
1445 endif
1446 
1447 ##########################################################################################
1448 
1449 ifeq ($(OPENJDK_TARGET_OS), windows)
1450     ifeq ($(OPENJDK_TARGET_CPU), x86)
1451         KERNEL32_LIB:=kernel32.lib
1452     endif
1453     $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT,\
1454                 LIBRARY:=jawt, \
1455                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1456                 SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows,\
1457                 INCLUDE_FILES:=jawt.cpp,\
1458                 LANG:=C++,\
1459                 OPTIMIZATION:=LOW, \
1460                 CFLAGS:=$(CXXFLAGS_JDKLIB) \
1461                         -EHsc -DUNICODE -D_UNICODE \
1462                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
1463                         -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
1464                         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
1465                         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
1466                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \
1467                         -I$(DXSDK_INCLUDE_PATH), \
1468                 LDFLAGS:=$(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \
1469                          advapi32.lib $(WIN_AWT_LIB),\
1470                 LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
1471                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1472                 RC_FLAGS:=$(RC_FLAGS)\
1473                           -D "JDK_FNAME=jawt.dll" \
1474                           -D "JDK_INTERNAL_NAME=jawt" \
1475                           -D "JDK_FTYPE=0x2L",\
1476                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjawt,\
1477                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
1478 
1479 $(BUILD_LIBJAWT) : $(BUILD_LIBAWT)
1480 
1481 $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
1482         $(ECHO) Copying $(@F)
1483         $(CP) $(JDK_OUTPUTDIR)/objs/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
1484 
1485 BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
1486 
1487 else # OPENJDK_TARGET_OS not windows
1488 
1489     JAWT_LIBS:=
1490     ifneq ($(OPENJDK_TARGET_OS), solaris)
1491         JAWT_LIBS += -lawt
1492     endif
1493 
1494     ifndef BUILD_HEADLESS_ONLY
1495         JAWT_LIBS += -lawt_xawt
1496     else
1497         JAWT_LIBS += -lawt_headless
1498         HEADLESS_CFLAG += -DHEADLESS
1499     endif
1500 
1501     JAWT_FILES:=jawt.c
1502     ifeq ($(OPENJDK_TARGET_OS), macosx)
1503         JAWT_FILES:=jawt.m
1504         JAWT_LIBS:=-lawt_lwawt
1505     endif
1506 
1507     $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT,\
1508                 LIBRARY:=jawt, \
1509                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1510                 SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
1511                      $(JDK_TOPDIR)/src/macosx/native/sun/awt,\
1512                 INCLUDE_FILES:=$(JAWT_FILES),\
1513                 LANG:=C,\
1514                 OPTIMIZATION:=LOW, \
1515                 CFLAGS:=$(CFLAGS_JDKLIB), \
1516                 CFLAGS_linux:=$(HEADLESS_CFLAG),\
1517                 CFLAGS_macosx:=-I$(JDK_TOPDIR)/src/solaris/native/sun/awt ,\
1518                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjawt/mapfile-vers, \
1519                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1520                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1521                 LDFLAGS_solaris:=-L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR),\
1522                 LDFLAGS_SUFFIX_linux:=$(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX),\
1523                 LDFLAGS_SUFFIX_solaris:=$(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender,\
1524                 LDFLAGS_SUFFIX_macosx:=-Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \
1525                                        -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX),\
1526                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjawt))
1527 
1528 ifndef BUILD_HEADLESS_ONLY
1529 $(BUILD_LIBJAWT) : $(BUILD_LIBAWT_XAWT)
1530 else
1531 $(BUILD_LIBJAWT) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
1532 endif
1533 
1534 ifeq ($(OPENJDK_TARGET_OS),macosx)
1535 $(BUILD_LIBJAWT) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
1536 endif
1537 
1538 endif # OPENJDK_TARGET_OS
1539 
1540 BUILD_LIBRARIES += $(BUILD_LIBJAWT)
1541 
1542 ##########################################################################################
1543 
1544 LIBINSTRUMENT_SRC   :=$(JDK_TOPDIR)/src/share/instrument \
1545                       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \
1546                       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument
1547 
1548 LIBINSTRUMENT_FILES :=\
1549         EncodingSupport.c \
1550         EncodingSupport_md.c \
1551         FileSystemSupport_md.c \
1552         InstrumentationImplNativeMethods.c \
1553         InvocationAdapter.c \
1554         JarFacade.c \
1555         JPLISAgent.c \
1556         JPLISAssert.c \
1557         JavaExceptions.c \
1558         PathCharsValidator.c \
1559         Reentrancy.c \
1560         Utilities.c \
1561         canonicalize_md.c
1562 
1563 LIBINSTRUMENT_DIR   :=$(JDK_OUTPUTDIR)/objs/libinstrument
1564 LIBINSTRUMENT_CFLAGS:=$(CFLAGS_JDKLIB) \
1565                       -I$(JDK_TOPDIR)/src/share/instrument \
1566                       -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument \
1567                       -I$(JDK_TOPDIR)/src/share/bin
1568 
1569 LIBINSTRUMENT_LDFLAGS:=
1570 LIBINSTRUMENT_LDFLAGS_SUFFIX:=
1571 
1572 ifeq ($(OPENJDK_TARGET_OS), windows)
1573     LIBINSTRUMENT_LDFLAGS += $(JDK_OUTPUTDIR)/objs/jli_static.lib $(WIN_JAVA_LIB) \
1574                                  -export:Agent_OnAttach advapi32.lib
1575     # Statically link the C runtime so that there are not dependencies on modules 
1576     # not on the search patch when invoked from the Windows system directory 
1577     # (or elsewhere).
1578     LIBINSTRUMENT_CFLAGS := $(filter-out -MD,$(LIBINSTRUMENT_CFLAGS))
1579     # equivalent of strcasecmp is stricmp on Windows
1580     LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
1581 endif
1582 
1583 $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT,\
1584                 LIBRARY:=instrument, \
1585                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1586                 SRC:=$(LIBINSTRUMENT_SRC),\
1587                 INCLUDE_FILES:=$(LIBINSTRUMENT_FILES),\
1588                 LANG:=C,\
1589                 OPTIMIZATION:=LOW, \
1590                 CFLAGS:=$(LIBINSTRUMENT_CFLAGS),\
1591                 CFLAGS_debug:=-DJPLIS_LOGGING,\
1592                 CFLAGS_release:=-DNO_JPLIS_LOGGING,\
1593                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libinstrument/mapfile-vers, \
1594                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1595                          $(call SET_SHARED_LIBRARY_ORIGIN) \
1596                          $(LIBINSTRUMENT_LDFLAGS),\
1597                 LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_ORIGIN,/jli),\
1598                 LDFLAGS_solaris:= $(call SET_SHARED_LIBRARY_ORIGIN,/jli),\
1599                 LDFLAGS_macosx:=-Xlinker -all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
1600                                 -framework Cocoa -framework Security -framework ApplicationServices,\
1601                 LDFLAGS_SUFFIX:=$(LIBINSTRUMENT_LDFLAGS_SUFFIX),\
1602                 LDFLAGS_SUFFIX_macosx:=-liconv $(LIBZ),\
1603                 LDFLAGS_SUFFIX_solaris:=$(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL) -lc,\
1604                 LDFLAGS_SUFFIX_linux:=$(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL),\
1605                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1606                 RC_FLAGS:=$(RC_FLAGS)\
1607                           -D "JDK_FNAME=instrument.dll" \
1608                           -D "JDK_INTERNAL_NAME=instrument" \
1609                           -D "JDK_FTYPE=0x2L",\
1610                 OBJECT_DIR:=$(LIBINSTRUMENT_DIR),\
1611                 DEBUG_SYMBOLS:=true))
1612 
1613 ifneq (,$(findstring $(OPENJDK_TARGET_OS), macosx windows))
1614 $(BUILD_LIBINSTRUMENT) : $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)
1615 else
1616 $(BUILD_LIBINSTRUMENT) : $(INSTALL_LIBRARIES_HERE)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)
1617 endif
1618 $(BUILD_LIBINSTRUMENT) : $(BUILD_LIBJAVA)
1619 
1620 BUILD_LIBRARIES += $(BUILD_LIBINSTRUMENT)
1621 
1622 ##########################################################################################
1623 
1624 BUILD_LIBMANAGEMENT_SRC:=$(JDK_TOPDIR)/src/share/native/sun/management \
1625                            $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/management \
1626                            $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/management
1627 
1628 BUILD_LIBMANAGEMENT_EXCLUDES:=
1629 
1630 BUILD_LIBMANAGEMENT_CFLAGS:=-I$(JDK_TOPDIR)/src/share/native/sun/management
1631 
1632 ifneq ($(OPENJDK_TARGET_OS), windows)
1633         BUILD_LIBMANAGEMENT_EXCLUDES += OperatingSystem_md.c
1634 else
1635         BUILD_LIBMANAGEMENT_EXCLUDES += UnixOperatingSystem_md.c
1636 endif
1637 
1638 ifneq ($(OPENJDK_TARGET_OS),solaris)
1639         BUILD_LIBMANAGEMENT_EXCLUDES += SolarisOperatingSystem.c
1640 endif
1641 
1642 ifneq ($(OPENJDK_TARGET_OS),linux)
1643         BUILD_LIBMANAGEMENT_EXCLUDES += LinuxOperatingSystem.c
1644 endif
1645 
1646 ifneq ($(OPENJDK_TARGET_OS),macosx)
1647         BUILD_LIBMANAGEMENT_EXCLUDES += MacosxOperatingSystem.c
1648 endif
1649 
1650 LIBMANAGEMENT_OPTIMIZATION:=HIGH
1651 ifneq ($(findstring $(OPENJDK_TARGET_OS),solaris linux),)
1652     ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
1653         LIBMANAGEMENT_OPTIMIZATION:=LOW
1654     endif
1655 endif
1656 
1657 $(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT,\
1658                 LIBRARY:=management,\
1659                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1660                 SRC:=$(BUILD_LIBMANAGEMENT_SRC),\
1661                 EXCLUDE_FILES:=$(BUILD_LIBMANAGEMENT_EXCLUDES),\
1662                 LANG:=C,\
1663                 OPTIMIZATION:=$(LIBMANAGEMENT_OPTIMIZATION), \
1664                 CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBMANAGEMENT_CFLAGS),\
1665                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libmanagement/mapfile-vers, \
1666                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1667                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1668                 LDFLAGS_solaris:=-lkstat,\
1669                 LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
1670                 LDFLAGS_SUFFIX_windows:=jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib,\
1671                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1672                 RC_FLAGS:=$(RC_FLAGS)\
1673                           -D "JDK_FNAME=management.dll" \
1674                           -D "JDK_INTERNAL_NAME=management" \
1675                           -D "JDK_FTYPE=0x2L",\
1676                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libmanagement,\
1677                 DEBUG_SYMBOLS:=true))
1678 
1679 $(BUILD_LIBMANAGEMENT) : $(BUILD_LIBJAVA)
1680 
1681 BUILD_LIBRARIES += $(BUILD_LIBMANAGEMENT)
1682 
1683 ##########################################################################################
1684 
1685 BUILD_LIBHPROF_SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/hprof $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/hprof
1686 BUILD_LIBHPROF_CFLAGS:=-I$(JDK_TOPDIR)/src/share/demo/jvmti/hprof \
1687                          -I$(JDK_TOPDIR)/src/share/npt \
1688                          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
1689                          -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo
1690 
1691 BUILD_LIBHPROF_LDFLAGS:=
1692 
1693 LIBHPROF_OPTIMIZATION:=HIGHEST
1694 ifneq ($(findstring $(OPENJDK_TARGET_OS),solaris linux),)
1695     ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
1696         LIBHPROF_OPTIMIZATION:=LOW
1697     endif
1698 endif
1699 
1700 $(eval $(call SetupNativeCompilation,BUILD_LIBHPROF,\
1701                 LIBRARY:=hprof, \
1702                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1703                 SRC:=$(BUILD_LIBHPROF_SRC),\
1704                 LANG:=C,\
1705                 OPTIMIZATION:=$(LIBHPROF_OPTIMIZATION), \
1706                 CFLAGS:=$(CFLAGS_JDKLIB) \
1707                          $(BUILD_LIBHPROF_CFLAGS),\
1708                 CFLAGS_debug:=-DHPROF_LOGGING,\
1709                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libhprof/mapfile-vers, \
1710                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1711                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1712                 LDFLAGS_windows:=wsock32.lib winmm.lib advapi32.lib,\
1713                 LDFLAGS_SUFFIX_linux:=$(LIBDL),\
1714                 LDFLAGS_SUFFIX_macosx:=$(LIBDL),\
1715                 LDFLAGS_SUFFIX_solaris:=-lsocket -lnsl $(LIBDL) -lc,\
1716                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1717                 RC_FLAGS:=$(RC_FLAGS)\
1718                           -D "JDK_FNAME=hprof.dll" \
1719                           -D "JDK_INTERNAL_NAME=hprof" \
1720                           -D "JDK_FTYPE=0x2L",\
1721                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libhprof_jvmti,\
1722                 DEBUG_SYMBOLS:=true))
1723 
1724 BUILD_LIBRARIES += $(BUILD_LIBHPROF)
1725 
1726 ##########################################################################################
1727 
1728 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA_CRW_DEMO,\
1729                 LIBRARY:=java_crw_demo, \
1730                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1731                 SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo,\
1732                 LANG:=C,\
1733                 OPTIMIZATION:=LOW, \
1734                 CFLAGS:=$(CFLAGS_JDKLIB) \
1735                         -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo,\
1736                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjava_crw_demo/mapfile-vers, \
1737                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1738                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1739                 LDFLAGS_SUFFIX_solaris:=-lc,\
1740                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1741                 RC_FLAGS:=$(RC_FLAGS)\
1742                           -D "JDK_FNAME=java_crw_demo.dll" \
1743                           -D "JDK_INTERNAL_NAME=java_crw_demo" \
1744                           -D "JDK_FTYPE=0x2L",\
1745                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjava_crw_demo,\
1746                 DEBUG_SYMBOLS:=true))
1747 
1748 BUILD_LIBRARIES += $(BUILD_LIBJAVA_CRW_DEMO)
1749 
1750 ##########################################################################################
1751 
1752 $(eval $(call SetupNativeCompilation,BUILD_LIBNPT,\
1753                 LIBRARY:=npt, \
1754                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1755                 SRC:=$(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt,\
1756                 LANG:=C,\
1757                 OPTIMIZATION:=LOW, \
1758                 CFLAGS:=$(CFLAGS_JDKLIB) \
1759                         -I$(JDK_TOPDIR)/src/share/npt \
1760                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt,\
1761                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnpt/mapfile-vers, \
1762                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1763                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1764                 LDFLAGS_macosx:=-liconv,\
1765                 LDFLAGS_SUFFIX_windows:=-export:nptInitialize -export:nptTerminate,\
1766                 LDFLAGS_SUFFIX_solaris:=-lc, \
1767                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1768                 RC_FLAGS:=$(RC_FLAGS)\
1769                           -D "JDK_FNAME=npt.dll" \
1770                           -D "JDK_INTERNAL_NAME=npt" \
1771                           -D "JDK_FTYPE=0x2L",\
1772                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libnpt,\
1773                 DEBUG_SYMBOLS:=true))
1774 
1775 BUILD_LIBRARIES += $(BUILD_LIBNPT)
1776 
1777 ##########################################################################################
1778 
1779 LIBNET_SRC_DIRS:=$(JDK_TOPDIR)/src/share/native/java/net \
1780                    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net \
1781                    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/dns \
1782                    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/spi
1783 
1784 ifeq ($(OPENJDK_TARGET_OS),windows)
1785     LIBNET_SRC_DIRS+=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/www/protocol/http/ntlm
1786 else
1787     LIBNET_SRC_DIRS+=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/sdp
1788 endif
1789 
1790 LIBNET_CFLAGS:=$(foreach dir,$(LIBNET_SRC_DIRS),-I$(dir))
1791 
1792 LIBNET_EXCLUDE_FILES:=
1793 ifneq ($(OPENJDK_TARGET_OS),linux)
1794         LIBNET_EXCLUDE_FILES += linux_close.c
1795 endif
1796 
1797 ifneq ($(OPENJDK_TARGET_OS),macosx)
1798         LIBNET_EXCLUDE_FILES += bsd_close.c
1799 endif
1800 
1801 ifeq ($(OPENJDK_TARGET_OS),windows)
1802         LIBNET_EXCLUDE_FILES += PlainSocketImpl.c PlainDatagramSocketImpl.c SdpSupport.c
1803 else
1804         LIBNET_EXCLUDE_FILES += TwoStacksPlainSocketImpl.c DualStackPlainSocketImpl.c \
1805                                 TwoStacksPlainDatagramSocketImpl.c DualStackPlainDatagramSocketImpl.c \
1806                                 NTLMAuthSequence.c NetworkInterface_winXP.c
1807 endif
1808 
1809 $(eval $(call SetupNativeCompilation,BUILD_LIBNET,\
1810                 LIBRARY:=net,\
1811                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1812                 SRC:=$(LIBNET_SRC_DIRS),\
1813                 EXCLUDE_FILES:=$(LIBNET_EXCLUDE_FILES), \
1814                 LANG:=C,\
1815                 OPTIMIZATION:=LOW, \
1816                 CFLAGS:=$(CFLAGS_JDKLIB) \
1817                         $(LIBNET_CFLAGS),\
1818                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnet/mapfile-vers, \
1819                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
1820                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1821                 LDFLAGS_SUFFIX_macosx:=-ljvm -ljava,\
1822                 LDFLAGS_SUFFIX_solaris:=-ljvm -ljava -lnsl -lsocket $(LIBDL) -lc ,\
1823                 LDFLAGS_SUFFIX_linux:=$(LIBDL) -ljvm -lpthread -ljava,\
1824                 LDFLAGS_SUFFIX_windows:=ws2_32.lib jvm.lib secur32.lib iphlpapi.lib \
1825                                         delayimp.lib $(WIN_JAVA_LIB) advapi32.lib \
1826                                         -DELAYLOAD:secur32.dll -DELAYLOAD:iphlpapi.dll, \
1827                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1828                 RC_FLAGS:=$(RC_FLAGS)\
1829                           -D "JDK_FNAME=net.dll" \
1830                           -D "JDK_INTERNAL_NAME=net" \
1831                           -D "JDK_FTYPE=0x2L",\
1832                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libnet,\
1833                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
1834 
1835 $(BUILD_LIBNET) : $(BUILD_LIBJAVA)
1836 
1837 BUILD_LIBRARIES += $(BUILD_LIBNET)
1838 
1839 $(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/share/lib/net.properties
1840         $(ECHO) $(LOG_INFO) Copying $(@F)
1841         $(call install-file)
1842 
1843 COPY_FILES += $(JDK_OUTPUTDIR)/lib/net.properties
1844 
1845 ifeq ($(OPENJDK_TARGET_OS), solaris)
1846 $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template : $(JDK_TOPDIR)/src/${OPENJDK_TARGET_OS_API_DIR}/lib/sdp/sdp.conf.template
1847         $(ECHO) $(LOG_INFO) Copying $(@F)
1848         $(call install-file)
1849 
1850 COPY_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template
1851 endif
1852 
1853 ##########################################################################################
1854 
1855 BUILD_LIBNIO_SRC:=\
1856         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/nio \
1857         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch \
1858         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
1859 
1860 BUILD_LIBNIO_CFLAGS:=\
1861         -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
1862         -I$(JDK_TOPDIR)/src/share/native/java/io \
1863         -I$(JDK_TOPDIR)/src/share/native/java/net \
1864         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net
1865 
1866 BUILD_LIBNIO_FILES:=\
1867         DatagramChannelImpl.c \
1868         DatagramDispatcher.c \
1869         FileChannelImpl.c \
1870         FileDispatcherImpl.c \
1871         FileKey.c \
1872         IOUtil.c \
1873         MappedByteBuffer.c \
1874         Net.c \
1875         ServerSocketChannelImpl.c \
1876         SocketChannelImpl.c \
1877         SocketDispatcher.c
1878 
1879 ifeq ($(OPENJDK_TARGET_OS), windows)
1880         BUILD_LIBNIO_FILES += \
1881                 Iocp.c \
1882                 RegistryFileTypeDetector.c \
1883                 WindowsAsynchronousFileChannelImpl.c \
1884                 WindowsAsynchronousServerSocketChannelImpl.c \
1885                 WindowsAsynchronousSocketChannelImpl.c \
1886                 WindowsNativeDispatcher.c \
1887                 WindowsSelectorImpl.c
1888 endif
1889 
1890 ifeq ($(OPENJDK_TARGET_OS), linux)
1891         BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
1892         BUILD_LIBNIO_FILES += \
1893                 EPoll.c \
1894                 EPollArrayWrapper.c \
1895                 EPollPort.c \
1896                 InheritedChannel.c \
1897                 NativeThread.c \
1898                 PollArrayWrapper.c \
1899                 UnixAsynchronousServerSocketChannelImpl.c \
1900                 UnixAsynchronousSocketChannelImpl.c \
1901                 GnomeFileTypeDetector.c \
1902                 MagicFileTypeDetector.c \
1903                 LinuxNativeDispatcher.c \
1904                 LinuxWatchService.c \
1905                 UnixCopyFile.c \
1906                 UnixNativeDispatcher.c
1907 endif
1908 
1909 ifeq ($(OPENJDK_TARGET_OS), macosx)
1910         BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
1911         BUILD_LIBNIO_SRC += $(JDK_TOPDIR)/src/macosx/native/sun/nio/ch
1912         BUILD_LIBNIO_FILES += \
1913                 InheritedChannel.c \
1914                 NativeThread.c \
1915                 PollArrayWrapper.c \
1916                 UnixAsynchronousServerSocketChannelImpl.c \
1917                 UnixAsynchronousSocketChannelImpl.c \
1918                 BsdNativeDispatcher.c \
1919                 MacOSXNativeDispatcher.c \
1920                 UnixCopyFile.c \
1921                 UnixNativeDispatcher.c \
1922                 KQueue.c \
1923                 KQueuePort.c \
1924                 KQueueArrayWrapper.c
1925 endif
1926 
1927 ifeq ($(OPENJDK_TARGET_OS), solaris)
1928         BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
1929         BUILD_LIBNIO_FILES += \
1930                 DevPollArrayWrapper.c \
1931                 InheritedChannel.c \
1932                 NativeThread.c \
1933                 PollArrayWrapper.c \
1934                 SolarisEventPort.c \
1935                 UnixAsynchronousServerSocketChannelImpl.c \
1936                 UnixAsynchronousSocketChannelImpl.c \
1937                 GnomeFileTypeDetector.c \
1938                 SolarisNativeDispatcher.c \
1939                 SolarisWatchService.c \
1940                 UnixCopyFile.c \
1941                 UnixNativeDispatcher.c
1942 endif
1943 
1944 $(eval $(call SetupNativeCompilation,BUILD_LIBNIO,\
1945                 LIBRARY:=nio,\
1946                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1947                 SRC:=$(BUILD_LIBNIO_SRC),\
1948                 INCLUDE_FILES:=$(BUILD_LIBNIO_FILES), \
1949                 LANG:=C,\
1950                 OPTIMIZATION:=HIGH, \
1951                 CFLAGS:=$(CFLAGS_JDKLIB) \
1952                         $(BUILD_LIBNIO_CFLAGS),\
1953                 MAPFILE:=$(BUILD_LIBNIO_MAPFILE), \
1954                 LDFLAGS:=$(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \
1955                          $(call SET_SHARED_LIBRARY_ORIGIN),\
1956                 LDFLAGS_SUFFIX_linux:=-ljava -lnet -lpthread $(LIBDL),\
1957                 LDFLAGS_SUFFIX_solaris:=-ljvm -lsocket -lposix4 $(LIBDL) \
1958                                         -lsendfile -ljava -lnet -lc,\
1959                 LDFLAGS_SUFFIX_windows:=jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \
1960                                         $(JDK_OUTPUTDIR)/objs/libnet/net.lib \
1961                                         advapi32.lib,\
1962                 LDFLAGS_SUFFIX_macosx:=-ljava -lnet -pthread -framework CoreFoundation,\
1963                 LDFLAGS_SUFFIX:=,\
1964                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
1965                 RC_FLAGS:=$(RC_FLAGS)\
1966                           -D "JDK_FNAME=nio.dll" \
1967                           -D "JDK_INTERNAL_NAME=nio" \
1968                           -D "JDK_FTYPE=0x2L",\
1969                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libnio,\
1970                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
1971 
1972 BUILD_LIBRARIES += $(BUILD_LIBNIO)
1973 
1974 $(BUILD_LIBNIO) : $(BUILD_LIBNET)
1975 
1976 ##########################################################################################
1977 
1978 ifeq ($(OPENJDK_TARGET_OS_API),posix)
1979 
1980   ifneq ($(OPENJDK_TARGET_OS),macosx)
1981 
1982     SCTP_WERROR := -Werror
1983     ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
1984       SCTP_WERROR :=
1985     endif
1986 
1987     $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP,\
1988                 LIBRARY:=sctp,\
1989                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
1990                 SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch/sctp,\
1991                 LANG:=C,\
1992                 OPTIMIZATION:=LOW, \
1993                 CFLAGS:=$(CFLAGS_JDKLIB)\
1994                         -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
1995                         -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch/sctp \
1996                         -I$(JDK_TOPDIR)/src/share/native/java/net \
1997                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch \
1998                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net,\
1999                 CFLAGS_linux:=$(SCTP_WERROR),\
2000                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsctp/mapfile-vers, \
2001                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2002                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2003                 LDFLAGS_SUFFIX_linux:=-lpthread $(LIBDL) -ljava -ljvm,\
2004                 LDFLAGS_SUFFIX_posix:=-lnio -lnet,\
2005                 LDFLAGS_SUFFIX_solaris:=-lsocket -ljava -ljvm -lc,\
2006                 LDFLAGS_SUFFIX_macosx:=-ljava -ljvm,\
2007                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsctp))
2008 
2009     BUILD_LIBRARIES += $(BUILD_LIBSCTP)
2010 
2011     $(BUILD_LIBSCTP) : $(BUILD_LIBNIO)
2012   endif
2013 endif
2014 
2015 ##########################################################################################
2016 
2017 BUILD_LIBJLI_SRC_DIRS:=$(JDK_TOPDIR)/src/share/bin $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin
2018 LIBJLI_CFLAGS:=$(CFLAGS_JDKLIB) $(foreach dir,$(BUILD_LIBJLI_SRC_DIRS),-I$(dir))
2019 
2020 BUILD_LIBJLI_FILES:=\
2021         java.c \
2022         splashscreen_stubs.c \
2023         parse_manifest.c \
2024         version_comp.c \
2025         wildcard.c \
2026         jli_util.c
2027 
2028 ifeq ($(JVM_VARIANT_ZERO), true)
2029         ERGO_FAMILY:=zero
2030 else
2031         ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
2032                 ERGO_FAMILY:=i586
2033         else
2034                 ERGO_FAMILY:=$(OPENJDK_TARGET_CPU_ARCH)
2035         endif
2036 endif
2037 
2038 ifeq ($(OPENJDK_TARGET_OS), macosx)
2039         LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin
2040         BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/bin
2041         BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c
2042 
2043         BUILD_LIBJLI_java_md_macosx.c_CFLAGS:=-x objective-c
2044         BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS:=-x objective-c
2045 endif
2046 
2047 ifeq ($(OPENJDK_TARGET_OS), windows)
2048         BUILD_LIBJLI_FILES += java_md.c \
2049                               cmdtoargs.c
2050         # Staticically link with c runtime on windows.
2051         LIBJLI_CFLAGS:=$(filter-out -MD,$(LIBJLI_CFLAGS))
2052 else ifneq ($(OPENJDK_TARGET_OS), macosx)
2053 
2054         BUILD_LIBJLI_FILES += java_md_common.c
2055         BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c 
2056 
2057         ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
2058 
2059         # if the architecture specific ergo file exists then
2060         # use it, else use the generic definitions from ergo.c
2061         ifneq ($(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(ERGO_ARCH_FILE)),)
2062                 BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
2063         else # !ERGO_ARCH_FILE
2064                 LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
2065         endif # ERGO_ARCH_FILE
2066 endif #WINDOWS
2067 
2068 # Append defines depending on target platform
2069 LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
2070 
2071 ifeq ($(OPENJDK_TARGET_OS), macosx)
2072         LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
2073 endif
2074 
2075 ifneq ($(USE_EXTERNAL_LIBZ),true)
2076         BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
2077         LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
2078         BUILD_LIBJLI_FILES += \
2079                 inflate.c \
2080                 inftrees.c \
2081                 inffast.c \
2082                 zadler32.c \
2083                 zcrc32.c \
2084                 zutil.c
2085 endif
2086 
2087 ifeq ($(OPENJDK_TARGET_OS), windows)
2088     LIBJLI_OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE)
2089 else
2090     LIBJLI_OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE)/jli
2091 endif
2092 
2093 $(eval $(call SetupNativeCompilation,BUILD_LIBJLI,\
2094                 LIBRARY:=jli,\
2095                 OUTPUT_DIR:=$(LIBJLI_OUTPUT_DIR),\
2096                 SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
2097                 INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
2098                 LANG:=C,\
2099                 OPTIMIZATION:=HIGH, \
2100                 CFLAGS:=$(LIBJLI_CFLAGS),\
2101                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjli/mapfile-vers, \
2102                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2103                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2104                 LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_ORIGIN,/..),\
2105                 LDFLAGS_solaris:=$(call SET_SHARED_LIBRARY_ORIGIN,/..),\
2106                 LDFLAGS_macosx:=-framework Cocoa -framework Security -framework ApplicationServices,\
2107                 LDFLAGS_SUFFIX_solaris:=$(LIBZ) $(LIBDL) -lc,\
2108                 LDFLAGS_SUFFIX_linux:=$(LIBZ) $(LIBDL) -lc -lpthread,\
2109                 LDFLAGS_SUFFIX_macosx:=$(LIBZ),\
2110                 LDFLAGS_SUFFIX_windows:=\
2111                         -export:JLI_Launch \
2112                         -export:JLI_ManifestIterate \
2113                         -export:JLI_SetTraceLauncher \
2114                         -export:JLI_ReportErrorMessage \
2115                         -export:JLI_ReportErrorMessageSys \
2116                         -export:JLI_ReportMessage \
2117                         -export:JLI_ReportExceptionDescription \
2118                         -export:JLI_MemAlloc \
2119                         -export:JLI_CmdToArgs \
2120                         -export:JLI_GetStdArgc \
2121                         -export:JLI_GetStdArgs \
2122                         advapi32.lib \
2123                         comctl32.lib \
2124                         user32.lib,\
2125                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2126                 RC_FLAGS:=$(RC_FLAGS) \
2127                           -D "JDK_FNAME=jli.dll" \
2128                           -D "JDK_INTERNAL_NAME=jli" \
2129                           -D "JDK_FTYPE=0x2L",\
2130                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli,\
2131                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2132 
2133 BUILD_LIBRARIES += $(BUILD_LIBJLI)
2134 
2135 # On windows, the static library has the same suffix as the import library created by
2136 # with the shared library, so the static library is given a different name. No harm
2137 # in doing it for all platform to reduce complexity.
2138 ifeq ($(OPENJDK_TARGET_OS), windows)
2139     $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
2140                 STATIC_LIBRARY:=jli_static,\
2141                 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
2142                 SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
2143                 INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
2144                 LANG:=C,\
2145                 OPTIMIZATION:=HIGH, \
2146                 CFLAGS:=$(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS),\
2147                 ARFLAGS:=$(ARFLAGS),\
2148                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static))
2149 
2150 BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC)
2151 
2152 else ifeq ($(OPENJDK_TARGET_OS),macosx)
2153     #
2154     # On macosx they do partial (incremental) linking of libjli_static.a
2155     #   code it here...rather than add support to NativeCompilation
2156     #   as this is first time I see it
2157     $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
2158                 LIBRARY:=jli_static, \
2159                 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
2160                 SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
2161                 INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
2162                 LANG:=C,\
2163                 OPTIMIZATION:=HIGH, \
2164                 CFLAGS:=$(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS),\
2165                 LDFLAGS:=-nostdlib -r,\
2166                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static))
2167 
2168 $(JDK_OUTPUTDIR)/objs/libjli_static.a : $(BUILD_LIBJLI_STATIC)
2169         $(call install-file)
2170 
2171 BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
2172 endif
2173 
2174 ##########################################################################################
2175 
2176 ifndef OPENJDK
2177 ifeq ($(ENABLE_JFR), true)
2178 
2179 $(eval $(call SetupNativeCompilation,BUILD_LIBJFR,\
2180                 LIBRARY:=jfr,\
2181                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2182                 SRC:=$(JDK_TOPDIR)/src/closed/share/native/oracle/jfr,\
2183                 LANG:=C,\
2184                 OPTIMIZATION:=LOW, \
2185                 CFLAGS:=$(CFLAGS_JDKLIB) \
2186                         -I$(JDK_TOPDIR)/src/closed/share/javavm/export, \
2187                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjfr/mapfile-vers, \
2188                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2189                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2190                 LDFLAGS_SUFFIX_solaris:=-lc,\
2191                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2192                 RC_FLAGS:=$(RC_FLAGS)\
2193                           -D "JDK_FNAME=jfr.dll" \
2194                           -D "JDK_INTERNAL_NAME=jfr" \
2195                           -D "JDK_FTYPE=0x2L",\
2196                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjfr,\
2197                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2198 
2199 BUILD_LIBRARIES += $(BUILD_LIBJFR)
2200 
2201 endif
2202 endif
2203 
2204 ##########################################################################################
2205 
2206 ifndef OPENJDK
2207 
2208 BUILD_LIBKCMS_EXCLUDE_FILES:=
2209 ifeq ($(OPENJDK_TARGET_OS),windows)
2210         BUILD_LIBKCMS_EXCLUDE_FILES += ukcpmgr.c unixmem.c
2211 else
2212         BUILD_LIBKCMS_EXCLUDE_FILES += cmmdll.c registry.c spxffile.c sysinfo.c winmem.c wkcpmgr.c
2213 endif
2214 
2215 BUILD_LIBKCMS_FLAGS:=$(CFLAGS_JDKLIB)
2216 
2217 ifeq ($(OPENJDK_TARGET_OS),solaris)
2218      # This particular library uses a feature called PIC_CODE_SMALL (on solaris)
2219      #   implement it like this...since it's only used here
2220      BUILD_LIBKCMS_FLAGS:=$(patsubst -KPIC,-Kpic,$(BUILD_LIBKCMS_FLAGS))
2221 else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
2222      BUILD_LIBKCMS_FLAGS:=$(patsubst -fPIC,-fpic,$(BUILD_LIBKCMS_FLAGS))
2223 endif
2224 
2225 $(eval $(call SetupNativeCompilation,BUILD_LIBKCMS,\
2226                 LIBRARY:=kcms,\
2227                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2228                 SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms,\
2229                 LANG:=C,\
2230                 EXCLUDE_FILES:=$(BUILD_LIBKCMS_EXCLUDE_FILES),\
2231                 OPTIMIZATION:=LOW, \
2232                 CFLAGS:=$(BUILD_LIBKCMS_FLAGS) \
2233                         -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST,\
2234                 CFLAGS_linux:=-Wno-missing-field-initializers,\
2235                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libkcms/mapfile-vers, \
2236                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2237                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2238                 LDFLAGS_SUFFIX_linux:=-lc -lpthread,\
2239                 LDFLAGS_SUFFIX_solaris:=-lc,\
2240                 LDFLAGS_SUFFIX_windows:=$(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \
2241                 LDFLAGS_SUFFIX_posix:=-lm -ljava -ljvm,\
2242                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc,\
2243                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc,\
2244                 RC_FLAGS:=$(RC_FLAGS)\
2245                           -D "JDK_FNAME=kcms.dll" \
2246                           -D "JDK_INTERNAL_NAME=kcms" \
2247                           -D "JDK_FTYPE=0x2L",\
2248                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libkcms,\
2249                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2250 
2251 $(BUILD_LIBKCMS) : $(BUILD_LIBJAVA)
2252 
2253 BUILD_LIBRARIES += $(BUILD_LIBKCMS)
2254 
2255 endif
2256 
2257 ##########################################################################################
2258 
2259 ifndef OPENJDK
2260 ifeq ($(OPENJDK_TARGET_OS), solaris)
2261 ifneq ($(OPENJDK_TARGET_CPU), x86_64)
2262 
2263 ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok)
2264 
2265 SUNWJDGA_MAPFILE:=
2266 ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
2267         SUNWJDGA_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjdga/mapfile-vers
2268 endif
2269 
2270 $(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \
2271                 LIBRARY:=sunwjdga,\
2272                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2273                 SRC:=$(JDK_TOPDIR)/src/solaris/native/sun/jdga, \
2274                 LANG:=C, \
2275                 OPTIMIZATION:=LOW, \
2276                 CFLAGS:=$(CFLAGS_JDKLIB) \
2277                         -I$(JDK_TOPDIR)/src/share/javavm/export \
2278                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
2279                         -I$(OPENWIN_HOME)/include, \
2280                 MAPFILE:=$(SUNWJDGA_MAPFILE), \
2281                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2282                          $(call SET_SHARED_LIBRARY_ORIGIN), \
2283                 LDFLAGS_SUFFIX:=-L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -ldga -lX11 $(LIBDL) -lc, \
2284                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsunwjdga))
2285 
2286 BUILD_LIBRARIES += $(BUILD_LIBSUNWJDGA)
2287 
2288 endif
2289 endif
2290 endif
2291 endif
2292 
2293 ##########################################################################################
2294 
2295 ifeq ($(BUILD_HEADLESS), true)
2296 ifneq ($(OPENJDK_TARGET_OS), windows)
2297 
2298 LIBAWT_HEADLESS_DIRS:=$(JDK_TOPDIR)/src/share/native/sun/font \
2299                         $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
2300                         $(JDK_TOPDIR)/src/solaris/native/sun/font \
2301                         $(JDK_TOPDIR)/src/solaris/native/sun/awt \
2302                         $(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \
2303                         $(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11
2304 
2305 LIBAWT_HEADLESS_CFLAGS:=-DHEADLESS=true \
2306                           -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
2307                           $(CUPS_CFLAGS) \
2308                           $(X_CFLAGS) \
2309                           -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
2310                           -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
2311                           -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
2312                           -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
2313                           -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
2314                           -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
2315                           -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
2316                           -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
2317                           $(foreach dir,$(LIBAWT_HEADLESS_DIRS),-I$(dir))
2318 
2319 LIBAWT_HEADLESS_FILES:=\
2320         awt_Font.c \
2321         HeadlessToolkit.c \
2322         fontpath.c \
2323         VDrawingArea.c \
2324         X11Color.c \
2325         X11Renderer.c \
2326         X11PMBlitLoops.c \
2327         X11SurfaceData.c \
2328         X11FontScaler_md.c \
2329         X11TextRenderer_md.c \
2330         OGLBlitLoops.c \
2331         OGLBufImgOps.c \
2332         OGLContext.c \
2333         OGLFuncs.c \
2334         OGLMaskBlit.c \
2335         OGLMaskFill.c \
2336         OGLPaints.c \
2337         OGLRenderQueue.c \
2338         OGLRenderer.c \
2339         OGLSurfaceData.c \
2340         OGLTextRenderer.c \
2341         OGLVertexCache.c \
2342         GLXGraphicsConfig.c \
2343         GLXSurfaceData.c \
2344         AccelGlyphCache.c \
2345         CUPSfuncs.c
2346 
2347 LIBAWT_HEADLESS_REORDER:=
2348 ifeq ($(OPENJDK_TARGET_OS), solaris)
2349         ifneq ($(OPENJDK_TARGET_CPU), x86_64)
2350                 LIBAWT_HEADLESS_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
2351         endif
2352 endif
2353 
2354 $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS,\
2355                 LIBRARY:=awt_headless,\
2356                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2357                 SRC:=$(LIBAWT_HEADLESS_DIRS),\
2358                 INCLUDE_FILES:=$(LIBAWT_HEADLESS_FILES),\
2359                 LANG:=C,\
2360                 OPTIMIZATION:=LOW, \
2361                 CFLAGS:=$(CFLAGS_JDKLIB) $(LIBAWT_HEADLESS_CFLAGS),\
2362                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/mapfile-vers,\
2363                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2364                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2365                 LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_ORIGIN,/..),\
2366                 LDFLAGS_solaris:=$(call SET_SHARED_LIBRARY_ORIGIN,/..) \
2367                                  -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
2368                                  -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR),\
2369                 LDFLAGS_macosx:=$(call SET_SHARED_LIBRARY_ORIGIN).,\
2370                 REORDER:=$(LIBAWT_HEADLESS_REORDER), \
2371                 LDFLAGS_SUFFIX_linux:=-ljvm -lawt -lm $(LIBDL) -ljava,\
2372                 LDFLAGS_SUFFIX_solaris:=$(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc,\
2373                 LDFLAGS_SUFFIX_macosx:=-ljvm $(LIBCXX) -lawt $(LIBDL) -ljava,\
2374                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_headless))
2375 
2376 $(BUILD_LIBAWT_HEADLESS) : $(BUILD_LIBAWT)
2377 
2378 BUILD_LIBRARIES += $(BUILD_LIBAWT_HEADLESS)
2379 
2380 endif
2381 endif
2382 
2383 ##########################################################################################
2384 
2385 ifndef BUILD_HEADLESS_ONLY
2386 LIBSPLASHSCREEN_DIRS:=\
2387         $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
2388         $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
2389         $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
2390 
2391 ifeq ($(USE_EXTERNAL_LIBGIF),true)
2392     GIFLIB_LDFLAGS := -lgif
2393 else
2394     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/giflib
2395     GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
2396 endif
2397 
2398 ifneq ($(OPENJDK_TARGET_OS), macosx)
2399     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
2400 else
2401     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
2402 endif
2403 
2404 LIBSPLASHSCREEN_CFLAGS:=-DSPLASHSCREEN -DPNG_NO_MMX_CODE \
2405         $(foreach dir,$(LIBSPLASHSCREEN_DIRS),-I$(dir))
2406 
2407 ifeq ($(OPENJDK_TARGET_OS), macosx)
2408         LIBSPLASHSCREEN_CFLAGS:=-I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
2409                                   $(LIBSPLASHSCREEN_CFLAGS) \
2410                                   -F/System/Library/Frameworks/JavaVM.framework/Frameworks
2411         LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
2412         LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
2413 
2414         LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS:=-x objective-c -O0
2415         LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS:=-x objective-c -O0
2416         LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS:=-x objective-c -O0
2417         LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS:=-x objective-c -O0
2418         LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS:=-x objective-c -O0
2419         LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS:=-x objective-c -O0
2420         LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS:=-O0
2421 
2422 else ifneq ($(OPENJDK_TARGET_OS), windows)
2423         LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
2424 else
2425         LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
2426 endif
2427 
2428 LIBSPLASHSCREEN_LDFLAGS_SUFFIX:=
2429 
2430 ifneq ($(USE_EXTERNAL_LIBZ),true)
2431         LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
2432         LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
2433 endif
2434 
2435 ifeq ($(OPENJDK_TARGET_OS), macosx)
2436         LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
2437                                   -framework ApplicationServices \
2438                                   -framework Foundation \
2439                                   -framework Cocoa \
2440                                   -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
2441                                   -framework JavaNativeFoundation
2442 else ifneq ($(OPENJDK_TARGET_OS), windows)
2443         LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread
2444 else # OPENJDK_TARGET_OS
2445         LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
2446 endif # OPENJDK_TARGET_OS
2447 
2448 $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN,\
2449                 LIBRARY:=splashscreen,\
2450                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2451                 SRC:=$(LIBSPLASHSCREEN_DIRS),\
2452                 EXCLUDE_FILES:=imageioJPEG.c jpegdecoder.c pngtest.c,\
2453                 LANG:=C,\
2454                 OPTIMIZATION:=LOW, \
2455                 CFLAGS:=$(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS),\
2456                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \
2457                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2458                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2459                 LDFLAGS_SUFFIX:=$(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS),\
2460                 LDFLAGS_SUFFIX_solaris:=-lc,\
2461                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2462                 RC_FLAGS:=$(RC_FLAGS)\
2463                           -D "JDK_FNAME=splashscreen.dll" \
2464                           -D "JDK_INTERNAL_NAME=splashscreen" \
2465                           -D "JDK_FTYPE=0x2L",\
2466                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsplashscreen,\
2467                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2468 
2469 BUILD_LIBRARIES += $(LIBSPLASHSCREEN)
2470 
2471 ifeq ($(OPENJDK_TARGET_OS),macosx)
2472 $(LIBSPLASHSCREEN) :  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX) 
2473 endif
2474 
2475 endif
2476 
2477 ##########################################################################################
2478 
2479 ifndef OPENJDK
2480 
2481 LIBDCPR_SRC_DIRS:=\
2482         $(JDK_TOPDIR)/src/closed/share/native/sun/dc/doe \
2483         $(JDK_TOPDIR)/src/closed/share/native/sun/dc/path \
2484         $(JDK_TOPDIR)/src/closed/share/native/sun/dc/pr \
2485         $(JDK_TOPDIR)/src/closed/share/native/sun/dc/util
2486 
2487 LIBDCPR_CFLAGS:=$(foreach dir,$(LIBDCPR_SRC_DIRS),-I$(dir)) \
2488                   -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe
2489 
2490 $(eval $(call SetupNativeCompilation,BUILD_LIBDCPR,\
2491                 LIBRARY:=dcpr,\
2492                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2493                 SRC:=$(LIBDCPR_SRC_DIRS),\
2494                 LANG:=C,\
2495                 OPTIMIZATION:=LOW, \
2496                 CFLAGS:=$(CFLAGS_JDKLIB) \
2497                         $(LIBDCPR_CFLAGS), \
2498                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libdcpr/mapfile-vers, \
2499                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2500                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2501                 LDFLAGS_SUFFIX:=$(LIBM) $(LDFLAGS_JDKLIB_SUFFIX),\
2502                 LDFLAGS_SUFFIX_posix:=-lm,\
2503                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2504                 RC_FLAGS:=$(RC_FLAGS)\
2505                           -D "JDK_FNAME=dcpr.dll" \
2506                           -D "JDK_INTERNAL_NAME=dcpr" \
2507                           -D "JDK_FTYPE=0x2L",\
2508                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libdcpr,\
2509                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2510 
2511 $(BUILD_LIBDCPR) : $(BUILD_LIBJAVA)
2512 
2513 BUILD_LIBRARIES += $(BUILD_LIBDCPR)
2514 
2515 endif
2516 
2517 ##########################################################################################
2518 
2519 $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC,\
2520                 LIBRARY:=j2pcsc,\
2521                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2522                 SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
2523                      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio,\
2524                 LANG:=C,\
2525                 CFLAGS_posix:=-D__sun_jdk,\
2526                 OPTIMIZATION:=LOW, \
2527                 CFLAGS:=$(CFLAGS_JDKLIB) \
2528                      -I$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
2529                      -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio\
2530                      -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio/MUSCLE,\
2531                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2pcsc/mapfile-vers, \
2532                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2533                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2534                 LDFLAGS_SUFFIX_posix:=$(LIBDL), \
2535                 LDFLAGS_SUFFIX_windows:=winscard.lib,\
2536                 LDFLAGS_SUFFIX_solaris:=-lc,\
2537                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2538                 RC_FLAGS:=$(RC_FLAGS)\
2539                           -D "JDK_FNAME=j2pcsc.dll" \
2540                           -D "JDK_INTERNAL_NAME=j2pcsc" \
2541                           -D "JDK_FTYPE=0x2L",\
2542                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2pcsc,\
2543                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2544 
2545 BUILD_LIBRARIES += $(BUILD_LIBJ2PCSC)
2546 
2547 ##########################################################################################
2548 
2549 ifneq ($(OPENJDK_TARGET_OS), windows)
2550 ifneq ($(OPENJDK_TARGET_OS), macosx)
2551 $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\
2552                 LIBRARY:=j2gss,\
2553                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2554                 SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
2555                      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper,\
2556                 LANG:=C,\
2557                 OPTIMIZATION:=LOW, \
2558                 CFLAGS:=$(CFLAGS_JDKLIB) \
2559                      -I$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
2560                      -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper,\
2561                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2gss/mapfile-vers, \
2562                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2563                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2564                 LDFLAGS_SUFFIX:=$(LIBDL),\
2565                 LDFLAGS_SUFFIX_solaris:=-lc,\
2566                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2gss))
2567 
2568 BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
2569 endif
2570 endif
2571 
2572 ##########################################################################################
2573 
2574 ifneq ($(BUILD_CRYPTO),no)
2575   BUILD_LIBKRB5_NAME:=
2576   ifeq ($(OPENJDK_TARGET_OS), windows)
2577      BUILD_LIBKRB5_NAME:=w2k_lsa_auth
2578      BUILD_LIBKRB5_SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5
2579      BUILD_LIBKRB5_LIBS:=advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \
2580                          gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \
2581                          ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib
2582   else ifeq ($(OPENJDK_TARGET_OS), macosx)
2583      BUILD_LIBKRB5_NAME:=osxkrb5
2584      BUILD_LIBKRB5_SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/krb5
2585      BUILD_LIBKRB5_LIBS:=-framework Kerberos
2586   endif
2587 
2588   ifneq ($(BUILD_LIBKRB5_NAME),)
2589     $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5,\
2590                 LIBRARY:=$(BUILD_LIBKRB5_NAME),\
2591                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2592                 SRC:=$(BUILD_LIBKRB5_SRC),\
2593                 LANG:=C,\
2594                 OPTIMIZATION:=LOW, \
2595                 CFLAGS:=$(CFLAGS_JDKLIB) \
2596                         -I$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \
2597                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5 ,\
2598                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2599                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2600                 LDFLAGS_SUFFIX:=$(BUILD_LIBKRB5_LIBS) ,\
2601                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2602                 RC_FLAGS:=$(RC_FLAGS)\
2603                           -D "JDK_FNAME=$(BUILD_LIBKRB5_NAME).dll" \
2604                           -D "JDK_INTERNAL_NAME=$(BUILD_LIBKRB5_NAME)" \
2605                           -D "JDK_FTYPE=0x2L",\
2606                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libkrb5,\
2607                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2608 
2609     BUILD_LIBRARIES += $(BUILD_LIBKRB5)
2610   endif
2611 endif
2612 
2613 ##########################################################################################
2614 
2615 ifeq ($(OPENJDK_TARGET_OS), windows)
2616 
2617 $(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI,\
2618                 LIBRARY:=sunmscapi,\
2619                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2620                 SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi,\
2621                 LANG:=C++,\
2622                 OPTIMIZATION:=LOW, \
2623                 CFLAGS:=$(CFLAGS_JDKLIB) \
2624                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi ,\
2625                 LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
2626                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2627                 LDFLAGS_SUFFIX:=Crypt32.Lib advapi32.lib,\
2628                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2629                 RC_FLAGS:=$(RC_FLAGS)\
2630                           -D "JDK_FNAME=sunmscapi.dll" \
2631                           -D "JDK_INTERNAL_NAME=sunmscapi" \
2632                           -D "JDK_FTYPE=0x2L",\
2633                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsunmscapi,\
2634                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2635 
2636 BUILD_LIBRARIES += $(BUILD_LIBSUNMSCAPI)
2637 endif
2638 
2639 ##########################################################################################
2640 
2641 $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11,\
2642                 LIBRARY:=j2pkcs11,\
2643                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2644                 SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
2645                      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \
2646                      $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \
2647                      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper,\
2648                 LANG:=C,\
2649                 OPTIMIZATION:=LOW, \
2650                 CFLAGS:=$(CFLAGS_JDKLIB) \
2651                         -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
2652                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \
2653                         -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \
2654                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper,\
2655                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2pkcs11/mapfile-vers, \
2656                 LDFLAGS:=$(LDFLAGS_JDKLIB) \
2657                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2658                 LDFLAGS_SUFFIX_posix:=$(LIBDL),\
2659                 LDFLAGS_SUFFIX_solaris:=-lc,\
2660                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2661                 RC_FLAGS:=$(RC_FLAGS)\
2662                           -D "JDK_FNAME=j2pkcs11.dll" \
2663                           -D "JDK_INTERNAL_NAME=j2pkcs11" \
2664                           -D "JDK_FTYPE=0x2L",\
2665                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2pkcs11,\
2666                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2667 
2668 BUILD_LIBRARIES += $(BUILD_LIBJ2PKCS11)
2669 
2670 ##########################################################################################
2671 
2672 ifeq ($(ENABLE_INTREE_EC),yes)
2673 
2674 BUILD_LIBSUNEC_FLAGS:= -I$(JDK_TOPDIR)/src/share/native/sun/security/ec \
2675                        -I$(JDK_TOPDIR)/src/share/native/sun/security/ec/impl
2676 
2677 #
2678 # On sol-sparc...all libraries are compiled with -xregs=no%appl
2679 #   (set in CFLAGS_REQUIRED_sparc)
2680 #
2681 # except!!! libsunec.so
2682 #
2683 ECC_JNI_SOLSPARC_FILTER:=
2684 ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
2685      ECC_JNI_SOLSPARC_FILTER:=-xregs=no%appl
2686 endif
2687 
2688 $(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC,\
2689                 LIBRARY:=sunec,\
2690                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2691                 SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/ec \
2692                      $(JDK_TOPDIR)/src/share/native/sun/security/ec/impl, \
2693                 LANG:=C++, \
2694                 OPTIMIZATION:=LOW, \
2695                 CFLAGS:=$(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB))\
2696                         $(BUILD_LIBSUNEC_FLAGS) \
2697                         -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B,\
2698                 CXXFLAGS:=$(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \
2699                           $(BUILD_LIBSUNEC_FLAGS),\
2700                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsunec/mapfile-vers, \
2701                 LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK),\
2702                 LDFLAGS_macosx:=$(call SET_SHARED_LIBRARY_ORIGIN),\
2703                 LDFLAGS_SUFFIX:=$(LIBCXX),\
2704                 LDFLAGS_SUFFIX_linux:=-lc ,\
2705                 LDFLAGS_SUFFIX_solaris:=-lc ,\
2706                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2707                 RC_FLAGS:=$(RC_FLAGS)\
2708                           -D "JDK_FNAME=sunec.dll" \
2709                           -D "JDK_INTERNAL_NAME=sunec" \
2710                           -D "JDK_FTYPE=0x2L",\
2711                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsunec,\
2712                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2713 
2714 BUILD_LIBRARIES += $(BUILD_LIBSUNEC)
2715 endif
2716 
2717 ##########################################################################################
2718 
2719 LIBJSOUND_SRC_DIRS:=\
2720         $(JDK_TOPDIR)/src/share/native/com/sun/media/sound \
2721         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/media/sound
2722 
2723 LIBJSOUND_SRC_FILES:=Utilities.c Platform.c
2724 
2725 LIBJSOUND_LANG:=C
2726 LIBJSOUND_CFLAGS:=$(foreach dir,$(LIBJSOUND_SRC_DIRS),-I$(dir))
2727 
2728 EXTRA_SOUND_JNI_LIBS:=
2729 
2730 LIBJSOUND_MIDIFILES:=\
2731         MidiInDevice.c \
2732         MidiInDeviceProvider.c \
2733         MidiOutDevice.c \
2734         MidiOutDeviceProvider.c \
2735         PlatformMidi.c
2736 
2737 # files needed for ports
2738 LIBJSOUND_PORTFILES:=\
2739         PortMixerProvider.c \
2740         PortMixer.c
2741 
2742 # files needed for direct audio
2743 LIBJSOUND_DAUDIOFILES:=\
2744         DirectAudioDeviceProvider.c \
2745         DirectAudioDevice.c
2746 
2747 ifeq ($(OPENJDK_TARGET_OS), windows)
2748         EXTRA_SOUND_JNI_LIBS += jsoundds
2749         LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \
2750                             -DUSE_PLATFORM_MIDI_OUT=TRUE \
2751                             -DUSE_PLATFORM_MIDI_IN=TRUE \
2752                             -DUSE_PORTS=TRUE
2753         LIBJSOUND_SRC_FILES += \
2754                 PLATFORM_API_WinOS_MidiIn.cpp \
2755                 PLATFORM_API_WinOS_MidiOut.c \
2756                 PLATFORM_API_WinOS_Util.c \
2757                 PLATFORM_API_WinOS_Ports.c
2758         LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
2759         LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
2760 endif # OPENJDK_TARGET_OS windows
2761 
2762 ifeq ($(OPENJDK_TARGET_OS), linux)
2763         EXTRA_SOUND_JNI_LIBS += jsoundalsa
2764         LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX
2765 endif # OPENJDK_TARGET_OS linux
2766 
2767 ifeq ($(OPENJDK_TARGET_OS), macosx)
2768         LIBJSOUND_LANG:=C++
2769         LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \
2770                             -DUSE_PORTS=TRUE \
2771                             -DUSE_DAUDIO=TRUE \
2772                             -DUSE_PLATFORM_MIDI_OUT=TRUE \
2773                             -DUSE_PLATFORM_MIDI_IN=TRUE
2774         LIBJSOUND_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/sun/media/sound
2775         LIBJSOUND_SRC_FILES += \
2776                 PLATFORM_API_MacOSX_Utils.cpp \
2777                 PLATFORM_API_MacOSX_PCM.cpp \
2778                 PLATFORM_API_MacOSX_Ports.cpp \
2779                 PLATFORM_API_MacOSX_MidiIn.c \
2780                 PLATFORM_API_MacOSX_MidiOut.c \
2781                 PLATFORM_API_MacOSX_MidiUtils.c
2782         LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
2783         LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
2784         LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
2785 endif # OPENJDK_TARGET_OS macosx
2786 
2787 ifeq ($(OPENJDK_TARGET_OS), solaris)
2788         LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \
2789                             -DUSE_PORTS=TRUE \
2790                             -DUSE_DAUDIO=TRUE
2791         LIBJSOUND_SRC_FILES += \
2792                 PLATFORM_API_SolarisOS_Utils.c \
2793                 PLATFORM_API_SolarisOS_Ports.c \
2794                 PLATFORM_API_SolarisOS_PCM.c
2795         LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
2796         LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
2797         LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
2798 endif # OPENJDK_TARGET_OS solaris
2799 
2800 
2801 ifeq ($(JVM_VARIANT_ZERO), true)
2802         LIBJSOUND_CFLAGS += -DX_ARCH=X_ZERO
2803 else
2804   ifeq ($(OPENJDK_TARGET_CPU), x86)
2805         LIBJSOUND_CFLAGS += -DX_ARCH=X_I586
2806   endif
2807 
2808   ifeq ($(OPENJDK_TARGET_CPU), sparc)
2809         LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC
2810   endif
2811 
2812   ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
2813         LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9
2814   endif
2815 
2816   ifeq ($(OPENJDK_TARGET_CPU), x86_64)
2817         LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64
2818   endif
2819 
2820   ifeq ($(OPENJDK_TARGET_CPU), arm)
2821         LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM
2822   endif
2823 
2824   ifeq ($(OPENJDK_TARGET_CPU), ppc)
2825         LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC
2826   endif
2827 endif
2828 
2829 LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
2830 
2831 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND,\
2832                 LIBRARY:=jsound,\
2833                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2834                 SRC:=$(LIBJSOUND_SRC_DIRS),\
2835                 INCLUDE_FILES:=$(LIBJSOUND_SRC_FILES),\
2836                 LANG:=$(LIBJSOUND_LANG),\
2837                 OPTIMIZATION:=LOW, \
2838                 CFLAGS:=$(CFLAGS_JDKLIB) \
2839                         $(LIBJSOUND_CFLAGS), \
2840                 CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
2841                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsound/mapfile-vers, \
2842                 LDFLAGS:=$(LDFLAGS_JDKLIB)\
2843                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2844                 LDFLAGS_macosx:=-framework CoreAudio -framework CoreFoundation \
2845                                 -framework CoreServices -framework AudioUnit $(LIBCXX) \
2846                                 -framework CoreMIDI -framework AudioToolbox,\
2847                 LDFLAGS_windows:=$(WIN_JAVA_LIB) advapi32.lib winmm.lib,\
2848                 LDFLAGS_SUFFIX_posix:=-ljava -ljvm,\
2849                 LDFLAGS_SUFFIX_solaris:=-lc ,\
2850                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2851                 RC_FLAGS:=$(RC_FLAGS)\
2852                           -D "JDK_FNAME=jsound.dll" \
2853                           -D "JDK_INTERNAL_NAME=jsound" \
2854                           -D "JDK_FTYPE=0x2L",\
2855                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsound,\
2856                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2857 
2858 $(BUILD_LIBJSOUND) : $(BUILD_LIBJAVA)
2859 
2860 BUILD_LIBRARIES += $(BUILD_LIBJSOUND)
2861 
2862 ##########################################################################################
2863 
2864 ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)),)
2865 
2866 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA,\
2867                 LIBRARY:=jsoundalsa,\
2868                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2869                 SRC:=$(LIBJSOUND_SRC_DIRS),\
2870                 INCLUDE_FILES:=Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \
2871                                 $(LIBJSOUND_DAUDIOFILES) \
2872                                 PLATFORM_API_LinuxOS_ALSA_CommonUtils.c   \
2873                                 PLATFORM_API_LinuxOS_ALSA_PCM.c     \
2874                                 PLATFORM_API_LinuxOS_ALSA_PCMUtils.c   \
2875                                 PLATFORM_API_LinuxOS_ALSA_MidiIn.c  \
2876                                 PLATFORM_API_LinuxOS_ALSA_MidiOut.c \
2877                                 PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \
2878                                 PLATFORM_API_LinuxOS_ALSA_Ports.c,\
2879                 LANG:=C,\
2880                 OPTIMIZATION:=LOW, \
2881                 CFLAGS:=$(CFLAGS_JDKLIB) \
2882                         $(LIBJSOUND_CFLAGS) \
2883                         -DUSE_DAUDIO=TRUE \
2884                         -DUSE_PORTS=TRUE  \
2885                         -DUSE_PLATFORM_MIDI_OUT=TRUE \
2886                         -DUSE_PLATFORM_MIDI_IN=TRUE, \
2887                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsoundalsa/mapfile-vers, \
2888                 LDFLAGS:=$(LDFLAGS_JDKLIB)\
2889                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2890                 LDFLAGS_SUFFIX:=-lasound -ljava -ljvm,\
2891                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsoundalsa))
2892 
2893 $(BUILD_LIBJSOUNDALSA) : $(BUILD_LIBJAVA)
2894 
2895 BUILD_LIBRARIES += $(BUILD_LIBJSOUNDALSA)
2896 
2897 endif
2898 
2899 ##########################################################################################
2900 
2901 ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)),)
2902 
2903 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS,\
2904                 LIBRARY:=jsoundds,\
2905                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2906                 SRC:=$(LIBJSOUND_SRC_DIRS),\
2907                 INCLUDE_FILES:=Utilities.c $(LIBJSOUND_DAUDIOFILES) \
2908                                 PLATFORM_API_WinOS_DirectSound.cpp, \
2909                 LANG:=C++,\
2910                 OPTIMIZATION:=LOW, \
2911                 CFLAGS:=$(CFLAGS_JDKLIB) \
2912                         $(LIBJSOUND_CFLAGS) \
2913                         -DUSE_DAUDIO=TRUE \
2914                         -I$(DXSDK_INCLUDE_PATH), \
2915                 LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
2916                          $(call SET_SHARED_LIBRARY_ORIGIN),\
2917                 LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib,\
2918                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
2919                 RC_FLAGS:=$(RC_FLAGS)\
2920                           -D "JDK_FNAME=jsoundds.dll" \
2921                           -D "JDK_INTERNAL_NAME=jsoundds" \
2922                           -D "JDK_FTYPE=0x2L",\
2923                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsoundds,\
2924                 DEBUG_SYMBOLS:=$(WINDOWS_ONLY)))
2925 
2926 $(BUILD_LIBJSOUNDDS) : $(BUILD_LIBJAVA)
2927 
2928 BUILD_LIBRARIES += $(BUILD_LIBJSOUNDDS)
2929 
2930 endif
2931 
2932 ##########################################################################################
2933 
2934 ifeq ($(OPENJDK_TARGET_OS), solaris)
2935 ifndef OPENJDK
2936 
2937 $(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO,\
2938                 LIBRARY:=j2ucrypto,\
2939                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2940                 SRC:=$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto,\
2941                 LANG:=C,\
2942                 OPTIMIZATION:=LOW, \
2943                 CFLAGS:=$(CFLAGS_JDKLIB) \
2944                         -I$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto ,\
2945                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2ucrypto/mapfile-vers, \
2946                 LDFLAGS:=$(LDFLAGS_JDKLIB),\
2947                 LDFLAGS_SUFFIX:=$(LIBDL),\
2948                 LDFLAGS_SUFFIX_solaris:=-lc,\
2949                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2ucrypto))
2950 
2951 $(BUILD_LIBJ2UCRYPTO) : $(BUILD_LIBJAVA)
2952 
2953 BUILD_LIBRARIES += $(BUILD_LIBJ2UCRYPTO)
2954 
2955 endif
2956 endif
2957 
2958 ##########################################################################################
2959 
2960 ifeq ($(OPENJDK_TARGET_OS), macosx)
2961 
2962 $(eval $(call SetupNativeCompilation,BUILD_LIBAPPLESCRIPTENGINE,\
2963                 LIBRARY:=AppleScriptEngine,\
2964                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2965                 SRC:=$(JDK_TOPDIR)/src/macosx/native/apple/applescript,\
2966                 LANG:=C,\
2967                 OPTIMIZATION:=LOW, \
2968                 CFLAGS:=$(CFLAGS_JDKLIB) \
2969                         -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
2970                         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
2971                         -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
2972                 LDFLAGS:=$(LDFLAGS_JDKLIB)\
2973                          $(call SET_SHARED_LIBRARY_ORIGIN), \
2974                 LDFLAGS_SUFFIX:=-framework Cocoa \
2975                                 -framework Carbon \
2976                                 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
2977                                 -framework JavaNativeFoundation \
2978                                 $(LDFLAGS_JDKLIB_SUFFIX),\
2979                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libAppleScriptEngine))
2980 
2981 $(BUILD_LIBAPPLESCRIPTENGINE) : $(BUILD_LIBJAVA)
2982 
2983 BUILD_LIBRARIES += $(BUILD_LIBAPPLESCRIPTENGINE)
2984 
2985 endif
2986 
2987 ##########################################################################################
2988 
2989 ifeq ($(OPENJDK_TARGET_OS), macosx)
2990 
2991 $(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP,\
2992                 LIBRARY:=osxapp,\
2993                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
2994                 SRC:=$(JDK_TOPDIR)/src/macosx/native/sun/osxapp,\
2995                 LANG:=C,\
2996                 OPTIMIZATION:=LOW, \
2997                 CFLAGS:=$(CFLAGS_JDKLIB) \
2998                         -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
2999                         -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp \
3000                         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3001                         -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks,\
3002                 LDFLAGS:=$(LDFLAGS_JDKLIB)\
3003                          $(call SET_SHARED_LIBRARY_ORIGIN), \
3004                 LDFLAGS_SUFFIX_macosx:=\
3005         -framework Accelerate \
3006         -framework ApplicationServices \
3007         -framework AudioToolbox \
3008         -framework Carbon \
3009         -framework Cocoa \
3010         -framework Security \
3011         -framework ExceptionHandling \
3012         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3013         -framework JavaNativeFoundation \
3014         -framework JavaRuntimeSupport \
3015         -framework OpenGL \
3016         -framework IOSurface \
3017         -framework QuartzCore, \
3018                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libosxapp))
3019 
3020 BUILD_LIBRARIES += $(BUILD_LIBOSXAPP)
3021 
3022 endif
3023 
3024 ##########################################################################################
3025 
3026 ifeq ($(OPENJDK_TARGET_OS), macosx)
3027 
3028 LIBOSX_DIRS:=\
3029   $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \
3030   $(JDK_TOPDIR)/src/macosx/native/java/util \
3031   $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \
3032   $(JDK_TOPDIR)/src/macosx/native/apple/security \
3033   $(JDK_TOPDIR)/src/macosx/native/apple/launcher
3034 
3035 $(eval $(call SetupNativeCompilation,BUILD_LIBOSX,\
3036                 LIBRARY:=osx,\
3037                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
3038                 SRC:=$(LIBOSX_DIRS),\
3039                 LANG:=C,\
3040                 OPTIMIZATION:=LOW, \
3041                 CFLAGS:=$(CFLAGS_JDKLIB) \
3042                         $(foreach dir,$(LIBOSX_DIRS),-I$(dir)) \
3043                         -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
3044                         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3045                         -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks,\
3046                 LDFLAGS:=$(LDFLAGS_JDKLIB)\
3047                          $(call SET_SHARED_LIBRARY_ORIGIN), \
3048                 LDFLAGS_SUFFIX_macosx:=\
3049     -losxapp \
3050     -framework Cocoa \
3051     -framework ApplicationServices \
3052     -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3053     -framework JavaNativeFoundation \
3054     -framework JavaRuntimeSupport \
3055     -framework Security \
3056     -framework SystemConfiguration \
3057     $(LDFLAGS_JDKLIB_SUFFIX), \
3058                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libosx))
3059 
3060 BUILD_LIBRARIES += $(BUILD_LIBOSX)
3061 
3062 $(BUILD_LIBOSX) : $(BUILD_LIBOSXAPP)
3063 
3064 $(BUILD_LIBOSX) : $(BUILD_LIBJAVA)
3065 
3066 endif
3067 
3068 ##########################################################################################
3069 
3070 ifeq ($(OPENJDK_TARGET_OS), macosx)
3071 
3072 LIBAWT_LWAWT_FILES:=\
3073         awt.m \
3074         ApplicationDelegate.m \
3075         CFRetainedResource.m \
3076         CGLGraphicsConfig.m \
3077         CGLSurfaceData.m \
3078         CGLLayer.m \
3079         CGraphicsConfig.m \
3080         CGraphicsDevice.m \
3081         CGraphicsEnv.m \
3082         CCharToGlyphMapper.m \
3083         CSystemColors.m \
3084         AWTFont.m \
3085         CGGlyphOutlines.m \
3086         CGGlyphImages.m \
3087         CoreTextSupport.m \
3088         AWTStrike.m \
3089         InitIDs.m \
3090         AWTEvent.m \
3091         AWTView.m \
3092         AWTWindow.m \
3093         AWTSurfaceLayers.m \
3094         CCursorManager.m \
3095         CClipboard.m \
3096         CDataTransferer.m \
3097         CDragSource.m \
3098         CDragSourceContextPeer.m \
3099         CDropTarget.m \
3100         CDropTargetContextPeer.m \
3101         CInputMethod.m \
3102         CDesktopPeer.m \
3103         OSVersion.m \
3104         DnDUtilities.m \
3105         CFileDialog.m \
3106         CImage.m \
3107         CMenu.m \
3108         CMenuBar.m \
3109         CMenuComponent.m \
3110         CMenuItem.m \
3111         CPopupMenu.m \
3112         CRobot.m \
3113         CTrayIcon.m \
3114         CWrapper.m \
3115         JavaAccessibilityAction.m \
3116         JavaAccessibilityUtilities.m \
3117         JavaComponentAccessibility.m \
3118         JavaTextAccessibility.m \
3119         LWCToolkit.m \
3120         GeomUtilities.m \
3121         CPrinterJob.m \
3122         PrintModel.m \
3123         PrinterSurfaceData.m \
3124         PrinterView.m \
3125         QuartzSurfaceData.m \
3126         QuartzRenderer.m \
3127         CTextPipe.m \
3128         ImageSurfaceData.m \
3129         awt_DrawingSurface.m \
3130         \
3131         OGLBlitLoops.c \
3132         OGLBufImgOps.c \
3133         OGLContext.c \
3134         OGLFuncs.c \
3135         OGLMaskBlit.c \
3136         OGLMaskFill.c \
3137         OGLPaints.c \
3138         OGLRenderQueue.c \
3139         OGLRenderer.c \
3140         OGLSurfaceData.c \
3141         OGLTextRenderer.c \
3142         OGLVertexCache.c \
3143         AccelGlyphCache.c \
3144         CUPSfuncs.c
3145 
3146 
3147 LIBAWT_LWAWT_DIRS:=\
3148   $(JDK_TOPDIR)/src/macosx/native/sun/awt \
3149   $(JDK_TOPDIR)/src/macosx/native/sun/font \
3150   $(JDK_TOPDIR)/src/macosx/native/sun/java2d/opengl \
3151   $(JDK_TOPDIR)/src/solaris/native/sun/awt \
3152   $(JDK_TOPDIR)/src/share/native/sun/font \
3153   $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
3154 
3155 $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT,\
3156                 LIBRARY:=awt_lwawt,\
3157                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
3158                 SRC:=$(LIBAWT_LWAWT_DIRS),\
3159                 LANG:=C,\
3160                 INCLUDE_FILES:=$(LIBAWT_LWAWT_FILES),\
3161                 OPTIMIZATION:=LOW, \
3162                 CFLAGS:=$(CFLAGS_JDKLIB) \
3163                         $(X_CFLAGS) \
3164                         $(X_LIBS) \
3165                         $(foreach dir,$(LIBAWT_LWAWT_DIRS),-I$(dir)) \
3166                         -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
3167                         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
3168                         -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d \
3169                         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
3170                         -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
3171                         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
3172                         -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
3173                         -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
3174                         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3175                         -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks,\
3176                 LDFLAGS:=$(LDFLAGS_JDKLIB)\
3177                          $(call SET_SHARED_LIBRARY_ORIGIN), \
3178                 LDFLAGS_SUFFIX_macosx:=-lawt -lmlib_image -losxapp -ljvm $(LIBM) \
3179                                        -framework Accelerate \
3180                                        -framework ApplicationServices \
3181                                        -framework AudioToolbox \
3182                                        -framework Carbon \
3183                                        -framework Cocoa \
3184                                        -framework Security \
3185                                        -framework ExceptionHandling \
3186                                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3187                                        -framework JavaNativeFoundation \
3188                                        -framework JavaRuntimeSupport \
3189                                        -framework OpenGL \
3190                                        -framework QuartzCore -ljava,\
3191                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_lwawt))
3192 
3193 BUILD_LIBRARIES += $(BUILD_LIBAWT_LWAWT)
3194 
3195 $(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBAWT) 
3196 
3197 $(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBMLIB_IMAGE)
3198 
3199 $(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBOSXAPP)
3200 
3201 $(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBJAVA)
3202 
3203 endif
3204 
3205 ##########################################################################################
3206 
3207 ifeq ($(OPENJDK_TARGET_OS), macosx)
3208 
3209 $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI,\
3210                 LIBRARY:=osxui,\
3211                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
3212                 SRC:=$(JDK_TOPDIR)/src/macosx/native/com/apple/laf,\
3213                 LANG:=C,\
3214                 OPTIMIZATION:=LOW, \
3215                 CFLAGS:=$(CFLAGS_JDKLIB) \
3216                         -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
3217                         -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
3218                         -I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
3219                         -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
3220                 LDFLAGS:=$(LDFLAGS_JDKLIB)\
3221                          $(call SET_SHARED_LIBRARY_ORIGIN) \
3222                          -Xlinker -rpath -Xlinker @loader_path,\
3223                 LDFLAGS_SUFFIX_macosx:=-lawt -losxapp -lawt_lwawt \
3224                                        -framework Cocoa \
3225                                        -framework Carbon \
3226                                        -framework ApplicationServices \
3227                                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3228                                        -framework JavaNativeFoundation \
3229                                        -framework JavaRuntimeSupport \
3230                                        -ljava -ljvm,\
3231                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libosxui))
3232 
3233 BUILD_LIBRARIES += $(BUILD_LIBOSXUI)
3234 
3235 $(BUILD_LIBOSXUI) : $(BUILD_LIBAWT) 
3236 
3237 $(BUILD_LIBOSXUI) : $(BUILD_LIBOSXAPP)
3238 
3239 $(BUILD_LIBOSXUI) : $(BUILD_LIBAWT_LWAWT)
3240 
3241 #$(BUILD_LIBOSXUI) : $(BUILD_LIBJAVA)
3242 
3243 endif
3244 
3245 ##########################################################################################
3246 
3247 ifeq ($(OPENJDK_TARGET_OS), macosx)
3248 
3249 # Ugly hack to mimic behaviour in old build where this is built as an xcode project.
3250 SET_SHARED_LIBRARY_NAME=-Xlinker -install_name -Xlinker /usr/local/lib/libJObjC.dylib
3251 
3252 $(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC32,\
3253                 LIBRARY:=JObjC,\
3254                 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/libjobjc32,\
3255                 SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \
3256                      $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native ,\
3257                 LANG:=C,\
3258                 OPTIMIZATION:=LOW, \
3259                 CFLAGS:=-fpascal-strings \
3260                         -fobjc-gc \
3261                         -gdwarf-2 \
3262                         $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \
3263                         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3264                         -m32,\
3265                 LDFLAGS:=$(LDFLAGS_JDKLIB)\
3266                         -m32, \
3267                 LDFLAGS_SUFFIX:=-framework Foundation -framework JavaVM \
3268                                   -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3269                                   -framework JavaNativeFoundation \
3270                                   -lffi, \
3271                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjobjc32))
3272 
3273 $(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC64,\
3274                 LIBRARY:=JObjC,\
3275                 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/libjobjc64,\
3276                 SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \
3277                      $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native ,\
3278                 LANG:=C,\
3279                 OPTIMIZATION:=LOW, \
3280                 CFLAGS:=-fpascal-strings \
3281                         -fobjc-gc \
3282                         -gdwarf-2 \
3283                         $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \
3284                         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3285                         , \
3286                 LDFLAGS:=-fpascal-strings \
3287                          -fobjc-gc \
3288                          -gdwarf-2 \
3289                          $(LDFLAGS_JDKLIB)\
3290                          $(call SET_SHARED_LIBRARY_ORIGIN), \
3291                 LDFLAGS_SUFFIX:=-framework Foundation -framework JavaVM \
3292                                   -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
3293                                   -framework JavaNativeFoundation \
3294                                   -lffi, \
3295                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjobjc64))
3296 
3297 $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX): $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64)
3298         $(LIPO) -create -output $@ $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64)
3299 
3300 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX)
3301 
3302 endif
3303 
3304 ##########################################################################################
3305 
3306 ifndef OPENJDK
3307 ifeq ($(OPENJDK_TARGET_OS), windows)
3308 
3309   ACCESSBRIDGE_SRCDIR:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
3310 
3311   define SetupAccessBridge
3312     # Parameter 1 Suffix
3313     # Parameter 2 Machine
3314     # Parameter 3 ACCESSBRIDGE_ARCH_ suffix
3315 
3316     $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1,\
3317                 LIBRARY=JAWTAccessBridge$1,\
3318                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
3319                 SRC:=$(ACCESSBRIDGE_SRCDIR),\
3320                 INCLUDE_FILES:=JAWTAccessBridge.cpp,\
3321                 LANG:=C++,\
3322                 OPTIMIZATION:=LOW,\
3323                 CFLAGS:=$(CFLAGS_JDKLIB) \
3324                         -DACCESSBRIDGE_ARCH_$3,\
3325                 LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
3326                          winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
3327                          ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
3328                          -subsystem:windows -machine:$2 \
3329                          -def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF,\
3330                 VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
3331                 RC_FLAGS:=$(RC_FLAGS),\
3332                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1,\
3333                 DEBUG_SYMBOLS:=true)
3334 
3335     $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
3336 
3337     $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1,\
3338                 LIBRARY=JavaAccessBridge$1,\
3339                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
3340                 SRC:=$(ACCESSBRIDGE_SRCDIR),\
3341                 INCLUDE_FILES:=AccessBridgeATInstance.cpp AccessBridgeDebug.cpp \
3342                                AccessBridgeJavaEntryPoints.cpp \
3343                                AccessBridgeMessages.cpp JavaAccessBridge.cpp,\
3344                 LANG:=C++,\
3345                 OPTIMIZATION:=LOW,\
3346                 CFLAGS:=$(CFLAGS_JDKLIB) \
3347                         -DACCESSBRIDGE_ARCH_$3,\
3348                 LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
3349                          winspool.lib comdlg32.lib advapi32.lib shell32.lib \
3350                          ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
3351                          -subsystem:windows -machine:$2 \
3352                          -def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF,\
3353                 VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
3354                 RC_FLAGS:=$(RC_FLAGS),\
3355                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjavaaccessbridge$1,\
3356                 DEBUG_SYMBOLS:=true)
3357 
3358     $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1,\
3359                 LIBRARY=WindowsAccessBridge$1,\
3360                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
3361                 SRC:=$(ACCESSBRIDGE_SRCDIR),\
3362                 INCLUDE_FILES:=AccessBridgeJavaVMInstance.cpp AccessBridgeMessageQueue.cpp \
3363                                AccessBridgeMessages.cpp AccessBridgeWindowsEntryPoints.cpp \
3364                                WinAccessBridge.cpp AccessBridgeDebug.cpp \
3365                                AccessBridgeEventHandler.cpp,\
3366                 LANG:=C++,\
3367                 OPTIMIZATION:=LOW,\
3368                 CFLAGS:=$(filter-out -MD,$(CFLAGS_JDKLIB)) -MT \
3369                         -DACCESSBRIDGE_ARCH_$3,\
3370                 LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
3371                          winspool.lib comdlg32.lib advapi32.lib shell32.lib \
3372                          ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
3373                          -subsystem:windows -machine:$2 \
3374                          -def:$(ACCESSBRIDGE_SRCDIR)/WinAccessBridge.DEF,\
3375                 VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
3376                 RC_FLAGS:=$(RC_FLAGS),\
3377                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libwindowsaccessbridge$1,\
3378                 DEBUG_SYMBOLS:=true)
3379 
3380     BUILD_LIBRARIES += $$(BUILD_JAWTACCESSBRIDGE$1) $$(BUILD_JAVAACCESSBRIDGE$1) \
3381                        $$(BUILD_WINDOWSACCESSBRIDGE$1)
3382 
3383   endef
3384 
3385   ifeq ($(OPENJDK_TARGET_CPU_BITS),32)
3386     $(eval $(call SetupAccessBridge,-32,I386,32))
3387     $(eval $(call SetupAccessBridge,,I386,LEGACY))
3388   else
3389     $(eval $(call SetupAccessBridge,-64,X64,64))
3390   endif
3391 endif
3392 endif
3393 
3394 
3395 ##########################################################################################
3396 
3397 all: $(COPY_FILES) $(BUILD_LIBRARIES)
3398 
3399 .PHONY: all