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