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