1 dnl Process this file with autoconf to produce a configure script.
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
9 AC_INIT([GNU Classpath],[0.92],[classpath@gnu.org],[classpath])
10 AC_CONFIG_SRCDIR(java/lang/System.java)
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
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")
33 CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
34 AC_SUBST(CLASSPATH_MODULE)
36 CLASSPATH_CONVENIENCE="-no-undefined"
37 AC_SUBST(CLASSPATH_CONVENIENCE)
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)
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}\"" ;;
55 [COMPILE_COLLECTIONS=no])
56 AM_CONDITIONAL(CREATE_COLLECTIONS, test "x${COMPILE_COLLECTIONS}" = xyes)
58 dnl -----------------------------------------------------------
59 dnl Enable JNI libraries (enabled by default)
60 dnl -----------------------------------------------------------
62 [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
63 [case "${enableval}" in
64 yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
66 *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
69 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
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 ;;
82 [COMPILE_CORE_JNI=yes])
83 AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
85 dnl -----------------------------------------------------------
86 dnl Default Preference Backend
87 dnl -----------------------------------------------------------
88 AC_ARG_ENABLE(default-preferences-peer,
89 AS_HELP_STRING([--enable-default-preferences-peer],
90 [fully qualified class name of default Preferences API Backend]))
91 DEFAULT_PREFS_PEER=$enable_default_preferences_peer
92 if test "$DEFAULT_PREFS_PEER" = ""; then
93 DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory
95 dnl AC_SUBST(DEFAULT_PREFS_PEER)
97 dnl -----------------------------------------------------------
98 dnl GConf native peer (enabled by default)
99 dnl -----------------------------------------------------------
100 AC_ARG_ENABLE([gconf-peer],
101 [AS_HELP_STRING(--disable-gconf-peer,compile GConf native peers (disabled by --disable-jni) [default=yes])],
102 [case "${enableval}" in
103 yes) COMPILE_GCONF_PEER=yes ;;
104 no) COMPILE_GCONF_PEER=no ;;
105 *) COMPILE_GCONF_PEER=yes ;;
107 [COMPILE_GCONF_PEER=yes])
108 AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
110 dnl -----------------------------------------------------------
111 dnl GTK native peer error checking
112 dnl -----------------------------------------------------------
113 AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
115 dnl ------------------------------------------------------------
116 dnl Whether to compile with -Werror or not (disabled by default)
117 dnl ------------------------------------------------------------
118 AC_ARG_ENABLE([Werror],
119 [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
120 [case "${enableval}" in
121 yes) ENABLE_WERROR=yes ;;
122 no) ENABLE_WERROR=no ;;
123 *) ENABLE_WERROR=no ;;
127 dnl -----------------------------------------------------------
128 dnl Default AWT toolkit
129 dnl -----------------------------------------------------------
130 AC_ARG_ENABLE(default-toolkit,
131 AS_HELP_STRING([--enable-default-toolkit],
132 [fully qualified class name of default AWT toolkit]))
133 default_toolkit=$enable_default_toolkit
134 if test "$default_toolkit" = ""; then
135 default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
137 AC_SUBST(default_toolkit)
139 dnl -----------------------------------------------------------
140 dnl Native libxml/xslt library (disabled by default)
141 dnl -----------------------------------------------------------
142 AC_ARG_ENABLE([xmlj],
143 [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
144 [case "${enableval}" in
145 yes) COMPILE_XMLJ=yes ;;
146 no) COMPILE_XMLJ=no ;;
147 *) COMPILE_XMLJ=no ;;
150 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
152 dnl -----------------------------------------------------------
153 dnl ALSA code (enabled by default)
154 dnl -----------------------------------------------------------
155 AC_ARG_ENABLE([alsa],
156 [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
157 [case "${enableval}" in
158 yes) COMPILE_ALSA=yes ;;
159 no) COMPILE_ALSA=no ;;
160 *) COMPILE_ALSA=yes ;;
162 [AC_CHECK_HEADERS([alsa/asoundlib.h],
163 [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
165 AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
167 dnl -----------------------------------------------------------
168 dnl DSSI code (enabled by default)
169 dnl -----------------------------------------------------------
170 AC_ARG_ENABLE([dssi],
171 [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
172 [case "${enableval}" in
173 yes) COMPILE_DSSI=yes ;;
174 no) COMPILE_DSSI=no ;;
175 *) COMPILE_DSSI=yes ;;
177 [AC_CHECK_HEADERS([dssi.h],COMPILE_DSSI=yes,COMPILE_DSSI=no)])
178 AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
180 dnl -----------------------------------------------------------
181 dnl GTK native peer (enabled by default)
182 dnl -----------------------------------------------------------
183 AC_ARG_ENABLE([gtk-peer],
184 [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
185 [case "${enableval}" in
186 yes) COMPILE_GTK_PEER=yes ;;
187 no) COMPILE_GTK_PEER=no ;;
188 *) COMPILE_GTK_PEER=yes ;;
190 [COMPILE_GTK_PEER=yes])
191 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
193 dnl -----------------------------------------------------------
194 dnl GTK native peer error checking
195 dnl -----------------------------------------------------------
196 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
198 dnl -----------------------------------------------------------
199 dnl Qt native peer (disabled by default)
200 dnl -----------------------------------------------------------
201 AC_ARG_ENABLE([qt-peer],
202 [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
203 [case "${enableval}" in
204 yes) COMPILE_QT_PEER=yes ;;
205 no) COMPILE_QT_PEER=no ;;
206 *) COMPILE_QT_PEER=yes ;;
208 [COMPILE_QT_PEER=no])
209 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
211 dnl -----------------------------------------------------------
212 dnl Plugin (enabled by default)
213 dnl -----------------------------------------------------------
214 AC_ARG_ENABLE([plugin],
215 [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
216 [case "${enableval}" in
217 yes) COMPILE_PLUGIN=yes ;;
218 no) COMPILE_PLUGIN=no ;;
219 *) COMPILE_PLUGIN=yes ;;
221 [COMPILE_PLUGIN=yes])
222 AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
224 dnl -----------------------------------------------------------
225 dnl GCJ LOCAL: Calculates and substitutes toolexeclibdir. $libdir is
226 dnl defined to the same value for all multilibs. We define toolexeclibdir
227 dnl so that we can refer to the multilib installation directories from
228 dnl classpath's build files.
229 dnl -----------------------------------------------------------
230 CLASSPATH_TOOLEXECLIBDIR
232 dnl -----------------------------------------------------------
233 dnl Sets the native libraries installation dir
234 dnl -----------------------------------------------------------
235 dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}
236 AC_ARG_WITH([native-libdir],
237 [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
239 nativeexeclibdir=${withval}
242 nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
245 AC_SUBST(nativeexeclibdir)
247 dnl -----------------------------------------------------------
248 dnl Sets the Java library installation dir.
249 dnl -----------------------------------------------------------
250 AC_ARG_WITH([glibj-dir],
251 [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
256 glibjdir='${datadir}/${PACKAGE}'
261 dnl -----------------------------------------------------------
262 dnl Sets the VM name for use in tool wrapper scripts
263 dnl -----------------------------------------------------------
265 [AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
270 VM_BINARY='${prefix}/bin/jamvm'
274 AM_CONDITIONAL(FOUND_CACAO, test "x`basename $VM_BINARY`" = xcacao)
276 dnl -----------------------------------------------------------
277 dnl Regenerate headers at build time (disabled by default)
278 dnl -----------------------------------------------------------
279 AC_ARG_ENABLE([regen-headers],
280 [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=no])],
281 [case "${enableval}" in
282 yes) REGENERATE_JNI_HEADERS=yes ;;
283 no) REGENERATE_JNI_HEADERS=no ;;
284 *) REGENERATE_JNI_HEADERS=no ;;
286 [REGENERATE_JNI_HEADERS=no])
287 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
289 dnl -----------------------------------------------------------
290 dnl Enable tool wrapper binaries (disabled by default)
291 dnl -----------------------------------------------------------
292 AC_ARG_ENABLE([tool-wrappers],
293 [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
294 [case x"${enableval}" in
295 xyes) COMPILE_WRAPPERS=yes ;;
296 xno) COMPILE_WRAPPERS=no ;;
297 x) COMPILE_WRAPPERS=yes ;;
298 *) COMPILE_WRAPPERS=yes ;;
300 [COMPILE_WRAPPERS=no])
301 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
306 dnl -----------------------------------------------------------
307 dnl Checks for programs.
308 dnl -----------------------------------------------------------
310 dnl Initialize libtool
317 if test "x${COMPILE_COLLECTIONS}" = xyes; then
318 AC_PATH_PROG(PERL, [perl])
320 AC_SUBST(COLLECTIONS_PREFIX)
321 AC_CONFIG_FILES([lib/mkcollections.pl])
322 AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
325 if test "x${COMPILE_JNI}" = xyes; then
328 dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
330 AC_COMPILE_CHECK_SIZEOF(void *)
332 dnl Checking for endianess.
335 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
336 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
337 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
338 dnl Check for crt_externs.h on Darwin.
339 AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
341 inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
349 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
350 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
351 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]))
352 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]))
354 AC_CHECK_FUNCS([ftruncate fsync select \
355 gethostname socket strerror fork pipe execve open close \
356 lseek fstat read write htonl memset htons connect \
357 getsockname getpeername bind listen accept \
358 recvfrom send sendto setsockopt getsockopt time mktime \
362 mmap munmap mincore msync madvise getpagesize sysconf \
367 AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
374 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
375 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
376 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
379 AC_MSG_CHECKING([for global timezone variable])
380 dnl FIXME: we don't want a link check here because that won't work
381 dnl when cross-compiling. So instead we make an assumption that
382 dnl the header file will mention timezone if it exists.
383 dnl Don't find the win32 function timezone
384 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
385 [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
388 AC_MSG_CHECKING([for global _timezone variable])
389 dnl FIXME: As above, don't want link check
390 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
391 [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
392 [Define if your platform has the global _timezone variable.])
394 [AC_MSG_RESULT(no)])])])
399 dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
402 dnl When using gcc we want warnings, lots of warnings :-)
403 if test "x${GCC}" = xyes; then
404 dnl We want ISO C90 pedantic ansi, but with longlong (jlong) support
405 dnl and modern POSIX and BSD C library functions/prototypes.
407 dnl Warning flags for (almost) everybody.
408 dnl Should probably be configurable
409 WARNING_CFLAGS='-pedantic -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
410 AC_SUBST(WARNING_CFLAGS)
412 dnl Strict warning flags which not every module uses.
413 dnl Should probably be configurable.
414 STRICT_WARNING_CFLAGS=-Wstrict-prototypes
415 AC_SUBST(STRICT_WARNING_CFLAGS)
417 dnl Whether or not to add -Werror, also not used by all modueles.
418 dnl Can be configured by --disable-Werror
420 if test "x${ENABLE_WERROR}" = xyes; then
421 ERROR_CFLAGS='-Werror'
423 AC_SUBST(ERROR_CFLAGS)
426 dnl Check for libxml and libxslt libraries (when xmlj is enabled).
427 if test "x${COMPILE_XMLJ}" = xyes; then
428 PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
429 PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
433 AC_SUBST(XSLT_CFLAGS)
436 dnl Check for AWT related gthread/gtk
437 if test "x${COMPILE_GTK_PEER}" = xyes; then
439 if test "$no_x" = yes; then
440 AC_MSG_ERROR([GTK+ peers requested but no X library available])
442 dnl We explicitly want the XTest Extension for Robot support.
443 AC_CHECK_LIB([Xtst], [XTestQueryExtension],
444 [XTEST_LIBS="$XTEST_LIBS -lX11 -lXtst"],
445 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
448 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
449 PKG_CHECK_MODULES(FREETYPE2, freetype2)
450 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
451 dnl Check if we can link against the XRender library and set
452 dnl HAVE_XRENDER accordingly.
453 AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
454 [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
458 dnl Check if we can link against the XRandR library and set
459 dnl HAVE_XRANDR accordingly.
460 AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
461 [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
467 AC_SUBST(FREETYPE2_LIBS)
468 AC_SUBST(FREETYPE2_CFLAGS)
469 AC_SUBST(PANGOFT2_LIBS)
470 AC_SUBST(PANGOFT2_CFLAGS)
475 if test "x${COMPILE_GCONF_PEER}" = xyes; then
476 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.11.2)
477 AC_SUBST(GCONF_CFLAGS)
479 dnl we also need gdk for locking
480 PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
483 dnl check if the config value was given form the command line,
484 dnl if not, overwrite the default if we have the gconf backend
486 USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
487 if test "$USE_GCONF_PREFS_PEER" = ""; then
488 DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
492 dnl Check for AWT related Qt4
493 if test "x${COMPILE_QT_PEER}" = xyes; then
494 PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
495 if test "x$HAVE_QT4" = "xyes"; then
496 dnl Check needed because in some cases the QtGui includedir
497 dnl doesn't contain the subsystem dir.
498 QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
499 EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
500 AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
501 AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
502 AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
503 QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
504 AC_MSG_WARN([QWidget not found])))
505 AC_CHECK_PROG(MOC, [moc], [moc])
506 AC_CHECK_PROG(MOC, [moc-qt4], [moc-qt4])
508 if test "x$HAVE_QT4" = "xno"; then
509 AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
512 AC_ARG_WITH([qt4dir],
513 [AS_HELP_STRING([--with-qt4dir=DIR],
514 [Qt4 installation directory used for OS-X.
515 For other systems use pkg-config.])],
518 if test x"$QT4DIR" = x ; then
519 AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
521 AC_MSG_RESULT([QT4DIR... $QT4DIR])
522 AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
523 if test x"$MOC" = x; then
524 AC_MSG_ERROR([*** This is not the right Qt installation])
526 QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
527 QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
528 QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
529 QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
532 AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
533 of your installed Qt4 installation.])
537 AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
542 dnl Check for plugin support headers and libraries.
543 if test "x${COMPILE_PLUGIN}" = xyes; then
544 PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
545 if test "x${MOZILLA_FOUND}" = xno; then
546 PKG_CHECK_MODULES(MOZILLA, firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
548 if test "x${MOZILLA_FOUND}" = xno; then
549 PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
551 if test "x${MOZILLA_FOUND}" = xno; then
552 PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
554 PKG_CHECK_MODULES(GLIB, glib-2.0)
556 AC_SUBST(MOZILLA_CFLAGS)
557 AC_SUBST(MOZILLA_LIBS)
558 AC_SUBST(GLIB_CFLAGS)
561 AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
567 dnl -----------------------------------------------------------
568 dnl Add the include files for the native abstraction layer.
569 dnl Used by AM_CPPFLAGS in the different modules.
570 dnl -----------------------------------------------------------
571 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/target/Linux -I\$(top_srcdir)/native/target/generic"
572 AC_SUBST(CLASSPATH_INCLUDES)
574 dnl -----------------------------------------------------------
575 if test "x${COMPILE_JNI}" = xyes; then
576 AC_MSG_CHECKING(jni_md.h support)
577 if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
582 AC_MSG_WARN(no, using x86-linux-gnu)
584 ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
585 ac_dests="include/jni_md.h"
586 while test -n "$ac_sources"; do
587 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
588 set $ac_sources; ac_source=$1; shift; ac_sources=$*
589 ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
591 AC_CONFIG_LINKS([$ac_config_links_1])
596 CLASSPATH_WITH_CLASSLIB
598 dnl -----------------------------------------------------------
599 dnl Initialize maintainer mode
600 dnl -----------------------------------------------------------
603 dnl -----------------------------------------------------------
604 dnl Enable debugging statements at compile time. By default
605 dnl these statements should be optimized out of the bytecode
606 dnl produced by an optimizing Java compiler and not hinder
607 dnl performance because debugging is turned off by default.
608 dnl -----------------------------------------------------------
609 AC_ARG_ENABLE([debug],
610 [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
611 [case "${enableval}" in
614 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
616 no) LIBDEBUG="false" ;;
617 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
622 dnl -----------------------------------------------------------
623 dnl Enable execution of all static initializer loadLibrary()
624 dnl calls at compile time. By default most people will not
625 dnl want to disable this, but some VMs (gcj) don't need or want
627 dnl -----------------------------------------------------------
628 AC_ARG_ENABLE([load-library],
629 [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
630 [case "${enableval}" in
631 yes) INIT_LOAD_LIBRARY="true" ;;
632 no) INIT_LOAD_LIBRARY="false" ;;
633 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
635 [INIT_LOAD_LIBRARY="true"])
636 AC_SUBST(INIT_LOAD_LIBRARY)
639 dnl -----------------------------------------------------------
640 dnl Should the VM explicitly run class initialization subfunctions for
641 dnl java.lang.System? (default is false -- the subfunctions will be run
642 dnl automatically by the class initializer)
643 dnl -----------------------------------------------------------
644 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
645 [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
646 [case "${enableval}" in
647 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
648 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
649 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
651 [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
652 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
655 dnl -----------------------------------------------------------
656 dnl avoiding automake complaints
657 dnl -----------------------------------------------------------
661 dnl -----------------------------------------------------------
662 dnl This is probably useless.
663 dnl -----------------------------------------------------------
664 AC_PATH_PROG(MKDIR, mkdir)
666 AC_PATH_PROG(DATE, date)
668 dnl -----------------------------------------------------------
669 dnl According to the GNU coding guide, we shouldn't require find,
670 dnl and zip, however GNU provides both so it should be okay
671 dnl -----------------------------------------------------------
672 AC_PATH_PROG(FIND, find)
674 dnl -----------------------------------------------------------
675 dnl Specify what to install (install only glibj.zip by default)
676 dnl -----------------------------------------------------------
679 dnl -----------------------------------------------------------
680 dnl Enable API documentation generation (disabled by default)
681 dnl -----------------------------------------------------------
684 dnl -----------------------------------------------------------
685 dnl Whether to use jay to regenerate parsers.
686 dnl -----------------------------------------------------------
689 dnl -----------------------------------------------------------
690 dnl This sets the build-time default, which can now be overridden
691 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
692 dnl to "true" or "false".
693 dnl -----------------------------------------------------------
694 AC_ARG_ENABLE([portable-native-sync],
695 [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
696 [case "${enableval}" in
698 AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
702 AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
707 AX_CREATE_STDINT_H([include/config-int.h])
709 dnl -----------------------------------------------------------------------
710 dnl Support for using a prebuilt class library
711 dnl -----------------------------------------------------------------------
712 AC_ARG_WITH([glibj_zip],
713 AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
714 [use prebuilt glibj.zip class library]))
716 case "$with_glibj_zip" in
724 AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
728 PATH_TO_GLIBJ_ZIP=$with_glibj_zip
732 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
733 AC_SUBST(PATH_TO_GLIBJ_ZIP)
735 dnl -----------------------------------------------------------
736 dnl Build with Escher based X peers.
737 dnl -----------------------------------------------------------
738 AC_ARG_WITH([escher],
739 AS_HELP_STRING([--with-escher=ABS.PATH],
740 [specify path to escher dir or JAR for X peers]))
741 case "$with_escher" in
749 AC_MSG_ERROR([Please suply an absolute path to Escher library])
753 PATH_TO_ESCHER=$with_escher
757 AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
758 AC_SUBST(PATH_TO_ESCHER)
760 dnl -----------------------------------------------------------
761 dnl Check if local socket support should be included.
762 dnl -----------------------------------------------------------
763 AC_ARG_ENABLE([local-sockets],
764 [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
765 [case "${enableval}" in
767 ENABLE_LOCAL_SOCKETS=yes
770 ENABLE_LOCAL_SOCKETS=no
774 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
776 AC_CHECK_HEADER([sys/un.h])
777 AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
778 AC_MSG_ERROR([networking support not available]))
779 AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
781 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
783 dnl -----------------------------------------------------------
784 dnl Add the default preference peer
785 dnl -----------------------------------------------------------
786 AC_SUBST(DEFAULT_PREFS_PEER)
788 dnl -----------------------------------------------------------
790 dnl -----------------------------------------------------------
791 AC_CONFIG_FILES([Makefile
795 external/sax/Makefile
796 external/w3c_dom/Makefile
797 external/relaxngDatatype/Makefile
798 gnu/classpath/Configuration.java
799 gnu/java/security/Configuration.java
802 native/fdlibm/Makefile
805 native/jni/classpath/Makefile
806 native/jni/java-io/Makefile
807 native/jni/java-lang/Makefile
808 native/jni/java-net/Makefile
809 native/jni/java-nio/Makefile
810 native/jni/java-util/Makefile
811 native/jni/gtk-peer/Makefile
812 native/jni/gconf-peer/Makefile
813 native/jni/qt-peer/Makefile
814 native/jni/xmlj/Makefile
815 native/jni/midi-alsa/Makefile
816 native/jni/midi-dssi/Makefile
817 native/plugin/Makefile
818 native/target/Makefile
819 native/target/Linux/Makefile
820 native/target/generic/Makefile
822 resource/META-INF/services/java.util.prefs.PreferencesFactory
824 scripts/classpath.spec
827 lib/copy-vmresources.sh
830 examples/Makefile.jawt
831 examples/Makefile.java2d])
833 if test "x${COMPILE_WRAPPERS}" = xno
835 AC_CONFIG_FILES([tools/gappletviewer
841 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
842 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
843 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
844 AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
845 AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
846 AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
850 if test "x${COMPILE_WRAPPERS}" = xno
852 AC_CONFIG_FILES([tools/appletviewer
855 AC_CONFIG_COMMANDS([appletviewer],[chmod 755 tools/appletviewer])
856 AC_CONFIG_COMMANDS([jarsigner],[chmod 755 tools/jarsigner])
857 AC_CONFIG_COMMANDS([keytool],[chmod 755 tools/keytool])
860 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
861 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
864 # Create standard.omit based on decisions we just made.
865 cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
866 if test x$use_escher != xtrue; then
867 echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit