Daily bump.
[official-gcc.git] / libjava / classpath / configure.ac
blobd120b5bdb4cb0ddf282a389a31e2f5a380e00c19
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.99.1-pre],[classpath@gnu.org],[classpath])
10 AC_CONFIG_SRCDIR(java/lang/System.java)
11 AC_CONFIG_MACRO_DIR([m4])
13 dnl GCJ LOCAL
14 AC_CONFIG_AUX_DIR(../..)
15 dnl END GCJ LOCAL
17 AC_CANONICAL_TARGET
19 dnl GCJ LOCAL
20 AC_ARG_ENABLE(java-maintainer-mode,
21         AS_HELP_STRING([--enable-java-maintainer-mode],
22         [allow rebuilding of .class and .h files]))
23 AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
24 dnl END GCJ LOCAL
26 dnl GCJ LOCAL
27 # We would like to our source tree to be readonly.  However when releases or
28 # pre-releases are generated, the man pages need to be included as they are
29 # converted from the texi files via perl which we don't require end users to
30 # have installed.
31 # Therefore we have --enable-generated-files-in-srcdir to do just that.
33 AC_MSG_CHECKING([whether to place generated files in the source directory])
34   dnl generated-files-in-srcdir is disabled by default
35   AC_ARG_ENABLE(generated-files-in-srcdir, 
36 [  --enable-generated-files-in-srcdir
37                           put copies of generated files in source dir
38                           intended for creating source tarballs for users
39                           without texinfo, perl, bison or flex.],
40       generated_files_in_srcdir=$enableval,
41       generated_files_in_srcdir=no)
43 AC_MSG_RESULT($generated_files_in_srcdir)
44 AM_CONDITIONAL(GENINSRC, test x$generated_files_in_srcdir = xyes)
45 dnl END GCJ LOCAL
47 # Find the rest of the source tree framework.
48 AM_ENABLE_MULTILIB(, ../..)
50 AM_CONDITIONAL(INSTALL_BINARIES, test -z "${with_multisubdir}")
52 dnl -----------------------------------------------------------
53 dnl Fold all IA-32 CPU architectures into "x86"
54 dnl -----------------------------------------------------------
55 if expr ${target_cpu} : '.*86' > /dev/null; then target_cpu=x86; fi
57 dnl -----------------------------------------------------------
58 dnl We will not track/change lib version until we reach version 1.0
59 dnl at which time we'll have to be more anal about such things
60 dnl -----------------------------------------------------------
61 AC_SUBST(LIBVERSION, "0:0:0")
62 case "$host_os" in
63      darwin*)
64         cp_module=""
65         ;;
66         *)
67         cp_module="-module"
68         ;;
69 esac
71 CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
72 AC_SUBST(CLASSPATH_MODULE)
74 CLASSPATH_CONVENIENCE="-no-undefined"
75 AC_SUBST(CLASSPATH_CONVENIENCE)
77 AC_PREREQ(2.64)
78 AM_INIT_AUTOMAKE([1.9.0 no-dist gnu std-options tar-ustar -Wno-portability])
79 AC_CONFIG_HEADERS([include/config.h])
80 AC_PREFIX_DEFAULT(/usr/local/classpath)
82 dnl GCC LOCAL
83 GCC_NO_EXECUTABLES
85 dnl -----------------------------------------------------------
86 dnl Enable collections.jar (disabled by default)
87 dnl -----------------------------------------------------------
88 AC_ARG_ENABLE([collections],
89               [AS_HELP_STRING(--enable-collections,create collections.jar [default=no])],
90               [case x"${enableval}" in
91                 xyes) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
92                 xno) COMPILE_COLLECTIONS=no ;;
93                 x) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
94                 *) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"${enableval}\"" ;;
95               esac],
96               [COMPILE_COLLECTIONS=no])
97 AM_CONDITIONAL(CREATE_COLLECTIONS, test "x${COMPILE_COLLECTIONS}" = xyes)
99 dnl -----------------------------------------------------------
100 dnl Enable JNI libraries (enabled by default)
101 dnl -----------------------------------------------------------
102 AC_ARG_ENABLE([jni],
103               [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
104               [case "${enableval}" in 
105                 yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
106                 no) COMPILE_JNI=no ;;
107                 *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
108               esac],
109               [COMPILE_JNI=yes])
110 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
112 dnl -----------------------------------------------------------
113 dnl Enable core JNI libraries (enabled by default)
114 dnl -----------------------------------------------------------
115 AC_ARG_ENABLE([core-jni],
116               [AS_HELP_STRING(--enable-core-jni,
117                               compile JNI sources for core [default=yes])],
118               [case "${enableval}" in 
119                 yes) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
120                 no) COMPILE_CORE_JNI=no ;;
121                 *) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
122               esac],
123               [COMPILE_CORE_JNI=yes])
124 AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
126 dnl -----------------------------------------------------------
127 dnl Default Preference Backend
128 dnl -----------------------------------------------------------
129 AC_ARG_ENABLE([default-preferences-peer],
130               [AS_HELP_STRING([--enable-default-preferences-peer@<:@=peer type or class name@:>@],
131                               [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])],
132               [case "${enableval}" in 
133                 file) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory  ;;
134                 gconf|yes|true) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory  ;;
135                 memory) DEFAULT_PREFS_PEER=gnu.java.util.prefs.MemoryBasedFactory  ;;
136                 no|false) AC_MSG_ERROR(bad value '${enableval}' for --enable-default-preferences-peer) ;;
137                 *) DEFAULT_PREFS_PEER=${enableval} ;;
138               esac],
139               [DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory])
140 dnl AC_SUBST(DEFAULT_PREFS_PEER)
142 dnl -----------------------------------------------------------
143 dnl GConf native peer (enabled by default)
144 dnl -----------------------------------------------------------
145 AC_ARG_ENABLE([gconf-peer],
146               [AS_HELP_STRING(--disable-gconf-peer,compile GConf native peers (disabled by --disable-jni) [default=yes])],
147               [case "${enableval}" in
148                 yes) COMPILE_GCONF_PEER=yes ;;
149                 no) COMPILE_GCONF_PEER=no ;;
150                 *) COMPILE_GCONF_PEER=yes ;;
151               esac],
152               [COMPILE_GCONF_PEER=yes])
153 AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
155 dnl -----------------------------------------------------------
156 dnl GConf native peer error checking
157 dnl -----------------------------------------------------------
158 AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
160 dnl ------------------------------------------------------------
161 dnl GStreamer based sound provider backend (disabled by default)
162 dnl ------------------------------------------------------------
163 AC_ARG_ENABLE([gstreamer-peer],
164               [AS_HELP_STRING(--enable-gstreamer-peer,compile GStreamer native peers (disabled by --disable-jni) [default=no])],
165               [case "${enableval}" in
166                 yes) COMPILE_GSTREAMER_PEER=yes ;;
167                 no) COMPILE_GSTREAMER_PEER=no ;;
168                 *) COMPILE_GSTREAMER_PEER=default ;;
169               esac],
170               [COMPILE_GSTREAMER_PEER=default])
171 AM_CONDITIONAL(CREATE_GSTREAMER_PEER_LIBRARIES, test "x${COMPILE_GSTREAMER_PEER}" = xyes)
173 dnl -----------------------------------------------------------
174 dnl GStreamer native peer error checking
175 dnl -----------------------------------------------------------
176 AC_ARG_ENABLE([gstreamer-peers],,AC_MSG_ERROR([No --enable-gstreamer-peers (or --disable-gstreamer-peers) option; you want --enable-gstreamer-peer]))
178 dnl ------------------------------------------------------------
179 dnl Whether to compile with -Werror or not (disabled by default)
180 dnl ------------------------------------------------------------
181 AC_ARG_ENABLE([Werror],
182               [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
183               [case "${enableval}" in
184                 yes) ENABLE_WERROR=yes ;;
185                 no) ENABLE_WERROR=no ;;
186                 *) ENABLE_WERROR=no ;;
187               esac],
188               [ENABLE_WERROR=no])
190 dnl -----------------------------------------------------------
191 dnl Default AWT toolkit
192 dnl -----------------------------------------------------------
193 AC_ARG_ENABLE(default-toolkit,
194   AS_HELP_STRING([--enable-default-toolkit],
195                  [fully qualified class name of default AWT toolkit]))
196 default_toolkit=$enable_default_toolkit
197 if test "$default_toolkit" = ""; then
198    default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
200 AC_SUBST(default_toolkit)
202 dnl -----------------------------------------------------------
203 dnl Native libxml/xslt library (disabled by default)
204 dnl -----------------------------------------------------------
205 AC_ARG_ENABLE([xmlj],
206               [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
207               [case "${enableval}" in
208                 yes) COMPILE_XMLJ=yes ;;
209                 no) COMPILE_XMLJ=no ;;
210                 *) COMPILE_XMLJ=no ;;
211               esac],
212               [COMPILE_XMLJ=no])
213 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
215 dnl -----------------------------------------------------------
216 dnl ALSA code (enabled by default)
217 dnl -----------------------------------------------------------
218 AC_ARG_ENABLE([alsa],
219               [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
220               [case "${enableval}" in
221                 yes) COMPILE_ALSA=yes ;;
222                 no) COMPILE_ALSA=no ;;
223                 *) COMPILE_ALSA=yes ;;
224               esac],
225               [AC_CHECK_HEADERS([alsa/asoundlib.h],
226                                 [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
227                                 COMPILE_ALSA=no)])
228 AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
230 dnl -----------------------------------------------------------
231 dnl DSSI code (enabled by default)
232 dnl -----------------------------------------------------------
233 AC_ARG_ENABLE([dssi],
234               [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
235               [case "${enableval}" in
236                 yes) COMPILE_DSSI=yes ;;
237                 no) COMPILE_DSSI=no ;;
238                 *) COMPILE_DSSI=yes ;;
239               esac],
240               [COMPILE_DSSI=no
241                AC_CHECK_HEADERS([dssi.h], [
242                  AC_CHECK_HEADERS([jack/jack.h],COMPILE_DSSI=yes)])])
243 AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
245 dnl -----------------------------------------------------------
246 dnl GTK native peer (enabled by default)
247 dnl -----------------------------------------------------------
248 AC_ARG_ENABLE([gtk-peer],
249               [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
250               [case "${enableval}" in
251                 yes) COMPILE_GTK_PEER=yes ;;
252                 no) COMPILE_GTK_PEER=no ;;
253                 *) COMPILE_GTK_PEER=yes ;;
254               esac],
255               [COMPILE_GTK_PEER=yes])
256 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
258 dnl -----------------------------------------------------------
259 dnl GTK native peer error checking 
260 dnl -----------------------------------------------------------
261 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
263 dnl -----------------------------------------------------------
264 dnl Qt native peer (disabled by default)
265 dnl -----------------------------------------------------------
266 AC_ARG_ENABLE([qt-peer],
267               [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
268               [case "${enableval}" in
269                 yes) COMPILE_QT_PEER=yes ;;
270                 no) COMPILE_QT_PEER=no ;;
271                 *) COMPILE_QT_PEER=yes ;;
272               esac],
273               [COMPILE_QT_PEER=no])
274 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
276 dnl -----------------------------------------------------------
277 dnl Plugin (disabled by default)
278 dnl -----------------------------------------------------------
279 AC_ARG_ENABLE([plugin],
280               [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
281               [case "${enableval}" in
282                 yes) COMPILE_PLUGIN=yes ;;
283                 no) COMPILE_PLUGIN=no ;;
284                 *) COMPILE_PLUGIN=yes ;;
285               esac],
286               [COMPILE_PLUGIN=no])
287 AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
289 dnl -----------------------------------------------------------
290 dnl Native java.math.BigInteger (enabled by default)
291 dnl -----------------------------------------------------------
292 AC_ARG_ENABLE([gmp],
293               [AS_HELP_STRING(--enable-gmp,
294                               compile native java.math.BigInteger library (disabled by --disable-gmp) [default=yes])],
295               [case "${enableval}" in
296                 yes|true) COMPILE_GMP=yes ;;
297                 no|false) COMPILE_GMP=no ;;
298                 *) COMPILE_GMP=yes ;;
299               esac],
300               [COMPILE_GMP=yes])
302 dnl -----------------------------------------------------------
303 dnl GJDoc (enabled by default)
304 dnl -----------------------------------------------------------
305 AC_ARG_ENABLE([gjdoc],
306               [AS_HELP_STRING(--disable-gjdoc,compile GJDoc (disabled by --disable-gjdoc) [default=yes])],
307               [case "${enableval}" in
308                 yes) COMPILE_GJDOC=yes ;;
309                 no) COMPILE_GJDOC=no ;;
310                 *) COMPILE_GJDOC=yes ;;
311               esac],
312               [COMPILE_GJDOC=yes])
313 AM_CONDITIONAL(CREATE_GJDOC, test "x${COMPILE_GJDOC}" = xyes)
315 dnl GCJ LOCAL: Calculates and substitutes toolexeclibdir.  $libdir is
316 dnl defined to the same value for all multilibs.  We define toolexeclibdir
317 dnl so that we can refer to the multilib installation directories from
318 dnl classpath's build files.
319 dnl -----------------------------------------------------------
320 case ${host_alias} in
321   "") host_noncanonical=${build_noncanonical} ;;
322   *) host_noncanonical=${host_alias} ;;
323 esac
324 case ${target_alias} in
325   "") target_noncanonical=${host_noncanonical} ;;
326   *) target_noncanonical=${target_alias} ;;
327 esac
328 AC_SUBST(target_noncanonical)
330 AC_ARG_ENABLE(version-specific-runtime-libs,
331   AS_HELP_STRING([--enable-version-specific-runtime-libs],    
332                  [specify that runtime libraries should be installed in a compiler-specific directory]),
333     [case "$enableval" in
334       yes) version_specific_libs=yes ;;
335       no)  version_specific_libs=no ;;
336       *)   AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
337      esac],
338     [version_specific_libs=no]
340 CLASSPATH_TOOLEXECLIBDIR
342 dnl -----------------------------------------------------------
343 dnl Sets the native libraries installation dir
344 dnl -----------------------------------------------------------
345 dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}-${libgcj_soversion}
346 AC_ARG_WITH([native-libdir],
347             [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
348             [
349              nativeexeclibdir=${withval}
350             ],
351             [
352              nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`-`awk -F: '/^[[^#]].*:/ { print $1 }' ${srcdir}/../libtool-version`
353             ])
355 AC_SUBST(nativeexeclibdir)
357 dnl -----------------------------------------------------------
358 dnl Sets the Java library installation dir.
359 dnl -----------------------------------------------------------
360 AC_ARG_WITH([glibj-dir],
361             [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
362             [
363              glibjdir=${withval}
364             ],
365             [
366              glibjdir='${datadir}/${PACKAGE}'
367             ])
369 AC_SUBST(glibjdir)
371 dnl -----------------------------------------------------------
372 dnl Sets the Antlr jar to use for compiling gjdoc
373 dnl -----------------------------------------------------------
374 AC_ARG_WITH([antlr-jar],
375             [AS_HELP_STRING([--with-antlr-jar=file],[Use ANTLR from the specified jar file])],
376             [
377              ANTLR_JAR=$withval
378             ],
379             [
380              ANTLR_JAR="$ANTLR_JAR"
381             ])
383 dnl -----------------------------------------------------------
384 dnl Regenerate headers at build time (enabled if not found)
385 dnl -----------------------------------------------------------
386 AC_MSG_CHECKING([whether to regenerate the headers])
387 AC_ARG_ENABLE([regen-headers],
388               [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=yes if headers don't exist])],
389               [case "${enableval}" in
390                 yes) REGENERATE_JNI_HEADERS=yes ;;
391                 no) REGENERATE_JNI_HEADERS=no ;;
392                 *) REGENERATE_JNI_HEADERS=yes ;;
393               esac],
394               [if test -e ${srcdir}/include/java_lang_VMSystem.h; then
395                         REGENERATE_JNI_HEADERS=no ;
396                    else
397                         REGENERATE_JNI_HEADERS=yes ;
398                fi])
399 AC_MSG_RESULT(${REGENERATE_JNI_HEADERS})
400 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
402 dnl ------------------------------------------------------------------------
403 dnl Regenerate GJDoc parser at build time (enabled if not found)
404 dnl ------------------------------------------------------------------------
405 AC_MSG_CHECKING([whether to regenerate the GJDoc parser])
406 AC_ARG_ENABLE([regen-gjdoc-parser],
407               [AS_HELP_STRING(--enable-regen-gjdoc-parser,automatically regenerate the GJDoc parser [default=yes if generated source doesn't exist])],
408               [case "${enableval}" in
409                 yes) REGENERATE_GJDOC_PARSER=yes ;;
410                 no) REGENERATE_GJDOC_PARSER=no ;;
411                 *) REGENERATE_GJDOC_PARSER=yes ;;
412               esac],
413               [if test -e ${srcdir}/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.java; then
414                         REGENERATE_GJDOC_PARSER=no ;
415                    else
416                         REGENERATE_GJDOC_PARSER=yes ;
417                fi])
418 AC_MSG_RESULT(${REGENERATE_GJDOC_PARSER})
419 AM_CONDITIONAL(CREATE_GJDOC_PARSER, test "x${REGENERATE_GJDOC_PARSER}" = xyes)
421 dnl -----------------------------------------------------------
422 dnl Enable tool wrapper binaries (disabled by default)
423 dnl -----------------------------------------------------------
424 AC_ARG_ENABLE([tool-wrappers],
425               [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
426               [case x"${enableval}" in
427                 xyes)
428                   COMPILE_WRAPPERS=yes;
429                   AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
430                   AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
431                   ;;
432                 xno) COMPILE_WRAPPERS=no ;;
433                 x) COMPILE_WRAPPERS=yes ;;
434                 *) COMPILE_WRAPPERS=yes ;;
435               esac],
436               [COMPILE_WRAPPERS=no])
437 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
439 AC_PROG_LN_S
440 AC_PROG_INSTALL
442 dnl -----------------------------------------------------------
443 dnl Checks for programs.
444 dnl -----------------------------------------------------------
446 dnl Initialize libtool
447 AC_DISABLE_STATIC
448 LT_INIT
449 AC_PROG_AWK
450 AC_PROG_CC
451 AM_PROG_CC_C_O
452 AC_PROG_CPP
453 AC_PROG_CXX
455 # Handle -Werror default case.
456 if test "$ENABLE_WERROR" = default; then
457   case "$host_os" in
458     *linux*)
459       if test "$GCC" = yes; then
460         ENABLE_WERROR=yes
461       fi
462       ;;
463   esac
466 if test "x${COMPILE_COLLECTIONS}" = xyes; then
467   AC_PATH_PROG(PERL, [perl])
468   AC_SUBST(PERL)
469   AC_SUBST(COLLECTIONS_PREFIX)
470   AC_CONFIG_FILES([lib/mkcollections.pl])
471   AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
474 if test "x${COMPILE_JNI}" = xyes; then
475   GCC_ATTRIBUTE_UNUSED
477   AC_HEADER_STDC
479   dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64, 
480   dnl at least. 
481   AC_COMPILE_CHECK_SIZEOF(void *)
483   dnl Checking for endianess.
484   AC_C_BIGENDIAN_CROSS
485   
486   dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
487   dnl On that system, sys/ioctl.h will not include sys/filio.h unless
488   dnl BSD_COMP is defined; just including sys/filio.h is simpler.
489   dnl Check for crt_externs.h on Darwin.
490   dnl Check for netinet/in_systm.h, netinet/ip.h and net/if.h for Windows CE.
491   dnl Check for sys/loadavg.h for getloadavg() on Solaris 9.
492   dnl Check for sys/sockio.h for SIOCGIFFLAGS on OpenSolaris.
493   AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
494                     asm/ioctls.h \
495                     inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
496                     sys/time.h \
497                     sys/select.h \
498                     crt_externs.h \
499                     fcntl.h \
500                     sys/mman.h \
501                     magic.h \
502                     sys/event.h sys/epoll.h \
503                     ifaddrs.h \
504                     netinet/in_systm.h netinet/ip.h net/if.h \
505                     sys/loadavg.h sys/sockio.h])
507   AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
508   AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
509   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]))
510   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]))
512   AC_SEARCH_LIBS([clock_gettime], [rt])
513   AC_SEARCH_LIBS([inet_pton],[nsl])
514   AC_CHECK_LIB([socket], [gethostname]) 
516   AC_CHECK_FUNCS([ftruncate fsync select \
517                   gethostname socket strerror fork pipe execve open close \
518                   lseek fstat read readv write writev htonl memset htons connect \
519                   getsockname getpeername bind listen accept \
520                   recvfrom send sendto setsockopt getsockopt time mktime clock_gettime \
521                   gethostbyname_r localtime_r \
522                   strerror_r \
523                   fcntl \
524                   statvfs \  
525                   mmap munmap mincore msync madvise getpagesize sysconf \
526                   lstat readlink \
527                   inet_aton inet_addr inet_pton \
528                   getifaddrs kqueue kevent epoll_create \
529                   getloadavg])
531   LIBMAGIC=
532   AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
533   AC_SUBST(LIBMAGIC)
535   AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
536   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
537                     [AC_DEFINE(HAVE_INET6, 1,
538                      [Define if inet6 structures are defined in netinet/in.h.])
539                      AC_MSG_RESULT(yes)],
540                     [AC_MSG_RESULT(no)])
542   AC_HEADER_TIME
543   AC_STRUCT_TM
544   AC_STRUCT_TIMEZONE
546   AC_MSG_CHECKING([for tm_gmtoff in struct tm])
547   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
548   [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
549    AC_MSG_RESULT(yes)],
550   [AC_MSG_RESULT(no)
551    AC_MSG_CHECKING([for global timezone variable])
552    dnl FIXME: we don't want a link check here because that won't work
553    dnl when cross-compiling.  So instead we make an assumption that
554    dnl the header file will mention timezone if it exists.
555    dnl Don't find the win32 function timezone
556    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
557      [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
558       AC_MSG_RESULT(yes)],
559      [AC_MSG_RESULT(no)
560        AC_MSG_CHECKING([for global _timezone variable])
561        dnl FIXME: As above, don't want link check
562        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
563          [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
564             [Define if your platform has the global _timezone variable.])
565           AC_MSG_RESULT(yes)],
566           [AC_MSG_RESULT(no)])])])
568   AC_C_CONST
569   AC_C_INLINE
570   AC_C_ATTRIBUTE
571   AX_FUNC_WHICH_GETHOSTBYNAME_R
573   dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
574   AM_ICONV
576   dnl When using gcc we want warnings, lots of warnings :-)
577   if test "x${GCC}" = xyes; then
578     dnl We want ISO C90 ansi, but with longlong (jlong) support
579     dnl and modern POSIX and BSD C library functions/prototypes.
581     dnl Warning flags for (almost) everybody.
582     dnl Should probably be configurable
583     WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
584     AC_SUBST(WARNING_CFLAGS)
586     dnl CFLAGS that are used for all native code.  We want to compile
587     dnl everything with unwinder data so that backtrace() will always
588     dnl work.
589     EXTRA_CFLAGS='-fexceptions -fasynchronous-unwind-tables'
590     AC_SUBST(EXTRA_CFLAGS)
592     dnl Strict warning flags which not every module uses.
593     dnl Should probably be configurable.
594     STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
595     AC_SUBST(STRICT_WARNING_CFLAGS)
597     dnl Whether or not to add -Werror, also not used by all modueles.
598     dnl Can be configured by --disable-Werror
599     ERROR_CFLAGS=
600     if test "x${ENABLE_WERROR}" = xyes; then
601        ERROR_CFLAGS='-Werror'
602     fi
603     AC_SUBST(ERROR_CFLAGS)
604   fi
606   dnl Check for libxml and libxslt libraries (when xmlj is enabled).
607   if test "x${COMPILE_XMLJ}" = xyes; then
608     PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
609     PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
610     AC_SUBST(XML_LIBS)
611     AC_SUBST(XML_CFLAGS)
612     AC_SUBST(XSLT_LIBS)
613     AC_SUBST(XSLT_CFLAGS)
614   fi
616   dnl Check for AWT related gthread/gtk
617   if test "x${COMPILE_GTK_PEER}" = xyes; then
618     AC_PATH_XTRA
619     if test "$no_x" = yes; then
620         AC_MSG_ERROR([GTK+ peers requested but no X library available])
621     fi
622     dnl Check if we can link against the XTest library and set
623     dnl HAVE_XTEST accordingly.
624     AC_CHECK_LIB([Xtst], [XTestQueryExtension],
625                  [AC_DEFINE(HAVE_XTEST, 1, [Define to 1 if you have libXtst.])[XTEST_LIBS="$XTEST_LIBS -X11 -lXtst"]],
626                  [true],
627                  [${X_LIBS}])
630     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
631     PKG_CHECK_MODULES(FREETYPE2, freetype2)
632     PKG_CHECK_MODULES(PANGOFT2, pangoft2)
633     PKG_CHECK_MODULES(CAIRO, cairo >= 1.1.8)
634     dnl Check if we can link against the XRender library and set
635     dnl HAVE_XRENDER accordingly.
636     AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
637                  [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
638                  [true],
639                  [${X_LIBS}])
641     dnl Check if we can link against the XRandR library and set
642     dnl HAVE_XRANDR accordingly.
643     AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
644                  [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
645                  [true],
646                  [${X_LIBS}])
648     AC_SUBST(GTK_CFLAGS)
649     AC_SUBST(GTK_LIBS)
650     AC_SUBST(FREETYPE2_LIBS)
651     AC_SUBST(FREETYPE2_CFLAGS)
652     AC_SUBST(PANGOFT2_LIBS)
653     AC_SUBST(PANGOFT2_CFLAGS)
654     AC_SUBST(XTEST_LIBS)
655   fi
657   dnl gconf-peer
658   if  test "x${COMPILE_GCONF_PEER}" = xyes; then
659     PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6.0)
660     AC_SUBST(GCONF_CFLAGS)
661     AC_SUBST(GCONF_LIBS)
662     dnl we also need gdk for locking
663     PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
664     AC_SUBST(GDK_CFLAGS)
665     AC_SUBST(GDK_LIBS)
666     dnl check if the config value was given form the command line,
667     dnl if not, overwrite the default if we have the gconf backend
668     dnl compiled in
669     USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
670     if test "$USE_GCONF_PREFS_PEER" = ""; then
671       DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
672     fi
673   fi
675   dnl gstreamer-peer
676   if  test "x${COMPILE_GSTREAMER_PEER}" = xyes; then
677     GST_MAJORMINOR=0.10
678     GST_REQUIRED=0.10.10
680     dnl gstreamer
681     PKG_CHECK_MODULES(GSTREAMER, gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED)
682     AC_SUBST(GSTREAMER_CFLAGS)
683     AC_SUBST(GSTREAMER_LIBS)
685     dnl gstreamer-base
686     PKG_CHECK_MODULES(GSTREAMER_BASE,
687                       gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED)
688     AC_SUBST(GSTREAMER_BASE_CFLAGS)
689     AC_SUBST(GSTREAMER_BASE_LIBS)
691     dnl gstreamer-plugin-base
692     PKG_CHECK_MODULES(GSTREAMER_PLUGINS_BASE,
693                       gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_REQUIRED)
694     AC_SUBST(GSTREAMER_PLUGINS_BASE_CFLAGS)
695     AC_SUBST(GSTREAMER_PLUGINS_BASE_LIBS)
697         GST_PLUGIN_LDFLAGS='-module -avoid-version -Wno-unused-parameter -no-undefined'
698         AC_SUBST(GST_PLUGIN_LDFLAGS)
700     PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
701     AC_SUBST(GDK_CFLAGS)
702     AC_SUBST(GDK_LIBS)
703         
704         dnl set the gstreamer based file reader, writer and mixer
705         GSTREAMER_FILE_READER=gnu.javax.sound.sampled.gstreamer.io.GstAudioFileReader
706         GSTREAMER_MIXER_PROVIDER=gnu.javax.sound.sampled.gstreamer.GStreamerMixerProvider
707   fi
708   dnl add the gstreamer resources 
709   AC_SUBST(GSTREAMER_FILE_READER)
710   AC_SUBST(GSTREAMER_MIXER_PROVIDER)
712   dnl Check for AWT related Qt4
713   if test "x${COMPILE_QT_PEER}" = xyes; then
714     PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
715     if test "x$HAVE_QT4" = "xyes"; then
716       dnl Check needed because in some cases the QtGui includedir
717       dnl doesn't contain the subsystem dir.
718       QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
719       EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
720       AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
721       AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
722       AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
723         QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
724         AC_MSG_WARN([QWidget not found])))
725         AC_CHECK_PROG(MOC, [moc], [moc])
726         AC_CHECK_PROG(MOC4, [moc-qt4], [moc-qt4])
727         if test x"$MOC4" != x ; then
728           AC_MSG_NOTICE([Using $MOC4 as moc])
729           MOC=$MOC4;
730         fi
731     fi
732     if test "x$HAVE_QT4" = "xno"; then
733       AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
734       case "$host_os" in
735         darwin*)
736           AC_ARG_WITH([qt4dir],
737             [AS_HELP_STRING([--with-qt4dir=DIR],
738             [Qt4 installation directory used for OS-X.
739             For other systems use pkg-config.])],
740             [QT4DIR=$withval]
741             )
742           if test x"$QT4DIR" = x ; then
743             AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
744           fi
745           AC_MSG_RESULT([QT4DIR... $QT4DIR])
746           AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
747           if test x"$MOC" = x; then
748             AC_MSG_ERROR([*** This is not the right Qt installation])
749           fi
750           QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
751           QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
752           QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
753           QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
754           ;;
755         *)
756           AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
757           of your installed Qt4 installation.])
758           ;;
759       esac
760     fi
761     AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
762     AC_SUBST(QT_CFLAGS)
763     AC_SUBST(QT_LIBS)
764   fi
765   dnl **********************************************************************
766   dnl Check for MSG_NOSIGNAL
767   dnl **********************************************************************
768   AC_MSG_CHECKING(for MSG_NOSIGNAL)
769   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = MSG_NOSIGNAL; ]])],[ AC_MSG_RESULT(yes)
770      AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
771                [Define this symbol if you have MSG_NOSIGNAL]) ],[ AC_MSG_RESULT(no)
772   ])
773  dnl **********************************************************************
774  dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
775  dnl **********************************************************************
776  AC_MSG_CHECKING(for SO_NOSIGPIPE )
777  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = SO_NOSIGPIPE; ]])],[ AC_MSG_RESULT(yes)
778     AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
779               [Define this symbol if you have SO_NOSIGPIPE]) ],[ AC_MSG_RESULT(no)
780  ])
781   dnl **********************************************************************
782   dnl Check for MSG_WAITALL
783   dnl **********************************************************************
784   AC_MSG_CHECKING(for MSG_WAITALL)
785   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = MSG_WAITALL; ]])],[ AC_MSG_RESULT(yes)
786      AC_DEFINE(HAVE_MSG_WAITALL, 1,
787                [Define this symbol if you have MSG_WAITALL]) ],[ AC_MSG_RESULT(no)
788   ])
790   dnl Check for plugin support headers and libraries.
791   if test "x${COMPILE_PLUGIN}" = xyes; then
792     PKG_CHECK_MODULES(MOZILLA, mozilla-plugin libxul-unstable, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
793     if test "x${MOZILLA_FOUND}" = xno; then
794       PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
795     fi
796     if test "x${MOZILLA_FOUND}" = xno; then
797       PKG_CHECK_MODULES(MOZILLA, firefox-plugin firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
798     fi
799     if test "x${MOZILLA_FOUND}" = xno; then
800       PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin xulrunner-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
801     fi
802     if test "x${MOZILLA_FOUND}" = xno; then
803       PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin mozilla-firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
804     fi
805     if test "x${MOZILLA_FOUND}" = xno; then
806       PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin seamonkey-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
807     fi
808     if test "x${MOZILLA_FOUND}" = xno; then
809       PKG_CHECK_MODULES(MOZILLA, iceape-plugin iceape-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
810     fi
811     if test "x${MOZILLA_FOUND}" = xno; then
812       AC_MSG_ERROR([Couldn't find plugin support headers and libraries, try --disable-plugin])
813     fi
815     PKG_CHECK_MODULES(GLIB, glib-2.0)
816     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
818     AC_SUBST(MOZILLA_CFLAGS)
819     AC_SUBST(MOZILLA_LIBS)
820     AC_SUBST(GLIB_CFLAGS)
821     AC_SUBST(GLIB_LIBS)
822     AC_SUBST(GTK_CFLAGS)
823     AC_SUBST(GTK_LIBS)
825     AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
826   fi
828   dnl Check for GNU MP library and header file
829   dnl for GNU MP versions >= 4.2 use __gmpz_combit; otherwise look for
830   dnl __gmpz_mul_si for earlier versions (>= 3.1).
831   dnl IMPORTANT: if you decide to look for __gmpz_combit, don't forget to
832   dnl change the name of the corresponding ac_ variable on lines 860...
833   AC_ARG_WITH(gmp, [  --with-gmp=PATH         specify prefix directory for the installed GMP package.
834                           Equivalent to --with-gmp-include=PATH/include
835                           plus --with-gmp-lib=PATH/lib])
836   AC_ARG_WITH(gmp_include, [  --with-gmp-include=PATH specify directory for installed GMP include files])
837   AC_ARG_WITH(gmp_lib, [  --with-gmp-lib=PATH     specify directory for the installed GMP library])
839   if test "x$with_gmp" != x; then
840     gmplibs=-lgmp
841     gmpinc=
842     gmplibs="-L$with_gmp/lib $gmplibs"
843     gmpinc="-I$with_gmp/include $gmpinc"
844     if test "x$with_gmp_include" != x; then
845       gmpinc="-I$with_gmp_include $gmpinc"
846     fi
847     if test "x$with_gmp_lib" != x; then
848       gmplibs="-L$with_gmp_lib $gmplibs"
849     fi
850   else
851     gmplibs="-lgmp"
852     gmpinc="-I/usr/include"
853   fi
855   if test "x${COMPILE_GMP}" = xyes; then
856     AC_MSG_CHECKING([for GMP directories])
857     if test "x$with_gmp" != x; then
858        gmplibs="-L$with_gmp/lib -lgmp"
859        gmpinc="-I$with_gmp/include"
860        if test "x$with_gmp_include" != x; then
861           gmpinc="-I$with_gmp_include $gmpinc"
862        fi
863        if test "x$with_gmp_lib" != x; then
864           gmplibs="-L$with_gmp_lib $gmplibs"
865        fi
866     else
867         with_gmp="/usr"
868         gmplibs="-lgmp"
869         gmpinc="-I/usr/include"
870     fi
871     AC_MSG_RESULT([prefix=$with_gmp, libs=$gmplibs, inc=$gmpinc])
872     AC_CHECK_LIB(gmp, __gmpz_mul_si,
873       [GMP_CFLAGS="$gmpinc"
874        GMP_LIBS="$gmplibs" ],
875       [GMP_CFLAGS=
876        GMP_LIBS= ])
877     AC_SUBST(GMP_CFLAGS)
878     AC_SUBST(GMP_LIBS)
880     AC_CHECK_HEADERS([gmp.h])
881   fi
883 else
884   COMPILE_GMP=no
887 if test "x${REGENERATE_JNI_HEADERS}" = xyes; then
888   CLASSPATH_WITH_JAVAH
891 dnl ----------------------------------------------------------- 
892 dnl Add the include files for the native abstraction layer.
893 dnl Used by AM_CPPFLAGS in the different modules.
894 dnl -----------------------------------------------------------
895 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
896 AC_SUBST(CLASSPATH_INCLUDES)
898 dnl -----------------------------------------------------------
899 if test "x${COMPILE_JNI}" = xyes; then
900   AC_MSG_CHECKING(jni_md.h support)
901   if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
902     AC_MSG_RESULT(yes)
903   else
904     target_cpu=x86
905     target_os=linux-gnu 
906     AC_MSG_WARN(no, using x86-linux-gnu)
907   fi
908   ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
909   ac_dests="include/jni_md.h"
910   while test -n "$ac_sources"; do
911     set $ac_dests; ac_dest=$1; shift; ac_dests=$*
912     set $ac_sources; ac_source=$1; shift; ac_sources=$*
913     ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
914   done
915   AC_CONFIG_LINKS([$ac_config_links_1])
918 CLASSPATH_WITH_CLASSLIB
920 dnl -----------------------------------------------------------
921 dnl Initialize maintainer mode
922 dnl -----------------------------------------------------------
923 AM_MAINTAINER_MODE
925 dnl -----------------------------------------------------------
926 dnl Enable debugging statements at compile time.  By default
927 dnl these statements should be optimized out of the bytecode
928 dnl produced by an optimizing Java compiler and not hinder 
929 dnl performance because debugging is turned off by default.
930 dnl -----------------------------------------------------------
931 AC_ARG_ENABLE([debug],
932               [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
933               [case "${enableval}" in 
934                 yes) 
935                 LIBDEBUG="true"
936                 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled]) 
937                 ;;
938                 no)   LIBDEBUG="false" ;;
939                 *)      AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
940               esac],
941               [LIBDEBUG="false"])
942 AC_SUBST(LIBDEBUG)
944 dnl -----------------------------------------------------------
945 dnl Enable execution of all static initializer loadLibrary() 
946 dnl calls at compile time.  By default most people will not
947 dnl want to disable this, but some VMs (gcj) don't need or want 
948 dnl them.
949 dnl -----------------------------------------------------------
950 AC_ARG_ENABLE([load-library],
951               [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
952               [case "${enableval}" in 
953                 yes) INIT_LOAD_LIBRARY="true" ;;
954                 no) INIT_LOAD_LIBRARY="false" ;;
955                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
956               esac],
957               [INIT_LOAD_LIBRARY="true"])
958 AC_SUBST(INIT_LOAD_LIBRARY)
961 dnl -----------------------------------------------------------
962 dnl Specify the jar file containing the Eclipse Java Compiler.  If
963 dnl this option is not specified then the com.sun.tools.javac
964 dnl implementation will not be included in tools.zip.
965 dnl -----------------------------------------------------------
966 dnl GCJ LOCAL: default to $multi_basedir/ecj.jar
967 dnl In the default case where $multi_basedir/ecj.jar is found
968 dnl $(jardir)/ecj.jar will not expand properly in GNU Classpath's
969 dnl gnu/classpath/Configuration.java.  That is OK though since libjava's
970 dnl gnu/classpath/Configuration.java overrides GNU Classpath's and
971 dnl ECJ_JAR_FILE will be properly expanded in libjava's
972 dnl gnu/classpath/natConfiguration.cc.
973 AC_ARG_WITH([ecj-jar],
974             [AS_HELP_STRING([--with-ecj-jar=ABS.PATH],
975             [specify jar file containing the Eclipse Java Compiler])],
976             [ECJ_JAR=$withval],
977             [if test -f $multi_basedir/ecj.jar; then
978                ECJ_JAR='$(jardir)/ecj.jar'
979              fi])
980 AC_SUBST(ECJ_JAR)
982 dnl -----------------------------------------------------------
983 dnl Should the VM explicitly run class initialization subfunctions for
984 dnl java.lang.System?   (default is false -- the subfunctions will be run 
985 dnl automatically by the class initializer)
986 dnl -----------------------------------------------------------
987 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
988               [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
989               [case "${enableval}" in 
990                 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
991                 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
992                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
993               esac],
994               [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
995 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
998 dnl -----------------------------------------------------------
999 dnl avoiding automake complaints
1000 dnl -----------------------------------------------------------
1001 REMOVE=""
1002 AC_SUBST(REMOVE)
1004 dnl -----------------------------------------------------------
1005 dnl This is probably useless.
1006 dnl -----------------------------------------------------------
1007 AC_PATH_PROG(MKDIR, mkdir)
1008 AC_PATH_PROG(CP, cp)
1009 AC_PATH_PROG(DATE, date)
1011 dnl -----------------------------------------------------------
1012 dnl According to the GNU coding guide, we shouldn't require find, 
1013 dnl and zip, however GNU provides both so it should be okay 
1014 dnl -----------------------------------------------------------
1015 AC_PATH_PROG(FIND, find)
1017 dnl -----------------------------------------------------------
1018 dnl Specify what to install (install only glibj.zip by default)
1019 dnl -----------------------------------------------------------
1020 CLASSPATH_WITH_GLIBJ
1022 dnl -----------------------------------------------------------
1023 dnl Enable API documentation generation (disabled by default)
1024 dnl -----------------------------------------------------------
1025 CLASSPATH_WITH_GJDOC
1027 dnl -----------------------------------------------------------
1028 dnl Whether to use jay to regenerate parsers.
1029 dnl -----------------------------------------------------------
1030 REGEN_WITH_JAY
1032 dnl -----------------------------------------------------------
1033 dnl This sets the build-time default, which can now be overridden 
1034 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
1035 dnl to "true" or "false".
1036 dnl -----------------------------------------------------------
1037 AC_ARG_ENABLE([portable-native-sync],
1038               [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
1039               [case "${enableval}" in 
1040                 yes) 
1041                      AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
1042                      ;;
1043                 no)  ;;
1044                 *)   
1045                      AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync) 
1046                      ;;
1047               esac],
1048               [])
1050 AX_CREATE_STDINT_H([include/config-int.h])
1052 dnl -----------------------------------------------------------------------
1053 dnl                    Support for using a prebuilt class library
1054 dnl -----------------------------------------------------------------------
1055 AC_ARG_WITH([glibj_zip],
1056             AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
1057                            [use prebuilt glibj.zip class library]))
1059 case "$with_glibj_zip" in
1061         use_glibj_zip=false
1062         ;;
1063 "no" )
1064         use_glibj_zip=false
1065         ;;
1066 "yes")
1067         AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
1068         ;;
1070         use_glibj_zip=true
1071         PATH_TO_GLIBJ_ZIP=$with_glibj_zip
1072         ;;
1073 esac;
1075 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
1076 AC_SUBST(PATH_TO_GLIBJ_ZIP)
1078 if test "x${TOOLSDIR}" != x; then
1079   dnl GCJ LOCAL
1080   if test "x${COMPILE_WRAPPERS}" = xno && test "x${enable_java_maintainer_mode}" = xyes; then
1081     AC_PROG_JAVA_WORKS
1082   fi
1083   dnl END GCJ LOCAL
1084   if test "x${COMPILE_GJDOC}" = xyes; then
1085     AC_LIB_ANTLR
1086     dnl GCJ LOCAL
1087     if test "x${REGENERATE_GJDOC_PARSER}" = xyes && test "x${enable_java_maintainer_mode}" = xyes; then
1088     dnl END GCJ LOCAL
1089         AC_PROG_ANTLR(2,7,1)
1090     fi
1091   fi
1095 # Check for javac if we need to build either the class library,
1096 # the examples or the tools
1097 if test "x${use_glibj_zip}" = xfalse || \
1098    test "x${EXAMPLESDIR}" != x || \
1099    test "x${TOOLSDIR}" != x && \
1100    test "x${build_class_files}" != xno && \
1101    test "${enable_java_maintainer_mode}" = yes; then dnl GCJ_LOCAL
1102         AC_PROG_JAVAC_WORKS
1103         CLASSPATH_JAVAC_MEM_CHECK
1104 else
1105    AM_CONDITIONAL(GCJ_JAVAC, false)
1108 dnl -----------------------------------------------------------
1109 dnl Build with Escher based X peers.
1110 dnl -----------------------------------------------------------
1111 AC_ARG_WITH([escher],
1112          AS_HELP_STRING([--with-escher=ABS.PATH],
1113                         [specify path to escher dir or JAR for X peers]))
1114 case "$with_escher" in
1116         use_escher=false
1117         ;;
1118 "no")
1119         use_escher=false
1120         ;;
1121 "yes")
1122         AC_MSG_ERROR([Please supply an absolute path to Escher library])
1123         ;;
1125         use_escher=true
1126         PATH_TO_ESCHER=$with_escher
1127         ;;
1128 esac
1130 AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
1131 AC_SUBST(PATH_TO_ESCHER)
1133 dnl -----------------------------------------------------------
1134 dnl Check if local socket support should be included.
1135 dnl -----------------------------------------------------------
1136 AC_ARG_ENABLE([local-sockets],
1137               [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
1138               [case "${enableval}" in
1139                 yes)
1140                   ENABLE_LOCAL_SOCKETS=yes
1141                   ;;
1142                 *)
1143                   ENABLE_LOCAL_SOCKETS=no
1144                   ;;
1145                esac],
1146               [])
1147 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
1148 then
1149   AC_CHECK_HEADER([sys/un.h])
1150   AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
1151                  AC_MSG_ERROR([networking support not available]))
1152   AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
1154 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
1156 dnl -----------------------------------------------------------
1157 dnl Add the default preference peer
1158 dnl -----------------------------------------------------------
1159 AC_SUBST(DEFAULT_PREFS_PEER)
1161 dnl -----------------------------------------------------------
1162 dnl Set GNU MP related params
1163 dnl -----------------------------------------------------------
1164 WANT_NATIVE_BIG_INTEGER=false
1165 if test "x${COMPILE_GMP}" = xyes; then
1166   if test "x${ac_cv_lib_gmp___gmpz_mul_si}" = xyes; then
1167     if test "x${ac_cv_header_gmp_h}" = xyes; then
1168       WANT_NATIVE_BIG_INTEGER=true
1169       AC_DEFINE(WITH_GNU_MP, 1, [Define to 1 if gmp is usable])
1170     else
1171       COMPILE_GMP=no
1172     fi
1173   else
1174     COMPILE_GMP=no
1175   fi
1177 AC_SUBST(WANT_NATIVE_BIG_INTEGER)
1178 AM_CONDITIONAL(CREATE_GMPBI_LIBRARY, test "x${COMPILE_GMP}" = xyes)
1180 dnl -----------------------------------------------------------
1181 dnl output files
1182 dnl -----------------------------------------------------------
1183 AC_CONFIG_FILES([Makefile
1184 doc/Makefile
1185 doc/api/Makefile
1186 external/Makefile
1187 external/sax/Makefile
1188 external/w3c_dom/Makefile
1189 external/relaxngDatatype/Makefile
1190 external/jsr166/Makefile
1191 gnu/classpath/Configuration.java
1192 gnu/java/security/Configuration.java
1193 include/Makefile
1194 native/Makefile
1195 native/fdlibm/Makefile
1196 native/jawt/Makefile
1197 native/jni/Makefile
1198 native/jni/classpath/Makefile
1199 native/jni/java-io/Makefile
1200 native/jni/java-lang/Makefile
1201 native/jni/java-math/Makefile
1202 native/jni/java-net/Makefile
1203 native/jni/java-nio/Makefile
1204 native/jni/java-util/Makefile
1205 native/jni/gtk-peer/Makefile
1206 native/jni/gconf-peer/Makefile
1207 native/jni/gstreamer-peer/Makefile
1208 native/jni/qt-peer/Makefile
1209 native/jni/xmlj/Makefile
1210 native/jni/midi-alsa/Makefile
1211 native/jni/midi-dssi/Makefile
1212 native/jni/native-lib/Makefile
1213 native/plugin/Makefile
1214 resource/Makefile
1215 resource/META-INF/services/java.util.prefs.PreferencesFactory
1216 resource/META-INF/services/javax.sound.sampled.spi.AudioFileReader
1217 resource/META-INF/services/javax.sound.sampled.spi.MixerProvider
1218 scripts/Makefile
1219 scripts/classpath.spec
1220 lib/Makefile
1221 lib/gen-classlist.sh
1222 lib/copy-vmresources.sh
1223 scripts/check_jni_methods.sh
1224 tools/Makefile
1225 examples/Makefile
1226 examples/Makefile.jawt
1227 examples/Makefile.java2d])
1229 CLASSPATH_COND_IF([CREATE_WRAPPERS], [test "x${COMPILE_WRAPPERS}" = xyes], [],
1230 [AC_CONFIG_FILES([tools/gappletviewer
1231 tools/gjarsigner
1232 tools/gkeytool
1233 tools/gjar
1234 tools/gnative2ascii
1235 tools/gserialver
1236 tools/grmiregistry
1237 tools/gtnameserv
1238 tools/gorbd
1239 tools/grmid
1240 tools/grmic
1241 tools/gjavah])
1243 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
1244 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
1245 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
1246 AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
1247 AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
1248 AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
1249 AC_CONFIG_COMMANDS([grmiregistry],[chmod 755 tools/grmiregistry])
1250 AC_CONFIG_COMMANDS([gtnameserv],[chmod 755 tools/gtnameserv])
1251 AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
1252 AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
1253 AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
1254 AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
1257 if test "x${COMPILE_GJDOC}" = xyes
1258 then
1259 AC_CONFIG_FILES([tools/gjdoc])
1260 AC_CONFIG_COMMANDS([gjdoc], [chmod 755 tools/gjdoc])
1263 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
1264 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
1265 AC_OUTPUT
1267 # Create standard.omit based on decisions we just made.
1268 cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
1269 if test x$use_escher != xtrue; then
1270    echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit
1273 if test "x${COMPILE_PLUGIN}" = "xyes" ; then
1274   AC_MSG_WARN([You have enabled the browser plugin.  Please note that this is no longer maintained as part of GNU Classpath; development has moved to the IcedTea project.])