source: trunk/openjdk/jdk/make/common/Defs-os2.gmk

Last change on this file was 333, checked in by dmik, 14 years ago

jdk: Fix a whole bunch of warnings and a few build errors.

GCC is more strict than MSVC.

  • Property svn:executable set to *
File size: 6.2 KB
Line 
1#
2# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2010 netlabs.org. OS/2 parts
6#
7# This code is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License version 2 only, as
9# published by the Free Software Foundation. Sun designates this
10# particular file as subject to the "Classpath" exception as provided
11# by Sun in the LICENSE file that accompanied this code.
12#
13# This code is distributed in the hope that it will be useful, but WITHOUT
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16# version 2 for more details (a copy is included in the LICENSE file that
17# accompanied this code).
18#
19# You should have received a copy of the GNU General Public License version
20# 2 along with this work; if not, write to the Free Software Foundation,
21# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22#
23# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
24# CA 95054 USA or visit www.sun.com if you need additional information or
25# have any questions.
26#
27
28#
29# Makefile to specify compiler flags for programs and libraries
30# targeted to Windows builds. Should not contain any rules.
31#
32# WARNING: This file is shared with other workspaces.
33# So when it includes other files, it must use JDK_TOPDIR.
34#
35
36# Get shared JDK settings
37include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
38
39# LIB_LOCATION, which for OS/2 identifies where .exe files go, may be
40# set by each GNUmakefile. The default is BINDIR.
41ifndef LIB_LOCATION
42 LIB_LOCATION = $(BINDIR)
43endif # LIB_LOCATION
44
45# Part of INCREMENTAL_BUILD mechanism.
46# Compiler emits things like: file.obj: file.c file.h...
47# We want something like: obj_path/file.obj: file.c file.h...
48CC_DEPEND = -MM -MT $(@:$(suffix $@)=.$(OBJECT_SUFFIX))
49CC_DEPEND_FILTER =
50
51ifndef PLATFORM_SRC
52 # We mostly reuse the windows code so far.
53 PLATFORM_SRC = $(BUILDDIR)/../src/windows
54endif # PLATFORM_SRC
55
56ifndef PLATFORM_SRC_OS2
57 # OS/2 is based on Odin32 so PLATFORM_SRC is 'windows'. But in some cases we
58 # provide the native bits and need to refer to a separate 'os2' soorce tree
59 PLATFORM_SRC_OS2 = $(PLATFORM_SRC:%/windows=%/os2)
60endif
61
62ifeq ($(PLATFORM_SRC), $(PLATFORM_SRC_OS2))
63 $(error Both PLATFORM_SRC and PLATFORM_SRC_OS2 are '$(PLATFOROM_SRC)'!)
64endif
65
66# Platform specific closed sources
67ifndef OPENJDK
68 ifndef CLOSED_PLATFORM_SRC
69 CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/os2
70 endif
71endif
72
73# platform specific include files
74PLATFORM_INCLUDE_NAME = os2
75PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
76
77# suffix used for make dependencies files.
78DEPEND_SUFFIX = dep
79# The suffix applied to the library name for FDLIBM
80FDDLIBM_SUFFIX = lib
81# The suffix applied to scripts (.bat for windows, nothing for unix)
82SCRIPT_SUFFIX = cmd
83# CC compiler object code output directive flag value
84CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
85CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
86
87#
88# Default HPI libraries. Build will build only native, unless
89# overriden at the make command line. This makes it convenient for
90# people doing, say, a pthreads port -- they can create a posix
91# directory here, and say "gnumake HPIS=posix" at the top
92# level.
93#
94HPIS = windows
95
96#
97# Default optimization
98#
99CC_HIGHEST_OPT = -O3
100CC_HIGHER_OPT = -O3
101CC_LOWER_OPT = -O2
102CC_NO_OPT =
103
104ifeq ($(PRODUCT), java)
105 _OPT = $(CC_HIGHER_OPT)
106else
107 _OPT = $(CC_LOWER_OPT)
108 CPPFLAGS_DBG += -DLOGGING
109endif
110
111# If NO_OPTIMIZATIONS is defined in the environment, turn all optimzations off
112ifdef NO_OPTIMIZATIONS
113 CC_HIGHEST_OPT = $(CC_NO_OPT)
114 CC_HIGHER_OPT = $(CC_NO_OPT)
115 CC_LOWER_OPT = $(CC_NO_OPT)
116endif
117
118#
119# Selection of warning messages
120#
121GCC_INHIBIT = -Wno-unused -Wno-parentheses
122GCC_STYLE =
123GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
124
125# We compile a lot of MSVC code which seems to silently tolerate this
126GCC_WARNINGS += -Wno-sign-compare -Wno-type-limits -Wno-missing-field-initializers -Wno-missing-braces
127GCC_WARNINGS_C += -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
128GCC_WARNINGS_CXX += -Wno-write-strings
129
130#
131# Treat compiler warnings as errors, if warnings not allowed
132#
133ifeq ($(COMPILER_WARNINGS_FATAL),true)
134 GCC_WARNINGS += -Werror
135endif
136
137#
138# Misc compiler options
139#
140CFLAGS_COMMON = $(GCC_WARNINGS) $(GCC_WARNINGS_C) -march=i486 -mtune=generic -Zomf
141CFLAGS_OPT = -s $(POPT)
142CFLAGS_DBG = -g
143
144CXXFLAGS_COMMON = -DCC_NOEX $(GCC_WARNINGS) $(GCC_WARNINGS_CXX) -march=i486 -mtune=generic -Zomf
145CXXFLAGS_OPT = $(CFLAGS_OPT)
146CXXFLAGS_DBG = $(CFLAGS_DBG)
147
148# Some code uses very unstrict aliasing turn this optimization off
149CFLAGS_COMMON += -fno-strict-aliasing
150CXXFLAGS_COMMON += -fno-strict-aliasing
151
152#
153# Preprocessor macro definitions
154#
155CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DOS2 -D_LITTLE_ENDIAN $(VERSION_DEFINES)
156CPPFLAGS_OPT =
157CPPFLAGS_DBG = -DDEBUG
158
159#
160# Linker options
161#
162LDFLAGS_COMMON = -Zomf -Zmap -Zstack 0x2000 -Zhigh-mem -Zno-fork -Zno-unix
163LDFLAGS_OPT = -s
164LDFLAGS_DBG =
165
166ifeq ($(EMXOMFLD_TYPE), WLINK)
167 LDFLAGS_COMMON += -Zlinker "DISABLE 1121"
168endif
169ifeq ($(EMXOMFLD_TYPE), VAC308)
170 LDFLAGS_COMMON += -Zlinker /OPTFUNC
171endif
172
173#
174# Additional libraries needed by all targets
175#
176
177CPPFLAGS_COMMON += -D__WIN32OS2__ -D__i386__ -DSTRICT -D_POSIX_SOURCE \
178 -D_POSIX_C_SOURCE=200112 -D_EMX_SOURCE -D_XOPEN_SOURCE=600 \
179 -D_SVID_SOURCE -DOS2EMX_PLAIN_CHAR
180CPPFLAGS_COMMON += -I$(ODINSDK_HEADERS_PATH)/Win -I$(ODINSDK_HEADERS_PATH) \
181 -DWINE_LARGE_INTEGER
182
183LDFLAGS_OPT += -L$(ODINSDK_LIB_PATH)
184LDFLAGS_DBG += -L$(firstword $(ODINSDK_DBGLIB_PATH) $(ODINSDK_LIB_PATH))
185LDFLAGS_COMMON += -lkernel32.lib -luser32.lib -ladvapi32.lib \
186 -lminivcrt.lib -lntdll.lib -llibwrap.lib
187
188#
189# Path and option to link against the VM, if you have to.
190#
191JVMLIB = $(LIBDIR)/jvm.lib
192JAVALIB = $(LIBDIR)/java.lib
193
194LIBRARY_SUFFIX = dll
195LIB_SUFFIX = lib
196
197# Settings for the JDI - Serviceability Agent binding.
198HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/bin
199SALIB_NAME = $(LIB_PREFIX)sawindbg.$(LIBRARY_SUFFIX)
200SAMAP_NAME = $(LIB_PREFIX)sawindbg.map
201
202# SA is not supported so far.
203INCLUDE_SA = false
204
Note: See TracBrowser for help on using the repository browser.