comparison makefiles/CompileNativeLibraries.gmk @ 8491:9850efaedc50

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