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 GCJ LOCAL: Calculates and substitutes toolexeclibdir. $libdir is
240 dnl defined to the same value for all multilibs. We define toolexeclibdir
241 dnl so that we can refer to the multilib installation directories from
242 dnl classpath's build files.
243 dnl -----------------------------------------------------------
244 CLASSPATH_TOOLEXECLIBDIR
246 dnl -----------------------------------------------------------
247 dnl Sets the native libraries installation dir
248 dnl -----------------------------------------------------------
249 dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}
250 AC_ARG_WITH([native-libdir],
251 [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
253 nativeexeclibdir=${withval}
256 nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
259 AC_SUBST(nativeexeclibdir)
261 dnl -----------------------------------------------------------
262 dnl Sets the Java library installation dir.
263 dnl -----------------------------------------------------------
264 AC_ARG_WITH([glibj-dir],
265 [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
270 glibjdir='${datadir}/${PACKAGE}'
275 dnl -----------------------------------------------------------
276 dnl Sets the VM name for use in tool wrapper scripts
277 dnl -----------------------------------------------------------
279 [AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
284 VM_BINARY='${prefix}/bin/jamvm'
288 AM_CONDITIONAL(FOUND_CACAO, test "x`basename $VM_BINARY`" = xcacao)
290 dnl -----------------------------------------------------------
291 dnl Regenerate headers at build time (disabled by default)
292 dnl -----------------------------------------------------------
293 AC_ARG_ENABLE([regen-headers],
294 [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=no])],
295 [case "${enableval}" in
296 yes) REGENERATE_JNI_HEADERS=yes ;;
297 no) REGENERATE_JNI_HEADERS=no ;;
298 *) REGENERATE_JNI_HEADERS=no ;;
300 [REGENERATE_JNI_HEADERS=no])
301 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
303 dnl -----------------------------------------------------------
304 dnl Enable tool wrapper binaries (disabled by default)
305 dnl -----------------------------------------------------------
306 AC_ARG_ENABLE([tool-wrappers],
307 [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
308 [case x"${enableval}" in
310 COMPILE_WRAPPERS=yes;
311 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
312 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
314 xno) COMPILE_WRAPPERS=no ;;
315 x) COMPILE_WRAPPERS=yes ;;
316 *) COMPILE_WRAPPERS=yes ;;
318 [COMPILE_WRAPPERS=no])
319 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
324 dnl -----------------------------------------------------------
325 dnl Checks for programs.
326 dnl -----------------------------------------------------------
328 dnl Initialize libtool
336 # Handle -Werror default case.
337 if test "$ENABLE_WERROR" = default; then
340 if test "$GCC" = yes; then
347 if test "x${COMPILE_COLLECTIONS}" = xyes; then
348 AC_PATH_PROG(PERL, [perl])
350 AC_SUBST(COLLECTIONS_PREFIX)
351 AC_CONFIG_FILES([lib/mkcollections.pl])
352 AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
355 if test "x${COMPILE_JNI}" = xyes; then
360 dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
362 AC_COMPILE_CHECK_SIZEOF(void *)
364 dnl Checking for endianess.
367 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
368 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
369 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
370 dnl Check for crt_externs.h on Darwin.
371 AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
373 inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
380 sys/event.h sys/epoll.h \
383 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
384 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
385 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]))
386 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]))
388 AC_CHECK_FUNCS([ftruncate fsync select \
389 gethostname socket strerror fork pipe execve open close \
390 lseek fstat read readv write writev htonl memset htons connect \
391 getsockname getpeername bind listen accept \
392 recvfrom send sendto setsockopt getsockopt time mktime \
393 gethostbyname_r localtime_r \
396 mmap munmap mincore msync madvise getpagesize sysconf \
398 inet_aton inet_addr inet_pton \
399 getifaddrs kqueue kevent epoll_create \
403 AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
406 AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
407 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
408 [AC_DEFINE(HAVE_INET6, 1,
409 [Define if inet6 structures are defined in netinet/in.h.])
417 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
418 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
419 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
422 AC_MSG_CHECKING([for global timezone variable])
423 dnl FIXME: we don't want a link check here because that won't work
424 dnl when cross-compiling. So instead we make an assumption that
425 dnl the header file will mention timezone if it exists.
426 dnl Don't find the win32 function timezone
427 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
428 [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
431 AC_MSG_CHECKING([for global _timezone variable])
432 dnl FIXME: As above, don't want link check
433 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
434 [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
435 [Define if your platform has the global _timezone variable.])
437 [AC_MSG_RESULT(no)])])])
442 dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
445 dnl When using gcc we want warnings, lots of warnings :-)
446 if test "x${GCC}" = xyes; then
447 dnl We want ISO C90 ansi, but with longlong (jlong) support
448 dnl and modern POSIX and BSD C library functions/prototypes.
450 dnl Warning flags for (almost) everybody.
451 dnl Should probably be configurable
452 WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
453 AC_SUBST(WARNING_CFLAGS)
455 dnl Strict warning flags which not every module uses.
456 dnl Should probably be configurable.
457 STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
458 AC_SUBST(STRICT_WARNING_CFLAGS)
460 dnl Whether or not to add -Werror, also not used by all modueles.
461 dnl Can be configured by --disable-Werror
463 if test "x${ENABLE_WERROR}" = xyes; then
464 ERROR_CFLAGS='-Werror'
466 AC_SUBST(ERROR_CFLAGS)
469 dnl Check for libxml and libxslt libraries (when xmlj is enabled).
470 if test "x${COMPILE_XMLJ}" = xyes; then
471 PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
472 PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
476 AC_SUBST(XSLT_CFLAGS)
479 dnl Check for AWT related gthread/gtk
480 if test "x${COMPILE_GTK_PEER}" = xyes; then
482 if test "$no_x" = yes; then
483 AC_MSG_ERROR([GTK+ peers requested but no X library available])
485 dnl We explicitly want the XTest Extension for Robot support.
486 AC_CHECK_LIB([Xtst], [XTestQueryExtension],
487 [XTEST_LIBS="$XTEST_LIBS -lX11 -lXtst"],
488 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
491 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
492 PKG_CHECK_MODULES(FREETYPE2, freetype2)
493 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
494 dnl Check if we can link against the XRender library and set
495 dnl HAVE_XRENDER accordingly.
496 AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
497 [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
501 dnl Check if we can link against the XRandR library and set
502 dnl HAVE_XRANDR accordingly.
503 AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
504 [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
510 AC_SUBST(FREETYPE2_LIBS)
511 AC_SUBST(FREETYPE2_CFLAGS)
512 AC_SUBST(PANGOFT2_LIBS)
513 AC_SUBST(PANGOFT2_CFLAGS)
518 if test "x${COMPILE_GCONF_PEER}" = xyes; then
519 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.11.2)
520 AC_SUBST(GCONF_CFLAGS)
522 dnl we also need gdk for locking
523 PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
526 dnl check if the config value was given form the command line,
527 dnl if not, overwrite the default if we have the gconf backend
529 USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
530 if test "$USE_GCONF_PREFS_PEER" = ""; then
531 DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
535 dnl Check for AWT related Qt4
536 if test "x${COMPILE_QT_PEER}" = xyes; then
537 PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
538 if test "x$HAVE_QT4" = "xyes"; then
539 dnl Check needed because in some cases the QtGui includedir
540 dnl doesn't contain the subsystem dir.
541 QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
542 EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
543 AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
544 AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
545 AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
546 QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
547 AC_MSG_WARN([QWidget not found])))
548 AC_CHECK_PROG(MOC, [moc], [moc])
549 AC_CHECK_PROG(MOC, [moc-qt4], [moc-qt4])
551 if test "x$HAVE_QT4" = "xno"; then
552 AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
555 AC_ARG_WITH([qt4dir],
556 [AS_HELP_STRING([--with-qt4dir=DIR],
557 [Qt4 installation directory used for OS-X.
558 For other systems use pkg-config.])],
561 if test x"$QT4DIR" = x ; then
562 AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
564 AC_MSG_RESULT([QT4DIR... $QT4DIR])
565 AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
566 if test x"$MOC" = x; then
567 AC_MSG_ERROR([*** This is not the right Qt installation])
569 QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
570 QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
571 QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
572 QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
575 AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
576 of your installed Qt4 installation.])
580 AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
584 dnl **********************************************************************
585 dnl Check for MSG_NOSIGNAL
586 dnl **********************************************************************
587 AC_MSG_CHECKING(for MSG_NOSIGNAL)
588 AC_TRY_COMPILE([#include <sys/socket.h>],
589 [ int f = MSG_NOSIGNAL; ],
591 AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
592 [Define this symbol if you have MSG_NOSIGNAL]) ],
595 dnl **********************************************************************
596 dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
597 dnl **********************************************************************
598 AC_MSG_CHECKING(for SO_NOSIGPIPE )
599 AC_TRY_COMPILE([#include <sys/socket.h>],
600 [ int f = SO_NOSIGPIPE; ],
602 AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
603 [Define this symbol if you have SO_NOSIGPIPE]) ],
607 dnl Check for plugin support headers and libraries.
608 if test "x${COMPILE_PLUGIN}" = xyes; then
609 PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
610 if test "x${MOZILLA_FOUND}" = xno; then
611 PKG_CHECK_MODULES(MOZILLA, firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
613 if test "x${MOZILLA_FOUND}" = xno; then
614 PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
616 if test "x${MOZILLA_FOUND}" = xno; then
617 PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
619 if test "x${MOZILLA_FOUND}" = xno; then
620 PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
622 PKG_CHECK_MODULES(GLIB, glib-2.0)
624 AC_SUBST(MOZILLA_CFLAGS)
625 AC_SUBST(MOZILLA_LIBS)
626 AC_SUBST(GLIB_CFLAGS)
629 AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
635 dnl -----------------------------------------------------------
636 dnl Add the include files for the native abstraction layer.
637 dnl Used by AM_CPPFLAGS in the different modules.
638 dnl -----------------------------------------------------------
639 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
640 AC_SUBST(CLASSPATH_INCLUDES)
642 dnl -----------------------------------------------------------
643 if test "x${COMPILE_JNI}" = xyes; then
644 AC_MSG_CHECKING(jni_md.h support)
645 if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
650 AC_MSG_WARN(no, using x86-linux-gnu)
652 ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
653 ac_dests="include/jni_md.h"
654 while test -n "$ac_sources"; do
655 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
656 set $ac_sources; ac_source=$1; shift; ac_sources=$*
657 ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
659 AC_CONFIG_LINKS([$ac_config_links_1])
664 CLASSPATH_WITH_CLASSLIB
666 dnl -----------------------------------------------------------
667 dnl Initialize maintainer mode
668 dnl -----------------------------------------------------------
671 dnl -----------------------------------------------------------
672 dnl Enable debugging statements at compile time. By default
673 dnl these statements should be optimized out of the bytecode
674 dnl produced by an optimizing Java compiler and not hinder
675 dnl performance because debugging is turned off by default.
676 dnl -----------------------------------------------------------
677 AC_ARG_ENABLE([debug],
678 [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
679 [case "${enableval}" in
682 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
684 no) LIBDEBUG="false" ;;
685 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
690 dnl -----------------------------------------------------------
691 dnl Enable execution of all static initializer loadLibrary()
692 dnl calls at compile time. By default most people will not
693 dnl want to disable this, but some VMs (gcj) don't need or want
695 dnl -----------------------------------------------------------
696 AC_ARG_ENABLE([load-library],
697 [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
698 [case "${enableval}" in
699 yes) INIT_LOAD_LIBRARY="true" ;;
700 no) INIT_LOAD_LIBRARY="false" ;;
701 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
703 [INIT_LOAD_LIBRARY="true"])
704 AC_SUBST(INIT_LOAD_LIBRARY)
707 dnl -----------------------------------------------------------
708 dnl Should the VM explicitly run class initialization subfunctions for
709 dnl java.lang.System? (default is false -- the subfunctions will be run
710 dnl automatically by the class initializer)
711 dnl -----------------------------------------------------------
712 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
713 [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
714 [case "${enableval}" in
715 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
716 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
717 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
719 [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
720 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
723 dnl -----------------------------------------------------------
724 dnl avoiding automake complaints
725 dnl -----------------------------------------------------------
729 dnl -----------------------------------------------------------
730 dnl This is probably useless.
731 dnl -----------------------------------------------------------
732 AC_PATH_PROG(MKDIR, mkdir)
734 AC_PATH_PROG(DATE, date)
736 dnl -----------------------------------------------------------
737 dnl According to the GNU coding guide, we shouldn't require find,
738 dnl and zip, however GNU provides both so it should be okay
739 dnl -----------------------------------------------------------
740 AC_PATH_PROG(FIND, find)
742 dnl -----------------------------------------------------------
743 dnl Specify what to install (install only glibj.zip by default)
744 dnl -----------------------------------------------------------
747 dnl -----------------------------------------------------------
748 dnl Enable API documentation generation (disabled by default)
749 dnl -----------------------------------------------------------
752 dnl -----------------------------------------------------------
753 dnl Whether to use jay to regenerate parsers.
754 dnl -----------------------------------------------------------
757 dnl -----------------------------------------------------------
758 dnl This sets the build-time default, which can now be overridden
759 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
760 dnl to "true" or "false".
761 dnl -----------------------------------------------------------
762 AC_ARG_ENABLE([portable-native-sync],
763 [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
764 [case "${enableval}" in
766 AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
770 AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
775 AX_CREATE_STDINT_H([include/config-int.h])
777 dnl -----------------------------------------------------------------------
778 dnl Support for using a prebuilt class library
779 dnl -----------------------------------------------------------------------
780 AC_ARG_WITH([glibj_zip],
781 AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
782 [use prebuilt glibj.zip class library]))
784 case "$with_glibj_zip" in
792 AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
796 PATH_TO_GLIBJ_ZIP=$with_glibj_zip
800 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
801 AC_SUBST(PATH_TO_GLIBJ_ZIP)
803 dnl -----------------------------------------------------------
804 dnl Build with Escher based X peers.
805 dnl -----------------------------------------------------------
806 AC_ARG_WITH([escher],
807 AS_HELP_STRING([--with-escher=ABS.PATH],
808 [specify path to escher dir or JAR for X peers]))
809 case "$with_escher" in
817 AC_MSG_ERROR([Please supply an absolute path to Escher library])
821 PATH_TO_ESCHER=$with_escher
825 AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
826 AC_SUBST(PATH_TO_ESCHER)
828 dnl -----------------------------------------------------------
829 dnl Check if local socket support should be included.
830 dnl -----------------------------------------------------------
831 AC_ARG_ENABLE([local-sockets],
832 [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
833 [case "${enableval}" in
835 ENABLE_LOCAL_SOCKETS=yes
838 ENABLE_LOCAL_SOCKETS=no
842 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
844 AC_CHECK_HEADER([sys/un.h])
845 AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
846 AC_MSG_ERROR([networking support not available]))
847 AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
849 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
851 dnl -----------------------------------------------------------
852 dnl Add the default preference peer
853 dnl -----------------------------------------------------------
854 AC_SUBST(DEFAULT_PREFS_PEER)
856 dnl -----------------------------------------------------------
858 dnl -----------------------------------------------------------
859 AC_CONFIG_FILES([Makefile
863 external/sax/Makefile
864 external/w3c_dom/Makefile
865 external/relaxngDatatype/Makefile
866 external/jsr166/Makefile
867 gnu/classpath/Configuration.java
868 gnu/java/security/Configuration.java
871 native/fdlibm/Makefile
874 native/jni/classpath/Makefile
875 native/jni/java-io/Makefile
876 native/jni/java-lang/Makefile
877 native/jni/java-net/Makefile
878 native/jni/java-nio/Makefile
879 native/jni/java-util/Makefile
880 native/jni/gtk-peer/Makefile
881 native/jni/gconf-peer/Makefile
882 native/jni/qt-peer/Makefile
883 native/jni/xmlj/Makefile
884 native/jni/midi-alsa/Makefile
885 native/jni/midi-dssi/Makefile
886 native/jni/native-lib/Makefile
887 native/plugin/Makefile
889 resource/META-INF/services/java.util.prefs.PreferencesFactory
891 scripts/classpath.spec
894 lib/copy-vmresources.sh
897 examples/Makefile.jawt
898 examples/Makefile.java2d])
900 if test "x${COMPILE_WRAPPERS}" = xno
902 AC_CONFIG_FILES([tools/gappletviewer
914 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
915 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
916 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
917 AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
918 AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
919 AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
920 AC_CONFIG_COMMANDS([grmiregistry],[chmod 755 tools/grmiregistry])
921 AC_CONFIG_COMMANDS([gtnameserv],[chmod 755 tools/gtnameserv])
922 AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
923 AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
924 AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
925 AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
928 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
929 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
932 # Create standard.omit based on decisions we just made.
933 cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
934 if test x$use_escher != xtrue; then
935 echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit