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.94-pre],[classpath@gnu.org],[classpath])
10 AC_CONFIG_SRCDIR(java/lang/System.java)
15 AC_ARG_ENABLE(java-maintainer-mode,
16 AS_HELP_STRING([--enable-java-maintainer-mode],
17 [allow rebuilding of .class and .h files]))
18 AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
21 dnl -----------------------------------------------------------
22 dnl Fold all IA-32 CPU architectures into "x86"
23 dnl -----------------------------------------------------------
24 if expr ${target_cpu} : '.*86' > /dev/null; then target_cpu=x86; fi
26 dnl -----------------------------------------------------------
27 dnl We will not track/change lib version until we reach version 1.0
28 dnl at which time we'll have to be more anal about such things
29 dnl -----------------------------------------------------------
30 AC_SUBST(LIBVERSION, "0:0:0")
40 CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
41 AC_SUBST(CLASSPATH_MODULE)
43 CLASSPATH_CONVENIENCE="-no-undefined"
44 AC_SUBST(CLASSPATH_CONVENIENCE)
47 AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar])
48 AC_CONFIG_HEADERS([include/config.h])
49 AC_PREFIX_DEFAULT(/usr/local/classpath)
54 dnl -----------------------------------------------------------
55 dnl Enable collections.jar (disabled by default)
56 dnl -----------------------------------------------------------
57 AC_ARG_ENABLE([collections],
58 [AS_HELP_STRING(--enable-collections,create collections.jar [default=no])],
59 [case x"${enableval}" in
60 xyes) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
61 xno) COMPILE_COLLECTIONS=no ;;
62 x) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
63 *) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"${enableval}\"" ;;
65 [COMPILE_COLLECTIONS=no])
66 AM_CONDITIONAL(CREATE_COLLECTIONS, test "x${COMPILE_COLLECTIONS}" = xyes)
68 dnl -----------------------------------------------------------
69 dnl Enable JNI libraries (enabled by default)
70 dnl -----------------------------------------------------------
72 [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
73 [case "${enableval}" in
74 yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
76 *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
79 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
81 dnl -----------------------------------------------------------
82 dnl Enable core JNI libraries (enabled by default)
83 dnl -----------------------------------------------------------
84 AC_ARG_ENABLE([core-jni],
85 [AS_HELP_STRING(--enable-core-jni,
86 compile JNI sources for core [default=yes])],
87 [case "${enableval}" in
88 yes) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
89 no) COMPILE_CORE_JNI=no ;;
90 *) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
92 [COMPILE_CORE_JNI=yes])
93 AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
95 dnl -----------------------------------------------------------
96 dnl Default Preference Backend
97 dnl -----------------------------------------------------------
98 AC_ARG_ENABLE([default-preferences-peer],
99 [AS_HELP_STRING([--enable-default-preferences-peer@<:@=peer type or class name@:>@],
100 [specify one of: "gconf" [default] for a GConf based backend, "file" for a file based one, "memory" for a transient one, or a fully qualified class name implementing java.util.prefs.PreferencesFactory])],
101 [case "${enableval}" in
102 file) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory ;;
103 gconf|yes|true) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory ;;
104 memory) DEFAULT_PREFS_PEER=gnu.java.util.prefs.MemoryBasedFactory ;;
105 no|false) AC_MSG_ERROR(bad value '${enableval}' for --enable-default-preferences-peer) ;;
106 *) DEFAULT_PREFS_PEER=${enableval} ;;
108 [DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory])
109 dnl AC_SUBST(DEFAULT_PREFS_PEER)
111 dnl -----------------------------------------------------------
112 dnl GConf native peer (enabled by default)
113 dnl -----------------------------------------------------------
114 AC_ARG_ENABLE([gconf-peer],
115 [AS_HELP_STRING(--disable-gconf-peer,compile GConf native peers (disabled by --disable-jni) [default=yes])],
116 [case "${enableval}" in
117 yes) COMPILE_GCONF_PEER=yes ;;
118 no) COMPILE_GCONF_PEER=no ;;
119 *) COMPILE_GCONF_PEER=yes ;;
121 [COMPILE_GCONF_PEER=yes])
122 AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
124 dnl -----------------------------------------------------------
125 dnl GTK native peer error checking
126 dnl -----------------------------------------------------------
127 AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
129 dnl ------------------------------------------------------------
130 dnl Whether to compile with -Werror or not (disabled by default)
131 dnl ------------------------------------------------------------
132 AC_ARG_ENABLE([Werror],
133 [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
134 [case "${enableval}" in
135 yes) ENABLE_WERROR=yes ;;
136 no) ENABLE_WERROR=no ;;
137 *) ENABLE_WERROR=default ;;
139 [ENABLE_WERROR=default])
141 dnl -----------------------------------------------------------
142 dnl Default AWT toolkit
143 dnl -----------------------------------------------------------
144 AC_ARG_ENABLE(default-toolkit,
145 AS_HELP_STRING([--enable-default-toolkit],
146 [fully qualified class name of default AWT toolkit]))
147 default_toolkit=$enable_default_toolkit
148 if test "$default_toolkit" = ""; then
149 default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
151 AC_SUBST(default_toolkit)
153 dnl -----------------------------------------------------------
154 dnl Native libxml/xslt library (disabled by default)
155 dnl -----------------------------------------------------------
156 AC_ARG_ENABLE([xmlj],
157 [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
158 [case "${enableval}" in
159 yes) COMPILE_XMLJ=yes ;;
160 no) COMPILE_XMLJ=no ;;
161 *) COMPILE_XMLJ=no ;;
164 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
166 dnl -----------------------------------------------------------
167 dnl ALSA code (enabled by default)
168 dnl -----------------------------------------------------------
169 AC_ARG_ENABLE([alsa],
170 [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
171 [case "${enableval}" in
172 yes) COMPILE_ALSA=yes ;;
173 no) COMPILE_ALSA=no ;;
174 *) COMPILE_ALSA=yes ;;
176 [AC_CHECK_HEADERS([alsa/asoundlib.h],
177 [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
179 AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
181 dnl -----------------------------------------------------------
182 dnl DSSI code (enabled by default)
183 dnl -----------------------------------------------------------
184 AC_ARG_ENABLE([dssi],
185 [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
186 [case "${enableval}" in
187 yes) COMPILE_DSSI=yes ;;
188 no) COMPILE_DSSI=no ;;
189 *) COMPILE_DSSI=yes ;;
191 [AC_CHECK_HEADERS([dssi.h],COMPILE_DSSI=yes,COMPILE_DSSI=no)])
192 AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
194 dnl -----------------------------------------------------------
195 dnl GTK native peer (enabled by default)
196 dnl -----------------------------------------------------------
197 AC_ARG_ENABLE([gtk-peer],
198 [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
199 [case "${enableval}" in
200 yes) COMPILE_GTK_PEER=yes ;;
201 no) COMPILE_GTK_PEER=no ;;
202 *) COMPILE_GTK_PEER=yes ;;
204 [COMPILE_GTK_PEER=yes])
205 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
207 dnl -----------------------------------------------------------
208 dnl GTK native peer error checking
209 dnl -----------------------------------------------------------
210 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
212 dnl -----------------------------------------------------------
213 dnl Qt native peer (disabled by default)
214 dnl -----------------------------------------------------------
215 AC_ARG_ENABLE([qt-peer],
216 [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
217 [case "${enableval}" in
218 yes) COMPILE_QT_PEER=yes ;;
219 no) COMPILE_QT_PEER=no ;;
220 *) COMPILE_QT_PEER=yes ;;
222 [COMPILE_QT_PEER=no])
223 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
225 dnl -----------------------------------------------------------
226 dnl Plugin (enabled by default)
227 dnl -----------------------------------------------------------
228 AC_ARG_ENABLE([plugin],
229 [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
230 [case "${enableval}" in
231 yes) COMPILE_PLUGIN=yes ;;
232 no) COMPILE_PLUGIN=no ;;
233 *) COMPILE_PLUGIN=yes ;;
235 [COMPILE_PLUGIN=yes])
236 AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
238 dnl -----------------------------------------------------------
239 dnl Sets the native libraries installation dir
240 dnl -----------------------------------------------------------
241 AC_ARG_WITH([native-libdir],
242 [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
244 nativeexeclibdir=${withval}
247 nativeexeclibdir='${libdir}/${PACKAGE}'
250 AC_SUBST(nativeexeclibdir)
252 dnl -----------------------------------------------------------
253 dnl Sets the Java library installation dir.
254 dnl -----------------------------------------------------------
255 AC_ARG_WITH([glibj-dir],
256 [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
261 glibjdir='${datadir}/${PACKAGE}'
266 dnl -----------------------------------------------------------
267 dnl Sets the VM name for use in tool wrapper scripts
268 dnl -----------------------------------------------------------
270 [AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
275 VM_BINARY='${prefix}/bin/jamvm'
279 AM_CONDITIONAL(FOUND_CACAO, test "x`basename $VM_BINARY`" = xcacao)
281 dnl -----------------------------------------------------------
282 dnl Regenerate headers at build time (disabled by default)
283 dnl -----------------------------------------------------------
284 AC_ARG_ENABLE([regen-headers],
285 [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=no])],
286 [case "${enableval}" in
287 yes) REGENERATE_JNI_HEADERS=yes ;;
288 no) REGENERATE_JNI_HEADERS=no ;;
289 *) REGENERATE_JNI_HEADERS=no ;;
291 [REGENERATE_JNI_HEADERS=no])
292 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
294 dnl -----------------------------------------------------------
295 dnl Enable tool wrapper binaries (disabled by default)
296 dnl -----------------------------------------------------------
297 AC_ARG_ENABLE([tool-wrappers],
298 [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
299 [case x"${enableval}" in
301 COMPILE_WRAPPERS=yes;
302 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
303 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
305 xno) COMPILE_WRAPPERS=no ;;
306 x) COMPILE_WRAPPERS=yes ;;
307 *) COMPILE_WRAPPERS=yes ;;
309 [COMPILE_WRAPPERS=no])
310 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
315 dnl -----------------------------------------------------------
316 dnl Checks for programs.
317 dnl -----------------------------------------------------------
319 dnl Initialize libtool
327 # Handle -Werror default case.
328 if test "$ENABLE_WERROR" = default; then
331 if test "$GCC" = yes; then
338 if test "x${COMPILE_COLLECTIONS}" = xyes; then
339 AC_PATH_PROG(PERL, [perl])
341 AC_SUBST(COLLECTIONS_PREFIX)
342 AC_CONFIG_FILES([lib/mkcollections.pl])
343 AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
346 if test "x${COMPILE_JNI}" = xyes; then
351 dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
353 AC_COMPILE_CHECK_SIZEOF(void *)
355 dnl Checking for endianess.
358 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
359 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
360 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
361 dnl Check for crt_externs.h on Darwin.
362 AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
364 inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
371 sys/event.h sys/epoll.h \
374 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
375 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
376 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]))
377 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]))
379 AC_CHECK_FUNCS([ftruncate fsync select \
380 gethostname socket strerror fork pipe execve open close \
381 lseek fstat read readv write writev htonl memset htons connect \
382 getsockname getpeername bind listen accept \
383 recvfrom send sendto setsockopt getsockopt time mktime \
384 gethostbyname_r localtime_r \
387 mmap munmap mincore msync madvise getpagesize sysconf \
389 inet_aton inet_addr inet_pton \
390 getifaddrs kqueue kevent epoll_create \
394 AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
397 AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
398 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
399 [AC_DEFINE(HAVE_INET6, 1,
400 [Define if inet6 structures are defined in netinet/in.h.])
408 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
409 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
410 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
413 AC_MSG_CHECKING([for global timezone variable])
414 dnl FIXME: we don't want a link check here because that won't work
415 dnl when cross-compiling. So instead we make an assumption that
416 dnl the header file will mention timezone if it exists.
417 dnl Don't find the win32 function timezone
418 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
419 [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
422 AC_MSG_CHECKING([for global _timezone variable])
423 dnl FIXME: As above, don't want link check
424 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
425 [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
426 [Define if your platform has the global _timezone variable.])
428 [AC_MSG_RESULT(no)])])])
433 dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
436 dnl When using gcc we want warnings, lots of warnings :-)
437 if test "x${GCC}" = xyes; then
438 dnl We want ISO C90 ansi, but with longlong (jlong) support
439 dnl and modern POSIX and BSD C library functions/prototypes.
441 dnl Warning flags for (almost) everybody.
442 dnl Should probably be configurable
443 WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
444 AC_SUBST(WARNING_CFLAGS)
446 dnl Strict warning flags which not every module uses.
447 dnl Should probably be configurable.
448 STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
449 AC_SUBST(STRICT_WARNING_CFLAGS)
451 dnl Whether or not to add -Werror, also not used by all modueles.
452 dnl Can be configured by --disable-Werror
454 if test "x${ENABLE_WERROR}" = xyes; then
455 ERROR_CFLAGS='-Werror'
457 AC_SUBST(ERROR_CFLAGS)
460 dnl Check for libxml and libxslt libraries (when xmlj is enabled).
461 if test "x${COMPILE_XMLJ}" = xyes; then
462 PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
463 PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
467 AC_SUBST(XSLT_CFLAGS)
470 dnl Check for AWT related gthread/gtk
471 if test "x${COMPILE_GTK_PEER}" = xyes; then
473 if test "$no_x" = yes; then
474 AC_MSG_ERROR([GTK+ peers requested but no X library available])
476 dnl We explicitly want the XTest Extension for Robot support.
477 AC_CHECK_LIB([Xtst], [XTestQueryExtension],
478 [XTEST_LIBS="$XTEST_LIBS -lX11 -lXtst"],
479 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
482 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
483 PKG_CHECK_MODULES(FREETYPE2, freetype2)
484 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
485 dnl Check if we can link against the XRender library and set
486 dnl HAVE_XRENDER accordingly.
487 AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
488 [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
492 dnl Check if we can link against the XRandR library and set
493 dnl HAVE_XRANDR accordingly.
494 AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
495 [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
501 AC_SUBST(FREETYPE2_LIBS)
502 AC_SUBST(FREETYPE2_CFLAGS)
503 AC_SUBST(PANGOFT2_LIBS)
504 AC_SUBST(PANGOFT2_CFLAGS)
509 if test "x${COMPILE_GCONF_PEER}" = xyes; then
510 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.11.2)
511 AC_SUBST(GCONF_CFLAGS)
513 dnl we also need gdk for locking
514 PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
517 dnl check if the config value was given form the command line,
518 dnl if not, overwrite the default if we have the gconf backend
520 USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
521 if test "$USE_GCONF_PREFS_PEER" = ""; then
522 DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
526 dnl Check for AWT related Qt4
527 if test "x${COMPILE_QT_PEER}" = xyes; then
528 PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
529 if test "x$HAVE_QT4" = "xyes"; then
530 dnl Check needed because in some cases the QtGui includedir
531 dnl doesn't contain the subsystem dir.
532 QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
533 EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
534 AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
535 AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
536 AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
537 QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
538 AC_MSG_WARN([QWidget not found])))
539 AC_CHECK_PROG(MOC, [moc], [moc])
540 AC_CHECK_PROG(MOC, [moc-qt4], [moc-qt4])
542 if test "x$HAVE_QT4" = "xno"; then
543 AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
546 AC_ARG_WITH([qt4dir],
547 [AS_HELP_STRING([--with-qt4dir=DIR],
548 [Qt4 installation directory used for OS-X.
549 For other systems use pkg-config.])],
552 if test x"$QT4DIR" = x ; then
553 AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
555 AC_MSG_RESULT([QT4DIR... $QT4DIR])
556 AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
557 if test x"$MOC" = x; then
558 AC_MSG_ERROR([*** This is not the right Qt installation])
560 QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
561 QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
562 QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
563 QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
566 AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
567 of your installed Qt4 installation.])
571 AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
575 dnl **********************************************************************
576 dnl Check for MSG_NOSIGNAL
577 dnl **********************************************************************
578 AC_MSG_CHECKING(for MSG_NOSIGNAL)
579 AC_TRY_COMPILE([#include <sys/socket.h>],
580 [ int f = MSG_NOSIGNAL; ],
582 AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
583 [Define this symbol if you have MSG_NOSIGNAL]) ],
586 dnl **********************************************************************
587 dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
588 dnl **********************************************************************
589 AC_MSG_CHECKING(for SO_NOSIGPIPE )
590 AC_TRY_COMPILE([#include <sys/socket.h>],
591 [ int f = SO_NOSIGPIPE; ],
593 AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
594 [Define this symbol if you have SO_NOSIGPIPE]) ],
598 dnl Check for plugin support headers and libraries.
599 if test "x${COMPILE_PLUGIN}" = xyes; then
600 PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
601 if test "x${MOZILLA_FOUND}" = xno; then
602 PKG_CHECK_MODULES(MOZILLA, firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
604 if test "x${MOZILLA_FOUND}" = xno; then
605 PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
607 if test "x${MOZILLA_FOUND}" = xno; then
608 PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
610 if test "x${MOZILLA_FOUND}" = xno; then
611 PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
613 PKG_CHECK_MODULES(GLIB, glib-2.0)
615 AC_SUBST(MOZILLA_CFLAGS)
616 AC_SUBST(MOZILLA_LIBS)
617 AC_SUBST(GLIB_CFLAGS)
620 AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
626 dnl -----------------------------------------------------------
627 dnl Add the include files for the native abstraction layer.
628 dnl Used by AM_CPPFLAGS in the different modules.
629 dnl -----------------------------------------------------------
630 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
631 AC_SUBST(CLASSPATH_INCLUDES)
633 dnl -----------------------------------------------------------
634 if test "x${COMPILE_JNI}" = xyes; then
635 AC_MSG_CHECKING(jni_md.h support)
636 if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
641 AC_MSG_WARN(no, using x86-linux-gnu)
643 ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
644 ac_dests="include/jni_md.h"
645 while test -n "$ac_sources"; do
646 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
647 set $ac_sources; ac_source=$1; shift; ac_sources=$*
648 ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
650 AC_CONFIG_LINKS([$ac_config_links_1])
655 CLASSPATH_WITH_CLASSLIB
657 dnl -----------------------------------------------------------
658 dnl Initialize maintainer mode
659 dnl -----------------------------------------------------------
662 dnl -----------------------------------------------------------
663 dnl Enable debugging statements at compile time. By default
664 dnl these statements should be optimized out of the bytecode
665 dnl produced by an optimizing Java compiler and not hinder
666 dnl performance because debugging is turned off by default.
667 dnl -----------------------------------------------------------
668 AC_ARG_ENABLE([debug],
669 [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
670 [case "${enableval}" in
673 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
675 no) LIBDEBUG="false" ;;
676 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
681 dnl -----------------------------------------------------------
682 dnl Enable execution of all static initializer loadLibrary()
683 dnl calls at compile time. By default most people will not
684 dnl want to disable this, but some VMs (gcj) don't need or want
686 dnl -----------------------------------------------------------
687 AC_ARG_ENABLE([load-library],
688 [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
689 [case "${enableval}" in
690 yes) INIT_LOAD_LIBRARY="true" ;;
691 no) INIT_LOAD_LIBRARY="false" ;;
692 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
694 [INIT_LOAD_LIBRARY="true"])
695 AC_SUBST(INIT_LOAD_LIBRARY)
698 dnl -----------------------------------------------------------
699 dnl Should the VM explicitly run class initialization subfunctions for
700 dnl java.lang.System? (default is false -- the subfunctions will be run
701 dnl automatically by the class initializer)
702 dnl -----------------------------------------------------------
703 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
704 [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
705 [case "${enableval}" in
706 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
707 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
708 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
710 [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
711 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
714 dnl -----------------------------------------------------------
715 dnl avoiding automake complaints
716 dnl -----------------------------------------------------------
720 dnl -----------------------------------------------------------
721 dnl This is probably useless.
722 dnl -----------------------------------------------------------
723 AC_PATH_PROG(MKDIR, mkdir)
725 AC_PATH_PROG(DATE, date)
727 dnl -----------------------------------------------------------
728 dnl According to the GNU coding guide, we shouldn't require find,
729 dnl and zip, however GNU provides both so it should be okay
730 dnl -----------------------------------------------------------
731 AC_PATH_PROG(FIND, find)
733 dnl -----------------------------------------------------------
734 dnl Specify what to install (install only glibj.zip by default)
735 dnl -----------------------------------------------------------
738 dnl -----------------------------------------------------------
739 dnl Enable API documentation generation (disabled by default)
740 dnl -----------------------------------------------------------
743 dnl -----------------------------------------------------------
744 dnl Whether to use jay to regenerate parsers.
745 dnl -----------------------------------------------------------
748 dnl -----------------------------------------------------------
749 dnl This sets the build-time default, which can now be overridden
750 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
751 dnl to "true" or "false".
752 dnl -----------------------------------------------------------
753 AC_ARG_ENABLE([portable-native-sync],
754 [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
755 [case "${enableval}" in
757 AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
761 AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
766 AX_CREATE_STDINT_H([include/config-int.h])
768 dnl -----------------------------------------------------------------------
769 dnl Support for using a prebuilt class library
770 dnl -----------------------------------------------------------------------
771 AC_ARG_WITH([glibj_zip],
772 AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
773 [use prebuilt glibj.zip class library]))
775 case "$with_glibj_zip" in
783 AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
787 PATH_TO_GLIBJ_ZIP=$with_glibj_zip
791 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
792 AC_SUBST(PATH_TO_GLIBJ_ZIP)
794 dnl -----------------------------------------------------------
795 dnl Build with Escher based X peers.
796 dnl -----------------------------------------------------------
797 AC_ARG_WITH([escher],
798 AS_HELP_STRING([--with-escher=ABS.PATH],
799 [specify path to escher dir or JAR for X peers]))
800 case "$with_escher" in
808 AC_MSG_ERROR([Please supply an absolute path to Escher library])
812 PATH_TO_ESCHER=$with_escher
816 AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
817 AC_SUBST(PATH_TO_ESCHER)
819 dnl -----------------------------------------------------------
820 dnl Check if local socket support should be included.
821 dnl -----------------------------------------------------------
822 AC_ARG_ENABLE([local-sockets],
823 [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
824 [case "${enableval}" in
826 ENABLE_LOCAL_SOCKETS=yes
829 ENABLE_LOCAL_SOCKETS=no
833 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
835 AC_CHECK_HEADER([sys/un.h])
836 AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
837 AC_MSG_ERROR([networking support not available]))
838 AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
840 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
842 dnl -----------------------------------------------------------
843 dnl Add the default preference peer
844 dnl -----------------------------------------------------------
845 AC_SUBST(DEFAULT_PREFS_PEER)
847 dnl -----------------------------------------------------------
849 dnl -----------------------------------------------------------
850 AC_CONFIG_FILES([Makefile
854 external/sax/Makefile
855 external/w3c_dom/Makefile
856 external/relaxngDatatype/Makefile
857 external/jsr166/Makefile
858 gnu/classpath/Configuration.java
859 gnu/java/security/Configuration.java
862 native/fdlibm/Makefile
865 native/jni/classpath/Makefile
866 native/jni/java-io/Makefile
867 native/jni/java-lang/Makefile
868 native/jni/java-net/Makefile
869 native/jni/java-nio/Makefile
870 native/jni/java-util/Makefile
871 native/jni/gtk-peer/Makefile
872 native/jni/gconf-peer/Makefile
873 native/jni/qt-peer/Makefile
874 native/jni/xmlj/Makefile
875 native/jni/midi-alsa/Makefile
876 native/jni/midi-dssi/Makefile
877 native/jni/native-lib/Makefile
878 native/plugin/Makefile
880 resource/META-INF/services/java.util.prefs.PreferencesFactory
882 scripts/classpath.spec
885 lib/copy-vmresources.sh
888 examples/Makefile.jawt
889 examples/Makefile.java2d])
891 if test "x${COMPILE_WRAPPERS}" = xno
893 AC_CONFIG_FILES([tools/gappletviewer
905 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
906 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
907 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
908 AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
909 AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
910 AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
911 AC_CONFIG_COMMANDS([grmiregistry],[chmod 755 tools/grmiregistry])
912 AC_CONFIG_COMMANDS([gtnameserv],[chmod 755 tools/gtnameserv])
913 AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
914 AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
915 AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
916 AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
919 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
920 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
923 # Create standard.omit based on decisions we just made.
924 cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
925 if test x$use_escher != xtrue; then
926 echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit