1 #
2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
191
192 ifneq ($(OPENJDK_TARGET_OS), solaris)
193 LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
194 endif
195
196 ifeq ($(OPENJDK_TARGET_OS), windows)
197 LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
198 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
199 LIBAWT_CFLAGS += -DMLIB_OS64BIT
200 endif
201
202 LIBAWT_RC_FLAGS ?= -I $(TOPDIR)/src/java.base/windows/native/launcher/icons
203 LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
204 endif
205
206 ifeq ($(OPENJDK_TARGET_OS), linux)
207 # FIXME: This is probably not what we want to do, but keep it now for compatibility.
208 LIBAWT_CFLAGS += $(EXPORT_ALL_SYMBOLS)
209 endif
210
211 # Turn off all warnings for debug_mem.c This is needed because the specific warning
212 # about initializing a declared 'extern' cannot be turned off individually. Only
213 # applies to debug builds.
214 ifeq ($(TOOLCHAIN_TYPE), gcc)
215 BUILD_LIBAWT_debug_mem.c_CFLAGS := -w
216 # This option improves performance of MaskFill in Java2D by 20% for some gcc
217 LIBAWT_CFLAGS += -fgcse-after-reload
218 endif
219
220 $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
221 NAME := awt, \
222 EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \
223 EXCLUDES := $(LIBAWT_EXCLUDES), \
224 EXCLUDE_FILES := $(LIBAWT_EXFILES), \
225 OPTIMIZATION := LOW, \
226 CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
227 EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
228 DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
229 format-nonliteral parentheses unused-value unused-function, \
230 DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer \
231 sign-compare format-nonliteral, \
232 DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
233 DISABLED_WARNINGS_microsoft := 4244 4267 4996, \
234 ASFLAGS := $(LIBAWT_ASFLAGS), \
235 LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
236 LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
237 LDFLAGS_windows := -delayload:user32.dll -delayload:gdi32.dll \
238 -delayload:shell32.dll -delayload:winmm.dll \
239 -delayload:winspool.drv -delayload:imm32.dll \
240 -delayload:ole32.dll -delayload:comdlg32.dll \
241 -delayload:comctl32.dll -delayload:shlwapi.dll, \
242 LIBS_unix := -ljvm -ljava $(LIBM), \
243 LIBS_linux := $(LIBDL), \
244 LIBS_solaris := $(LIBDL), \
245 LIBS_aix := $(LIBDL),\
246 LIBS_macosx := -lmlib_image \
247 -framework Cocoa \
248 -framework OpenGL \
249 -framework JavaNativeFoundation \
250 -framework JavaRuntimeSupport \
251 -framework ApplicationServices \
252 -framework AudioToolbox, \
253 LIBS_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
296 LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
297 $(FONTCONFIG_CFLAGS) \
298 $(CUPS_CFLAGS)
299
300 ifeq ($(OPENJDK_TARGET_OS), solaris)
301 LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
302 endif
303
304 ifeq ($(OPENJDK_TARGET_OS), linux)
305 ifeq ($(DISABLE_XRENDER), true)
306 LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
307 endif
308 endif
309
310 LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm
311
312 ifeq ($(OPENJDK_TARGET_OS), linux)
313 LIBAWT_XAWT_LIBS += -lpthread
314 endif
315
316 ifeq ($(TOOLCHAIN_TYPE), gcc)
317 # Turn off all warnings for the following files since they contain warnings
318 # that cannot be turned of individually.
319 # redefining a macro
320 BUILD_LIBAWT_XAWT_gtk2_interface.c_CFLAGS := -w
321 # comparison between pointer and integer
322 BUILD_LIBAWT_XAWT_awt_Font.c_CFLAGS := -w
323 # initializing a declared 'extern'
324 BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w
325 endif
326
327 $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
328 NAME := awt_xawt, \
329 EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
330 EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
331 EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
332 OPTIMIZATION := LOW, \
333 CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
334 $(X_CFLAGS), \
335 WARNINGS_AS_ERRORS_xlc := false, \
336 DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \
337 unused-result maybe-uninitialized format \
338 format-security int-to-pointer-cast parentheses \
339 implicit-fallthrough undef unused-function, \
340 DISABLED_WARNINGS_clang := parentheses format undef \
341 logical-op-parentheses format-nonliteral int-conversion, \
342 DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
343 E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
344 LDFLAGS := $(LDFLAGS_JDKLIB) \
345 $(call SET_SHARED_LIBRARY_ORIGIN) \
346 -L$(INSTALL_LIBRARIES_HERE), \
347 LIBS := $(X_LIBS) $(LIBAWT_XAWT_LIBS), \
348 ))
349
350 $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
351
352 $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
353
354 TARGETS += $(BUILD_LIBAWT_XAWT)
355
356 endif
357 endif
358
359 ################################################################################
360
361 # The fast floor code loses precision.
|
1
2 #
3 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # This code is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License version 2 only, as
8 # published by the Free Software Foundation. Oracle designates this
9 # particular file as subject to the "Classpath" exception as provided
10 # by Oracle in the LICENSE file that accompanied this code.
11 #
12 # This code is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 # version 2 for more details (a copy is included in the LICENSE file that
16 # accompanied this code).
17 #
18 # You should have received a copy of the GNU General Public License version
19 # 2 along with this work; if not, write to the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 #
192
193 ifneq ($(OPENJDK_TARGET_OS), solaris)
194 LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
195 endif
196
197 ifeq ($(OPENJDK_TARGET_OS), windows)
198 LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
199 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
200 LIBAWT_CFLAGS += -DMLIB_OS64BIT
201 endif
202
203 LIBAWT_RC_FLAGS ?= -I $(TOPDIR)/src/java.base/windows/native/launcher/icons
204 LIBAWT_VERSIONINFO_RESOURCE := $(TOPDIR)/src/$(MODULE)/windows/native/libawt/windows/awt.rc
205 endif
206
207 ifeq ($(OPENJDK_TARGET_OS), linux)
208 # FIXME: This is probably not what we want to do, but keep it now for compatibility.
209 LIBAWT_CFLAGS += $(EXPORT_ALL_SYMBOLS)
210 endif
211
212 ifeq ($(TOOLCHAIN_TYPE), gcc)
213 # This option improves performance of MaskFill in Java2D by 20% for some gcc
214 LIBAWT_CFLAGS += -fgcse-after-reload
215 endif
216
217 $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
218 NAME := awt, \
219 EXTRA_SRC := $(LIBAWT_EXTRA_SRC), \
220 EXCLUDES := $(LIBAWT_EXCLUDES), \
221 EXCLUDE_FILES := $(LIBAWT_EXFILES), \
222 OPTIMIZATION := LOW, \
223 CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
224 EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
225 DISABLED_WARNINGS_gcc := unused-value unused-function, \
226 DISABLED_WARNINGS_clang := format-nonliteral, \
227 DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
228 DISABLED_WARNINGS_microsoft := 4996, \
229 ASFLAGS := $(LIBAWT_ASFLAGS), \
230 LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
231 LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
232 LDFLAGS_windows := -delayload:user32.dll -delayload:gdi32.dll \
233 -delayload:shell32.dll -delayload:winmm.dll \
234 -delayload:winspool.drv -delayload:imm32.dll \
235 -delayload:ole32.dll -delayload:comdlg32.dll \
236 -delayload:comctl32.dll -delayload:shlwapi.dll, \
237 LIBS_unix := -ljvm -ljava $(LIBM), \
238 LIBS_linux := $(LIBDL), \
239 LIBS_solaris := $(LIBDL), \
240 LIBS_aix := $(LIBDL),\
241 LIBS_macosx := -lmlib_image \
242 -framework Cocoa \
243 -framework OpenGL \
244 -framework JavaNativeFoundation \
245 -framework JavaRuntimeSupport \
246 -framework ApplicationServices \
247 -framework AudioToolbox, \
248 LIBS_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
291 LIBAWT_XAWT_CFLAGS += -DXAWT -DXAWT_HACK \
292 $(FONTCONFIG_CFLAGS) \
293 $(CUPS_CFLAGS)
294
295 ifeq ($(OPENJDK_TARGET_OS), solaris)
296 LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
297 endif
298
299 ifeq ($(OPENJDK_TARGET_OS), linux)
300 ifeq ($(DISABLE_XRENDER), true)
301 LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
302 endif
303 endif
304
305 LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm
306
307 ifeq ($(OPENJDK_TARGET_OS), linux)
308 LIBAWT_XAWT_LIBS += -lpthread
309 endif
310
311 $(eval $(call SetupJdkLibrary, BUILD_LIBAWT_XAWT, \
312 NAME := awt_xawt, \
313 EXTRA_SRC := $(LIBAWT_XAWT_EXTRA_SRC), \
314 EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
315 EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
316 OPTIMIZATION := LOW, \
317 CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
318 $(X_CFLAGS), \
319 WARNINGS_AS_ERRORS_xlc := false, \
320 DISABLED_WARNINGS_gcc := format implicit-fallthrough unused-function, \
321 DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
322 E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
323 LDFLAGS := $(LDFLAGS_JDKLIB) \
324 $(call SET_SHARED_LIBRARY_ORIGIN) \
325 -L$(INSTALL_LIBRARIES_HERE), \
326 LIBS := $(X_LIBS) $(LIBAWT_XAWT_LIBS), \
327 ))
328
329 $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
330
331 $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
332
333 TARGETS += $(BUILD_LIBAWT_XAWT)
334
335 endif
336 endif
337
338 ################################################################################
339
340 # The fast floor code loses precision.
|