re PR java/28024 (libjava build failure on Solaris 2.8 (sun4u))
[gcc.git] / libjava / classpath / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 dnl -----------------------------------------------------------
4 dnl Turning off cache for debug reasons
5 dnl -----------------------------------------------------------
6 dnl define([AC_CACHE_LOAD], )dnl
7 dnl define([AC_CACHE_SAVE], )dnl
8
9 AC_INIT([GNU Classpath],[0.92-pre],[classpath@gnu.org],[classpath])
10 AC_CONFIG_SRCDIR(java/lang/System.java)
11
12 AC_CANONICAL_TARGET
13
14 dnl -----------------------------------------------------------
15 dnl Fold all IA-32 CPU architectures into "x86"
16 dnl -----------------------------------------------------------
17 if expr ${target_cpu} : '.*86' > /dev/null; then target_cpu=x86; fi
18
19 dnl -----------------------------------------------------------
20 dnl We will not track/change lib version until we reach version 1.0
21 dnl at which time we'll have to be more anal about such things
22 dnl -----------------------------------------------------------
23 AC_SUBST(LIBVERSION, "0:0:0")
24 case "$host_os" in
25 darwin*)
26 cp_module=""
27 ;;
28 *)
29 cp_module="-module"
30 ;;
31 esac
32
33 CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
34 AC_SUBST(CLASSPATH_MODULE)
35
36 CLASSPATH_CONVENIENCE="-no-undefined"
37 AC_SUBST(CLASSPATH_CONVENIENCE)
38
39 AC_PREREQ(2.59)
40 AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar])
41 AC_CONFIG_HEADERS([include/config.h])
42 AC_PREFIX_DEFAULT(/usr/local/classpath)
43
44 dnl -----------------------------------------------------------
45 dnl Enable collections.jar (disabled by default)
46 dnl -----------------------------------------------------------
47 AC_ARG_ENABLE([collections],
48 [AS_HELP_STRING(--enable-collections,create collections.jar [default=no])],
49 [case x"${enableval}" in
50 xyes) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
51 xno) COMPILE_COLLECTIONS=no ;;
52 x) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
53 *) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"${enableval}\"" ;;
54 esac],
55 [COMPILE_COLLECTIONS=no])
56 AM_CONDITIONAL(CREATE_COLLECTIONS, test "x${COMPILE_COLLECTIONS}" = xyes)
57
58 dnl -----------------------------------------------------------
59 dnl Enable JNI libraries (enabled by default)
60 dnl -----------------------------------------------------------
61 AC_ARG_ENABLE([jni],
62 [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
63 [case "${enableval}" in
64 yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
65 no) COMPILE_JNI=no ;;
66 *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
67 esac],
68 [COMPILE_JNI=yes])
69 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
70
71 dnl -----------------------------------------------------------
72 dnl Enable core JNI libraries (enabled by default)
73 dnl -----------------------------------------------------------
74 AC_ARG_ENABLE([core-jni],
75 [AS_HELP_STRING(--enable-core-jni,
76 compile JNI sources for core [default=yes])],
77 [case "${enableval}" in
78 yes) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
79 no) COMPILE_CORE_JNI=no ;;
80 *) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
81 esac],
82 [COMPILE_CORE_JNI=yes])
83 AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
84
85 dnl ------------------------------------------------------------
86 dnl Whether to compile with -Werror or not (disabled by default)
87 dnl ------------------------------------------------------------
88 AC_ARG_ENABLE([Werror],
89 [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
90 [case "${enableval}" in
91 yes) ENABLE_WERROR=yes ;;
92 no) ENABLE_WERROR=no ;;
93 *) ENABLE_WERROR=no ;;
94 esac],
95 [ENABLE_WERROR=no])
96
97 dnl -----------------------------------------------------------
98 dnl Default AWT toolkit
99 dnl -----------------------------------------------------------
100 AC_ARG_ENABLE(default-toolkit,
101 AS_HELP_STRING([--enable-default-toolkit],
102 [fully qualified class name of default AWT toolkit]))
103 default_toolkit=$enable_default_toolkit
104 if test "$default_toolkit" = ""; then
105 default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
106 fi
107 AC_SUBST(default_toolkit)
108
109 dnl -----------------------------------------------------------
110 dnl Native libxml/xslt library (disabled by default)
111 dnl -----------------------------------------------------------
112 AC_ARG_ENABLE([xmlj],
113 [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
114 [case "${enableval}" in
115 yes) COMPILE_XMLJ=yes ;;
116 no) COMPILE_XMLJ=no ;;
117 *) COMPILE_XMLJ=no ;;
118 esac],
119 [COMPILE_XMLJ=no])
120 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
121
122 dnl -----------------------------------------------------------
123 dnl ALSA code (enabled by default)
124 dnl -----------------------------------------------------------
125 AC_ARG_ENABLE([alsa],
126 [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
127 [case "${enableval}" in
128 yes) COMPILE_ALSA=yes ;;
129 no) COMPILE_ALSA=no ;;
130 *) COMPILE_ALSA=yes ;;
131 esac],
132 [AC_CHECK_HEADERS([alsa/asoundlib.h],
133 [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
134 COMPILE_ALSA=no)])
135 AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
136
137 dnl -----------------------------------------------------------
138 dnl DSSI code (enabled by default)
139 dnl -----------------------------------------------------------
140 AC_ARG_ENABLE([dssi],
141 [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
142 [case "${enableval}" in
143 yes) COMPILE_DSSI=yes ;;
144 no) COMPILE_DSSI=no ;;
145 *) COMPILE_DSSI=yes ;;
146 esac],
147 [AC_CHECK_HEADERS([dssi.h],COMPILE_DSSI=yes,COMPILE_DSSI=no)])
148 AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
149
150 dnl -----------------------------------------------------------
151 dnl GTK native peer (enabled by default)
152 dnl -----------------------------------------------------------
153 AC_ARG_ENABLE([gtk-peer],
154 [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
155 [case "${enableval}" in
156 yes) COMPILE_GTK_PEER=yes ;;
157 no) COMPILE_GTK_PEER=no ;;
158 *) COMPILE_GTK_PEER=yes ;;
159 esac],
160 [COMPILE_GTK_PEER=yes])
161 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
162
163 dnl -----------------------------------------------------------
164 dnl GTK native peer error checking
165 dnl -----------------------------------------------------------
166 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
167
168 dnl -----------------------------------------------------------
169 dnl Qt native peer (disabled by default)
170 dnl -----------------------------------------------------------
171 AC_ARG_ENABLE([qt-peer],
172 [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
173 [case "${enableval}" in
174 yes) COMPILE_QT_PEER=yes ;;
175 no) COMPILE_QT_PEER=no ;;
176 *) COMPILE_QT_PEER=yes ;;
177 esac],
178 [COMPILE_QT_PEER=no])
179 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
180
181 dnl -----------------------------------------------------------
182 dnl Plugin (enabled by default)
183 dnl -----------------------------------------------------------
184 AC_ARG_ENABLE([plugin],
185 [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
186 [case "${enableval}" in
187 yes) COMPILE_PLUGIN=yes ;;
188 no) COMPILE_PLUGIN=no ;;
189 *) COMPILE_PLUGIN=yes ;;
190 esac],
191 [COMPILE_PLUGIN=yes])
192 AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
193
194 dnl -----------------------------------------------------------
195 dnl Sets the native libraries installation dir
196 dnl -----------------------------------------------------------
197 AC_ARG_WITH([native-libdir],
198 [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
199 [
200 nativeexeclibdir=${withval}
201 ],
202 [
203 nativeexeclibdir='${libdir}/${PACKAGE}'
204 ])
205
206 AC_SUBST(nativeexeclibdir)
207
208 dnl -----------------------------------------------------------
209 dnl Sets the Java library installation dir.
210 dnl -----------------------------------------------------------
211 AC_ARG_WITH([glibj-dir],
212 [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
213 [
214 glibjdir=${withval}
215 ],
216 [
217 glibjdir='${datadir}/${PACKAGE}'
218 ])
219
220 AC_SUBST(glibjdir)
221
222 dnl -----------------------------------------------------------
223 dnl Sets the VM name for use in tool wrapper scripts
224 dnl -----------------------------------------------------------
225 AC_ARG_WITH([vm],
226 [AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
227 [
228 VM_BINARY=${withval}
229 ],
230 [
231 VM_BINARY='${prefix}/bin/jamvm'
232 ])
233
234 AC_SUBST(VM_BINARY)
235 AM_CONDITIONAL(FOUND_CACAO, test "x`basename $VM_BINARY`" = xcacao)
236
237 dnl -----------------------------------------------------------
238 dnl Regenerate headers at build time (disabled by default)
239 dnl -----------------------------------------------------------
240 AC_ARG_ENABLE([regen-headers],
241 [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=no])],
242 [case "${enableval}" in
243 yes) REGENERATE_JNI_HEADERS=yes ;;
244 no) REGENERATE_JNI_HEADERS=no ;;
245 *) REGENERATE_JNI_HEADERS=no ;;
246 esac],
247 [REGENERATE_JNI_HEADERS=no])
248 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
249
250 dnl -----------------------------------------------------------
251 dnl Enable tool wrapper binaries (disabled by default)
252 dnl -----------------------------------------------------------
253 AC_ARG_ENABLE([tool-wrappers],
254 [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
255 [case x"${enableval}" in
256 xyes) COMPILE_WRAPPERS=yes ;;
257 xno) COMPILE_WRAPPERS=no ;;
258 x) COMPILE_WRAPPERS=yes ;;
259 *) COMPILE_WRAPPERS=yes ;;
260 esac],
261 [COMPILE_WRAPPERS=no])
262 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
263
264 AC_PROG_LN_S
265 AC_PROG_INSTALL
266
267 dnl -----------------------------------------------------------
268 dnl Checks for programs.
269 dnl -----------------------------------------------------------
270 AC_PROG_CXX
271 dnl Initialize libtool
272 AC_DISABLE_STATIC
273 AC_PROG_LIBTOOL
274 dnl AC_PROG_AWK
275 AC_PROG_CC
276 AC_PROG_CPP
277
278 if test "x${COMPILE_COLLECTIONS}" = xyes; then
279 AC_PATH_PROG(PERL, [perl])
280 AC_SUBST(PERL)
281 AC_SUBST(COLLECTIONS_PREFIX)
282 AC_CONFIG_FILES([lib/mkcollections.pl])
283 AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
284 fi
285
286 if test "x${COMPILE_JNI}" = xyes; then
287 AC_HEADER_STDC
288
289 dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
290 dnl at least.
291 AC_COMPILE_CHECK_SIZEOF(void *)
292
293 dnl Checking for endianess.
294 AC_C_BIGENDIAN_CROSS
295
296 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
297 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
298 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
299 dnl Check for crt_externs.h on Darwin.
300 AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
301 asm/ioctls.h \
302 inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
303 sys/time.h \
304 sys/select.h \
305 crt_externs.h \
306 fcntl.h \
307 sys/mman.h \
308 magic.h])
309
310 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
311 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
312 AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
313 AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
314
315 AC_CHECK_FUNCS([ftruncate fsync select \
316 gethostname socket strerror fork pipe execve open close \
317 lseek fstat read write htonl memset htons connect \
318 getsockname getpeername bind listen accept \
319 recvfrom send sendto setsockopt getsockopt time mktime \
320 localtime_r \
321 strerror_r \
322 fcntl \
323 mmap munmap mincore msync madvise getpagesize sysconf \
324 lstat readlink \
325 ])
326
327 LIBMAGIC=
328 AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
329 AC_SUBST(LIBMAGIC)
330
331 AC_HEADER_TIME
332 AC_STRUCT_TM
333 AC_STRUCT_TIMEZONE
334
335 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
336 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
337 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
338 AC_MSG_RESULT(yes)],
339 [AC_MSG_RESULT(no)
340 AC_MSG_CHECKING([for global timezone variable])
341 dnl FIXME: we don't want a link check here because that won't work
342 dnl when cross-compiling. So instead we make an assumption that
343 dnl the header file will mention timezone if it exists.
344 dnl Don't find the win32 function timezone
345 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
346 [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
347 AC_MSG_RESULT(yes)],
348 [AC_MSG_RESULT(no)
349 AC_MSG_CHECKING([for global _timezone variable])
350 dnl FIXME: As above, don't want link check
351 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
352 [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
353 [Define if your platform has the global _timezone variable.])
354 AC_MSG_RESULT(yes)],
355 [AC_MSG_RESULT(no)])])])
356
357 AC_C_CONST
358 AC_C_ATTRIBUTE
359
360 dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
361 AM_ICONV
362
363 dnl When using gcc we want warnings, lots of warnings :-)
364 if test "x${GCC}" = xyes; then
365 dnl We want ISO C90 pedantic ansi, but with longlong (jlong) support
366 dnl and modern POSIX and BSD C library functions/prototypes.
367
368 dnl Warning flags for (almost) everybody.
369 dnl Should probably be configurable
370 WARNING_CFLAGS='-pedantic -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
371 AC_SUBST(WARNING_CFLAGS)
372
373 dnl Strict warning flags which not every module uses.
374 dnl Should probably be configurable.
375 STRICT_WARNING_CFLAGS=-Wstrict-prototypes
376 AC_SUBST(STRICT_WARNING_CFLAGS)
377
378 dnl Whether or not to add -Werror, also not used by all modueles.
379 dnl Can be configured by --disable-Werror
380 ERROR_CFLAGS=
381 if test "x${ENABLE_WERROR}" = xyes; then
382 ERROR_CFLAGS='-Werror'
383 fi
384 AC_SUBST(ERROR_CFLAGS)
385 fi
386
387 dnl Check for libxml and libxslt libraries (when xmlj is enabled).
388 if test "x${COMPILE_XMLJ}" = xyes; then
389 PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
390 PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
391 AC_SUBST(XML_LIBS)
392 AC_SUBST(XML_CFLAGS)
393 AC_SUBST(XSLT_LIBS)
394 AC_SUBST(XSLT_CFLAGS)
395 fi
396
397 dnl Check for AWT related gthread/gtk
398 if test "x${COMPILE_GTK_PEER}" = xyes; then
399 AC_PATH_XTRA
400 if test "$no_x" = yes; then
401 AC_MSG_ERROR([GTK+ peers requested but no X library available])
402 fi
403 dnl We explicitly want the XTest Extension for Robot support.
404 AC_CHECK_LIB([Xtst], [XTestQueryExtension],
405 [XTEST_LIBS="$XTEST_LIBS -lX11 -lXtst"],
406 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
407 [${X_LIBS}])
408
409 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
410 PKG_CHECK_MODULES(FREETYPE2, freetype2)
411 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
412 dnl Check if we can link against the XRender library and set
413 dnl HAVE_XRENDER accordingly.
414 AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
415 [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
416 [true],
417 [${X_LIBS}])
418
419 dnl Check if we can link against the XRandR library and set
420 dnl HAVE_XRANDR accordingly.
421 AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
422 [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
423 [true],
424 [${X_LIBS}])
425
426 AC_SUBST(GTK_CFLAGS)
427 AC_SUBST(GTK_LIBS)
428 AC_SUBST(FREETYPE2_LIBS)
429 AC_SUBST(FREETYPE2_CFLAGS)
430 AC_SUBST(PANGOFT2_LIBS)
431 AC_SUBST(PANGOFT2_CFLAGS)
432 AC_SUBST(XTEST_LIBS)
433 fi
434
435 dnl Check for AWT related Qt4
436 if test "x${COMPILE_QT_PEER}" = xyes; then
437 PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
438 if test "x$HAVE_QT4" = "xyes"; then
439 dnl Check needed because in some cases the QtGui includedir
440 dnl doesn't contain the subsystem dir.
441 QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
442 EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
443 AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
444 AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
445 AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
446 QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
447 AC_MSG_WARN([QWidget not found])))
448 AC_CHECK_PROG(MOC, [moc], [moc])
449 fi
450 if test "x$HAVE_QT4" = "xno"; then
451 AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
452 case "$host_os" in
453 darwin*)
454 AC_ARG_WITH([qt4dir],
455 [AS_HELP_STRING([--with-qt4dir=DIR],
456 [Qt4 installation directory used for OS-X.
457 For other systems use pkg-config.])],
458 [QT4DIR=$withval]
459 )
460 if test x"$QT4DIR" = x ; then
461 AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
462 fi
463 AC_MSG_RESULT([QT4DIR... $QT4DIR])
464 AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
465 if test x"$MOC" = x; then
466 AC_MSG_ERROR([*** This is not the right Qt installation])
467 fi
468 QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
469 QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
470 QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
471 QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
472 ;;
473 *)
474 AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
475 of your installed Qt4 installation.])
476 ;;
477 esac
478 fi
479 AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
480 AC_SUBST(QT_CFLAGS)
481 AC_SUBST(QT_LIBS)
482 fi
483
484 dnl Check for plugin support headers and libraries.
485 if test "x${COMPILE_PLUGIN}" = xyes; then
486 PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
487 if test "x${MOZILLA_FOUND}" = xno; then
488 PKG_CHECK_MODULES(MOZILLA, firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
489 fi
490 if test "x${MOZILLA_FOUND}" = xno; then
491 PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
492 fi
493 PKG_CHECK_MODULES(GLIB, glib-2.0)
494
495 AC_SUBST(MOZILLA_CFLAGS)
496 AC_SUBST(MOZILLA_LIBS)
497 AC_SUBST(GLIB_CFLAGS)
498 AC_SUBST(GLIB_LIBS)
499
500 AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
501 fi
502 fi
503
504 CLASSPATH_WITH_JAVAH
505
506 dnl -----------------------------------------------------------
507 dnl Add the include files for the native abstraction layer.
508 dnl Used by AM_CPPFLAGS in the different modules.
509 dnl -----------------------------------------------------------
510 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/target/Linux -I\$(top_srcdir)/native/target/generic"
511 AC_SUBST(CLASSPATH_INCLUDES)
512
513 dnl -----------------------------------------------------------
514 if test "x${COMPILE_JNI}" = xyes; then
515 AC_MSG_CHECKING(jni_md.h support)
516 if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
517 AC_MSG_RESULT(yes)
518 else
519 target_cpu=x86
520 target_os=linux-gnu
521 AC_MSG_WARN(no, using x86-linux-gnu)
522 fi
523 ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
524 ac_dests="include/jni_md.h"
525 while test -n "$ac_sources"; do
526 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
527 set $ac_sources; ac_source=$1; shift; ac_sources=$*
528 ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
529 done
530 AC_CONFIG_LINKS([$ac_config_links_1])
531 fi
532
533 CLASSPATH_FIND_JAVAC
534
535 CLASSPATH_WITH_CLASSLIB
536
537 dnl -----------------------------------------------------------
538 dnl Initialize maintainer mode
539 dnl -----------------------------------------------------------
540 AM_MAINTAINER_MODE
541
542 dnl -----------------------------------------------------------
543 dnl Enable debugging statements at compile time. By default
544 dnl these statements should be optimized out of the bytecode
545 dnl produced by an optimizing Java compiler and not hinder
546 dnl performance because debugging is turned off by default.
547 dnl -----------------------------------------------------------
548 AC_ARG_ENABLE([debug],
549 [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
550 [case "${enableval}" in
551 yes)
552 LIBDEBUG="true"
553 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
554 ;;
555 no) LIBDEBUG="false" ;;
556 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
557 esac],
558 [LIBDEBUG="false"])
559 AC_SUBST(LIBDEBUG)
560
561 dnl -----------------------------------------------------------
562 dnl Enable execution of all static initializer loadLibrary()
563 dnl calls at compile time. By default most people will not
564 dnl want to disable this, but some VMs (gcj) don't need or want
565 dnl them.
566 dnl -----------------------------------------------------------
567 AC_ARG_ENABLE([load-library],
568 [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
569 [case "${enableval}" in
570 yes) INIT_LOAD_LIBRARY="true" ;;
571 no) INIT_LOAD_LIBRARY="false" ;;
572 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
573 esac],
574 [INIT_LOAD_LIBRARY="true"])
575 AC_SUBST(INIT_LOAD_LIBRARY)
576
577
578 dnl -----------------------------------------------------------
579 dnl Should the VM explicitly run class initialization subfunctions for
580 dnl java.lang.System? (default is false -- the subfunctions will be run
581 dnl automatically by the class initializer)
582 dnl -----------------------------------------------------------
583 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
584 [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
585 [case "${enableval}" in
586 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
587 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
588 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
589 esac],
590 [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
591 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
592
593
594 dnl -----------------------------------------------------------
595 dnl avoiding automake complaints
596 dnl -----------------------------------------------------------
597 REMOVE=""
598 AC_SUBST(REMOVE)
599
600 dnl -----------------------------------------------------------
601 dnl This is probably useless.
602 dnl -----------------------------------------------------------
603 AC_PATH_PROG(MKDIR, mkdir)
604 AC_PATH_PROG(CP, cp)
605 AC_PATH_PROG(DATE, date)
606
607 dnl -----------------------------------------------------------
608 dnl According to the GNU coding guide, we shouldn't require find,
609 dnl and zip, however GNU provides both so it should be okay
610 dnl -----------------------------------------------------------
611 AC_PATH_PROG(FIND, find)
612
613 dnl -----------------------------------------------------------
614 dnl Specify what to install (install only glibj.zip by default)
615 dnl -----------------------------------------------------------
616 CLASSPATH_WITH_GLIBJ
617
618 dnl -----------------------------------------------------------
619 dnl Enable API documentation generation (disabled by default)
620 dnl -----------------------------------------------------------
621 CLASSPATH_WITH_GJDOC
622
623 dnl -----------------------------------------------------------
624 dnl Whether to use jay to regenerate parsers.
625 dnl -----------------------------------------------------------
626 REGEN_WITH_JAY
627
628 dnl -----------------------------------------------------------
629 dnl This sets the build-time default, which can now be overridden
630 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
631 dnl to "true" or "false".
632 dnl -----------------------------------------------------------
633 AC_ARG_ENABLE([portable-native-sync],
634 [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
635 [case "${enableval}" in
636 yes)
637 AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
638 ;;
639 no) ;;
640 *)
641 AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
642 ;;
643 esac],
644 [])
645
646 AX_CREATE_STDINT_H([include/config-int.h])
647
648 dnl -----------------------------------------------------------------------
649 dnl Support for using a prebuilt class library
650 dnl -----------------------------------------------------------------------
651 AC_ARG_WITH([glibj_zip],
652 AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
653 [use prebuilt glibj.zip class library]))
654
655 case "$with_glibj_zip" in
656 "")
657 use_glibj_zip=false
658 ;;
659 "no" )
660 use_glibj_zip=false
661 ;;
662 "yes")
663 AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
664 ;;
665 *)
666 use_glibj_zip=true
667 PATH_TO_GLIBJ_ZIP=$with_glibj_zip
668 ;;
669 esac;
670
671 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
672 AC_SUBST(PATH_TO_GLIBJ_ZIP)
673
674
675 dnl -----------------------------------------------------------
676 dnl Check if local socket support should be included.
677 dnl -----------------------------------------------------------
678 AC_ARG_ENABLE([local-sockets],
679 [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
680 [case "${enableval}" in
681 yes)
682 ENABLE_LOCAL_SOCKETS=yes
683 ;;
684 *)
685 ENABLE_LOCAL_SOCKETS=no
686 ;;
687 esac],
688 [])
689 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
690 then
691 AC_CHECK_HEADER([sys/un.h])
692 AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
693 AC_MSG_ERROR([networking support not available]))
694 AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
695 fi
696 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
697
698
699 dnl -----------------------------------------------------------
700 dnl output files
701 dnl -----------------------------------------------------------
702 AC_CONFIG_FILES([Makefile
703 doc/Makefile
704 doc/api/Makefile
705 external/Makefile
706 external/sax/Makefile
707 external/w3c_dom/Makefile
708 external/relaxngDatatype/Makefile
709 gnu/classpath/Configuration.java
710 include/Makefile
711 native/Makefile
712 native/fdlibm/Makefile
713 native/jawt/Makefile
714 native/jni/Makefile
715 native/jni/classpath/Makefile
716 native/jni/java-io/Makefile
717 native/jni/java-lang/Makefile
718 native/jni/java-net/Makefile
719 native/jni/java-nio/Makefile
720 native/jni/java-util/Makefile
721 native/jni/gtk-peer/Makefile
722 native/jni/qt-peer/Makefile
723 native/jni/xmlj/Makefile
724 native/jni/midi-alsa/Makefile
725 native/jni/midi-dssi/Makefile
726 native/plugin/Makefile
727 native/target/Makefile
728 native/target/Linux/Makefile
729 native/target/generic/Makefile
730 resource/Makefile
731 scripts/Makefile
732 scripts/classpath.spec
733 lib/Makefile
734 lib/gen-classlist.sh
735 lib/copy-vmresources.sh
736 tools/Makefile
737 examples/Makefile
738 examples/Makefile.jawt])
739
740 if test "x${COMPILE_WRAPPERS}" = xno
741 then
742 AC_CONFIG_FILES([tools/appletviewer
743 tools/jarsigner
744 tools/keytool])
745 AC_CONFIG_COMMANDS([appletviewer],[chmod 755 tools/appletviewer])
746 AC_CONFIG_COMMANDS([jarsigner],[chmod 755 tools/jarsigner])
747 AC_CONFIG_COMMANDS([keytool],[chmod 755 tools/keytool])
748 fi
749
750 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
751 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
752 AC_OUTPUT