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)
22 # We would like to our source tree to be readonly. However when releases or
23 # pre-releases are generated, the man pages need to be included as they are
24 # converted from the texi files via perl which we don't require end users to
26 # Therefore we have --enable-generated-files-in-srcdir to do just that.
28 AC_MSG_CHECKING([whether to place generated files in the source directory])
29 dnl generated-files-in-srcdir is disabled by default
30 AC_ARG_ENABLE(generated-files-in-srcdir,
31 [ --enable-generated-files-in-srcdir
32 put copies of generated files in source dir
33 intended for creating source tarballs for users
34 without texinfo, perl, bison or flex.],
35 generated_files_in_srcdir=$enableval,
36 generated_files_in_srcdir=no)
38 AC_MSG_RESULT($generated_files_in_srcdir)
39 AM_CONDITIONAL(GENINSRC, test x$generated_files_in_srcdir = xyes)
42 # Find the rest of the source tree framework.
43 AM_ENABLE_MULTILIB(, ../..)
45 dnl -----------------------------------------------------------
46 dnl Fold all IA-32 CPU architectures into "x86"
47 dnl -----------------------------------------------------------
48 if expr ${target_cpu} : '.*86' > /dev/null; then target_cpu=x86; fi
50 dnl -----------------------------------------------------------
51 dnl We will not track/change lib version until we reach version 1.0
52 dnl at which time we'll have to be more anal about such things
53 dnl -----------------------------------------------------------
54 AC_SUBST(LIBVERSION, "0:0:0")
64 CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
65 AC_SUBST(CLASSPATH_MODULE)
67 CLASSPATH_CONVENIENCE="-no-undefined"
68 AC_SUBST(CLASSPATH_CONVENIENCE)
71 AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar])
72 AC_CONFIG_HEADERS([include/config.h])
73 AC_PREFIX_DEFAULT(/usr/local/classpath)
78 dnl -----------------------------------------------------------
79 dnl Enable collections.jar (disabled by default)
80 dnl -----------------------------------------------------------
81 AC_ARG_ENABLE([collections],
82 [AS_HELP_STRING(--enable-collections,create collections.jar [default=no])],
83 [case x"${enableval}" in
84 xyes) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
85 xno) COMPILE_COLLECTIONS=no ;;
86 x) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
87 *) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"${enableval}\"" ;;
89 [COMPILE_COLLECTIONS=no])
90 AM_CONDITIONAL(CREATE_COLLECTIONS, test "x${COMPILE_COLLECTIONS}" = xyes)
92 dnl -----------------------------------------------------------
93 dnl Enable JNI libraries (enabled by default)
94 dnl -----------------------------------------------------------
96 [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
97 [case "${enableval}" in
98 yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
100 *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
103 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
105 dnl -----------------------------------------------------------
106 dnl Enable core JNI libraries (enabled by default)
107 dnl -----------------------------------------------------------
108 AC_ARG_ENABLE([core-jni],
109 [AS_HELP_STRING(--enable-core-jni,
110 compile JNI sources for core [default=yes])],
111 [case "${enableval}" in
112 yes) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
113 no) COMPILE_CORE_JNI=no ;;
114 *) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
116 [COMPILE_CORE_JNI=yes])
117 AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
119 dnl -----------------------------------------------------------
120 dnl Default Preference Backend
121 dnl -----------------------------------------------------------
122 AC_ARG_ENABLE([default-preferences-peer],
123 [AS_HELP_STRING([--enable-default-preferences-peer@<:@=peer type or class name@:>@],
124 [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])],
125 [case "${enableval}" in
126 file) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory ;;
127 gconf|yes|true) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory ;;
128 memory) DEFAULT_PREFS_PEER=gnu.java.util.prefs.MemoryBasedFactory ;;
129 no|false) AC_MSG_ERROR(bad value '${enableval}' for --enable-default-preferences-peer) ;;
130 *) DEFAULT_PREFS_PEER=${enableval} ;;
132 [DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory])
133 dnl AC_SUBST(DEFAULT_PREFS_PEER)
135 dnl -----------------------------------------------------------
136 dnl GConf native peer (enabled by default)
137 dnl -----------------------------------------------------------
138 AC_ARG_ENABLE([gconf-peer],
139 [AS_HELP_STRING(--disable-gconf-peer,compile GConf native peers (disabled by --disable-jni) [default=yes])],
140 [case "${enableval}" in
141 yes) COMPILE_GCONF_PEER=yes ;;
142 no) COMPILE_GCONF_PEER=no ;;
143 *) COMPILE_GCONF_PEER=yes ;;
145 [COMPILE_GCONF_PEER=yes])
146 AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
148 dnl -----------------------------------------------------------
149 dnl GTK native peer error checking
150 dnl -----------------------------------------------------------
151 AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
153 dnl ------------------------------------------------------------
154 dnl Whether to compile with -Werror or not (disabled by default)
155 dnl ------------------------------------------------------------
156 AC_ARG_ENABLE([Werror],
157 [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
158 [case "${enableval}" in
159 yes) ENABLE_WERROR=yes ;;
160 no) ENABLE_WERROR=no ;;
161 *) ENABLE_WERROR=default ;;
163 [ENABLE_WERROR=default])
165 dnl -----------------------------------------------------------
166 dnl Default AWT toolkit
167 dnl -----------------------------------------------------------
168 AC_ARG_ENABLE(default-toolkit,
169 AS_HELP_STRING([--enable-default-toolkit],
170 [fully qualified class name of default AWT toolkit]))
171 default_toolkit=$enable_default_toolkit
172 if test "$default_toolkit" = ""; then
173 default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
175 AC_SUBST(default_toolkit)
177 dnl -----------------------------------------------------------
178 dnl Native libxml/xslt library (disabled by default)
179 dnl -----------------------------------------------------------
180 AC_ARG_ENABLE([xmlj],
181 [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
182 [case "${enableval}" in
183 yes) COMPILE_XMLJ=yes ;;
184 no) COMPILE_XMLJ=no ;;
185 *) COMPILE_XMLJ=no ;;
188 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
190 dnl -----------------------------------------------------------
191 dnl ALSA code (enabled by default)
192 dnl -----------------------------------------------------------
193 AC_ARG_ENABLE([alsa],
194 [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
195 [case "${enableval}" in
196 yes) COMPILE_ALSA=yes ;;
197 no) COMPILE_ALSA=no ;;
198 *) COMPILE_ALSA=yes ;;
200 [AC_CHECK_HEADERS([alsa/asoundlib.h],
201 [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
203 AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
205 dnl -----------------------------------------------------------
206 dnl DSSI code (enabled by default)
207 dnl -----------------------------------------------------------
208 AC_ARG_ENABLE([dssi],
209 [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
210 [case "${enableval}" in
211 yes) COMPILE_DSSI=yes ;;
212 no) COMPILE_DSSI=no ;;
213 *) COMPILE_DSSI=yes ;;
216 AC_CHECK_HEADERS([dssi.h], [
217 AC_CHECK_HEADERS([jack/jack.h],COMPILE_DSSI=yes)])])
218 AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
220 dnl -----------------------------------------------------------
221 dnl GTK native peer (enabled by default)
222 dnl -----------------------------------------------------------
223 AC_ARG_ENABLE([gtk-peer],
224 [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
225 [case "${enableval}" in
226 yes) COMPILE_GTK_PEER=yes ;;
227 no) COMPILE_GTK_PEER=no ;;
228 *) COMPILE_GTK_PEER=yes ;;
230 [COMPILE_GTK_PEER=yes])
231 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
233 dnl -----------------------------------------------------------
234 dnl GTK native peer error checking
235 dnl -----------------------------------------------------------
236 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
238 dnl -----------------------------------------------------------
239 dnl Qt native peer (disabled by default)
240 dnl -----------------------------------------------------------
241 AC_ARG_ENABLE([qt-peer],
242 [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
243 [case "${enableval}" in
244 yes) COMPILE_QT_PEER=yes ;;
245 no) COMPILE_QT_PEER=no ;;
246 *) COMPILE_QT_PEER=yes ;;
248 [COMPILE_QT_PEER=no])
249 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
251 dnl -----------------------------------------------------------
252 dnl Plugin (enabled by default)
253 dnl -----------------------------------------------------------
254 AC_ARG_ENABLE([plugin],
255 [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
256 [case "${enableval}" in
257 yes) COMPILE_PLUGIN=yes ;;
258 no) COMPILE_PLUGIN=no ;;
259 *) COMPILE_PLUGIN=yes ;;
261 [COMPILE_PLUGIN=yes])
262 AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
264 dnl -----------------------------------------------------------
265 dnl GCJ LOCAL: Calculates and substitutes toolexeclibdir. $libdir is
266 dnl defined to the same value for all multilibs. We define toolexeclibdir
267 dnl so that we can refer to the multilib installation directories from
268 dnl classpath's build files.
269 dnl -----------------------------------------------------------
270 CLASSPATH_TOOLEXECLIBDIR
272 dnl -----------------------------------------------------------
273 dnl Sets the native libraries installation dir
274 dnl -----------------------------------------------------------
275 dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}
276 AC_ARG_WITH([native-libdir],
277 [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
279 nativeexeclibdir=${withval}
282 nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
285 AC_SUBST(nativeexeclibdir)
287 dnl -----------------------------------------------------------
288 dnl Sets the Java library installation dir.
289 dnl -----------------------------------------------------------
290 AC_ARG_WITH([glibj-dir],
291 [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
296 glibjdir='${datadir}/${PACKAGE}'
301 dnl -----------------------------------------------------------
302 dnl Sets the VM name for use in tool wrapper scripts
303 dnl -----------------------------------------------------------
305 [AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
310 VM_BINARY='${prefix}/bin/jamvm'
314 AM_CONDITIONAL(FOUND_CACAO, test "x`basename $VM_BINARY`" = xcacao)
316 dnl -----------------------------------------------------------
317 dnl Regenerate headers at build time (disabled by default)
318 dnl -----------------------------------------------------------
319 AC_ARG_ENABLE([regen-headers],
320 [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=no])],
321 [case "${enableval}" in
322 yes) REGENERATE_JNI_HEADERS=yes ;;
323 no) REGENERATE_JNI_HEADERS=no ;;
324 *) REGENERATE_JNI_HEADERS=no ;;
326 [REGENERATE_JNI_HEADERS=no])
327 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
329 dnl -----------------------------------------------------------
330 dnl Enable tool wrapper binaries (disabled by default)
331 dnl -----------------------------------------------------------
332 AC_ARG_ENABLE([tool-wrappers],
333 [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
334 [case x"${enableval}" in
336 COMPILE_WRAPPERS=yes;
337 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
338 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
340 xno) COMPILE_WRAPPERS=no ;;
341 x) COMPILE_WRAPPERS=yes ;;
342 *) COMPILE_WRAPPERS=yes ;;
344 [COMPILE_WRAPPERS=no])
345 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
350 dnl -----------------------------------------------------------
351 dnl Checks for programs.
352 dnl -----------------------------------------------------------
354 dnl Initialize libtool
362 # Handle -Werror default case.
363 if test "$ENABLE_WERROR" = default; then
366 if test "$GCC" = yes; then
373 if test "x${COMPILE_COLLECTIONS}" = xyes; then
374 AC_PATH_PROG(PERL, [perl])
376 AC_SUBST(COLLECTIONS_PREFIX)
377 AC_CONFIG_FILES([lib/mkcollections.pl])
378 AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
381 if test "x${COMPILE_JNI}" = xyes; then
386 dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
388 AC_COMPILE_CHECK_SIZEOF(void *)
390 dnl Checking for endianess.
393 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
394 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
395 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
396 dnl Check for crt_externs.h on Darwin.
397 AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
399 inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
406 sys/event.h sys/epoll.h \
409 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
410 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
411 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]))
412 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]))
414 AC_CHECK_FUNCS([ftruncate fsync select \
415 gethostname socket strerror fork pipe execve open close \
416 lseek fstat read readv write writev htonl memset htons connect \
417 getsockname getpeername bind listen accept \
418 recvfrom send sendto setsockopt getsockopt time mktime \
419 gethostbyname_r localtime_r \
422 mmap munmap mincore msync madvise getpagesize sysconf \
424 inet_aton inet_addr inet_pton \
425 getifaddrs kqueue kevent epoll_create \
429 AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
432 AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
433 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
434 [AC_DEFINE(HAVE_INET6, 1,
435 [Define if inet6 structures are defined in netinet/in.h.])
443 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
444 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
445 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
448 AC_MSG_CHECKING([for global timezone variable])
449 dnl FIXME: we don't want a link check here because that won't work
450 dnl when cross-compiling. So instead we make an assumption that
451 dnl the header file will mention timezone if it exists.
452 dnl Don't find the win32 function timezone
453 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
454 [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
457 AC_MSG_CHECKING([for global _timezone variable])
458 dnl FIXME: As above, don't want link check
459 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
460 [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
461 [Define if your platform has the global _timezone variable.])
463 [AC_MSG_RESULT(no)])])])
468 dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
471 dnl When using gcc we want warnings, lots of warnings :-)
472 if test "x${GCC}" = xyes; then
473 dnl We want ISO C90 ansi, but with longlong (jlong) support
474 dnl and modern POSIX and BSD C library functions/prototypes.
476 dnl Warning flags for (almost) everybody.
477 dnl Should probably be configurable
478 WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
479 AC_SUBST(WARNING_CFLAGS)
481 dnl Strict warning flags which not every module uses.
482 dnl Should probably be configurable.
483 STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
484 AC_SUBST(STRICT_WARNING_CFLAGS)
486 dnl Whether or not to add -Werror, also not used by all modueles.
487 dnl Can be configured by --disable-Werror
489 if test "x${ENABLE_WERROR}" = xyes; then
490 ERROR_CFLAGS='-Werror'
492 AC_SUBST(ERROR_CFLAGS)
495 dnl Check for libxml and libxslt libraries (when xmlj is enabled).
496 if test "x${COMPILE_XMLJ}" = xyes; then
497 PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
498 PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
502 AC_SUBST(XSLT_CFLAGS)
505 dnl Check for AWT related gthread/gtk
506 if test "x${COMPILE_GTK_PEER}" = xyes; then
508 if test "$no_x" = yes; then
509 AC_MSG_ERROR([GTK+ peers requested but no X library available])
511 dnl We explicitly want the XTest Extension for Robot support.
512 AC_CHECK_LIB([Xtst], [XTestQueryExtension],
513 [XTEST_LIBS="$XTEST_LIBS -lX11 -lXtst"],
514 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
517 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
518 PKG_CHECK_MODULES(FREETYPE2, freetype2)
519 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
520 dnl Check if we can link against the XRender library and set
521 dnl HAVE_XRENDER accordingly.
522 AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
523 [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
527 dnl Check if we can link against the XRandR library and set
528 dnl HAVE_XRANDR accordingly.
529 AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
530 [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
536 AC_SUBST(FREETYPE2_LIBS)
537 AC_SUBST(FREETYPE2_CFLAGS)
538 AC_SUBST(PANGOFT2_LIBS)
539 AC_SUBST(PANGOFT2_CFLAGS)
544 if test "x${COMPILE_GCONF_PEER}" = xyes; then
545 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.11.2)
546 AC_SUBST(GCONF_CFLAGS)
548 dnl we also need gdk for locking
549 PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
552 dnl check if the config value was given form the command line,
553 dnl if not, overwrite the default if we have the gconf backend
555 USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
556 if test "$USE_GCONF_PREFS_PEER" = ""; then
557 DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
561 dnl Check for AWT related Qt4
562 if test "x${COMPILE_QT_PEER}" = xyes; then
563 PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
564 if test "x$HAVE_QT4" = "xyes"; then
565 dnl Check needed because in some cases the QtGui includedir
566 dnl doesn't contain the subsystem dir.
567 QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
568 EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
569 AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
570 AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
571 AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
572 QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
573 AC_MSG_WARN([QWidget not found])))
574 AC_CHECK_PROG(MOC, [moc], [moc])
575 AC_CHECK_PROG(MOC, [moc-qt4], [moc-qt4])
577 if test "x$HAVE_QT4" = "xno"; then
578 AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
581 AC_ARG_WITH([qt4dir],
582 [AS_HELP_STRING([--with-qt4dir=DIR],
583 [Qt4 installation directory used for OS-X.
584 For other systems use pkg-config.])],
587 if test x"$QT4DIR" = x ; then
588 AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
590 AC_MSG_RESULT([QT4DIR... $QT4DIR])
591 AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
592 if test x"$MOC" = x; then
593 AC_MSG_ERROR([*** This is not the right Qt installation])
595 QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
596 QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
597 QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
598 QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
601 AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
602 of your installed Qt4 installation.])
606 AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
610 dnl **********************************************************************
611 dnl Check for MSG_NOSIGNAL
612 dnl **********************************************************************
613 AC_MSG_CHECKING(for MSG_NOSIGNAL)
614 AC_TRY_COMPILE([#include <sys/socket.h>],
615 [ int f = MSG_NOSIGNAL; ],
617 AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
618 [Define this symbol if you have MSG_NOSIGNAL]) ],
621 dnl **********************************************************************
622 dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
623 dnl **********************************************************************
624 AC_MSG_CHECKING(for SO_NOSIGPIPE )
625 AC_TRY_COMPILE([#include <sys/socket.h>],
626 [ int f = SO_NOSIGPIPE; ],
628 AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
629 [Define this symbol if you have SO_NOSIGPIPE]) ],
633 dnl Check for plugin support headers and libraries.
634 if test "x${COMPILE_PLUGIN}" = xyes; then
635 PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
636 if test "x${MOZILLA_FOUND}" = xno; then
637 PKG_CHECK_MODULES(MOZILLA, firefox-plugin firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
639 if test "x${MOZILLA_FOUND}" = xno; then
640 PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin xulrunner-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
642 if test "x${MOZILLA_FOUND}" = xno; then
643 PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin mozilla-firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
645 if test "x${MOZILLA_FOUND}" = xno; then
646 PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin seamonkey-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
648 PKG_CHECK_MODULES(GLIB, glib-2.0)
650 AC_SUBST(MOZILLA_CFLAGS)
651 AC_SUBST(MOZILLA_LIBS)
652 AC_SUBST(GLIB_CFLAGS)
655 AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
661 dnl -----------------------------------------------------------
662 dnl Add the include files for the native abstraction layer.
663 dnl Used by AM_CPPFLAGS in the different modules.
664 dnl -----------------------------------------------------------
665 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
666 AC_SUBST(CLASSPATH_INCLUDES)
668 dnl -----------------------------------------------------------
669 if test "x${COMPILE_JNI}" = xyes; then
670 AC_MSG_CHECKING(jni_md.h support)
671 if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
676 AC_MSG_WARN(no, using x86-linux-gnu)
678 ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
679 ac_dests="include/jni_md.h"
680 while test -n "$ac_sources"; do
681 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
682 set $ac_sources; ac_source=$1; shift; ac_sources=$*
683 ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
685 AC_CONFIG_LINKS([$ac_config_links_1])
690 CLASSPATH_WITH_CLASSLIB
692 dnl -----------------------------------------------------------
693 dnl Initialize maintainer mode
694 dnl -----------------------------------------------------------
697 dnl -----------------------------------------------------------
698 dnl Enable debugging statements at compile time. By default
699 dnl these statements should be optimized out of the bytecode
700 dnl produced by an optimizing Java compiler and not hinder
701 dnl performance because debugging is turned off by default.
702 dnl -----------------------------------------------------------
703 AC_ARG_ENABLE([debug],
704 [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
705 [case "${enableval}" in
708 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
710 no) LIBDEBUG="false" ;;
711 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
716 dnl -----------------------------------------------------------
717 dnl Enable execution of all static initializer loadLibrary()
718 dnl calls at compile time. By default most people will not
719 dnl want to disable this, but some VMs (gcj) don't need or want
721 dnl -----------------------------------------------------------
722 AC_ARG_ENABLE([load-library],
723 [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
724 [case "${enableval}" in
725 yes) INIT_LOAD_LIBRARY="true" ;;
726 no) INIT_LOAD_LIBRARY="false" ;;
727 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
729 [INIT_LOAD_LIBRARY="true"])
730 AC_SUBST(INIT_LOAD_LIBRARY)
733 dnl -----------------------------------------------------------
734 dnl Specify the jar file containing the Eclipse Java Compiler. If
735 dnl this option is not specified then the com.sun.tools.javac
736 dnl implementation will not be included in tools.zip.
737 dnl -----------------------------------------------------------
738 dnl GCJ LOCAL: default to $multi_basedir/ecj.jar
739 dnl In the default case where $multi_basedir/ecj.jar is found
740 dnl $(jardir)/ecj.jar will not expand properly in GNU Classpath's
741 dnl gnu/classpath/Configuration.java. That is OK though since libjava's
742 dnl gnu/classpath/Configuration.java overrides GNU Classpath's and
743 dnl ECJ_JAR_FILE will be properly expanded in libjava's
744 dnl gnu/classpath/natConfiguration.cc.
745 AC_ARG_WITH([ecj-jar],
746 [AS_HELP_STRING([--with-ecj-jar=ABS.PATH],
747 [specify jar file containing the Eclipse Java Compiler])],
749 [if test -f $multi_basedir/ecj.jar; then
750 ECJ_JAR='$(jardir)/ecj.jar'
754 dnl -----------------------------------------------------------
755 dnl Should the VM explicitly run class initialization subfunctions for
756 dnl java.lang.System? (default is false -- the subfunctions will be run
757 dnl automatically by the class initializer)
758 dnl -----------------------------------------------------------
759 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
760 [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
761 [case "${enableval}" in
762 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
763 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
764 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
766 [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
767 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
770 dnl -----------------------------------------------------------
771 dnl avoiding automake complaints
772 dnl -----------------------------------------------------------
776 dnl -----------------------------------------------------------
777 dnl This is probably useless.
778 dnl -----------------------------------------------------------
779 AC_PATH_PROG(MKDIR, mkdir)
781 AC_PATH_PROG(DATE, date)
783 dnl -----------------------------------------------------------
784 dnl According to the GNU coding guide, we shouldn't require find,
785 dnl and zip, however GNU provides both so it should be okay
786 dnl -----------------------------------------------------------
787 AC_PATH_PROG(FIND, find)
789 dnl -----------------------------------------------------------
790 dnl Specify what to install (install only glibj.zip by default)
791 dnl -----------------------------------------------------------
794 dnl -----------------------------------------------------------
795 dnl Enable API documentation generation (disabled by default)
796 dnl -----------------------------------------------------------
799 dnl -----------------------------------------------------------
800 dnl Whether to use jay to regenerate parsers.
801 dnl -----------------------------------------------------------
804 dnl -----------------------------------------------------------
805 dnl This sets the build-time default, which can now be overridden
806 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
807 dnl to "true" or "false".
808 dnl -----------------------------------------------------------
809 AC_ARG_ENABLE([portable-native-sync],
810 [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
811 [case "${enableval}" in
813 AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
817 AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
822 AX_CREATE_STDINT_H([include/config-int.h])
824 dnl -----------------------------------------------------------------------
825 dnl Support for using a prebuilt class library
826 dnl -----------------------------------------------------------------------
827 AC_ARG_WITH([glibj_zip],
828 AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
829 [use prebuilt glibj.zip class library]))
831 case "$with_glibj_zip" in
839 AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
843 PATH_TO_GLIBJ_ZIP=$with_glibj_zip
847 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
848 AC_SUBST(PATH_TO_GLIBJ_ZIP)
850 dnl -----------------------------------------------------------
851 dnl Build with Escher based X peers.
852 dnl -----------------------------------------------------------
853 AC_ARG_WITH([escher],
854 AS_HELP_STRING([--with-escher=ABS.PATH],
855 [specify path to escher dir or JAR for X peers]))
856 case "$with_escher" in
864 AC_MSG_ERROR([Please supply an absolute path to Escher library])
868 PATH_TO_ESCHER=$with_escher
872 AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
873 AC_SUBST(PATH_TO_ESCHER)
875 dnl -----------------------------------------------------------
876 dnl Check if local socket support should be included.
877 dnl -----------------------------------------------------------
878 AC_ARG_ENABLE([local-sockets],
879 [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
880 [case "${enableval}" in
882 ENABLE_LOCAL_SOCKETS=yes
885 ENABLE_LOCAL_SOCKETS=no
889 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
891 AC_CHECK_HEADER([sys/un.h])
892 AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
893 AC_MSG_ERROR([networking support not available]))
894 AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
896 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
898 dnl -----------------------------------------------------------
899 dnl Add the default preference peer
900 dnl -----------------------------------------------------------
901 AC_SUBST(DEFAULT_PREFS_PEER)
903 dnl -----------------------------------------------------------
905 dnl -----------------------------------------------------------
906 AC_CONFIG_FILES([Makefile
910 external/sax/Makefile
911 external/w3c_dom/Makefile
912 external/relaxngDatatype/Makefile
913 external/jsr166/Makefile
914 gnu/classpath/Configuration.java
915 gnu/java/security/Configuration.java
918 native/fdlibm/Makefile
921 native/jni/classpath/Makefile
922 native/jni/java-io/Makefile
923 native/jni/java-lang/Makefile
924 native/jni/java-net/Makefile
925 native/jni/java-nio/Makefile
926 native/jni/java-util/Makefile
927 native/jni/gtk-peer/Makefile
928 native/jni/gconf-peer/Makefile
929 native/jni/qt-peer/Makefile
930 native/jni/xmlj/Makefile
931 native/jni/midi-alsa/Makefile
932 native/jni/midi-dssi/Makefile
933 native/jni/native-lib/Makefile
934 native/plugin/Makefile
936 resource/META-INF/services/java.util.prefs.PreferencesFactory
938 scripts/classpath.spec
941 lib/copy-vmresources.sh
944 examples/Makefile.jawt
945 examples/Makefile.java2d])
947 if test "x${COMPILE_WRAPPERS}" = xno
949 AC_CONFIG_FILES([tools/gappletviewer
961 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
962 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
963 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
964 AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
965 AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
966 AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
967 AC_CONFIG_COMMANDS([grmiregistry],[chmod 755 tools/grmiregistry])
968 AC_CONFIG_COMMANDS([gtnameserv],[chmod 755 tools/gtnameserv])
969 AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
970 AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
971 AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
972 AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
975 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
976 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
979 # Create standard.omit based on decisions we just made.
980 cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
981 if test x$use_escher != xtrue; then
982 echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit