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.97.2],[classpath@gnu.org],[classpath])
10 AC_CONFIG_SRCDIR(java/lang/System.java)
14 dnl -----------------------------------------------------------
15 dnl Fold all IA-32 CPU architectures into "x86"
16 dnl -----------------------------------------------------------
17 if expr ${target_cpu} : '.*86' > /dev/null; then target_cpu=x86; fi
19 dnl -----------------------------------------------------------
20 dnl We will not track/change lib version until we reach version 1.0
21 dnl at which time we'll have to be more anal about such things
22 dnl -----------------------------------------------------------
23 AC_SUBST(LIBVERSION, "0:0:0")
33 CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
34 AC_SUBST(CLASSPATH_MODULE)
36 CLASSPATH_CONVENIENCE="-no-undefined"
37 AC_SUBST(CLASSPATH_CONVENIENCE)
40 AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar -Wno-portability])
41 AC_CONFIG_HEADERS([include/config.h])
42 AC_PREFIX_DEFAULT(/usr/local/classpath)
44 dnl -----------------------------------------------------------
45 dnl Enable collections.jar (disabled by default)
46 dnl -----------------------------------------------------------
47 AC_ARG_ENABLE([collections],
48 [AS_HELP_STRING(--enable-collections,create collections.jar [default=no])],
49 [case x"${enableval}" in
50 xyes) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
51 xno) COMPILE_COLLECTIONS=no ;;
52 x) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
53 *) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"${enableval}\"" ;;
55 [COMPILE_COLLECTIONS=no])
56 AM_CONDITIONAL(CREATE_COLLECTIONS, test "x${COMPILE_COLLECTIONS}" = xyes)
58 dnl -----------------------------------------------------------
59 dnl Enable JNI libraries (enabled by default)
60 dnl -----------------------------------------------------------
62 [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
63 [case "${enableval}" in
64 yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
66 *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
69 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
71 dnl -----------------------------------------------------------
72 dnl Enable core JNI libraries (enabled by default)
73 dnl -----------------------------------------------------------
74 AC_ARG_ENABLE([core-jni],
75 [AS_HELP_STRING(--enable-core-jni,
76 compile JNI sources for core [default=yes])],
77 [case "${enableval}" in
78 yes) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
79 no) COMPILE_CORE_JNI=no ;;
80 *) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
82 [COMPILE_CORE_JNI=yes])
83 AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
85 dnl -----------------------------------------------------------
86 dnl Default Preference Backend
87 dnl -----------------------------------------------------------
88 AC_ARG_ENABLE([default-preferences-peer],
89 [AS_HELP_STRING([--enable-default-preferences-peer@<:@=peer type or class name@:>@],
90 [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])],
91 [case "${enableval}" in
92 file) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory ;;
93 gconf|yes|true) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory ;;
94 memory) DEFAULT_PREFS_PEER=gnu.java.util.prefs.MemoryBasedFactory ;;
95 no|false) AC_MSG_ERROR(bad value '${enableval}' for --enable-default-preferences-peer) ;;
96 *) DEFAULT_PREFS_PEER=${enableval} ;;
98 [DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory])
99 dnl AC_SUBST(DEFAULT_PREFS_PEER)
101 dnl -----------------------------------------------------------
102 dnl GConf native peer (enabled by default)
103 dnl -----------------------------------------------------------
104 AC_ARG_ENABLE([gconf-peer],
105 [AS_HELP_STRING(--disable-gconf-peer,compile GConf native peers (disabled by --disable-jni) [default=yes])],
106 [case "${enableval}" in
107 yes) COMPILE_GCONF_PEER=yes ;;
108 no) COMPILE_GCONF_PEER=no ;;
109 *) COMPILE_GCONF_PEER=yes ;;
111 [COMPILE_GCONF_PEER=yes])
112 AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
114 dnl -----------------------------------------------------------
115 dnl GConf native peer error checking
116 dnl -----------------------------------------------------------
117 AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
119 dnl ------------------------------------------------------------
120 dnl GStreamer based sound provider backend (disabled by default)
121 dnl ------------------------------------------------------------
122 AC_ARG_ENABLE([gstreamer-peer],
123 [AS_HELP_STRING(--enable-gstreamer-peer,compile GStreamer native peers (disabled by --disable-jni) [default=no])],
124 [case "${enableval}" in
125 yes) COMPILE_GSTREAMER_PEER=yes ;;
126 no) COMPILE_GSTREAMER_PEER=no ;;
127 *) COMPILE_GSTREAMER_PEER=default ;;
129 [COMPILE_GSTREAMER_PEER=default])
130 AM_CONDITIONAL(CREATE_GSTREAMER_PEER_LIBRARIES, test "x${COMPILE_GSTREAMER_PEER}" = xyes)
132 dnl -----------------------------------------------------------
133 dnl GStreamer native peer error checking
134 dnl -----------------------------------------------------------
135 AC_ARG_ENABLE([gstreamer-peers],,AC_MSG_ERROR([No --enable-gstreamer-peers (or --disable-gstreamer-peers) option; you want --enable-gstreamer-peer]))
137 dnl ------------------------------------------------------------
138 dnl Whether to compile with -Werror or not (disabled by default)
139 dnl ------------------------------------------------------------
140 AC_ARG_ENABLE([Werror],
141 [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
142 [case "${enableval}" in
143 yes) ENABLE_WERROR=yes ;;
144 no) ENABLE_WERROR=no ;;
145 *) ENABLE_WERROR=default ;;
147 [ENABLE_WERROR=default])
149 dnl -----------------------------------------------------------
150 dnl Default AWT toolkit
151 dnl -----------------------------------------------------------
152 AC_ARG_ENABLE(default-toolkit,
153 AS_HELP_STRING([--enable-default-toolkit],
154 [fully qualified class name of default AWT toolkit]))
155 default_toolkit=$enable_default_toolkit
156 if test "$default_toolkit" = ""; then
157 default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
159 AC_SUBST(default_toolkit)
161 dnl -----------------------------------------------------------
162 dnl Native libxml/xslt library (disabled by default)
163 dnl -----------------------------------------------------------
164 AC_ARG_ENABLE([xmlj],
165 [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
166 [case "${enableval}" in
167 yes) COMPILE_XMLJ=yes ;;
168 no) COMPILE_XMLJ=no ;;
169 *) COMPILE_XMLJ=no ;;
172 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
174 dnl -----------------------------------------------------------
175 dnl ALSA code (enabled by default)
176 dnl -----------------------------------------------------------
177 AC_ARG_ENABLE([alsa],
178 [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
179 [case "${enableval}" in
180 yes) COMPILE_ALSA=yes ;;
181 no) COMPILE_ALSA=no ;;
182 *) COMPILE_ALSA=yes ;;
184 [AC_CHECK_HEADERS([alsa/asoundlib.h],
185 [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
187 AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
189 dnl -----------------------------------------------------------
190 dnl DSSI code (enabled by default)
191 dnl -----------------------------------------------------------
192 AC_ARG_ENABLE([dssi],
193 [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
194 [case "${enableval}" in
195 yes) COMPILE_DSSI=yes ;;
196 no) COMPILE_DSSI=no ;;
197 *) COMPILE_DSSI=yes ;;
200 AC_CHECK_HEADERS([dssi.h], [
201 AC_CHECK_HEADERS([jack/jack.h],COMPILE_DSSI=yes)])])
202 AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
204 dnl -----------------------------------------------------------
205 dnl GTK native peer (enabled by default)
206 dnl -----------------------------------------------------------
207 AC_ARG_ENABLE([gtk-peer],
208 [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
209 [case "${enableval}" in
210 yes) COMPILE_GTK_PEER=yes ;;
211 no) COMPILE_GTK_PEER=no ;;
212 *) COMPILE_GTK_PEER=yes ;;
214 [COMPILE_GTK_PEER=yes])
215 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
217 dnl -----------------------------------------------------------
218 dnl GTK native peer error checking
219 dnl -----------------------------------------------------------
220 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
222 dnl -----------------------------------------------------------
223 dnl Qt native peer (disabled by default)
224 dnl -----------------------------------------------------------
225 AC_ARG_ENABLE([qt-peer],
226 [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
227 [case "${enableval}" in
228 yes) COMPILE_QT_PEER=yes ;;
229 no) COMPILE_QT_PEER=no ;;
230 *) COMPILE_QT_PEER=yes ;;
232 [COMPILE_QT_PEER=no])
233 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
235 dnl -----------------------------------------------------------
236 dnl Plugin (enabled by default)
237 dnl -----------------------------------------------------------
238 AC_ARG_ENABLE([plugin],
239 [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
240 [case "${enableval}" in
241 yes) COMPILE_PLUGIN=yes ;;
242 no) COMPILE_PLUGIN=no ;;
243 *) COMPILE_PLUGIN=yes ;;
245 [COMPILE_PLUGIN=yes])
246 AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
248 dnl -----------------------------------------------------------
249 dnl Sets the native libraries installation dir
250 dnl -----------------------------------------------------------
251 AC_ARG_WITH([native-libdir],
252 [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
254 nativeexeclibdir=${withval}
257 nativeexeclibdir='${libdir}/${PACKAGE}'
260 AC_SUBST(nativeexeclibdir)
262 dnl -----------------------------------------------------------
263 dnl Sets the Java library installation dir.
264 dnl -----------------------------------------------------------
265 AC_ARG_WITH([glibj-dir],
266 [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
271 glibjdir='${datadir}/${PACKAGE}'
276 dnl -----------------------------------------------------------
277 dnl Sets the VM name for use in tool wrapper scripts
278 dnl -----------------------------------------------------------
280 [AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
285 VM_BINARY='${prefix}/bin/jamvm'
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=yes if headers don't exist])],
295 [case "${enableval}" in
296 yes) REGENERATE_JNI_HEADERS=yes ;;
297 no) REGENERATE_JNI_HEADERS=no ;;
298 *) REGENERATE_JNI_HEADERS=yes ;;
300 [if test -e include/java_lang_VMSystem.h; then
301 REGENERATE_JNI_HEADERS=no ;
303 REGENERATE_JNI_HEADERS=yes ;
305 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
307 dnl -----------------------------------------------------------
308 dnl Enable tool wrapper binaries (disabled by default)
309 dnl -----------------------------------------------------------
310 AC_ARG_ENABLE([tool-wrappers],
311 [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
312 [case x"${enableval}" in
314 COMPILE_WRAPPERS=yes;
315 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
316 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
318 xno) COMPILE_WRAPPERS=no ;;
319 x) COMPILE_WRAPPERS=yes ;;
320 *) COMPILE_WRAPPERS=yes ;;
322 [COMPILE_WRAPPERS=no])
323 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
328 dnl -----------------------------------------------------------
329 dnl Checks for programs.
330 dnl -----------------------------------------------------------
332 dnl Initialize libtool
340 # Handle -Werror default case.
341 if test "$ENABLE_WERROR" = default; then
344 if test "$GCC" = yes; then
351 if test "x${COMPILE_COLLECTIONS}" = xyes; then
352 AC_PATH_PROG(PERL, [perl])
354 AC_SUBST(COLLECTIONS_PREFIX)
355 AC_CONFIG_FILES([lib/mkcollections.pl])
356 AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
359 if test "x${COMPILE_JNI}" = xyes; then
364 dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
366 AC_COMPILE_CHECK_SIZEOF(void *)
368 dnl Checking for endianess.
371 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
372 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
373 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
374 dnl Check for crt_externs.h on Darwin.
375 dnl Check for netinet/in_systm.h, netinet/ip.h and net/if.h for Windows CE.
376 dnl Check for sys/loadavg.h for getloadavg() on Solaris 9.
377 AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
379 inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
386 sys/event.h sys/epoll.h \
388 netinet/in_systm.h netinet/ip.h net/if.h \
391 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
392 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
393 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]))
394 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]))
396 AC_SEARCH_LIBS([inet_pton],[nsl])
397 AC_CHECK_FUNCS([ftruncate fsync select \
398 gethostname socket strerror fork pipe execve open close \
399 lseek fstat read readv write writev htonl memset htons connect \
400 getsockname getpeername bind listen accept \
401 recvfrom send sendto setsockopt getsockopt time mktime \
402 gethostbyname_r localtime_r \
406 mmap munmap mincore msync madvise getpagesize sysconf \
408 inet_aton inet_addr inet_pton \
409 getifaddrs kqueue kevent epoll_create \
413 AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
416 AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
417 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
418 [AC_DEFINE(HAVE_INET6, 1,
419 [Define if inet6 structures are defined in netinet/in.h.])
427 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
428 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
429 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
432 AC_MSG_CHECKING([for global timezone variable])
433 dnl FIXME: we don't want a link check here because that won't work
434 dnl when cross-compiling. So instead we make an assumption that
435 dnl the header file will mention timezone if it exists.
436 dnl Don't find the win32 function timezone
437 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
438 [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
441 AC_MSG_CHECKING([for global _timezone variable])
442 dnl FIXME: As above, don't want link check
443 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
444 [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
445 [Define if your platform has the global _timezone variable.])
447 [AC_MSG_RESULT(no)])])])
452 AX_FUNC_WHICH_GETHOSTBYNAME_R
454 dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
457 dnl When using gcc we want warnings, lots of warnings :-)
458 if test "x${GCC}" = xyes; then
459 dnl We want ISO C90 ansi, but with longlong (jlong) support
460 dnl and modern POSIX and BSD C library functions/prototypes.
462 dnl Warning flags for (almost) everybody.
463 dnl Should probably be configurable
464 WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
465 AC_SUBST(WARNING_CFLAGS)
467 dnl Strict warning flags which not every module uses.
468 dnl Should probably be configurable.
469 STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
470 AC_SUBST(STRICT_WARNING_CFLAGS)
472 dnl Whether or not to add -Werror, also not used by all modueles.
473 dnl Can be configured by --disable-Werror
475 if test "x${ENABLE_WERROR}" = xyes; then
476 ERROR_CFLAGS='-Werror'
478 AC_SUBST(ERROR_CFLAGS)
481 dnl Check for libxml and libxslt libraries (when xmlj is enabled).
482 if test "x${COMPILE_XMLJ}" = xyes; then
483 PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
484 PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
488 AC_SUBST(XSLT_CFLAGS)
491 dnl Check for AWT related gthread/gtk
492 if test "x${COMPILE_GTK_PEER}" = xyes; then
494 if test "$no_x" = yes; then
495 AC_MSG_ERROR([GTK+ peers requested but no X library available])
497 dnl Check if we can link against the XTest library and set
498 dnl HAVE_XTEST accordingly.
499 AC_CHECK_LIB([Xtst], [XTestQueryExtension],
500 [AC_DEFINE(HAVE_XTEST, 1, [Define to 1 if you have libXtst.])[XTEST_LIBS="$XTEST_LIBS -X11 -lXtst"]],
505 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
506 PKG_CHECK_MODULES(FREETYPE2, freetype2)
507 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
508 PKG_CHECK_MODULES(CAIRO, cairo >= 1.1.8)
509 dnl Check if we can link against the XRender library and set
510 dnl HAVE_XRENDER accordingly.
511 AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
512 [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
516 dnl Check if we can link against the XRandR library and set
517 dnl HAVE_XRANDR accordingly.
518 AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
519 [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
525 AC_SUBST(FREETYPE2_LIBS)
526 AC_SUBST(FREETYPE2_CFLAGS)
527 AC_SUBST(PANGOFT2_LIBS)
528 AC_SUBST(PANGOFT2_CFLAGS)
533 if test "x${COMPILE_GCONF_PEER}" = xyes; then
534 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6.0)
535 AC_SUBST(GCONF_CFLAGS)
537 dnl we also need gdk for locking
538 PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
541 dnl check if the config value was given form the command line,
542 dnl if not, overwrite the default if we have the gconf backend
544 USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
545 if test "$USE_GCONF_PREFS_PEER" = ""; then
546 DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
551 if test "x${COMPILE_GSTREAMER_PEER}" = xyes; then
556 PKG_CHECK_MODULES(GSTREAMER, gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED)
557 AC_SUBST(GSTREAMER_CFLAGS)
558 AC_SUBST(GSTREAMER_LIBS)
561 PKG_CHECK_MODULES(GSTREAMER_BASE,
562 gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED)
563 AC_SUBST(GSTREAMER_BASE_CFLAGS)
564 AC_SUBST(GSTREAMER_BASE_LIBS)
566 dnl gstreamer-plugin-base
567 PKG_CHECK_MODULES(GSTREAMER_PLUGINS_BASE,
568 gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_REQUIRED)
569 AC_SUBST(GSTREAMER_PLUGINS_BASE_CFLAGS)
570 AC_SUBST(GSTREAMER_PLUGINS_BASE_LIBS)
572 GST_PLUGIN_LDFLAGS='-module -avoid-version -Wno-unused-parameter -no-undefined'
573 AC_SUBST(GST_PLUGIN_LDFLAGS)
575 PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
579 dnl set the gstreamer based file reader, writer and mixer
580 GSTREAMER_FILE_READER=gnu.javax.sound.sampled.gstreamer.io.GstAudioFileReader
581 GSTREAMER_MIXER_PROVIDER=gnu.javax.sound.sampled.gstreamer.GStreamerMixerProvider
583 dnl add the gstreamer resources
584 AC_SUBST(GSTREAMER_FILE_READER)
585 AC_SUBST(GSTREAMER_MIXER_PROVIDER)
587 dnl Check for AWT related Qt4
588 if test "x${COMPILE_QT_PEER}" = xyes; then
589 PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
590 if test "x$HAVE_QT4" = "xyes"; then
591 dnl Check needed because in some cases the QtGui includedir
592 dnl doesn't contain the subsystem dir.
593 QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
594 EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
595 AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
596 AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
597 AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
598 QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
599 AC_MSG_WARN([QWidget not found])))
600 AC_CHECK_PROG(MOC, [moc], [moc])
601 AC_CHECK_PROG(MOC, [moc-qt4], [moc-qt4])
603 if test "x$HAVE_QT4" = "xno"; then
604 AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
607 AC_ARG_WITH([qt4dir],
608 [AS_HELP_STRING([--with-qt4dir=DIR],
609 [Qt4 installation directory used for OS-X.
610 For other systems use pkg-config.])],
613 if test x"$QT4DIR" = x ; then
614 AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
616 AC_MSG_RESULT([QT4DIR... $QT4DIR])
617 AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
618 if test x"$MOC" = x; then
619 AC_MSG_ERROR([*** This is not the right Qt installation])
621 QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
622 QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
623 QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
624 QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
627 AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
628 of your installed Qt4 installation.])
632 AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
636 dnl **********************************************************************
637 dnl Check for MSG_NOSIGNAL
638 dnl **********************************************************************
639 AC_MSG_CHECKING(for MSG_NOSIGNAL)
640 AC_TRY_COMPILE([#include <sys/socket.h>],
641 [ int f = MSG_NOSIGNAL; ],
643 AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
644 [Define this symbol if you have MSG_NOSIGNAL]) ],
647 dnl **********************************************************************
648 dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
649 dnl **********************************************************************
650 AC_MSG_CHECKING(for SO_NOSIGPIPE )
651 AC_TRY_COMPILE([#include <sys/socket.h>],
652 [ int f = SO_NOSIGPIPE; ],
654 AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
655 [Define this symbol if you have SO_NOSIGPIPE]) ],
658 dnl **********************************************************************
659 dnl Check for MSG_WAITALL
660 dnl **********************************************************************
661 AC_MSG_CHECKING(for MSG_WAITALL)
662 AC_TRY_COMPILE([#include <sys/socket.h>],
663 [ int f = MSG_WAITALL; ],
665 AC_DEFINE(HAVE_MSG_WAITALL, 1,
666 [Define this symbol if you have MSG_WAITALL]) ],
670 dnl Check for plugin support headers and libraries.
671 if test "x${COMPILE_PLUGIN}" = xyes; then
672 PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
673 if test "x${MOZILLA_FOUND}" = xno; then
674 PKG_CHECK_MODULES(MOZILLA, firefox-plugin firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
676 if test "x${MOZILLA_FOUND}" = xno; then
677 PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin xulrunner-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
679 if test "x${MOZILLA_FOUND}" = xno; then
680 PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin mozilla-firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
682 if test "x${MOZILLA_FOUND}" = xno; then
683 PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin seamonkey-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
685 if test "x${MOZILLA_FOUND}" = xno; then
686 PKG_CHECK_MODULES(MOZILLA, iceape-plugin iceape-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
688 if test "x${MOZILLA_FOUND}" = xno; then
689 AC_MSG_ERROR([Couldn't find plugin support headers and libraries, try --disable-plugin])
692 PKG_CHECK_MODULES(GLIB, glib-2.0)
693 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
695 AC_SUBST(MOZILLA_CFLAGS)
696 AC_SUBST(MOZILLA_LIBS)
697 AC_SUBST(GLIB_CFLAGS)
702 AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
706 if test "x${REGENERATE_JNI_HEADERS}" = xyes; then
710 dnl -----------------------------------------------------------
711 dnl Add the include files for the native abstraction layer.
712 dnl Used by AM_CPPFLAGS in the different modules.
713 dnl -----------------------------------------------------------
714 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
715 AC_SUBST(CLASSPATH_INCLUDES)
717 dnl -----------------------------------------------------------
718 if test "x${COMPILE_JNI}" = xyes; then
719 AC_MSG_CHECKING(jni_md.h support)
720 if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
725 AC_MSG_WARN(no, using x86-linux-gnu)
727 ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
728 ac_dests="include/jni_md.h"
729 while test -n "$ac_sources"; do
730 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
731 set $ac_sources; ac_source=$1; shift; ac_sources=$*
732 ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
734 AC_CONFIG_LINKS([$ac_config_links_1])
737 CLASSPATH_WITH_CLASSLIB
739 dnl -----------------------------------------------------------
740 dnl Initialize maintainer mode
741 dnl -----------------------------------------------------------
744 dnl -----------------------------------------------------------
745 dnl Enable debugging statements at compile time. By default
746 dnl these statements should be optimized out of the bytecode
747 dnl produced by an optimizing Java compiler and not hinder
748 dnl performance because debugging is turned off by default.
749 dnl -----------------------------------------------------------
750 AC_ARG_ENABLE([debug],
751 [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
752 [case "${enableval}" in
755 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
757 no) LIBDEBUG="false" ;;
758 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
763 dnl -----------------------------------------------------------
764 dnl Enable execution of all static initializer loadLibrary()
765 dnl calls at compile time. By default most people will not
766 dnl want to disable this, but some VMs (gcj) don't need or want
768 dnl -----------------------------------------------------------
769 AC_ARG_ENABLE([load-library],
770 [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
771 [case "${enableval}" in
772 yes) INIT_LOAD_LIBRARY="true" ;;
773 no) INIT_LOAD_LIBRARY="false" ;;
774 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
776 [INIT_LOAD_LIBRARY="true"])
777 AC_SUBST(INIT_LOAD_LIBRARY)
780 dnl -----------------------------------------------------------
781 dnl Specify the jar file containing the Eclipse Java Compiler. If
782 dnl this option is not specified then the com.sun.tools.javac
783 dnl implementation will not be included in tools.zip.
784 dnl -----------------------------------------------------------
785 AC_ARG_WITH([ecj-jar],
786 [AS_HELP_STRING([--with-ecj-jar=ABS.PATH],
787 [specify jar file containing the Eclipse Java Compiler])],
792 dnl -----------------------------------------------------------
793 dnl Should the VM explicitly run class initialization subfunctions for
794 dnl java.lang.System? (default is false -- the subfunctions will be run
795 dnl automatically by the class initializer)
796 dnl -----------------------------------------------------------
797 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
798 [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
799 [case "${enableval}" in
800 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
801 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
802 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
804 [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
805 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
808 dnl -----------------------------------------------------------
809 dnl avoiding automake complaints
810 dnl -----------------------------------------------------------
814 dnl -----------------------------------------------------------
815 dnl This is probably useless.
816 dnl -----------------------------------------------------------
817 AC_PATH_PROG(MKDIR, mkdir)
819 AC_PATH_PROG(DATE, date)
821 dnl -----------------------------------------------------------
822 dnl According to the GNU coding guide, we shouldn't require find,
823 dnl and zip, however GNU provides both so it should be okay
824 dnl -----------------------------------------------------------
825 AC_PATH_PROG(FIND, find)
827 dnl -----------------------------------------------------------
828 dnl Specify what to install (install only glibj.zip by default)
829 dnl -----------------------------------------------------------
832 dnl -----------------------------------------------------------
833 dnl Enable API documentation generation (disabled by default)
834 dnl -----------------------------------------------------------
837 dnl -----------------------------------------------------------
838 dnl Whether to use jay to regenerate parsers.
839 dnl -----------------------------------------------------------
842 dnl -----------------------------------------------------------
843 dnl This sets the build-time default, which can now be overridden
844 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
845 dnl to "true" or "false".
846 dnl -----------------------------------------------------------
847 AC_ARG_ENABLE([portable-native-sync],
848 [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
849 [case "${enableval}" in
851 AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
855 AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
860 AX_CREATE_STDINT_H([include/config-int.h])
862 dnl -----------------------------------------------------------------------
863 dnl Support for using a prebuilt class library
864 dnl -----------------------------------------------------------------------
865 AC_ARG_WITH([glibj_zip],
866 AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
867 [use prebuilt glibj.zip class library]))
869 case "$with_glibj_zip" in
877 AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
881 PATH_TO_GLIBJ_ZIP=$with_glibj_zip
885 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
886 AC_SUBST(PATH_TO_GLIBJ_ZIP)
888 # Check for javac if we need to build either the class library,
889 # the examples or the tools
890 if test "x${use_glibj_zip}" = xfalse || \
891 test "x${EXAMPLESDIR}" != x || \
892 test "x${TOOLSDIR}" != x && \
893 test "x${build_class_files}" != xno; then
895 CLASSPATH_JAVAC_MEM_CHECK
898 dnl -----------------------------------------------------------
899 dnl Build with Escher based X peers.
900 dnl -----------------------------------------------------------
901 AC_ARG_WITH([escher],
902 AS_HELP_STRING([--with-escher=ABS.PATH],
903 [specify path to escher dir or JAR for X peers]))
904 case "$with_escher" in
912 AC_MSG_ERROR([Please supply an absolute path to Escher library])
916 PATH_TO_ESCHER=$with_escher
920 AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
921 AC_SUBST(PATH_TO_ESCHER)
923 dnl -----------------------------------------------------------
924 dnl Check if local socket support should be included.
925 dnl -----------------------------------------------------------
926 AC_ARG_ENABLE([local-sockets],
927 [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
928 [case "${enableval}" in
930 ENABLE_LOCAL_SOCKETS=yes
933 ENABLE_LOCAL_SOCKETS=no
937 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
939 AC_CHECK_HEADER([sys/un.h])
940 AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
941 AC_MSG_ERROR([networking support not available]))
942 AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
944 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
946 dnl -----------------------------------------------------------
947 dnl Add the default preference peer
948 dnl -----------------------------------------------------------
949 AC_SUBST(DEFAULT_PREFS_PEER)
951 dnl -----------------------------------------------------------
953 dnl -----------------------------------------------------------
954 AC_CONFIG_FILES([Makefile
958 external/sax/Makefile
959 external/w3c_dom/Makefile
960 external/relaxngDatatype/Makefile
961 external/jsr166/Makefile
962 gnu/classpath/Configuration.java
963 gnu/java/security/Configuration.java
966 native/fdlibm/Makefile
969 native/jni/classpath/Makefile
970 native/jni/java-io/Makefile
971 native/jni/java-lang/Makefile
972 native/jni/java-net/Makefile
973 native/jni/java-nio/Makefile
974 native/jni/java-util/Makefile
975 native/jni/gtk-peer/Makefile
976 native/jni/gconf-peer/Makefile
977 native/jni/gstreamer-peer/Makefile
978 native/jni/qt-peer/Makefile
979 native/jni/xmlj/Makefile
980 native/jni/midi-alsa/Makefile
981 native/jni/midi-dssi/Makefile
982 native/jni/native-lib/Makefile
983 native/plugin/Makefile
985 resource/META-INF/services/java.util.prefs.PreferencesFactory
986 resource/META-INF/services/javax.sound.sampled.spi.AudioFileReader
987 resource/META-INF/services/javax.sound.sampled.spi.MixerProvider
989 scripts/classpath.spec
992 lib/copy-vmresources.sh
993 scripts/check_jni_methods.sh
996 examples/Makefile.jawt
997 examples/Makefile.java2d])
999 if test "x${COMPILE_WRAPPERS}" = xno
1001 AC_CONFIG_FILES([tools/gappletviewer
1013 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
1014 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
1015 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
1016 AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
1017 AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
1018 AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
1019 AC_CONFIG_COMMANDS([grmiregistry],[chmod 755 tools/grmiregistry])
1020 AC_CONFIG_COMMANDS([gtnameserv],[chmod 755 tools/gtnameserv])
1021 AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
1022 AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
1023 AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
1024 AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
1027 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
1028 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
1031 # Create standard.omit based on decisions we just made.
1032 cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
1033 if test x$use_escher != xtrue; then
1034 echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit