duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | # |
| 2 | # Copyright 2000-2007 Sun Microsystems, Inc. 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. Sun designates this |
| 8 | # particular file as subject to the "Classpath" exception as provided |
| 9 | # by Sun in the LICENSE file that accompanied this code. |
| 10 | # |
| 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | # version 2 for more details (a copy is included in the LICENSE file that |
| 15 | # accompanied this code). |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License version |
| 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | # |
| 21 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | # CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | # have any questions. |
| 24 | # |
| 25 | |
| 26 | # |
| 27 | # to create directory: |
| 28 | # |
| 29 | INIT += $(LIB_LOCATION) |
| 30 | |
| 31 | ifndef HEADLESS |
| 32 | ifeq ($(PLATFORM), linux) |
| 33 | ifeq ($(STATIC_MOTIF),false) |
| 34 | INIT += $(LIB_LOCATION)/libXm.so |
| 35 | endif |
| 36 | endif |
| 37 | endif |
| 38 | |
| 39 | # |
| 40 | # Files |
| 41 | # |
| 42 | # mawt.gmk is just used in building X/Motif native code, so |
| 43 | # this list of java files is no longer included. |
| 44 | #include FILES_java_unix.gmk |
| 45 | include $(BUILDDIR)/sun/awt/FILES_c_unix.gmk |
| 46 | |
| 47 | include $(BUILDDIR)/sun/awt/FILES_export_unix.gmk |
| 48 | |
| 49 | # Check which C files should be built. Headless uses only |
| 50 | # non-motif files. Also, a version-specific motif file is |
| 51 | # compiled based on the motif version. |
| 52 | ifdef HEADLESS |
| 53 | FILES_c = $(FILES_NO_MOTIF_c) |
| 54 | else |
| 55 | FILES_c = $(FILES_MOTIF_c) $(FILES_NO_MOTIF_c) |
| 56 | |
| 57 | ifeq ($(MOTIF_VERSION), 2) |
| 58 | FILES_c += awt_motif21.c |
| 59 | FILES_c += awt_Choice21.c |
| 60 | endif |
| 61 | |
| 62 | endif |
| 63 | |
| 64 | ifeq ($(PLATFORM), solaris) |
| 65 | ifneq ($(ARCH), amd64) |
| 66 | FILES_reorder += reorder-$(ARCH) |
| 67 | endif |
| 68 | endif |
| 69 | |
| 70 | # |
| 71 | # Rules |
| 72 | # |
| 73 | |
| 74 | # Class files should be built & clobbered in make/sun/awt |
| 75 | # If removing this line, also reinclude sun_awt.jmk |
| 76 | DONT_CLOBBER_CLASSES = true |
| 77 | |
| 78 | |
| 79 | ifndef HEADLESS |
| 80 | ifeq ($(VARIANT), OPT) |
| 81 | FILES_m = ../awt/mapfile-mawt-vers |
| 82 | endif |
| 83 | endif |
| 84 | |
| 85 | # Since this library will be living in a subdirectory below the other libraries |
| 86 | # we need to add an extra runpath so that libraries in the upper directory |
| 87 | # are found at runtime. |
| 88 | LD_RUNPATH_EXTRAS = .. |
| 89 | |
| 90 | include $(BUILDDIR)/common/Mapfile-vers.gmk |
| 91 | include $(BUILDDIR)/common/Library.gmk |
| 92 | |
| 93 | $(LIB_LOCATION): |
| 94 | $(MKDIR) -p $@ |
| 95 | |
| 96 | ifeq ($(PLATFORM), linux) |
| 97 | ifeq ($(STATIC_MOTIF),false) |
| 98 | $(LIB_LOCATION)/libXm.so: |
| 99 | $(CP) $(MOTIF_LIB)/libXm.so $(LIB_LOCATION)/libXm.so |
| 100 | # Automounter problem makes the link fail on Redhat 6.1. |
| 101 | # $(LN) -s $(MOTIF_LIB)/libXm.so $(LIB_LOCATION)/libXm.so |
| 102 | endif |
| 103 | endif |
| 104 | |
| 105 | clean:: |
| 106 | |
| 107 | # |
| 108 | # Add to the ambient vpath to pick up files in subdirectories |
| 109 | # |
| 110 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/alphacomposite |
| 111 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image |
| 112 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/gif |
| 113 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/cvutils |
| 114 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/shell |
| 115 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/medialib |
| 116 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl |
| 117 | vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl |
| 118 | vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11 |
| 119 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/debug |
| 120 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../font |
| 121 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d |
| 122 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops |
| 123 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe |
| 124 | vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/image |
| 125 | vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/robot_child |
| 126 | |
| 127 | # |
| 128 | # Libraries to link in. |
| 129 | # |
| 130 | |
| 131 | |
| 132 | #CFLAGS += -g |
| 133 | ifeq ($(HEADLESS),true) |
| 134 | CFLAGS += -DHEADLESS=$(HEADLESS) |
| 135 | CPPFLAGS += -DHEADLESS=$(HEADLESS) |
| 136 | OTHER_LDLIBS = |
| 137 | else |
| 138 | CFLAGS += -DMOTIF_VERSION=$(MOTIF_VERSION) |
| 139 | |
| 140 | ifeq ($(STATIC_MOTIF),true) |
| 141 | LIBXM = $(MOTIF_LIB)/libXm.a -lXp -lXmu |
| 142 | ifeq ($(PLATFORM), linux) |
| 143 | ifeq ($(ARCH_DATA_MODEL), 64) |
| 144 | LIBXT = -lXt |
| 145 | else |
| 146 | # Allows for builds on Debian GNU Linux, X11 is in a different place |
| 147 | LIBXT = $(firstword $(wildcard /usr/X11R6/lib/libXt.a) \ |
| 148 | $(wildcard /usr/lib/libXt.a)) |
| 149 | LIBSM = $(firstword $(wildcard /usr/X11R6/lib/libSM.a) \ |
| 150 | $(wildcard /usr/lib/libSM.a)) |
| 151 | LIBICE = $(firstword $(wildcard /usr/X11R6/lib/libICE.a) \ |
| 152 | $(wildcard /usr/lib/libICE.a)) |
| 153 | endif |
| 154 | endif |
| 155 | else |
| 156 | LIBXM = -L$(MOTIF_LIB) -lXm -lXp |
| 157 | ifeq ($(PLATFORM), linux) |
| 158 | LIBXT = -lXt |
| 159 | LIBSM = |
| 160 | LIBICE = |
| 161 | endif |
| 162 | endif |
| 163 | |
| 164 | LIBXTST = -lXtst |
| 165 | |
| 166 | # Use -lXmu for EditRes support |
| 167 | LIBXMU_DBG = -lXmu |
| 168 | LIBXMU_OPT = |
| 169 | LIBXMU = $(LIBXMU_$(VARIANT)) |
| 170 | |
| 171 | ifeq ($(PLATFORM), solaris) |
| 172 | OTHER_LDLIBS = $(LIBXM) -lXt -lXext $(LIBXTST) $(LIBXMU) -lX11 -lXi |
| 173 | endif |
| 174 | |
| 175 | ifeq ($(PLATFORM), linux) |
| 176 | OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH |
| 177 | OTHER_CFLAGS += -DMOTIF_VERSION=2 |
| 178 | OTHER_CFLAGS += -DXMSTRINGDEFINES=1 |
| 179 | OTHER_LDLIBS = $(LIBXM) $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi |
| 180 | endif |
| 181 | |
| 182 | endif |
| 183 | # !HEADLESS |
| 184 | |
| 185 | OTHER_LDLIBS += $(JVMLIB) $(LIBCXX) \ |
| 186 | -lawt $(LIBM) -ldl |
| 187 | |
| 188 | # |
| 189 | # Sun CC with -Xa misdefines __STDC__ to 0 (zero). |
| 190 | # The following will force checking of X11 prototypes. |
| 191 | # |
| 192 | ifneq ($(CC_VERSION),gcc) |
| 193 | CPPFLAGS += -DFUNCPROTO=15 |
| 194 | endif |
| 195 | |
| 196 | # |
| 197 | # Other extra flags needed for compiling. |
| 198 | # |
| 199 | CPPFLAGS += -I$(CUPS_HEADERS_PATH) |
| 200 | |
| 201 | ifndef HEADLESS |
| 202 | CPPFLAGS += -I$(MOTIF_DIR)/include \ |
| 203 | -I$(OPENWIN_HOME)/include |
| 204 | LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB) |
| 205 | |
| 206 | endif # !HEADLESS |
| 207 | |
| 208 | CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \ |
| 209 | -I$(SHARE_SRC)/native/$(PKGDIR)/../font \ |
| 210 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/../font \ |
| 211 | -I$(SHARE_SRC)/native/$(PKGDIR)/image \ |
| 212 | -I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \ |
| 213 | -I$(SHARE_SRC)/native/$(PKGDIR)/shell \ |
| 214 | -I$(SHARE_SRC)/native/$(PKGDIR)/alphacomposite \ |
| 215 | -I$(SHARE_SRC)/native/$(PKGDIR)/medialib \ |
| 216 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/medialib \ |
| 217 | -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d \ |
| 218 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d \ |
| 219 | -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops \ |
| 220 | -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe \ |
| 221 | -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl \ |
| 222 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl \ |
| 223 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11 \ |
| 224 | -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/doe \ |
| 225 | -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/path \ |
| 226 | -I$(PLATFORM_SRC)/native/$(PKGDIR)/../jdga \ |
| 227 | -I$(PLATFORM_SRC)/native/$(PKGDIR) \ |
| 228 | $(EVENT_MODEL) |
| 229 | |
| 230 | ifeq ($(PLATFORM), linux) |
| 231 | # Checking for the X11/extensions headers at the additional location |
| 232 | CPPFLAGS += -I/X11R6/include/X11/extensions \ |
| 233 | -I/usr/include/X11/extensions |
| 234 | endif |
| 235 | |
| 236 | ifeq ($(PLATFORM), solaris) |
| 237 | CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions |
| 238 | endif |
| 239 | |
| 240 | |
| 241 | LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/$(TSOBJDIR) \ |
| 242 | $(AWT_RUNPATH) |
| 243 | |
| 244 | CLASSES.export += java.io.InputStream \ |
| 245 | java.lang.ThreadGroup |
| 246 | |