duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 1 | # |
alanb | 0d05823 | 2012-11-02 15:50:11 +0000 | [diff] [blame^] | 2 | # Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 7 | # published by the Free Software Foundation. Oracle designates this |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 8 | # particular file as subject to the "Classpath" exception as provided |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 9 | # by Oracle in the LICENSE file that accompanied this code. |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 | # |
ohair | 2283b9d | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 22 | # or visit www.oracle.com if you need additional information or have any |
| 23 | # questions. |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 24 | # |
| 25 | |
| 26 | # |
| 27 | # to create directory: |
| 28 | # |
| 29 | INIT += $(LIB_LOCATION) |
| 30 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 31 | # |
| 32 | # Files |
| 33 | # |
| 34 | # mawt.gmk is just used in building X/Motif native code, so |
| 35 | # this list of java files is no longer included. |
| 36 | #include FILES_java_unix.gmk |
| 37 | include $(BUILDDIR)/sun/awt/FILES_c_unix.gmk |
| 38 | |
| 39 | include $(BUILDDIR)/sun/awt/FILES_export_unix.gmk |
| 40 | |
| 41 | # Check which C files should be built. Headless uses only |
| 42 | # non-motif files. Also, a version-specific motif file is |
| 43 | # compiled based on the motif version. |
serb | df025b4 | 2011-11-12 04:13:38 +0400 | [diff] [blame] | 44 | FILES_c = $(FILES_NO_MOTIF_c) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 45 | |
| 46 | ifeq ($(PLATFORM), solaris) |
| 47 | ifneq ($(ARCH), amd64) |
| 48 | FILES_reorder += reorder-$(ARCH) |
| 49 | endif |
| 50 | endif |
| 51 | |
| 52 | # |
| 53 | # Rules |
| 54 | # |
| 55 | |
| 56 | # Class files should be built & clobbered in make/sun/awt |
| 57 | # If removing this line, also reinclude sun_awt.jmk |
| 58 | DONT_CLOBBER_CLASSES = true |
| 59 | |
| 60 | |
| 61 | ifndef HEADLESS |
| 62 | ifeq ($(VARIANT), OPT) |
| 63 | FILES_m = ../awt/mapfile-mawt-vers |
| 64 | endif |
| 65 | endif |
| 66 | |
| 67 | # Since this library will be living in a subdirectory below the other libraries |
| 68 | # we need to add an extra runpath so that libraries in the upper directory |
| 69 | # are found at runtime. |
| 70 | LD_RUNPATH_EXTRAS = .. |
| 71 | |
| 72 | include $(BUILDDIR)/common/Mapfile-vers.gmk |
| 73 | include $(BUILDDIR)/common/Library.gmk |
| 74 | |
| 75 | $(LIB_LOCATION): |
| 76 | $(MKDIR) -p $@ |
| 77 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 78 | clean:: |
| 79 | |
| 80 | # |
| 81 | # Add to the ambient vpath to pick up files in subdirectories |
| 82 | # |
| 83 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/alphacomposite |
| 84 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image |
| 85 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/gif |
| 86 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/cvutils |
| 87 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/shell |
| 88 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/medialib |
| 89 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl |
| 90 | vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl |
| 91 | vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11 |
| 92 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/debug |
| 93 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../font |
| 94 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d |
| 95 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops |
| 96 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe |
| 97 | vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/image |
| 98 | vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/robot_child |
| 99 | |
| 100 | # |
| 101 | # Libraries to link in. |
| 102 | # |
| 103 | |
| 104 | |
aph | d46bd76 | 2009-04-17 15:56:20 +0100 | [diff] [blame] | 105 | ifeq ($(DEBUG_BINARIES), true) |
| 106 | CFLAGS += -g |
| 107 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 108 | ifeq ($(HEADLESS),true) |
| 109 | CFLAGS += -DHEADLESS=$(HEADLESS) |
| 110 | CPPFLAGS += -DHEADLESS=$(HEADLESS) |
| 111 | OTHER_LDLIBS = |
| 112 | else |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 113 | LIBXTST = -lXtst |
yan | 0dcf7c8 | 2008-06-19 11:26:54 +0400 | [diff] [blame] | 114 | ifeq ($(PLATFORM), linux) |
| 115 | ifeq ($(ARCH_DATA_MODEL), 64) |
| 116 | # XXX what about the rest of them? |
| 117 | LIBXT = -lXt |
| 118 | else |
| 119 | # Allows for builds on Debian GNU Linux, X11 is in a different place |
dholmes | 55e3c86 | 2011-03-25 07:09:38 -0400 | [diff] [blame] | 120 | LIBXT = $(firstword $(wildcard $(OPENWIN_LIB)/libXt.a) \ |
yan | 0dcf7c8 | 2008-06-19 11:26:54 +0400 | [diff] [blame] | 121 | $(wildcard /usr/lib/libXt.a)) |
dholmes | 55e3c86 | 2011-03-25 07:09:38 -0400 | [diff] [blame] | 122 | LIBSM = $(firstword $(wildcard $(OPENWIN_LIB)/libSM.a) \ |
yan | 0dcf7c8 | 2008-06-19 11:26:54 +0400 | [diff] [blame] | 123 | $(wildcard /usr/lib/libSM.a)) |
dholmes | 55e3c86 | 2011-03-25 07:09:38 -0400 | [diff] [blame] | 124 | LIBICE = $(firstword $(wildcard $(OPENWIN_LIB)/libICE.a) \ |
yan | 0dcf7c8 | 2008-06-19 11:26:54 +0400 | [diff] [blame] | 125 | $(wildcard /usr/lib/libICE.a)) |
dholmes | 55e3c86 | 2011-03-25 07:09:38 -0400 | [diff] [blame] | 126 | LIBXTST = $(firstword $(wildcard $(OPENWIN_LIB)/libXtst.a) \ |
yan | 0dcf7c8 | 2008-06-19 11:26:54 +0400 | [diff] [blame] | 127 | $(wildcard /usr/lib/libXtst.a)) |
| 128 | endif |
| 129 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 130 | |
| 131 | # Use -lXmu for EditRes support |
| 132 | LIBXMU_DBG = -lXmu |
| 133 | LIBXMU_OPT = |
| 134 | LIBXMU = $(LIBXMU_$(VARIANT)) |
| 135 | |
| 136 | ifeq ($(PLATFORM), solaris) |
yan | 0dcf7c8 | 2008-06-19 11:26:54 +0400 | [diff] [blame] | 137 | OTHER_LDLIBS = -lXt -lXext $(LIBXTST) $(LIBXMU) -lX11 -lXi |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 138 | endif |
| 139 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 140 | ifneq (,$(findstring $(PLATFORM), linux macosx)) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 141 | OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH |
yan | 0dcf7c8 | 2008-06-19 11:26:54 +0400 | [diff] [blame] | 142 | # XXX what is this define below? Isn't it motif-related? |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 143 | OTHER_CFLAGS += -DXMSTRINGDEFINES=1 |
yan | 0dcf7c8 | 2008-06-19 11:26:54 +0400 | [diff] [blame] | 144 | OTHER_LDLIBS = $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 145 | endif |
| 146 | |
| 147 | endif |
| 148 | # !HEADLESS |
| 149 | |
| 150 | OTHER_LDLIBS += $(JVMLIB) $(LIBCXX) \ |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 151 | -lawt $(LIBM) $(LIBDL) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 152 | |
| 153 | # |
| 154 | # Sun CC with -Xa misdefines __STDC__ to 0 (zero). |
| 155 | # The following will force checking of X11 prototypes. |
| 156 | # |
| 157 | ifneq ($(CC_VERSION),gcc) |
| 158 | CPPFLAGS += -DFUNCPROTO=15 |
| 159 | endif |
| 160 | |
| 161 | # |
| 162 | # Other extra flags needed for compiling. |
| 163 | # |
| 164 | CPPFLAGS += -I$(CUPS_HEADERS_PATH) |
| 165 | |
| 166 | ifndef HEADLESS |
yan | 0dcf7c8 | 2008-06-19 11:26:54 +0400 | [diff] [blame] | 167 | CPPFLAGS += -I$(OPENWIN_HOME)/include |
| 168 | LDFLAGS += -L$(OPENWIN_LIB) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 169 | |
| 170 | endif # !HEADLESS |
| 171 | |
| 172 | CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \ |
| 173 | -I$(SHARE_SRC)/native/$(PKGDIR)/../font \ |
| 174 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/../font \ |
| 175 | -I$(SHARE_SRC)/native/$(PKGDIR)/image \ |
| 176 | -I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \ |
| 177 | -I$(SHARE_SRC)/native/$(PKGDIR)/shell \ |
| 178 | -I$(SHARE_SRC)/native/$(PKGDIR)/alphacomposite \ |
| 179 | -I$(SHARE_SRC)/native/$(PKGDIR)/medialib \ |
| 180 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/medialib \ |
| 181 | -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d \ |
| 182 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d \ |
| 183 | -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops \ |
| 184 | -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe \ |
| 185 | -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl \ |
| 186 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl \ |
| 187 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11 \ |
| 188 | -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/doe \ |
| 189 | -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/path \ |
| 190 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/../jdga \ |
| 191 | -I$(PLATFORM_SRC)/native/$(PKGDIR) \ |
| 192 | $(EVENT_MODEL) |
| 193 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 194 | ifeq ($(PLATFORM), macosx) |
| 195 | CPPFLAGS += -I$(CUPS_HEADERS_PATH) |
| 196 | |
| 197 | ifndef HEADLESS |
| 198 | CPPFLAGS += -I$(MOTIF_DIR)/include \ |
| 199 | -I$(OPENWIN_HOME)/include |
| 200 | LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB) |
| 201 | |
| 202 | endif # !HEADLESS |
| 203 | endif # PLATFORM |
| 204 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 205 | ifeq ($(PLATFORM), linux) |
dholmes | 55e3c86 | 2011-03-25 07:09:38 -0400 | [diff] [blame] | 206 | # Checking for the X11/extensions headers at the additional location |
| 207 | CPPFLAGS += -I$(firstword $(wildcard $(OPENWIN_HOME)/include/X11/extensions) \ |
| 208 | $(wildcard /usr/include/X11/extensions)) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 209 | endif |
| 210 | |
michaelm | 96f23c9 | 2012-03-23 11:28:58 +0000 | [diff] [blame] | 211 | ifeq ($(PLATFORM), macosx) |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 212 | CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \ |
| 213 | -I$(OPENWIN_HOME)/include |
| 214 | endif |
| 215 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 216 | ifeq ($(PLATFORM), solaris) |
| 217 | CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions |
| 218 | endif |
| 219 | |
michaelm | 5ac8c15 | 2012-03-06 20:34:38 +0000 | [diff] [blame] | 220 | ifeq ($(PLATFORM), macosx) |
| 221 | CPPFLAGS += -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" |
| 222 | endif |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 223 | |
| 224 | LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/$(TSOBJDIR) \ |
| 225 | $(AWT_RUNPATH) |
| 226 | |
| 227 | CLASSES.export += java.io.InputStream \ |
| 228 | java.lang.ThreadGroup |
| 229 | |