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 # Find the rest of the source tree framework.
22 AM_ENABLE_MULTILIB(, ../..)
24 dnl -----------------------------------------------------------
25 dnl Fold all IA-32 CPU architectures into "x86"
26 dnl -----------------------------------------------------------
27 if expr ${target_cpu} : '.*86' > /dev/null; then target_cpu=x86; fi
29 dnl -----------------------------------------------------------
30 dnl We will not track/change lib version until we reach version 1.0
31 dnl at which time we'll have to be more anal about such things
32 dnl -----------------------------------------------------------
33 AC_SUBST(LIBVERSION, "0:0:0")
43 CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
44 AC_SUBST(CLASSPATH_MODULE)
46 CLASSPATH_CONVENIENCE="-no-undefined"
47 AC_SUBST(CLASSPATH_CONVENIENCE)
50 AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar])
51 AC_CONFIG_HEADERS([include/config.h])
52 AC_PREFIX_DEFAULT(/usr/local/classpath)
57 dnl -----------------------------------------------------------
58 dnl Enable collections.jar (disabled by default)
59 dnl -----------------------------------------------------------
60 AC_ARG_ENABLE([collections],
61 [AS_HELP_STRING(--enable-collections,create collections.jar [default=no])],
62 [case x"${enableval}" in
63 xyes) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
64 xno) COMPILE_COLLECTIONS=no ;;
65 x) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
66 *) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"${enableval}\"" ;;
68 [COMPILE_COLLECTIONS=no])
69 AM_CONDITIONAL(CREATE_COLLECTIONS, test "x${COMPILE_COLLECTIONS}" = xyes)
71 dnl -----------------------------------------------------------
72 dnl Enable JNI libraries (enabled by default)
73 dnl -----------------------------------------------------------
75 [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
76 [case "${enableval}" in
77 yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
79 *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
82 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
84 dnl -----------------------------------------------------------
85 dnl Enable core JNI libraries (enabled by default)
86 dnl -----------------------------------------------------------
87 AC_ARG_ENABLE([core-jni],
88 [AS_HELP_STRING(--enable-core-jni,
89 compile JNI sources for core [default=yes])],
90 [case "${enableval}" in
91 yes) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
92 no) COMPILE_CORE_JNI=no ;;
93 *) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
95 [COMPILE_CORE_JNI=yes])
96 AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
98 dnl -----------------------------------------------------------
99 dnl Default Preference Backend
100 dnl -----------------------------------------------------------
101 AC_ARG_ENABLE([default-preferences-peer],
102 [AS_HELP_STRING([--enable-default-preferences-peer@<:@=peer type or class name@:>@],
103 [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])],
104 [case "${enableval}" in
105 file) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory ;;
106 gconf|yes|true) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory ;;
107 memory) DEFAULT_PREFS_PEER=gnu.java.util.prefs.MemoryBasedFactory ;;
108 no|false) AC_MSG_ERROR(bad value '${enableval}' for --enable-default-preferences-peer) ;;
109 *) DEFAULT_PREFS_PEER=${enableval} ;;
111 [DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory])
112 dnl AC_SUBST(DEFAULT_PREFS_PEER)
114 dnl -----------------------------------------------------------
115 dnl GConf native peer (enabled by default)
116 dnl -----------------------------------------------------------
117 AC_ARG_ENABLE([gconf-peer],
118 [AS_HELP_STRING(--disable-gconf-peer,compile GConf native peers (disabled by --disable-jni) [default=yes])],
119 [case "${enableval}" in
120 yes) COMPILE_GCONF_PEER=yes ;;
121 no) COMPILE_GCONF_PEER=no ;;
122 *) COMPILE_GCONF_PEER=yes ;;
124 [COMPILE_GCONF_PEER=yes])
125 AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
127 dnl -----------------------------------------------------------
128 dnl GTK native peer error checking
129 dnl -----------------------------------------------------------
130 AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
132 dnl ------------------------------------------------------------
133 dnl Whether to compile with -Werror or not (disabled by default)
134 dnl ------------------------------------------------------------
135 AC_ARG_ENABLE([Werror],
136 [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
137 [case "${enableval}" in
138 yes) ENABLE_WERROR=yes ;;
139 no) ENABLE_WERROR=no ;;
140 *) ENABLE_WERROR=default ;;
142 [ENABLE_WERROR=default])
144 dnl -----------------------------------------------------------
145 dnl Default AWT toolkit
146 dnl -----------------------------------------------------------
147 AC_ARG_ENABLE(default-toolkit,
148 AS_HELP_STRING([--enable-default-toolkit],
149 [fully qualified class name of default AWT toolkit]))
150 default_toolkit=$enable_default_toolkit
151 if test "$default_toolkit" = ""; then
152 default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
154 AC_SUBST(default_toolkit)
156 dnl -----------------------------------------------------------
157 dnl Native libxml/xslt library (disabled by default)
158 dnl -----------------------------------------------------------
159 AC_ARG_ENABLE([xmlj],
160 [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
161 [case "${enableval}" in
162 yes) COMPILE_XMLJ=yes ;;
163 no) COMPILE_XMLJ=no ;;
164 *) COMPILE_XMLJ=no ;;
167 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
169 dnl -----------------------------------------------------------
170 dnl ALSA code (enabled by default)
171 dnl -----------------------------------------------------------
172 AC_ARG_ENABLE([alsa],
173 [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
174 [case "${enableval}" in
175 yes) COMPILE_ALSA=yes ;;
176 no) COMPILE_ALSA=no ;;
177 *) COMPILE_ALSA=yes ;;
179 [AC_CHECK_HEADERS([alsa/asoundlib.h],
180 [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
182 AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
184 dnl -----------------------------------------------------------
185 dnl DSSI code (enabled by default)
186 dnl -----------------------------------------------------------
187 AC_ARG_ENABLE([dssi],
188 [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
189 [case "${enableval}" in
190 yes) COMPILE_DSSI=yes ;;
191 no) COMPILE_DSSI=no ;;
192 *) COMPILE_DSSI=yes ;;
195 AC_CHECK_HEADERS([dssi.h], [
196 AC_CHECK_HEADERS([jack/jack.h],COMPILE_DSSI=yes)])])
197 AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
199 dnl -----------------------------------------------------------
200 dnl GTK native peer (enabled by default)
201 dnl -----------------------------------------------------------
202 AC_ARG_ENABLE([gtk-peer],
203 [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
204 [case "${enableval}" in
205 yes) COMPILE_GTK_PEER=yes ;;
206 no) COMPILE_GTK_PEER=no ;;
207 *) COMPILE_GTK_PEER=yes ;;
209 [COMPILE_GTK_PEER=yes])
210 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
212 dnl -----------------------------------------------------------
213 dnl GTK native peer error checking
214 dnl -----------------------------------------------------------
215 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
217 dnl -----------------------------------------------------------
218 dnl Qt native peer (disabled by default)
219 dnl -----------------------------------------------------------
220 AC_ARG_ENABLE([qt-peer],
221 [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
222 [case "${enableval}" in
223 yes) COMPILE_QT_PEER=yes ;;
224 no) COMPILE_QT_PEER=no ;;
225 *) COMPILE_QT_PEER=yes ;;
227 [COMPILE_QT_PEER=no])
228 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
230 dnl -----------------------------------------------------------
231 dnl Plugin (enabled by default)
232 dnl -----------------------------------------------------------
233 AC_ARG_ENABLE([plugin],
234 [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
235 [case "${enableval}" in
236 yes) COMPILE_PLUGIN=yes ;;
237 no) COMPILE_PLUGIN=no ;;
238 *) COMPILE_PLUGIN=yes ;;
240 [COMPILE_PLUGIN=yes])
241 AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
243 dnl -----------------------------------------------------------
244 dnl GCJ LOCAL: Calculates and substitutes toolexeclibdir. $libdir is
245 dnl defined to the same value for all multilibs. We define toolexeclibdir
246 dnl so that we can refer to the multilib installation directories from
247 dnl classpath's build files.
248 dnl -----------------------------------------------------------
249 CLASSPATH_TOOLEXECLIBDIR
251 dnl -----------------------------------------------------------
252 dnl Sets the native libraries installation dir
253 dnl -----------------------------------------------------------
254 dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}
255 AC_ARG_WITH([native-libdir],
256 [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
258 nativeexeclibdir=${withval}
261 nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
264 AC_SUBST(nativeexeclibdir)
266 dnl -----------------------------------------------------------
267 dnl Sets the Java library installation dir.
268 dnl -----------------------------------------------------------
269 AC_ARG_WITH([glibj-dir],
270 [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
275 glibjdir='${datadir}/${PACKAGE}'
280 dnl -----------------------------------------------------------
281 dnl Sets the VM name for use in tool wrapper scripts
282 dnl -----------------------------------------------------------
284 [AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
289 VM_BINARY='${prefix}/bin/jamvm'
293 AM_CONDITIONAL(FOUND_CACAO, test "x`basename $VM_BINARY`" = xcacao)
295 dnl -----------------------------------------------------------
296 dnl Regenerate headers at build time (disabled by default)
297 dnl -----------------------------------------------------------
298 AC_ARG_ENABLE([regen-headers],
299 [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=no])],
300 [case "${enableval}" in
301 yes) REGENERATE_JNI_HEADERS=yes ;;
302 no) REGENERATE_JNI_HEADERS=no ;;
303 *) REGENERATE_JNI_HEADERS=no ;;
305 [REGENERATE_JNI_HEADERS=no])
306 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
308 dnl -----------------------------------------------------------
309 dnl Enable tool wrapper binaries (disabled by default)
310 dnl -----------------------------------------------------------
311 AC_ARG_ENABLE([tool-wrappers],
312 [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
313 [case x"${enableval}" in
315 COMPILE_WRAPPERS=yes;
316 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
317 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
319 xno) COMPILE_WRAPPERS=no ;;
320 x) COMPILE_WRAPPERS=yes ;;
321 *) COMPILE_WRAPPERS=yes ;;
323 [COMPILE_WRAPPERS=no])
324 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
329 dnl -----------------------------------------------------------
330 dnl Checks for programs.
331 dnl -----------------------------------------------------------
333 dnl Initialize libtool
341 # Handle -Werror default case.
342 if test "$ENABLE_WERROR" = default; then
345 if test "$GCC" = yes; then
352 if test "x${COMPILE_COLLECTIONS}" = xyes; then
353 AC_PATH_PROG(PERL, [perl])
355 AC_SUBST(COLLECTIONS_PREFIX)
356 AC_CONFIG_FILES([lib/mkcollections.pl])
357 AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
360 if test "x${COMPILE_JNI}" = xyes; then
365 dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
367 AC_COMPILE_CHECK_SIZEOF(void *)
369 dnl Checking for endianess.
372 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
373 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
374 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
375 dnl Check for crt_externs.h on Darwin.
376 AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
378 inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
385 sys/event.h sys/epoll.h \
388 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
389 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
390 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]))
391 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]))
393 AC_CHECK_FUNCS([ftruncate fsync select \
394 gethostname socket strerror fork pipe execve open close \
395 lseek fstat read readv write writev htonl memset htons connect \
396 getsockname getpeername bind listen accept \
397 recvfrom send sendto setsockopt getsockopt time mktime \
398 gethostbyname_r localtime_r \
401 mmap munmap mincore msync madvise getpagesize sysconf \
403 inet_aton inet_addr inet_pton \
404 getifaddrs kqueue kevent epoll_create \
408 AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
411 AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
412 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
413 [AC_DEFINE(HAVE_INET6, 1,
414 [Define if inet6 structures are defined in netinet/in.h.])
422 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
423 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
424 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
427 AC_MSG_CHECKING([for global timezone variable])
428 dnl FIXME: we don't want a link check here because that won't work
429 dnl when cross-compiling. So instead we make an assumption that
430 dnl the header file will mention timezone if it exists.
431 dnl Don't find the win32 function timezone
432 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
433 [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
436 AC_MSG_CHECKING([for global _timezone variable])
437 dnl FIXME: As above, don't want link check
438 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
439 [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
440 [Define if your platform has the global _timezone variable.])
442 [AC_MSG_RESULT(no)])])])
447 dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
450 dnl When using gcc we want warnings, lots of warnings :-)
451 if test "x${GCC}" = xyes; then
452 dnl We want ISO C90 ansi, but with longlong (jlong) support
453 dnl and modern POSIX and BSD C library functions/prototypes.
455 dnl Warning flags for (almost) everybody.
456 dnl Should probably be configurable
457 WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
458 AC_SUBST(WARNING_CFLAGS)
460 dnl Strict warning flags which not every module uses.
461 dnl Should probably be configurable.
462 STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
463 AC_SUBST(STRICT_WARNING_CFLAGS)
465 dnl Whether or not to add -Werror, also not used by all modueles.
466 dnl Can be configured by --disable-Werror
468 if test "x${ENABLE_WERROR}" = xyes; then
469 ERROR_CFLAGS='-Werror'
471 AC_SUBST(ERROR_CFLAGS)
474 dnl Check for libxml and libxslt libraries (when xmlj is enabled).
475 if test "x${COMPILE_XMLJ}" = xyes; then
476 PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
477 PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
481 AC_SUBST(XSLT_CFLAGS)
484 dnl Check for AWT related gthread/gtk
485 if test "x${COMPILE_GTK_PEER}" = xyes; then
487 if test "$no_x" = yes; then
488 AC_MSG_ERROR([GTK+ peers requested but no X library available])
490 dnl We explicitly want the XTest Extension for Robot support.
491 AC_CHECK_LIB([Xtst], [XTestQueryExtension],
492 [XTEST_LIBS="$XTEST_LIBS -lX11 -lXtst"],
493 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
496 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
497 PKG_CHECK_MODULES(FREETYPE2, freetype2)
498 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
499 dnl Check if we can link against the XRender library and set
500 dnl HAVE_XRENDER accordingly.
501 AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
502 [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
506 dnl Check if we can link against the XRandR library and set
507 dnl HAVE_XRANDR accordingly.
508 AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
509 [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
515 AC_SUBST(FREETYPE2_LIBS)
516 AC_SUBST(FREETYPE2_CFLAGS)
517 AC_SUBST(PANGOFT2_LIBS)
518 AC_SUBST(PANGOFT2_CFLAGS)
523 if test "x${COMPILE_GCONF_PEER}" = xyes; then
524 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.11.2)
525 AC_SUBST(GCONF_CFLAGS)
527 dnl we also need gdk for locking
528 PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
531 dnl check if the config value was given form the command line,
532 dnl if not, overwrite the default if we have the gconf backend
534 USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
535 if test "$USE_GCONF_PREFS_PEER" = ""; then
536 DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
540 dnl Check for AWT related Qt4
541 if test "x${COMPILE_QT_PEER}" = xyes; then
542 PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
543 if test "x$HAVE_QT4" = "xyes"; then
544 dnl Check needed because in some cases the QtGui includedir
545 dnl doesn't contain the subsystem dir.
546 QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
547 EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
548 AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
549 AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
550 AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
551 QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
552 AC_MSG_WARN([QWidget not found])))
553 AC_CHECK_PROG(MOC, [moc], [moc])
554 AC_CHECK_PROG(MOC, [moc-qt4], [moc-qt4])
556 if test "x$HAVE_QT4" = "xno"; then
557 AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
560 AC_ARG_WITH([qt4dir],
561 [AS_HELP_STRING([--with-qt4dir=DIR],
562 [Qt4 installation directory used for OS-X.
563 For other systems use pkg-config.])],
566 if test x"$QT4DIR" = x ; then
567 AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
569 AC_MSG_RESULT([QT4DIR... $QT4DIR])
570 AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
571 if test x"$MOC" = x; then
572 AC_MSG_ERROR([*** This is not the right Qt installation])
574 QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
575 QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
576 QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
577 QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
580 AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
581 of your installed Qt4 installation.])
585 AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
589 dnl **********************************************************************
590 dnl Check for MSG_NOSIGNAL
591 dnl **********************************************************************
592 AC_MSG_CHECKING(for MSG_NOSIGNAL)
593 AC_TRY_COMPILE([#include <sys/socket.h>],
594 [ int f = MSG_NOSIGNAL; ],
596 AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
597 [Define this symbol if you have MSG_NOSIGNAL]) ],
600 dnl **********************************************************************
601 dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
602 dnl **********************************************************************
603 AC_MSG_CHECKING(for SO_NOSIGPIPE )
604 AC_TRY_COMPILE([#include <sys/socket.h>],
605 [ int f = SO_NOSIGPIPE; ],
607 AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
608 [Define this symbol if you have SO_NOSIGPIPE]) ],
612 dnl Check for plugin support headers and libraries.
613 if test "x${COMPILE_PLUGIN}" = xyes; then
614 PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
615 if test "x${MOZILLA_FOUND}" = xno; then
616 PKG_CHECK_MODULES(MOZILLA, firefox-plugin firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
618 if test "x${MOZILLA_FOUND}" = xno; then
619 PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin xulrunner-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
621 if test "x${MOZILLA_FOUND}" = xno; then
622 PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin mozilla-firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
624 if test "x${MOZILLA_FOUND}" = xno; then
625 PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin seamonkey-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
627 PKG_CHECK_MODULES(GLIB, glib-2.0)
629 AC_SUBST(MOZILLA_CFLAGS)
630 AC_SUBST(MOZILLA_LIBS)
631 AC_SUBST(GLIB_CFLAGS)
634 AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
640 dnl -----------------------------------------------------------
641 dnl Add the include files for the native abstraction layer.
642 dnl Used by AM_CPPFLAGS in the different modules.
643 dnl -----------------------------------------------------------
644 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
645 AC_SUBST(CLASSPATH_INCLUDES)
647 dnl -----------------------------------------------------------
648 if test "x${COMPILE_JNI}" = xyes; then
649 AC_MSG_CHECKING(jni_md.h support)
650 if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
655 AC_MSG_WARN(no, using x86-linux-gnu)
657 ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
658 ac_dests="include/jni_md.h"
659 while test -n "$ac_sources"; do
660 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
661 set $ac_sources; ac_source=$1; shift; ac_sources=$*
662 ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
664 AC_CONFIG_LINKS([$ac_config_links_1])
669 CLASSPATH_WITH_CLASSLIB
671 dnl -----------------------------------------------------------
672 dnl Initialize maintainer mode
673 dnl -----------------------------------------------------------
676 dnl -----------------------------------------------------------
677 dnl Enable debugging statements at compile time. By default
678 dnl these statements should be optimized out of the bytecode
679 dnl produced by an optimizing Java compiler and not hinder
680 dnl performance because debugging is turned off by default.
681 dnl -----------------------------------------------------------
682 AC_ARG_ENABLE([debug],
683 [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
684 [case "${enableval}" in
687 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
689 no) LIBDEBUG="false" ;;
690 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
695 dnl -----------------------------------------------------------
696 dnl Enable execution of all static initializer loadLibrary()
697 dnl calls at compile time. By default most people will not
698 dnl want to disable this, but some VMs (gcj) don't need or want
700 dnl -----------------------------------------------------------
701 AC_ARG_ENABLE([load-library],
702 [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
703 [case "${enableval}" in
704 yes) INIT_LOAD_LIBRARY="true" ;;
705 no) INIT_LOAD_LIBRARY="false" ;;
706 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
708 [INIT_LOAD_LIBRARY="true"])
709 AC_SUBST(INIT_LOAD_LIBRARY)
712 dnl -----------------------------------------------------------
713 dnl Specify the jar file containing the Eclipse Java Compiler. If
714 dnl this option is not specified then the com.sun.tools.javac
715 dnl implementation will not be included in tools.zip.
716 dnl -----------------------------------------------------------
717 dnl GCJ LOCAL: default to $multi_basedir/ecj.jar
718 dnl In the default case where $multi_basedir/ecj.jar is found
719 dnl $(jardir)/ecj.jar will not expand properly in GNU Classpath's
720 dnl gnu/classpath/Configuration.java. That is OK though since libjava's
721 dnl gnu/classpath/Configuration.java overrides GNU Classpath's and
722 dnl ECJ_JAR_FILE will be properly expanded in libjava's
723 dnl gnu/classpath/natConfiguration.cc.
724 AC_ARG_WITH([ecj-jar],
725 [AS_HELP_STRING([--with-ecj-jar=ABS.PATH],
726 [specify jar file containing the Eclipse Java Compiler])],
728 [if test -f $multi_basedir/ecj.jar; then
729 ECJ_JAR='$(jardir)/ecj.jar'
732 AM_CONDITIONAL(FOUND_ECJ_JAR, test "$ECJ_JAR" != "")
734 dnl -----------------------------------------------------------
735 dnl Should the VM explicitly run class initialization subfunctions for
736 dnl java.lang.System? (default is false -- the subfunctions will be run
737 dnl automatically by the class initializer)
738 dnl -----------------------------------------------------------
739 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
740 [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
741 [case "${enableval}" in
742 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
743 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
744 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
746 [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
747 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
750 dnl -----------------------------------------------------------
751 dnl avoiding automake complaints
752 dnl -----------------------------------------------------------
756 dnl -----------------------------------------------------------
757 dnl This is probably useless.
758 dnl -----------------------------------------------------------
759 AC_PATH_PROG(MKDIR, mkdir)
761 AC_PATH_PROG(DATE, date)
763 dnl -----------------------------------------------------------
764 dnl According to the GNU coding guide, we shouldn't require find,
765 dnl and zip, however GNU provides both so it should be okay
766 dnl -----------------------------------------------------------
767 AC_PATH_PROG(FIND, find)
769 dnl -----------------------------------------------------------
770 dnl Specify what to install (install only glibj.zip by default)
771 dnl -----------------------------------------------------------
774 dnl -----------------------------------------------------------
775 dnl Enable API documentation generation (disabled by default)
776 dnl -----------------------------------------------------------
779 dnl -----------------------------------------------------------
780 dnl Whether to use jay to regenerate parsers.
781 dnl -----------------------------------------------------------
784 dnl -----------------------------------------------------------
785 dnl This sets the build-time default, which can now be overridden
786 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
787 dnl to "true" or "false".
788 dnl -----------------------------------------------------------
789 AC_ARG_ENABLE([portable-native-sync],
790 [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
791 [case "${enableval}" in
793 AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
797 AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
802 AX_CREATE_STDINT_H([include/config-int.h])
804 dnl -----------------------------------------------------------------------
805 dnl Support for using a prebuilt class library
806 dnl -----------------------------------------------------------------------
807 AC_ARG_WITH([glibj_zip],
808 AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
809 [use prebuilt glibj.zip class library]))
811 case "$with_glibj_zip" in
819 AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
823 PATH_TO_GLIBJ_ZIP=$with_glibj_zip
827 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
828 AC_SUBST(PATH_TO_GLIBJ_ZIP)
830 dnl -----------------------------------------------------------
831 dnl Build with Escher based X peers.
832 dnl -----------------------------------------------------------
833 AC_ARG_WITH([escher],
834 AS_HELP_STRING([--with-escher=ABS.PATH],
835 [specify path to escher dir or JAR for X peers]))
836 case "$with_escher" in
844 AC_MSG_ERROR([Please supply an absolute path to Escher library])
848 PATH_TO_ESCHER=$with_escher
852 AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
853 AC_SUBST(PATH_TO_ESCHER)
855 dnl -----------------------------------------------------------
856 dnl Check if local socket support should be included.
857 dnl -----------------------------------------------------------
858 AC_ARG_ENABLE([local-sockets],
859 [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
860 [case "${enableval}" in
862 ENABLE_LOCAL_SOCKETS=yes
865 ENABLE_LOCAL_SOCKETS=no
869 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
871 AC_CHECK_HEADER([sys/un.h])
872 AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
873 AC_MSG_ERROR([networking support not available]))
874 AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
876 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
878 dnl -----------------------------------------------------------
879 dnl Add the default preference peer
880 dnl -----------------------------------------------------------
881 AC_SUBST(DEFAULT_PREFS_PEER)
883 dnl -----------------------------------------------------------
885 dnl -----------------------------------------------------------
886 AC_CONFIG_FILES([Makefile
890 external/sax/Makefile
891 external/w3c_dom/Makefile
892 external/relaxngDatatype/Makefile
893 external/jsr166/Makefile
894 gnu/classpath/Configuration.java
895 gnu/java/security/Configuration.java
898 native/fdlibm/Makefile
901 native/jni/classpath/Makefile
902 native/jni/java-io/Makefile
903 native/jni/java-lang/Makefile
904 native/jni/java-net/Makefile
905 native/jni/java-nio/Makefile
906 native/jni/java-util/Makefile
907 native/jni/gtk-peer/Makefile
908 native/jni/gconf-peer/Makefile
909 native/jni/qt-peer/Makefile
910 native/jni/xmlj/Makefile
911 native/jni/midi-alsa/Makefile
912 native/jni/midi-dssi/Makefile
913 native/jni/native-lib/Makefile
914 native/plugin/Makefile
916 resource/META-INF/services/java.util.prefs.PreferencesFactory
918 scripts/classpath.spec
921 lib/copy-vmresources.sh
924 examples/Makefile.jawt
925 examples/Makefile.java2d])
927 if test "x${COMPILE_WRAPPERS}" = xno
929 AC_CONFIG_FILES([tools/gappletviewer
941 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
942 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
943 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
944 AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
945 AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
946 AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
947 AC_CONFIG_COMMANDS([grmiregistry],[chmod 755 tools/grmiregistry])
948 AC_CONFIG_COMMANDS([gtnameserv],[chmod 755 tools/gtnameserv])
949 AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
950 AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
951 AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
952 AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
955 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
956 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
959 # Create standard.omit based on decisions we just made.
960 cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
961 if test x$use_escher != xtrue; then
962 echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit