rev 7983 : 8024265: Enable new build on AIX

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