common/autoconf/libraries.m4

changeset 839
174a54ce39c4
parent 782
21198f51bc7e
child 863
56db38956113
equal deleted inserted replaced
838:ec48d637778a 839:174a54ce39c4
23 # questions. 23 # questions.
24 # 24 #
25 25
26 AC_DEFUN_ONCE([LIB_SETUP_INIT], 26 AC_DEFUN_ONCE([LIB_SETUP_INIT],
27 [ 27 [
28 28
29 ############################################################################### 29 ###############################################################################
30 # 30 #
31 # OS specific settings that we never will need to probe. 31 # OS specific settings that we never will need to probe.
32 # 32 #
33 if test "x$OPENJDK_TARGET_OS" = xlinux; then 33 if test "x$OPENJDK_TARGET_OS" = xlinux; then
34 AC_MSG_CHECKING([what is not needed on Linux?]) 34 AC_MSG_CHECKING([what is not needed on Linux?])
35 PULSE_NOT_NEEDED=yes 35 PULSE_NOT_NEEDED=yes
36 AC_MSG_RESULT([pulse]) 36 AC_MSG_RESULT([pulse])
37 fi 37 fi
38 38
39 if test "x$OPENJDK_TARGET_OS" = xsolaris; then 39 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
40 AC_MSG_CHECKING([what is not needed on Solaris?]) 40 AC_MSG_CHECKING([what is not needed on Solaris?])
41 ALSA_NOT_NEEDED=yes 41 ALSA_NOT_NEEDED=yes
42 PULSE_NOT_NEEDED=yes 42 PULSE_NOT_NEEDED=yes
43 AC_MSG_RESULT([alsa pulse]) 43 AC_MSG_RESULT([alsa pulse])
44 fi 44 fi
45 45
46 if test "x$OPENJDK_TARGET_OS" = xwindows; then 46 if test "x$OPENJDK_TARGET_OS" = xwindows; then
47 AC_MSG_CHECKING([what is not needed on Windows?]) 47 AC_MSG_CHECKING([what is not needed on Windows?])
48 CUPS_NOT_NEEDED=yes 48 CUPS_NOT_NEEDED=yes
49 ALSA_NOT_NEEDED=yes 49 ALSA_NOT_NEEDED=yes
50 PULSE_NOT_NEEDED=yes 50 PULSE_NOT_NEEDED=yes
51 X11_NOT_NEEDED=yes 51 X11_NOT_NEEDED=yes
52 AC_MSG_RESULT([alsa cups pulse x11]) 52 AC_MSG_RESULT([alsa cups pulse x11])
53 fi 53 fi
54 54
55 if test "x$OPENJDK_TARGET_OS" = xmacosx; then 55 if test "x$OPENJDK_TARGET_OS" = xmacosx; then
56 AC_MSG_CHECKING([what is not needed on MacOSX?]) 56 AC_MSG_CHECKING([what is not needed on MacOSX?])
57 ALSA_NOT_NEEDED=yes 57 ALSA_NOT_NEEDED=yes
58 PULSE_NOT_NEEDED=yes 58 PULSE_NOT_NEEDED=yes
59 X11_NOT_NEEDED=yes 59 X11_NOT_NEEDED=yes
60 FREETYPE2_NOT_NEEDED=yes 60 FREETYPE2_NOT_NEEDED=yes
61 # If the java runtime framework is disabled, then we need X11. 61 # If the java runtime framework is disabled, then we need X11.
62 # This will be adjusted below. 62 # This will be adjusted below.
63 AC_MSG_RESULT([alsa pulse x11]) 63 AC_MSG_RESULT([alsa pulse x11])
64 fi 64 fi
65 65
66 if test "x$OPENJDK_TARGET_OS" = xbsd; then 66 if test "x$OPENJDK_TARGET_OS" = xbsd; then
67 AC_MSG_CHECKING([what is not needed on bsd?]) 67 AC_MSG_CHECKING([what is not needed on bsd?])
68 ALSA_NOT_NEEDED=yes 68 ALSA_NOT_NEEDED=yes
69 AC_MSG_RESULT([alsa]) 69 AC_MSG_RESULT([alsa])
70 fi 70 fi
71 71
72 if test "x$OPENJDK" = "xfalse"; then 72 if test "x$OPENJDK" = "xfalse"; then
73 FREETYPE2_NOT_NEEDED=yes 73 FREETYPE2_NOT_NEEDED=yes
74 fi 74 fi
75 75
76 if test "x$SUPPORT_HEADFUL" = xno; then 76 if test "x$SUPPORT_HEADFUL" = xno; then
77 X11_NOT_NEEDED=yes 77 X11_NOT_NEEDED=yes
78 fi 78 fi
79 79
80 ############################################################################### 80 ###############################################################################
81 # 81 #
82 # Check for MacOSX support for OpenJDK. If this exists, try to build a JVM 82 # Check for MacOSX support for OpenJDK. If this exists, try to build a JVM
83 # that uses this API. 83 # that uses this API.
84 # 84 #
85 AC_ARG_ENABLE([macosx-runtime-support], [AS_HELP_STRING([--disable-macosx-runtime-support], 85 AC_ARG_ENABLE([macosx-runtime-support], [AS_HELP_STRING([--disable-macosx-runtime-support],
86 [disable the use of MacOSX Java runtime support framework @<:@enabled@:>@])], 86 [disable the use of MacOSX Java runtime support framework @<:@enabled@:>@])],
87 [MACOSX_RUNTIME_SUPPORT="${enableval}"],[MACOSX_RUNTIME_SUPPORT="no"]) 87 [MACOSX_RUNTIME_SUPPORT="${enableval}"],[MACOSX_RUNTIME_SUPPORT="no"])
88 88
89 USE_MACOSX_RUNTIME_SUPPORT=no 89 USE_MACOSX_RUNTIME_SUPPORT=no
90 AC_MSG_CHECKING([for explicit Java runtime support in the OS]) 90 AC_MSG_CHECKING([for explicit Java runtime support in the OS])
91 if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then 91 if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
92 if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then 92 if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then
93 MACOSX_RUNTIME_SUPPORT=yes 93 MACOSX_RUNTIME_SUPPORT=yes
94 USE_MACOSX_RUNTIME_SUPPORT=yes 94 USE_MACOSX_RUNTIME_SUPPORT=yes
95 AC_MSG_RESULT([yes, does not need alsa freetype2 pulse and X11]) 95 AC_MSG_RESULT([yes, does not need alsa freetype2 pulse and X11])
96 else 96 else
97 AC_MSG_RESULT([yes, but explicitly disabled.]) 97 AC_MSG_RESULT([yes, but explicitly disabled.])
98 fi 98 fi
99 else 99 else
100 AC_MSG_RESULT([no]) 100 AC_MSG_RESULT([no])
101 fi 101 fi
102 102
103 if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then 103 if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then
104 AC_MSG_CHECKING([what is not needed on an X11 build on MacOSX?]) 104 AC_MSG_CHECKING([what is not needed on an X11 build on MacOSX?])
105 X11_NOT_NEEDED= 105 X11_NOT_NEEDED=
106 FREETYPE2_NOT_NEEDED= 106 FREETYPE2_NOT_NEEDED=
107 AC_MSG_RESULT([alsa pulse]) 107 AC_MSG_RESULT([alsa pulse])
108 fi 108 fi
109 ]) 109 ])
110 110
111 AC_DEFUN_ONCE([LIB_SETUP_X11], 111 AC_DEFUN_ONCE([LIB_SETUP_X11],
112 [ 112 [
113 113
114 ############################################################################### 114 ###############################################################################
115 # 115 #
116 # Check for X Windows 116 # Check for X Windows
117 # 117 #
118 118
119 # Check if the user has specified sysroot, but not --x-includes or --x-libraries. 119 # Check if the user has specified sysroot, but not --x-includes or --x-libraries.
120 # Make a simple check for the libraries at the sysroot, and setup --x-includes and 120 # Make a simple check for the libraries at the sysroot, and setup --x-includes and
121 # --x-libraries for the sysroot, if that seems to be correct. 121 # --x-libraries for the sysroot, if that seems to be correct.
122 if test "x$SYS_ROOT" != "x/"; then 122 if test "x$SYS_ROOT" != "x/"; then
123 if test "x$x_includes" = xNONE; then 123 if test "x$x_includes" = xNONE; then
124 if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then 124 if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then
125 x_includes="$SYS_ROOT/usr/X11R6/include" 125 x_includes="$SYS_ROOT/usr/X11R6/include"
126 elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then 126 elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then
127 x_includes="$SYS_ROOT/usr/include" 127 x_includes="$SYS_ROOT/usr/include"
128 fi 128 fi
129 fi 129 fi
130 if test "x$x_libraries" = xNONE; then 130 if test "x$x_libraries" = xNONE; then
131 if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then 131 if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then
132 x_libraries="$SYS_ROOT/usr/X11R6/lib" 132 x_libraries="$SYS_ROOT/usr/X11R6/lib"
133 elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then 133 elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
134 x_libraries="$SYS_ROOT/usr/lib64" 134 x_libraries="$SYS_ROOT/usr/lib64"
135 elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then 135 elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then
136 x_libraries="$SYS_ROOT/usr/lib" 136 x_libraries="$SYS_ROOT/usr/lib"
137 fi 137 fi
138 fi 138 fi
139 fi 139 fi
140 140
141 # Now let autoconf do it's magic 141 # Now let autoconf do it's magic
142 AC_PATH_X 142 AC_PATH_X
143 AC_PATH_XTRA 143 AC_PATH_XTRA
144 144
145 # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling 145 # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling
146 # this doesn't make sense so we remove it. 146 # this doesn't make sense so we remove it.
147 if test "x$COMPILE_TYPE" = xcross; then 147 if test "x$COMPILE_TYPE" = xcross; then
148 X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'` 148 X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
149 fi 149 fi
150 150
151 if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then 151 if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then
152 HELP_MSG_MISSING_DEPENDENCY([x11]) 152 HELP_MSG_MISSING_DEPENDENCY([x11])
153 AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG]) 153 AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
154 fi 154 fi
155 155
156 # Some of the old makefiles require a setting of OPENWIN_HOME 156 # Some of the old makefiles require a setting of OPENWIN_HOME
157 # Since the X11R6 directory has disappeared on later Linuxes, 157 # Since the X11R6 directory has disappeared on later Linuxes,
158 # we need to probe for it. 158 # we need to probe for it.
159 if test "x$OPENJDK_TARGET_OS" = xlinux; then 159 if test "x$OPENJDK_TARGET_OS" = xlinux; then
160 if test -d "$SYS_ROOT/usr/X11R6"; then 160 if test -d "$SYS_ROOT/usr/X11R6"; then
161 OPENWIN_HOME="$SYS_ROOT/usr/X11R6" 161 OPENWIN_HOME="$SYS_ROOT/usr/X11R6"
162 elif test -d "$SYS_ROOT/usr/include/X11"; then 162 elif test -d "$SYS_ROOT/usr/include/X11"; then
163 OPENWIN_HOME="$SYS_ROOT/usr" 163 OPENWIN_HOME="$SYS_ROOT/usr"
164 fi 164 fi
165 fi 165 fi
166 if test "x$OPENJDK_TARGET_OS" = xsolaris; then 166 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
167 OPENWIN_HOME="/usr/openwin" 167 OPENWIN_HOME="/usr/openwin"
168 fi 168 fi
169 AC_SUBST(OPENWIN_HOME) 169 AC_SUBST(OPENWIN_HOME)
170 170
171 171
172 # 172 #
173 # Weird Sol10 something check...TODO change to try compile 173 # Weird Sol10 something check...TODO change to try compile
174 # 174 #
175 if test "x${OPENJDK_TARGET_OS}" = xsolaris; then 175 if test "x${OPENJDK_TARGET_OS}" = xsolaris; then
176 if test "`uname -r`" = "5.10"; then 176 if test "`uname -r`" = "5.10"; then
177 if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then 177 if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then
178 X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS" 178 X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS"
179 fi 179 fi
180 fi 180 fi
181 fi 181 fi
182 182
183 AC_LANG_PUSH(C) 183 AC_LANG_PUSH(C)
184 OLD_CFLAGS="$CFLAGS" 184 OLD_CFLAGS="$CFLAGS"
185 CFLAGS="$CFLAGS $X_CFLAGS" 185 CFLAGS="$CFLAGS $X_CFLAGS"
186 186
187 # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 187 # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
188 AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h], 188 AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
189 [X11_A_OK=yes], 189 [X11_A_OK=yes],
190 [X11_A_OK=no; break], 190 [X11_A_OK=no; break],
191 [ # include <X11/Xlib.h> 191 [
192 # include <X11/Xutil.h> 192 # include <X11/Xlib.h>
193 ]) 193 # include <X11/Xutil.h>
194 194 ]
195 CFLAGS="$OLD_CFLAGS" 195 )
196 AC_LANG_POP(C) 196
197 197 CFLAGS="$OLD_CFLAGS"
198 if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then 198 AC_LANG_POP(C)
199
200 if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then
199 HELP_MSG_MISSING_DEPENDENCY([x11]) 201 HELP_MSG_MISSING_DEPENDENCY([x11])
200 AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG]) 202 AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG])
201 fi 203 fi
202 204
203 AC_SUBST(X_CFLAGS) 205 AC_SUBST(X_CFLAGS)
204 AC_SUBST(X_LIBS) 206 AC_SUBST(X_LIBS)
205 ]) 207 ])
206 208
207 AC_DEFUN_ONCE([LIB_SETUP_CUPS], 209 AC_DEFUN_ONCE([LIB_SETUP_CUPS],
208 [ 210 [
209 211
210 ############################################################################### 212 ###############################################################################
211 # 213 #
212 # The common unix printing system cups is used to print from java. 214 # The common unix printing system cups is used to print from java.
213 # 215 #
214 AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups], 216 AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups],
215 [specify prefix directory for the cups package 217 [specify prefix directory for the cups package
216 (expecting the headers under PATH/include)])]) 218 (expecting the headers under PATH/include)])])
217 AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include], 219 AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include],
218 [specify directory for the cups include files])]) 220 [specify directory for the cups include files])])
219 221
220 if test "x$CUPS_NOT_NEEDED" = xyes; then 222 if test "x$CUPS_NOT_NEEDED" = xyes; then
221 if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then 223 if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then
222 AC_MSG_WARN([cups not used, so --with-cups is ignored]) 224 AC_MSG_WARN([cups not used, so --with-cups is ignored])
223 fi 225 fi
224 CUPS_CFLAGS= 226 CUPS_CFLAGS=
225 else 227 else
226 CUPS_FOUND=no 228 CUPS_FOUND=no
227 229
228 if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then 230 if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then
229 AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.]) 231 AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.])
230 fi 232 fi
231 233
232 if test "x${with_cups}" != x; then 234 if test "x${with_cups}" != x; then
233 CUPS_CFLAGS="-I${with_cups}/include" 235 CUPS_CFLAGS="-I${with_cups}/include"
234 CUPS_FOUND=yes 236 CUPS_FOUND=yes
235 fi 237 fi
236 if test "x${with_cups_include}" != x; then 238 if test "x${with_cups_include}" != x; then
237 CUPS_CFLAGS="-I${with_cups_include}" 239 CUPS_CFLAGS="-I${with_cups_include}"
238 CUPS_FOUND=yes 240 CUPS_FOUND=yes
239 fi 241 fi
240 if test "x$CUPS_FOUND" = xno; then 242 if test "x$CUPS_FOUND" = xno; then
241 BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes]) 243 BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes])
242 fi 244 fi
243 if test "x$CUPS_FOUND" = xno; then 245 if test "x$CUPS_FOUND" = xno; then
244 # Are the cups headers installed in the default /usr/include location? 246 # Are the cups headers installed in the default /usr/include location?
245 AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], 247 AC_CHECK_HEADERS([cups/cups.h cups/ppd.h],
246 [CUPS_FOUND=yes 248 [
247 CUPS_CFLAGS= 249 CUPS_FOUND=yes
248 DEFAULT_CUPS=yes]) 250 CUPS_CFLAGS=
249 fi 251 DEFAULT_CUPS=yes
250 if test "x$CUPS_FOUND" = xno; then 252 ]
251 # Getting nervous now? Lets poke around for standard Solaris third-party 253 )
252 # package installation locations. 254 fi
253 AC_MSG_CHECKING([for cups headers]) 255 if test "x$CUPS_FOUND" = xno; then
254 if test -s /opt/sfw/cups/include/cups/cups.h; then 256 # Getting nervous now? Lets poke around for standard Solaris third-party
255 # An SFW package seems to be installed! 257 # package installation locations.
256 CUPS_FOUND=yes 258 AC_MSG_CHECKING([for cups headers])
257 CUPS_CFLAGS="-I/opt/sfw/cups/include" 259 if test -s /opt/sfw/cups/include/cups/cups.h; then
258 elif test -s /opt/csw/include/cups/cups.h; then 260 # An SFW package seems to be installed!
259 # A CSW package seems to be installed! 261 CUPS_FOUND=yes
260 CUPS_FOUND=yes 262 CUPS_CFLAGS="-I/opt/sfw/cups/include"
261 CUPS_CFLAGS="-I/opt/csw/include" 263 elif test -s /opt/csw/include/cups/cups.h; then
262 fi 264 # A CSW package seems to be installed!
263 AC_MSG_RESULT([$CUPS_FOUND]) 265 CUPS_FOUND=yes
264 fi 266 CUPS_CFLAGS="-I/opt/csw/include"
265 if test "x$CUPS_FOUND" = xno; then 267 fi
266 HELP_MSG_MISSING_DEPENDENCY([cups]) 268 AC_MSG_RESULT([$CUPS_FOUND])
267 AC_MSG_ERROR([Could not find cups! $HELP_MSG ]) 269 fi
268 fi 270 if test "x$CUPS_FOUND" = xno; then
269 fi 271 HELP_MSG_MISSING_DEPENDENCY([cups])
270 272 AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
271 AC_SUBST(CUPS_CFLAGS) 273 fi
274 fi
275
276 AC_SUBST(CUPS_CFLAGS)
272 277
273 ]) 278 ])
274 279
275 AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], 280 AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
276 [ 281 [
277 282
278 ############################################################################### 283 ###############################################################################
279 # 284 #
280 # The ubiquitous freetype2 library is used to render fonts. 285 # The ubiquitous freetype2 library is used to render fonts.
281 # 286 #
282 AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype], 287 AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype],
283 [specify prefix directory for the freetype2 package 288 [specify prefix directory for the freetype2 package
284 (expecting the libraries under PATH/lib and the headers under PATH/include)])]) 289 (expecting the libraries under PATH/lib and the headers under PATH/include)])])
285 290
286 # If we are using the OS installed system lib for freetype, then we do not need to copy it to the build tree 291 # If we are using the OS installed system lib for freetype, then we do not need to copy it to the build tree
287 USING_SYSTEM_FT_LIB=false 292 USING_SYSTEM_FT_LIB=false
288 293
289 if test "x$FREETYPE2_NOT_NEEDED" = xyes; then 294 if test "x$FREETYPE2_NOT_NEEDED" = xyes; then
290 if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then 295 if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
291 AC_MSG_WARN([freetype not used, so --with-freetype is ignored]) 296 AC_MSG_WARN([freetype not used, so --with-freetype is ignored])
292 fi 297 fi
293 FREETYPE2_CFLAGS= 298 FREETYPE2_CFLAGS=
294 FREETYPE2_LIBS= 299 FREETYPE2_LIBS=
295 FREETYPE2_LIB_PATH= 300 FREETYPE2_LIB_PATH=
296 else 301 else
297 FREETYPE2_FOUND=no 302 FREETYPE2_FOUND=no
298 303
299 if test "x$with_freetype" != x; then 304 if test "x$with_freetype" != x; then
300 BASIC_FIXUP_PATH(with_freetype) 305 BASIC_FIXUP_PATH(with_freetype)
301 FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" 306 FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype"
302 FREETYPE2_LIB_PATH="$with_freetype/lib" 307 FREETYPE2_LIB_PATH="$with_freetype/lib"
303 if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -d "$with_freetype/lib/amd64"; then 308 if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -d "$with_freetype/lib/amd64"; then
304 FREETYPE2_LIBS="-L$with_freetype/lib/amd64 -lfreetype" 309 FREETYPE2_LIBS="-L$with_freetype/lib/amd64 -lfreetype"
305 FREETYPE2_LIB_PATH="$with_freetype/lib/amd64" 310 FREETYPE2_LIB_PATH="$with_freetype/lib/amd64"
306 fi 311 fi
307 if test "x$OPENJDK_TARGET_OS" = xwindows; then 312 if test "x$OPENJDK_TARGET_OS" = xwindows; then
308 FREETYPE2_LIBS="$with_freetype/lib/freetype.lib" 313 FREETYPE2_LIBS="$with_freetype/lib/freetype.lib"
309 fi 314 fi
310 FREETYPE2_CFLAGS="-I$with_freetype/include" 315 FREETYPE2_CFLAGS="-I$with_freetype/include"
311 if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then 316 if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then
312 FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include" 317 FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include"
313 fi 318 fi
314 FREETYPE2_FOUND=yes 319 FREETYPE2_FOUND=yes
315 if test "x$FREETYPE2_FOUND" = xyes; then 320 if test "x$FREETYPE2_FOUND" = xyes; then
316 # Verify that the directories exist 321 # Verify that the directories exist
317 if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then 322 if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then
318 AC_MSG_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include]) 323 AC_MSG_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include])
319 fi 324 fi
320 # List the contents of the lib. 325 # List the contents of the lib.
321 FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null` 326 FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null`
322 if test "x$FREETYPELIB" = x; then 327 if test "x$FREETYPELIB" = x; then
323 AC_MSG_ERROR([Could not find libfreetype.so nor freetype.dll in $with_freetype/lib]) 328 AC_MSG_ERROR([Could not find libfreetype.so nor freetype.dll in $with_freetype/lib])
324 fi 329 fi
325 # Check one h-file 330 # Check one h-file
326 if ! test -s "$with_freetype/include/ft2build.h"; then 331 if ! test -s "$with_freetype/include/ft2build.h"; then
327 AC_MSG_ERROR([Could not find $with_freetype/include/ft2build.h]) 332 AC_MSG_ERROR([Could not find $with_freetype/include/ft2build.h])
328 fi 333 fi
329 fi 334 fi
330 fi 335 fi
331 if test "x$FREETYPE2_FOUND" = xno; then 336 if test "x$FREETYPE2_FOUND" = xno; then
332 BDEPS_CHECK_MODULE(FREETYPE2, freetype2, xxx, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) 337 BDEPS_CHECK_MODULE(FREETYPE2, freetype2, xxx, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no])
333 USING_SYSTEM_FT_LIB=true 338 USING_SYSTEM_FT_LIB=true
334 fi 339 fi
335 if test "x$FREETYPE2_FOUND" = xno && test "x$OPENJDK_TARGET_OS" = xwindows; then 340 if test "x$FREETYPE2_FOUND" = xno && test "x$OPENJDK_TARGET_OS" = xwindows; then
336 FREETYPELOCATION="$PROGRAMFILES/GnuWin32" 341 FREETYPELOCATION="$PROGRAMFILES/GnuWin32"
337 BASIC_FIXUP_PATH(FREETYPELOCATION) 342 BASIC_FIXUP_PATH(FREETYPELOCATION)
338 AC_MSG_CHECKING([for freetype in some standard windows locations]) 343 AC_MSG_CHECKING([for freetype in some standard windows locations])
339 if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then 344 if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then
340 FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include" 345 FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include"
341 FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib" 346 FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib"
342 FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib" 347 FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib"
343 if ! test -s "$FREETYPE2_LIBS"; then 348 if ! test -s "$FREETYPE2_LIBS"; then
344 AC_MSG_ERROR([Could not find $FREETYPE2_LIBS]) 349 AC_MSG_ERROR([Could not find $FREETYPE2_LIBS])
345 fi 350 fi
346 if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then 351 if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then
347 AC_MSG_ERROR([Could not find $FREETYPE2_LIB_PATH/freetype.dll]) 352 AC_MSG_ERROR([Could not find $FREETYPE2_LIB_PATH/freetype.dll])
348 fi 353 fi
349 USING_SYSTEM_FT_LIB=true 354 USING_SYSTEM_FT_LIB=true
350 FREETYPE2_FOUND=yes 355 FREETYPE2_FOUND=yes
351 fi 356 fi
352 AC_MSG_RESULT([$FREETYPE2_FOUND]) 357 AC_MSG_RESULT([$FREETYPE2_FOUND])
353 fi 358 fi
354 if test "x$FREETYPE2_FOUND" = xno; then 359 if test "x$FREETYPE2_FOUND" = xno; then
355 PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) 360 PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no])
356 # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. 361 # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
357 FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'` 362 FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'`
358 USING_SYSTEM_FT_LIB=true 363 USING_SYSTEM_FT_LIB=true
359 # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 364 # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
360 if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then 365 if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
361 FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'` 366 FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'`
362 fi 367 fi
363 fi 368 fi
364 if test "x$FREETYPE2_FOUND" = xno; then 369 if test "x$FREETYPE2_FOUND" = xno; then
365 AC_MSG_CHECKING([for freetype in some standard locations]) 370 AC_MSG_CHECKING([for freetype in some standard locations])
366 371
367 if test -s $SYS_ROOT/usr/X11/include/ft2build.h && test -d $SYS_ROOT/usr/X11/include/freetype2/freetype; then 372 if test -s $SYS_ROOT/usr/X11/include/ft2build.h && test -d $SYS_ROOT/usr/X11/include/freetype2/freetype; then
368 DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/X11/include/freetype2 -I$SYS_ROOT/usr/X11/include" 373 DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/X11/include/freetype2 -I$SYS_ROOT/usr/X11/include"
369 DEFAULT_FREETYPE_LIBS="-L$SYS_ROOT/usr/X11/lib -lfreetype" 374 DEFAULT_FREETYPE_LIBS="-L$SYS_ROOT/usr/X11/lib -lfreetype"
370 fi 375 fi
371 if test -s $SYS_ROOT/usr/include/ft2build.h && test -d $SYS_ROOT/usr/include/freetype2/freetype; then 376 if test -s $SYS_ROOT/usr/include/ft2build.h && test -d $SYS_ROOT/usr/include/freetype2/freetype; then
372 DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/include/freetype2" 377 DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/include/freetype2"
373 DEFAULT_FREETYPE_LIBS="-lfreetype" 378 DEFAULT_FREETYPE_LIBS="-lfreetype"
374 fi 379 fi
375 380
376 PREV_CXXCFLAGS="$CXXFLAGS" 381 PREV_CXXCFLAGS="$CXXFLAGS"
377 PREV_LDFLAGS="$LDFLAGS" 382 PREV_LDFLAGS="$LDFLAGS"
378 CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS" 383 CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS"
379 LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS" 384 LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS"
380 AC_LINK_IFELSE([AC_LANG_SOURCE([[#include<ft2build.h> 385 AC_LINK_IFELSE([AC_LANG_SOURCE([[
381 #include FT_FREETYPE_H 386 #include<ft2build.h>
382 int main() { return 0; } 387 #include FT_FREETYPE_H
383 ]])], 388 int main() { return 0; }
384 [ 389 ]])],
385 # Yes, the default cflags and libs did the trick. 390 [
386 FREETYPE2_FOUND=yes 391 # Yes, the default cflags and libs did the trick.
387 FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS" 392 FREETYPE2_FOUND=yes
388 FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS" 393 FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS"
389 ], 394 FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS"
390 [ 395 ],
391 FREETYPE2_FOUND=no 396 [
392 ]) 397 FREETYPE2_FOUND=no
393 CXXCFLAGS="$PREV_CXXFLAGS" 398 ]
394 LDFLAGS="$PREV_LDFLAGS" 399 )
395 AC_MSG_RESULT([$FREETYPE2_FOUND]) 400 CXXCFLAGS="$PREV_CXXFLAGS"
396 USING_SYSTEM_FT_LIB=true 401 LDFLAGS="$PREV_LDFLAGS"
397 fi 402 AC_MSG_RESULT([$FREETYPE2_FOUND])
398 if test "x$FREETYPE2_FOUND" = xno; then 403 USING_SYSTEM_FT_LIB=true
399 HELP_MSG_MISSING_DEPENDENCY([freetype2]) 404 fi
400 AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ]) 405 if test "x$FREETYPE2_FOUND" = xno; then
401 fi 406 HELP_MSG_MISSING_DEPENDENCY([freetype2])
402 407 AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ])
403 if test "x$OPENJDK_TARGET_OS" != xwindows; then 408 fi
404 # AC_CHECK_LIB does not support use of cl.exe 409
405 PREV_LDFLAGS="$LDFLAGS" 410 if test "x$OPENJDK_TARGET_OS" != xwindows; then
406 LDFLAGS="$FREETYPE2_LIBS" 411 # AC_CHECK_LIB does not support use of cl.exe
407 AC_CHECK_LIB(freetype, FT_Init_FreeType, 412 PREV_LDFLAGS="$LDFLAGS"
408 FREETYPE2_FOUND=true, 413 LDFLAGS="$FREETYPE2_LIBS"
409 AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ])) 414 AC_CHECK_LIB(freetype, FT_Init_FreeType,
410 LDFLAGS="$PREV_LDFLAGS" 415 FREETYPE2_FOUND=true,
411 fi 416 AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ]))
412 fi 417 LDFLAGS="$PREV_LDFLAGS"
413 418 fi
414 AC_SUBST(USING_SYSTEM_FT_LIB) 419 fi
415 AC_SUBST(FREETYPE2_LIB_PATH) 420
416 AC_SUBST(FREETYPE2_CFLAGS) 421 AC_SUBST(USING_SYSTEM_FT_LIB)
417 AC_SUBST(FREETYPE2_LIBS) 422 AC_SUBST(FREETYPE2_LIB_PATH)
418 423 AC_SUBST(FREETYPE2_CFLAGS)
424 AC_SUBST(FREETYPE2_LIBS)
419 ]) 425 ])
420 426
421 AC_DEFUN_ONCE([LIB_SETUP_ALSA], 427 AC_DEFUN_ONCE([LIB_SETUP_ALSA],
422 [ 428 [
423 429
424 ############################################################################### 430 ###############################################################################
425 # 431 #
426 # Check for alsa headers and libraries. Used on Linux/GNU systems. 432 # Check for alsa headers and libraries. Used on Linux/GNU systems.
427 # 433 #
428 AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa], 434 AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],
429 [specify prefix directory for the alsa package 435 [specify prefix directory for the alsa package
430 (expecting the libraries under PATH/lib and the headers under PATH/include)])]) 436 (expecting the libraries under PATH/lib and the headers under PATH/include)])])
431 AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include], 437 AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include],
432 [specify directory for the alsa include files])]) 438 [specify directory for the alsa include files])])
433 AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib], 439 AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib],
434 [specify directory for the alsa library])]) 440 [specify directory for the alsa library])])
435 441
436 if test "x$ALSA_NOT_NEEDED" = xyes; then 442 if test "x$ALSA_NOT_NEEDED" = xyes; then
437 if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then 443 if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then
438 AC_MSG_WARN([alsa not used, so --with-alsa is ignored]) 444 AC_MSG_WARN([alsa not used, so --with-alsa is ignored])
439 fi 445 fi
440 ALSA_CFLAGS= 446 ALSA_CFLAGS=
441 ALSA_LIBS= 447 ALSA_LIBS=
442 else 448 else
443 ALSA_FOUND=no 449 ALSA_FOUND=no
444 450
445 if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then 451 if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then
446 AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.]) 452 AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.])
447 fi 453 fi
448 454
449 if test "x${with_alsa}" != x; then 455 if test "x${with_alsa}" != x; then
450 ALSA_LIBS="-L${with_alsa}/lib -lalsa" 456 ALSA_LIBS="-L${with_alsa}/lib -lalsa"
451 ALSA_CFLAGS="-I${with_alsa}/include" 457 ALSA_CFLAGS="-I${with_alsa}/include"
452 ALSA_FOUND=yes 458 ALSA_FOUND=yes
453 fi 459 fi
454 if test "x${with_alsa_include}" != x; then 460 if test "x${with_alsa_include}" != x; then
455 ALSA_CFLAGS="-I${with_alsa_include}" 461 ALSA_CFLAGS="-I${with_alsa_include}"
456 ALSA_FOUND=yes 462 ALSA_FOUND=yes
457 fi 463 fi
458 if test "x${with_alsa_lib}" != x; then 464 if test "x${with_alsa_lib}" != x; then
459 ALSA_LIBS="-L${with_alsa_lib} -lalsa" 465 ALSA_LIBS="-L${with_alsa_lib} -lalsa"
460 ALSA_FOUND=yes 466 ALSA_FOUND=yes
461 fi 467 fi
462 if test "x$ALSA_FOUND" = xno; then 468 if test "x$ALSA_FOUND" = xno; then
463 BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no]) 469 BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no])
464 fi 470 fi
465 if test "x$ALSA_FOUND" = xno; then 471 if test "x$ALSA_FOUND" = xno; then
466 PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no]) 472 PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
467 fi 473 fi
468 if test "x$ALSA_FOUND" = xno; then 474 if test "x$ALSA_FOUND" = xno; then
469 AC_CHECK_HEADERS([alsa/asoundlib.h], 475 AC_CHECK_HEADERS([alsa/asoundlib.h],
470 [ALSA_FOUND=yes 476 [
471 ALSA_CFLAGS=-Iignoreme 477 ALSA_FOUND=yes
472 ALSA_LIBS=-lasound 478 ALSA_CFLAGS=-Iignoreme
473 DEFAULT_ALSA=yes], 479 ALSA_LIBS=-lasound
474 [ALSA_FOUND=no]) 480 DEFAULT_ALSA=yes
475 fi 481 ],
476 if test "x$ALSA_FOUND" = xno; then 482 [ALSA_FOUND=no])
477 HELP_MSG_MISSING_DEPENDENCY([alsa]) 483 fi
478 AC_MSG_ERROR([Could not find alsa! $HELP_MSG ]) 484 if test "x$ALSA_FOUND" = xno; then
479 fi 485 HELP_MSG_MISSING_DEPENDENCY([alsa])
480 fi 486 AC_MSG_ERROR([Could not find alsa! $HELP_MSG ])
481 487 fi
482 AC_SUBST(ALSA_CFLAGS) 488 fi
483 AC_SUBST(ALSA_LIBS) 489
484 490 AC_SUBST(ALSA_CFLAGS)
491 AC_SUBST(ALSA_LIBS)
485 ]) 492 ])
486 493
487 AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], 494 AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
488 [ 495 [
489 496
490 ############################################################################### 497 ###############################################################################
491 # 498 #
492 # Check for the jpeg library 499 # Check for the jpeg library
493 # 500 #
494 501
495 USE_EXTERNAL_LIBJPEG=true 502 USE_EXTERNAL_LIBJPEG=true
496 AC_CHECK_LIB(jpeg, main, [], 503 AC_CHECK_LIB(jpeg, main, [],
497 [ USE_EXTERNAL_LIBJPEG=false 504 [ USE_EXTERNAL_LIBJPEG=false
498 AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source]) 505 AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source])
499 ]) 506 ])
500 AC_SUBST(USE_EXTERNAL_LIBJPEG) 507 AC_SUBST(USE_EXTERNAL_LIBJPEG)
501 508
502 ############################################################################### 509 ###############################################################################
503 # 510 #
504 # Check for the gif library 511 # Check for the gif library
505 # 512 #
506 513
507 AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib], 514 AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib],
508 [use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) 515 [use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
509 516
510 517
511 AC_MSG_CHECKING([for which giflib to use]) 518 AC_MSG_CHECKING([for which giflib to use])
512 519
513 # default is bundled 520 # default is bundled
514 DEFAULT_GIFLIB=bundled 521 DEFAULT_GIFLIB=bundled
515 522
516 # 523 #
517 # if user didn't specify, use DEFAULT_GIFLIB 524 # if user didn't specify, use DEFAULT_GIFLIB
518 # 525 #
519 if test "x${with_giflib}" = "x"; then 526 if test "x${with_giflib}" = "x"; then
520 with_giflib=${DEFAULT_GIFLIB} 527 with_giflib=${DEFAULT_GIFLIB}
521 fi 528 fi
522 529
523 AC_MSG_RESULT(${with_giflib}) 530 AC_MSG_RESULT(${with_giflib})
524 531
525 if test "x${with_giflib}" = "xbundled"; then 532 if test "x${with_giflib}" = "xbundled"; then
526 USE_EXTERNAL_LIBGIF=false 533 USE_EXTERNAL_LIBGIF=false
527 elif test "x${with_giflib}" = "xsystem"; then 534 elif test "x${with_giflib}" = "xsystem"; then
528 AC_CHECK_HEADER(gif_lib.h, [], 535 AC_CHECK_HEADER(gif_lib.h, [],
529 [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])]) 536 [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])])
530 AC_CHECK_LIB(gif, DGifGetCode, [], 537 AC_CHECK_LIB(gif, DGifGetCode, [],
531 [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])]) 538 [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])])
532 539
533 USE_EXTERNAL_LIBGIF=true 540 USE_EXTERNAL_LIBGIF=true
534 else 541 else
535 AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled']) 542 AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'])
536 fi 543 fi
537 AC_SUBST(USE_EXTERNAL_LIBGIF) 544 AC_SUBST(USE_EXTERNAL_LIBGIF)
538 545
539 ############################################################################### 546 ###############################################################################
540 # 547 #
541 # Check for the zlib library 548 # Check for the zlib library
542 # 549 #
543 550
544 AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib], 551 AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib],
545 [use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) 552 [use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
546 553
547 AC_CHECK_LIB(z, compress, 554 AC_CHECK_LIB(z, compress,
548 [ ZLIB_FOUND=yes ], 555 [ ZLIB_FOUND=yes ],
549 [ ZLIB_FOUND=no ]) 556 [ ZLIB_FOUND=no ])
550 557
551 AC_MSG_CHECKING([for which zlib to use]) 558 AC_MSG_CHECKING([for which zlib to use])
552 559
553 DEFAULT_ZLIB=bundled 560 DEFAULT_ZLIB=bundled
554 if test "x$OPENJDK_TARGET_OS" = xmacosx; then 561 if test "x$OPENJDK_TARGET_OS" = xmacosx; then
555 # 562 #
556 # On macosx default is system...on others default is 563 # On macosx default is system...on others default is
557 # 564 #
558 DEFAULT_ZLIB=system 565 DEFAULT_ZLIB=system
559 fi 566 fi
560 567
561 if test "x${ZLIB_FOUND}" != "xyes"; then 568 if test "x${ZLIB_FOUND}" != "xyes"; then
562 # 569 #
563 # If we don't find any system...set default to bundled 570 # If we don't find any system...set default to bundled
564 # 571 #
565 DEFAULT_ZLIB=bundled 572 DEFAULT_ZLIB=bundled
566 fi 573 fi
567 574
568 # 575 #
569 # If user didn't specify, use DEFAULT_ZLIB 576 # If user didn't specify, use DEFAULT_ZLIB
570 # 577 #
571 if test "x${with_zlib}" = "x"; then 578 if test "x${with_zlib}" = "x"; then
572 with_zlib=${DEFAULT_ZLIB} 579 with_zlib=${DEFAULT_ZLIB}
573 fi 580 fi
574 581
575 if test "x${with_zlib}" = "xbundled"; then 582 if test "x${with_zlib}" = "xbundled"; then
576 USE_EXTERNAL_LIBZ=false 583 USE_EXTERNAL_LIBZ=false
577 AC_MSG_RESULT([bundled]) 584 AC_MSG_RESULT([bundled])
578 elif test "x${with_zlib}" = "xsystem"; then 585 elif test "x${with_zlib}" = "xsystem"; then
579 if test "x${ZLIB_FOUND}" = "xyes"; then 586 if test "x${ZLIB_FOUND}" = "xyes"; then
580 USE_EXTERNAL_LIBZ=true 587 USE_EXTERNAL_LIBZ=true
581 AC_MSG_RESULT([system]) 588 AC_MSG_RESULT([system])
582 else 589 else
583 AC_MSG_RESULT([system not found]) 590 AC_MSG_RESULT([system not found])
584 AC_MSG_ERROR([--with-zlib=system specified, but no zlib found!]) 591 AC_MSG_ERROR([--with-zlib=system specified, but no zlib found!])
585 fi 592 fi
586 else 593 else
587 AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) 594 AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled'])
588 fi 595 fi
589 596
590 AC_SUBST(USE_EXTERNAL_LIBZ) 597 AC_SUBST(USE_EXTERNAL_LIBZ)
591 598
592 ############################################################################### 599 ###############################################################################
593 LIBZIP_CAN_USE_MMAP=true 600 LIBZIP_CAN_USE_MMAP=true
594 601
595 AC_SUBST(LIBZIP_CAN_USE_MMAP) 602 AC_SUBST(LIBZIP_CAN_USE_MMAP)
596 603
597 ############################################################################### 604 ###############################################################################
598 # 605 #
599 # Check if altzone exists in time.h 606 # Check if altzone exists in time.h
600 # 607 #
601 608
602 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [return (int)altzone;])], 609 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [return (int)altzone;])],
603 [has_altzone=yes], 610 [has_altzone=yes],
604 [has_altzone=no]) 611 [has_altzone=no])
605 if test "x$has_altzone" = xyes; then 612 if test "x$has_altzone" = xyes; then
606 AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h]) 613 AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h])
607 fi 614 fi
608 615
609 ############################################################################### 616 ###############################################################################
610 # 617 #
611 # Check the maths library 618 # Check the maths library
612 # 619 #
613 620
614 AC_CHECK_LIB(m, cos, [], 621 AC_CHECK_LIB(m, cos, [],
615 [ 622 [
616 AC_MSG_NOTICE([Maths library was not found]) 623 AC_MSG_NOTICE([Maths library was not found])
617 ]) 624 ]
618 AC_SUBST(LIBM) 625 )
619 626 AC_SUBST(LIBM)
620 ############################################################################### 627
621 # 628 ###############################################################################
622 # Check for libdl.so 629 #
623 630 # Check for libdl.so
624 save_LIBS="$LIBS" 631
625 LIBS="" 632 save_LIBS="$LIBS"
626 AC_CHECK_LIB(dl,dlopen) 633 LIBS=""
627 LIBDL="$LIBS" 634 AC_CHECK_LIB(dl,dlopen)
628 AC_SUBST(LIBDL) 635 LIBDL="$LIBS"
629 LIBS="$save_LIBS" 636 AC_SUBST(LIBDL)
630 637 LIBS="$save_LIBS"
631 ]) 638 ])
632 639
633 AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], 640 AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP],
634 [ 641 [
635 ############################################################################### 642 ###############################################################################
636 # 643 #
637 # statically link libstdc++ before C++ ABI is stablized on Linux unless 644 # statically link libstdc++ before C++ ABI is stablized on Linux unless
638 # dynamic build is configured on command line. 645 # dynamic build is configured on command line.
639 # 646 #
640 AC_ARG_WITH([stdc++lib], [AS_HELP_STRING([--with-stdc++lib=<static>,<dynamic>,<default>], 647 AC_ARG_WITH([stdc++lib], [AS_HELP_STRING([--with-stdc++lib=<static>,<dynamic>,<default>],
641 [force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback])], 648 [force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback])],
642 [ 649 [
643 if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \ 650 if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \
644 && test "x$with_stdc__lib" != xdefault; then 651 && test "x$with_stdc__lib" != xdefault; then
645 AC_MSG_ERROR([Bad parameter value --with-stdc++lib=$with_stdc__lib!]) 652 AC_MSG_ERROR([Bad parameter value --with-stdc++lib=$with_stdc__lib!])
646 fi 653 fi
647 ], 654 ],
648 [with_stdc__lib=default] 655 [with_stdc__lib=default]
649 ) 656 )
650 657
651 if test "x$OPENJDK_TARGET_OS" = xlinux; then 658 if test "x$OPENJDK_TARGET_OS" = xlinux; then
652 # Test if -lstdc++ works. 659 # Test if -lstdc++ works.
653 AC_MSG_CHECKING([if dynamic link of stdc++ is possible]) 660 AC_MSG_CHECKING([if dynamic link of stdc++ is possible])
654 AC_LANG_PUSH(C++) 661 AC_LANG_PUSH(C++)
655 OLD_CXXFLAGS="$CXXFLAGS" 662 OLD_CXXFLAGS="$CXXFLAGS"
656 CXXFLAGS="$CXXFLAGS -lstdc++" 663 CXXFLAGS="$CXXFLAGS -lstdc++"
657 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], 664 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
658 [has_dynamic_libstdcxx=yes], 665 [has_dynamic_libstdcxx=yes],
659 [has_dynamic_libstdcxx=no]) 666 [has_dynamic_libstdcxx=no])
660 CXXFLAGS="$OLD_CXXFLAGS" 667 CXXFLAGS="$OLD_CXXFLAGS"
661 AC_LANG_POP(C++) 668 AC_LANG_POP(C++)
662 AC_MSG_RESULT([$has_dynamic_libstdcxx]) 669 AC_MSG_RESULT([$has_dynamic_libstdcxx])
663 670
664 # Test if stdc++ can be linked statically. 671 # Test if stdc++ can be linked statically.
666 STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic" 673 STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic"
667 AC_LANG_PUSH(C++) 674 AC_LANG_PUSH(C++)
668 OLD_LIBS="$LIBS" 675 OLD_LIBS="$LIBS"
669 OLD_CXX="$CXX" 676 OLD_CXX="$CXX"
670 LIBS="$STATIC_STDCXX_FLAGS" 677 LIBS="$STATIC_STDCXX_FLAGS"
671 CXX="$CC" 678 CXX="$CC"
672 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], 679 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
673 [has_static_libstdcxx=yes], 680 [has_static_libstdcxx=yes],
674 [has_static_libstdcxx=no]) 681 [has_static_libstdcxx=no])
675 LIBS="$OLD_LIBS" 682 LIBS="$OLD_LIBS"
676 CXX="$OLD_CXX" 683 CXX="$OLD_CXX"
677 AC_LANG_POP(C++) 684 AC_LANG_POP(C++)
678 AC_MSG_RESULT([$has_static_libstdcxx]) 685 AC_MSG_RESULT([$has_static_libstdcxx])
679 686
680 if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then 687 if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then
681 AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!]) 688 AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!])
682 fi 689 fi
683 690
684 if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then 691 if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
685 AC_MSG_ERROR([Static linking of libstdc++ was not possible!]) 692 AC_MSG_ERROR([Static linking of libstdc++ was not possible!])
686 fi 693 fi
687 694
688 if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then 695 if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then
689 AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!]) 696 AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!])
690 fi 697 fi
691 698
692 AC_MSG_CHECKING([how to link with libstdc++]) 699 AC_MSG_CHECKING([how to link with libstdc++])
693 # If dynamic was requested, it's available since it would fail above otherwise. 700 # If dynamic was requested, it's available since it would fail above otherwise.
694 # If dynamic wasn't requested, go with static unless it isn't available. 701 # If dynamic wasn't requested, go with static unless it isn't available.
695 if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then 702 if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
696 LIBCXX="$LIBCXX -lstdc++" 703 LIBCXX="$LIBCXX -lstdc++"
697 LDCXX="$CXX" 704 LDCXX="$CXX"
698 STATIC_CXX_SETTING="STATIC_CXX=false" 705 STATIC_CXX_SETTING="STATIC_CXX=false"
699 AC_MSG_RESULT([dynamic]) 706 AC_MSG_RESULT([dynamic])
700 else 707 else
701 LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" 708 LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
702 LDCXX="$CC" 709 LDCXX="$CC"
703 STATIC_CXX_SETTING="STATIC_CXX=true" 710 STATIC_CXX_SETTING="STATIC_CXX=true"
704 AC_MSG_RESULT([static]) 711 AC_MSG_RESULT([static])
705 fi 712 fi
706 fi 713 fi
707 AC_SUBST(STATIC_CXX_SETTING) 714 AC_SUBST(STATIC_CXX_SETTING)
708 715
709 if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then 716 if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
710 # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS 717 # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS
711 PKG_CHECK_MODULES([LIBFFI], [libffi]) 718 PKG_CHECK_MODULES([LIBFFI], [libffi])
712 719
713 fi 720 fi
714 721
715 if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then 722 if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
716 AC_CHECK_PROG([LLVM_CONFIG], [llvm-config], [llvm-config]) 723 AC_CHECK_PROG([LLVM_CONFIG], [llvm-config], [llvm-config])
717 724
718 if test "x$LLVM_CONFIG" != xllvm-config; then 725 if test "x$LLVM_CONFIG" != xllvm-config; then
719 AC_MSG_ERROR([llvm-config not found in $PATH.]) 726 AC_MSG_ERROR([llvm-config not found in $PATH.])
720 fi 727 fi
721 728
722 llvm_components="jit mcjit engine nativecodegen native" 729 llvm_components="jit mcjit engine nativecodegen native"
723 unset LLVM_CFLAGS 730 unset LLVM_CFLAGS
724 for flag in $("$LLVM_CONFIG" --cxxflags); do 731 for flag in $("$LLVM_CONFIG" --cxxflags); do
755 done 762 done
756 763
757 AC_SUBST(LLVM_CFLAGS) 764 AC_SUBST(LLVM_CFLAGS)
758 AC_SUBST(LLVM_LDFLAGS) 765 AC_SUBST(LLVM_LDFLAGS)
759 AC_SUBST(LLVM_LIBS) 766 AC_SUBST(LLVM_LIBS)
760 fi 767 fi
761 768
762 # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) 769 # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
763 if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then 770 if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then
764 LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" 771 LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
765 fi 772 fi
766 773
767 # TODO better (platform agnostic) test 774 # TODO better (platform agnostic) test
768 if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then 775 if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then
769 LIBCXX="-lstdc++" 776 LIBCXX="-lstdc++"
770 fi 777 fi
771 778
772 AC_SUBST(LIBCXX) 779 AC_SUBST(LIBCXX)
773
774 ]) 780 ])

mercurial