Merge with trank @ 137446
[official-gcc.git] / libjava / classpath / configure.ac
bloba14d2c128c378749695dffc2b0e3587d50eb2094
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)
12 dnl GCJ LOCAL
13 AC_CONFIG_AUX_DIR(../..)
14 dnl END GCJ LOCAL
16 AC_CANONICAL_TARGET
18 dnl GCJ LOCAL
19 AC_ARG_ENABLE(java-maintainer-mode,
20         AS_HELP_STRING([--enable-java-maintainer-mode],
21         [allow rebuilding of .class and .h files]))
22 AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
23 dnl END GCJ LOCAL
25 dnl GCJ LOCAL
26 # We would like to our source tree to be readonly.  However when releases or
27 # pre-releases are generated, the man pages need to be included as they are
28 # converted from the texi files via perl which we don't require end users to
29 # have installed.
30 # Therefore we have --enable-generated-files-in-srcdir to do just that.
32 AC_MSG_CHECKING([whether to place generated files in the source directory])
33   dnl generated-files-in-srcdir is disabled by default
34   AC_ARG_ENABLE(generated-files-in-srcdir, 
35 [  --enable-generated-files-in-srcdir
36                           put copies of generated files in source dir
37                           intended for creating source tarballs for users
38                           without texinfo, perl, bison or flex.],
39       generated_files_in_srcdir=$enableval,
40       generated_files_in_srcdir=no)
42 AC_MSG_RESULT($generated_files_in_srcdir)
43 AM_CONDITIONAL(GENINSRC, test x$generated_files_in_srcdir = xyes)
44 dnl END GCJ LOCAL
46 # Find the rest of the source tree framework.
47 AM_ENABLE_MULTILIB(, ../..)
49 dnl -----------------------------------------------------------
50 dnl Fold all IA-32 CPU architectures into "x86"
51 dnl -----------------------------------------------------------
52 if expr ${target_cpu} : '.*86' > /dev/null; then target_cpu=x86; fi
54 dnl -----------------------------------------------------------
55 dnl We will not track/change lib version until we reach version 1.0
56 dnl at which time we'll have to be more anal about such things
57 dnl -----------------------------------------------------------
58 AC_SUBST(LIBVERSION, "0:0:0")
59 case "$host_os" in
60      darwin*)
61         cp_module=""
62         ;;
63         *)
64         cp_module="-module"
65         ;;
66 esac
68 CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
69 AC_SUBST(CLASSPATH_MODULE)
71 CLASSPATH_CONVENIENCE="-no-undefined"
72 AC_SUBST(CLASSPATH_CONVENIENCE)
74 AC_PREREQ(2.59)
75 AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar -Wno-portability])
76 AC_CONFIG_HEADERS([include/config.h])
77 AC_PREFIX_DEFAULT(/usr/local/classpath)
79 dnl GCC LOCAL
80 GCC_NO_EXECUTABLES
82 dnl -----------------------------------------------------------
83 dnl Enable collections.jar (disabled by default)
84 dnl -----------------------------------------------------------
85 AC_ARG_ENABLE([collections],
86               [AS_HELP_STRING(--enable-collections,create collections.jar [default=no])],
87               [case x"${enableval}" in
88                 xyes) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
89                 xno) COMPILE_COLLECTIONS=no ;;
90                 x) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
91                 *) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"${enableval}\"" ;;
92               esac],
93               [COMPILE_COLLECTIONS=no])
94 AM_CONDITIONAL(CREATE_COLLECTIONS, test "x${COMPILE_COLLECTIONS}" = xyes)
96 dnl -----------------------------------------------------------
97 dnl Enable JNI libraries (enabled by default)
98 dnl -----------------------------------------------------------
99 AC_ARG_ENABLE([jni],
100               [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
101               [case "${enableval}" in 
102                 yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
103                 no) COMPILE_JNI=no ;;
104                 *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
105               esac],
106               [COMPILE_JNI=yes])
107 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
109 dnl -----------------------------------------------------------
110 dnl Enable core JNI libraries (enabled by default)
111 dnl -----------------------------------------------------------
112 AC_ARG_ENABLE([core-jni],
113               [AS_HELP_STRING(--enable-core-jni,
114                               compile JNI sources for core [default=yes])],
115               [case "${enableval}" in 
116                 yes) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
117                 no) COMPILE_CORE_JNI=no ;;
118                 *) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
119               esac],
120               [COMPILE_CORE_JNI=yes])
121 AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
123 dnl -----------------------------------------------------------
124 dnl Default Preference Backend
125 dnl -----------------------------------------------------------
126 AC_ARG_ENABLE([default-preferences-peer],
127               [AS_HELP_STRING([--enable-default-preferences-peer@<:@=peer type or class name@:>@],
128                               [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])],
129               [case "${enableval}" in 
130                 file) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory  ;;
131                 gconf|yes|true) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory  ;;
132                 memory) DEFAULT_PREFS_PEER=gnu.java.util.prefs.MemoryBasedFactory  ;;
133                 no|false) AC_MSG_ERROR(bad value '${enableval}' for --enable-default-preferences-peer) ;;
134                 *) DEFAULT_PREFS_PEER=${enableval} ;;
135               esac],
136               [DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory])
137 dnl AC_SUBST(DEFAULT_PREFS_PEER)
139 dnl -----------------------------------------------------------
140 dnl GConf native peer (enabled by default)
141 dnl -----------------------------------------------------------
142 AC_ARG_ENABLE([gconf-peer],
143               [AS_HELP_STRING(--disable-gconf-peer,compile GConf native peers (disabled by --disable-jni) [default=yes])],
144               [case "${enableval}" in
145                 yes) COMPILE_GCONF_PEER=yes ;;
146                 no) COMPILE_GCONF_PEER=no ;;
147                 *) COMPILE_GCONF_PEER=yes ;;
148               esac],
149               [COMPILE_GCONF_PEER=yes])
150 AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
152 dnl -----------------------------------------------------------
153 dnl GConf native peer error checking
154 dnl -----------------------------------------------------------
155 AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
157 dnl ------------------------------------------------------------
158 dnl GStreamer based sound provider backend (disabled by default)
159 dnl ------------------------------------------------------------
160 AC_ARG_ENABLE([gstreamer-peer],
161               [AS_HELP_STRING(--enable-gstreamer-peer,compile GStreamer native peers (disabled by --disable-jni) [default=no])],
162               [case "${enableval}" in
163                 yes) COMPILE_GSTREAMER_PEER=yes ;;
164                 no) COMPILE_GSTREAMER_PEER=no ;;
165                 *) COMPILE_GSTREAMER_PEER=default ;;
166               esac],
167               [COMPILE_GSTREAMER_PEER=default])
168 AM_CONDITIONAL(CREATE_GSTREAMER_PEER_LIBRARIES, test "x${COMPILE_GSTREAMER_PEER}" = xyes)
170 dnl -----------------------------------------------------------
171 dnl GStreamer native peer error checking
172 dnl -----------------------------------------------------------
173 AC_ARG_ENABLE([gstreamer-peers],,AC_MSG_ERROR([No --enable-gstreamer-peers (or --disable-gstreamer-peers) option; you want --enable-gstreamer-peer]))
175 dnl ------------------------------------------------------------
176 dnl Whether to compile with -Werror or not (disabled by default)
177 dnl ------------------------------------------------------------
178 AC_ARG_ENABLE([Werror],
179               [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
180               [case "${enableval}" in
181                 yes) ENABLE_WERROR=yes ;;
182                 no) ENABLE_WERROR=no ;;
183                 *) ENABLE_WERROR=default ;;
184               esac],
185               [ENABLE_WERROR=default])
187 dnl -----------------------------------------------------------
188 dnl Default AWT toolkit
189 dnl -----------------------------------------------------------
190 AC_ARG_ENABLE(default-toolkit,
191   AS_HELP_STRING([--enable-default-toolkit],
192                  [fully qualified class name of default AWT toolkit]))
193 default_toolkit=$enable_default_toolkit
194 if test "$default_toolkit" = ""; then
195    default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
197 AC_SUBST(default_toolkit)
199 dnl -----------------------------------------------------------
200 dnl Native libxml/xslt library (disabled by default)
201 dnl -----------------------------------------------------------
202 AC_ARG_ENABLE([xmlj],
203               [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
204               [case "${enableval}" in
205                 yes) COMPILE_XMLJ=yes ;;
206                 no) COMPILE_XMLJ=no ;;
207                 *) COMPILE_XMLJ=no ;;
208               esac],
209               [COMPILE_XMLJ=no])
210 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
212 dnl -----------------------------------------------------------
213 dnl ALSA code (enabled by default)
214 dnl -----------------------------------------------------------
215 AC_ARG_ENABLE([alsa],
216               [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
217               [case "${enableval}" in
218                 yes) COMPILE_ALSA=yes ;;
219                 no) COMPILE_ALSA=no ;;
220                 *) COMPILE_ALSA=yes ;;
221               esac],
222               [AC_CHECK_HEADERS([alsa/asoundlib.h],
223                                 [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
224                                 COMPILE_ALSA=no)])
225 AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
227 dnl -----------------------------------------------------------
228 dnl DSSI code (enabled by default)
229 dnl -----------------------------------------------------------
230 AC_ARG_ENABLE([dssi],
231               [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
232               [case "${enableval}" in
233                 yes) COMPILE_DSSI=yes ;;
234                 no) COMPILE_DSSI=no ;;
235                 *) COMPILE_DSSI=yes ;;
236               esac],
237               [COMPILE_DSSI=no
238                AC_CHECK_HEADERS([dssi.h], [
239                  AC_CHECK_HEADERS([jack/jack.h],COMPILE_DSSI=yes)])])
240 AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
242 dnl -----------------------------------------------------------
243 dnl GTK native peer (enabled by default)
244 dnl -----------------------------------------------------------
245 AC_ARG_ENABLE([gtk-peer],
246               [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
247               [case "${enableval}" in
248                 yes) COMPILE_GTK_PEER=yes ;;
249                 no) COMPILE_GTK_PEER=no ;;
250                 *) COMPILE_GTK_PEER=yes ;;
251               esac],
252               [COMPILE_GTK_PEER=yes])
253 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
255 dnl -----------------------------------------------------------
256 dnl GTK native peer error checking 
257 dnl -----------------------------------------------------------
258 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
260 dnl -----------------------------------------------------------
261 dnl Qt native peer (disabled by default)
262 dnl -----------------------------------------------------------
263 AC_ARG_ENABLE([qt-peer],
264               [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
265               [case "${enableval}" in
266                 yes) COMPILE_QT_PEER=yes ;;
267                 no) COMPILE_QT_PEER=no ;;
268                 *) COMPILE_QT_PEER=yes ;;
269               esac],
270               [COMPILE_QT_PEER=no])
271 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
273 dnl -----------------------------------------------------------
274 dnl Plugin (enabled by default)
275 dnl -----------------------------------------------------------
276 AC_ARG_ENABLE([plugin],
277               [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
278               [case "${enableval}" in
279                 yes) COMPILE_PLUGIN=yes ;;
280                 no) COMPILE_PLUGIN=no ;;
281                 *) COMPILE_PLUGIN=yes ;;
282               esac],
283               [COMPILE_PLUGIN=yes])
284 AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
286 dnl -----------------------------------------------------------
287 dnl GCJ LOCAL: Calculates and substitutes toolexeclibdir.  $libdir is
288 dnl defined to the same value for all multilibs.  We define toolexeclibdir
289 dnl so that we can refer to the multilib installation directories from
290 dnl classpath's build files.
291 dnl -----------------------------------------------------------
292 CLASSPATH_TOOLEXECLIBDIR
294 dnl -----------------------------------------------------------
295 dnl Sets the native libraries installation dir
296 dnl -----------------------------------------------------------
297 dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}-${libgcj_soversion}
298 AC_ARG_WITH([native-libdir],
299             [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
300             [
301              nativeexeclibdir=${withval}
302             ],
303             [
304              nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`-`awk -F: '/^[[^#]].*:/ { print $1 }' ${srcdir}/../libtool-version`
305             ])
307 AC_SUBST(nativeexeclibdir)
309 dnl -----------------------------------------------------------
310 dnl Sets the Java library installation dir.
311 dnl -----------------------------------------------------------
312 AC_ARG_WITH([glibj-dir],
313             [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
314             [
315              glibjdir=${withval}
316             ],
317             [
318              glibjdir='${datadir}/${PACKAGE}'
319             ])
321 AC_SUBST(glibjdir)
323 dnl -----------------------------------------------------------
324 dnl Sets the VM name for use in tool wrapper scripts
325 dnl -----------------------------------------------------------
326 AC_ARG_WITH([vm],
327             [AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
328             [
329              VM_BINARY=${withval}
330             ],
331             [
332              VM_BINARY='${prefix}/bin/jamvm'
333             ])
335 AC_SUBST(VM_BINARY)
337 dnl -----------------------------------------------------------
338 dnl Regenerate headers at build time (disabled by default)
339 dnl -----------------------------------------------------------
340 AC_ARG_ENABLE([regen-headers],
341               [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=yes if headers don't exist])],
342               [case "${enableval}" in
343                 yes) REGENERATE_JNI_HEADERS=yes ;;
344                 no) REGENERATE_JNI_HEADERS=no ;;
345                 *) REGENERATE_JNI_HEADERS=yes ;;
346               esac],
347               [if test -e include/java_lang_VMSystem.h; then
348                         REGENERATE_JNI_HEADERS=no ;
349                    else
350                         REGENERATE_JNI_HEADERS=yes ;
351                fi])
352 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
354 dnl -----------------------------------------------------------
355 dnl Enable tool wrapper binaries (disabled by default)
356 dnl -----------------------------------------------------------
357 AC_ARG_ENABLE([tool-wrappers],
358               [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
359               [case x"${enableval}" in
360                 xyes)
361                   COMPILE_WRAPPERS=yes;
362                   AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
363                   AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
364                   ;;
365                 xno) COMPILE_WRAPPERS=no ;;
366                 x) COMPILE_WRAPPERS=yes ;;
367                 *) COMPILE_WRAPPERS=yes ;;
368               esac],
369               [COMPILE_WRAPPERS=no])
370 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
372 AC_PROG_LN_S
373 AC_PROG_INSTALL
375 dnl -----------------------------------------------------------
376 dnl Checks for programs.
377 dnl -----------------------------------------------------------
379 dnl Initialize libtool
380 AC_DISABLE_STATIC
381 AC_PROG_LIBTOOL
382 AC_PROG_AWK
383 AC_PROG_CC
384 AM_PROG_CC_C_O
385 AC_PROG_CPP
386 AC_PROG_CXX
388 # Handle -Werror default case.
389 if test "$ENABLE_WERROR" = default; then
390   case "$host_os" in
391     *linux*)
392       if test "$GCC" = yes; then
393         ENABLE_WERROR=yes
394       fi
395       ;;
396   esac
399 if test "x${COMPILE_COLLECTIONS}" = xyes; then
400   AC_PATH_PROG(PERL, [perl])
401   AC_SUBST(PERL)
402   AC_SUBST(COLLECTIONS_PREFIX)
403   AC_CONFIG_FILES([lib/mkcollections.pl])
404   AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
407 if test "x${COMPILE_JNI}" = xyes; then
408   GCC_ATTRIBUTE_UNUSED
410   AC_HEADER_STDC
412   dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64, 
413   dnl at least. 
414   AC_COMPILE_CHECK_SIZEOF(void *)
416   dnl Checking for endianess.
417   AC_C_BIGENDIAN_CROSS
418   
419   dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
420   dnl On that system, sys/ioctl.h will not include sys/filio.h unless
421   dnl BSD_COMP is defined; just including sys/filio.h is simpler.
422   dnl Check for crt_externs.h on Darwin.
423   dnl Check for netinet/in_systm.h, netinet/ip.h and net/if.h for Windows CE.
424   dnl Check for sys/loadavg.h for getloadavg() on Solaris 9.
425   AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
426                     asm/ioctls.h \
427                     inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
428                     sys/time.h \
429                     sys/select.h \
430                     crt_externs.h \
431                     fcntl.h \
432                     sys/mman.h \
433                     magic.h \
434                     sys/event.h sys/epoll.h \
435                     ifaddrs.h \
436                     netinet/in_systm.h netinet/ip.h net/if.h \
437                     sys/loadavg.h])
439   AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
440   AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
441   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]))
442   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]))
444   AC_SEARCH_LIBS([inet_pton],[nsl]) 
445   AC_CHECK_FUNCS([ftruncate fsync select \
446                   gethostname socket strerror fork pipe execve open close \
447                   lseek fstat read readv write writev htonl memset htons connect \
448                   getsockname getpeername bind listen accept \
449                   recvfrom send sendto setsockopt getsockopt time mktime \
450                   gethostbyname_r localtime_r \
451                   strerror_r \
452                   fcntl \
453                   statvfs \  
454                   mmap munmap mincore msync madvise getpagesize sysconf \
455                   lstat readlink \
456                   inet_aton inet_addr inet_pton \
457                   getifaddrs kqueue kevent epoll_create \
458                   getloadavg])
460   LIBMAGIC=
461   AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
462   AC_SUBST(LIBMAGIC)
464   AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
465   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
466                     [AC_DEFINE(HAVE_INET6, 1,
467                      [Define if inet6 structures are defined in netinet/in.h.])
468                      AC_MSG_RESULT(yes)],
469                     [AC_MSG_RESULT(no)])
471   AC_HEADER_TIME
472   AC_STRUCT_TM
473   AC_STRUCT_TIMEZONE
475   AC_MSG_CHECKING([for tm_gmtoff in struct tm])
476   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
477   [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
478    AC_MSG_RESULT(yes)],
479   [AC_MSG_RESULT(no)
480    AC_MSG_CHECKING([for global timezone variable])
481    dnl FIXME: we don't want a link check here because that won't work
482    dnl when cross-compiling.  So instead we make an assumption that
483    dnl the header file will mention timezone if it exists.
484    dnl Don't find the win32 function timezone
485    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
486      [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
487       AC_MSG_RESULT(yes)],
488      [AC_MSG_RESULT(no)
489        AC_MSG_CHECKING([for global _timezone variable])
490        dnl FIXME: As above, don't want link check
491        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
492          [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
493             [Define if your platform has the global _timezone variable.])
494           AC_MSG_RESULT(yes)],
495           [AC_MSG_RESULT(no)])])])
497   AC_C_CONST
498   AC_C_INLINE
499   AC_C_ATTRIBUTE
500   AX_FUNC_WHICH_GETHOSTBYNAME_R
502   dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
503   AM_ICONV
505   dnl When using gcc we want warnings, lots of warnings :-)
506   if test "x${GCC}" = xyes; then
507     dnl We want ISO C90 ansi, but with longlong (jlong) support
508     dnl and modern POSIX and BSD C library functions/prototypes.
510     dnl Warning flags for (almost) everybody.
511     dnl Should probably be configurable
512     WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
513     AC_SUBST(WARNING_CFLAGS)
515     dnl CFLAGS that are used for all native code.  We want to compile
516     dnl everything with unwinder data so that backtrace() will always
517     dnl work.
518     EXTRA_CFLAGS='-fexceptions -fasynchronous-unwind-tables'
519     AC_SUBST(EXTRA_CFLAGS)
521     dnl Strict warning flags which not every module uses.
522     dnl Should probably be configurable.
523     STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
524     AC_SUBST(STRICT_WARNING_CFLAGS)
526     dnl Whether or not to add -Werror, also not used by all modueles.
527     dnl Can be configured by --disable-Werror
528     ERROR_CFLAGS=
529     if test "x${ENABLE_WERROR}" = xyes; then
530        ERROR_CFLAGS='-Werror'
531     fi
532     AC_SUBST(ERROR_CFLAGS)
533   fi
535   dnl Check for libxml and libxslt libraries (when xmlj is enabled).
536   if test "x${COMPILE_XMLJ}" = xyes; then
537     PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
538     PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
539     AC_SUBST(XML_LIBS)
540     AC_SUBST(XML_CFLAGS)
541     AC_SUBST(XSLT_LIBS)
542     AC_SUBST(XSLT_CFLAGS)
543   fi
545   dnl Check for AWT related gthread/gtk
546   if test "x${COMPILE_GTK_PEER}" = xyes; then
547     AC_PATH_XTRA
548     if test "$no_x" = yes; then
549         AC_MSG_ERROR([GTK+ peers requested but no X library available])
550     fi
551     dnl Check if we can link against the XTest library and set
552     dnl HAVE_XTEST accordingly.
553     AC_CHECK_LIB([Xtst], [XTestQueryExtension],
554                  [AC_DEFINE(HAVE_XTEST, 1, [Define to 1 if you have libXtst.])[XTEST_LIBS="$XTEST_LIBS -X11 -lXtst"]],
555                  [true],
556                  [${X_LIBS}])
559     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
560     PKG_CHECK_MODULES(FREETYPE2, freetype2)
561     PKG_CHECK_MODULES(PANGOFT2, pangoft2)
562     PKG_CHECK_MODULES(CAIRO, cairo >= 1.1.8)
563     dnl Check if we can link against the XRender library and set
564     dnl HAVE_XRENDER accordingly.
565     AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
566                  [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
567                  [true],
568                  [${X_LIBS}])
570     dnl Check if we can link against the XRandR library and set
571     dnl HAVE_XRANDR accordingly.
572     AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
573                  [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
574                  [true],
575                  [${X_LIBS}])
577     AC_SUBST(GTK_CFLAGS)
578     AC_SUBST(GTK_LIBS)
579     AC_SUBST(FREETYPE2_LIBS)
580     AC_SUBST(FREETYPE2_CFLAGS)
581     AC_SUBST(PANGOFT2_LIBS)
582     AC_SUBST(PANGOFT2_CFLAGS)
583     AC_SUBST(XTEST_LIBS)
584   fi
586   dnl gconf-peer
587   if  test "x${COMPILE_GCONF_PEER}" = xyes; then
588     PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6.0)
589     AC_SUBST(GCONF_CFLAGS)
590     AC_SUBST(GCONF_LIBS)
591     dnl we also need gdk for locking
592     PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
593     AC_SUBST(GDK_CFLAGS)
594     AC_SUBST(GDK_LIBS)
595     dnl check if the config value was given form the command line,
596     dnl if not, overwrite the default if we have the gconf backend
597     dnl compiled in
598     USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
599     if test "$USE_GCONF_PREFS_PEER" = ""; then
600       DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
601     fi
602   fi
604   dnl gstreamer-peer
605   if  test "x${COMPILE_GSTREAMER_PEER}" = xyes; then
606     GST_MAJORMINOR=0.10
607     GST_REQUIRED=0.10.10
609     dnl gstreamer
610     PKG_CHECK_MODULES(GSTREAMER, gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED)
611     AC_SUBST(GSTREAMER_CFLAGS)
612     AC_SUBST(GSTREAMER_LIBS)
614     dnl gstreamer-base
615     PKG_CHECK_MODULES(GSTREAMER_BASE,
616                       gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED)
617     AC_SUBST(GSTREAMER_BASE_CFLAGS)
618     AC_SUBST(GSTREAMER_BASE_LIBS)
620     dnl gstreamer-plugin-base
621     PKG_CHECK_MODULES(GSTREAMER_PLUGINS_BASE,
622                       gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_REQUIRED)
623     AC_SUBST(GSTREAMER_PLUGINS_BASE_CFLAGS)
624     AC_SUBST(GSTREAMER_PLUGINS_BASE_LIBS)
626         GST_PLUGIN_LDFLAGS='-module -avoid-version -Wno-unused-parameter -no-undefined'
627         AC_SUBST(GST_PLUGIN_LDFLAGS)
629     PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
630     AC_SUBST(GDK_CFLAGS)
631     AC_SUBST(GDK_LIBS)
632         
633         dnl set the gstreamer based file reader, writer and mixer
634         GSTREAMER_FILE_READER=gnu.javax.sound.sampled.gstreamer.io.GstAudioFileReader
635         GSTREAMER_MIXER_PROVIDER=gnu.javax.sound.sampled.gstreamer.GStreamerMixerProvider
636   fi
637   dnl add the gstreamer resources 
638   AC_SUBST(GSTREAMER_FILE_READER)
639   AC_SUBST(GSTREAMER_MIXER_PROVIDER)
641   dnl Check for AWT related Qt4
642   if test "x${COMPILE_QT_PEER}" = xyes; then
643     PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
644     if test "x$HAVE_QT4" = "xyes"; then
645       dnl Check needed because in some cases the QtGui includedir
646       dnl doesn't contain the subsystem dir.
647       QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
648       EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
649       AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
650       AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
651       AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
652         QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
653         AC_MSG_WARN([QWidget not found])))
654         AC_CHECK_PROG(MOC, [moc], [moc])
655         AC_CHECK_PROG(MOC, [moc-qt4], [moc-qt4])
656     fi
657     if test "x$HAVE_QT4" = "xno"; then
658       AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
659       case "$host_os" in
660         darwin*)
661           AC_ARG_WITH([qt4dir],
662             [AS_HELP_STRING([--with-qt4dir=DIR],
663             [Qt4 installation directory used for OS-X.
664             For other systems use pkg-config.])],
665             [QT4DIR=$withval]
666             )
667           if test x"$QT4DIR" = x ; then
668             AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
669           fi
670           AC_MSG_RESULT([QT4DIR... $QT4DIR])
671           AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
672           if test x"$MOC" = x; then
673             AC_MSG_ERROR([*** This is not the right Qt installation])
674           fi
675           QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
676           QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
677           QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
678           QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
679           ;;
680         *)
681           AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
682           of your installed Qt4 installation.])
683           ;;
684       esac
685     fi
686     AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
687     AC_SUBST(QT_CFLAGS)
688     AC_SUBST(QT_LIBS)
689   fi
690   dnl **********************************************************************
691   dnl Check for MSG_NOSIGNAL
692   dnl **********************************************************************
693   AC_MSG_CHECKING(for MSG_NOSIGNAL)
694   AC_TRY_COMPILE([#include <sys/socket.h>],
695    [ int f = MSG_NOSIGNAL; ],
696    [ AC_MSG_RESULT(yes)
697      AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
698                [Define this symbol if you have MSG_NOSIGNAL]) ],
699    [ AC_MSG_RESULT(no)]
700   )
701  dnl **********************************************************************
702  dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
703  dnl **********************************************************************
704  AC_MSG_CHECKING(for SO_NOSIGPIPE )
705  AC_TRY_COMPILE([#include <sys/socket.h>],
706   [ int f = SO_NOSIGPIPE; ],
707   [ AC_MSG_RESULT(yes)
708     AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
709               [Define this symbol if you have SO_NOSIGPIPE]) ],
710   [ AC_MSG_RESULT(no)]
712   dnl **********************************************************************
713   dnl Check for MSG_WAITALL
714   dnl **********************************************************************
715   AC_MSG_CHECKING(for MSG_WAITALL)
716   AC_TRY_COMPILE([#include <sys/socket.h>],
717    [ int f = MSG_WAITALL; ],
718    [ AC_MSG_RESULT(yes)
719      AC_DEFINE(HAVE_MSG_WAITALL, 1,
720                [Define this symbol if you have MSG_WAITALL]) ],
721    [ AC_MSG_RESULT(no)]
722   )
724   dnl Check for plugin support headers and libraries.
725   if test "x${COMPILE_PLUGIN}" = xyes; then
726     PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
727     if test "x${MOZILLA_FOUND}" = xno; then
728       PKG_CHECK_MODULES(MOZILLA, firefox-plugin firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
729     fi
730     if test "x${MOZILLA_FOUND}" = xno; then
731       PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin xulrunner-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
732     fi
733     if test "x${MOZILLA_FOUND}" = xno; then
734       PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin mozilla-firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
735     fi
736     if test "x${MOZILLA_FOUND}" = xno; then
737       PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin seamonkey-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
738     fi
739     if test "x${MOZILLA_FOUND}" = xno; then
740       PKG_CHECK_MODULES(MOZILLA, iceape-plugin iceape-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
741     fi
742     if test "x${MOZILLA_FOUND}" = xno; then
743       AC_MSG_ERROR([Couldn't find plugin support headers and libraries, try --disable-plugin])
744     fi
746     PKG_CHECK_MODULES(GLIB, glib-2.0)
747     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
749     AC_SUBST(MOZILLA_CFLAGS)
750     AC_SUBST(MOZILLA_LIBS)
751     AC_SUBST(GLIB_CFLAGS)
752     AC_SUBST(GLIB_LIBS)
753     AC_SUBST(GTK_CFLAGS)
754     AC_SUBST(GTK_LIBS)
756     AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
757   fi
760 if test "x${REGENERATE_JNI_HEADERS}" = xyes; then
761   CLASSPATH_WITH_JAVAH
764 dnl ----------------------------------------------------------- 
765 dnl Add the include files for the native abstraction layer.
766 dnl Used by AM_CPPFLAGS in the different modules.
767 dnl -----------------------------------------------------------
768 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
769 AC_SUBST(CLASSPATH_INCLUDES)
771 dnl -----------------------------------------------------------
772 if test "x${COMPILE_JNI}" = xyes; then
773   AC_MSG_CHECKING(jni_md.h support)
774   if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
775     AC_MSG_RESULT(yes)
776   else
777     target_cpu=x86
778     target_os=linux-gnu 
779     AC_MSG_WARN(no, using x86-linux-gnu)
780   fi
781   ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
782   ac_dests="include/jni_md.h"
783   while test -n "$ac_sources"; do
784     set $ac_dests; ac_dest=$1; shift; ac_dests=$*
785     set $ac_sources; ac_source=$1; shift; ac_sources=$*
786     ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
787   done
788   AC_CONFIG_LINKS([$ac_config_links_1])
791 CLASSPATH_WITH_CLASSLIB
793 dnl -----------------------------------------------------------
794 dnl Initialize maintainer mode
795 dnl -----------------------------------------------------------
796 AM_MAINTAINER_MODE
798 dnl -----------------------------------------------------------
799 dnl Enable debugging statements at compile time.  By default
800 dnl these statements should be optimized out of the bytecode
801 dnl produced by an optimizing Java compiler and not hinder 
802 dnl performance because debugging is turned off by default.
803 dnl -----------------------------------------------------------
804 AC_ARG_ENABLE([debug],
805               [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
806               [case "${enableval}" in 
807                 yes) 
808                 LIBDEBUG="true"
809                 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled]) 
810                 ;;
811                 no)   LIBDEBUG="false" ;;
812                 *)      AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
813               esac],
814               [LIBDEBUG="false"])
815 AC_SUBST(LIBDEBUG)
817 dnl -----------------------------------------------------------
818 dnl Enable execution of all static initializer loadLibrary() 
819 dnl calls at compile time.  By default most people will not
820 dnl want to disable this, but some VMs (gcj) don't need or want 
821 dnl them.
822 dnl -----------------------------------------------------------
823 AC_ARG_ENABLE([load-library],
824               [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
825               [case "${enableval}" in 
826                 yes) INIT_LOAD_LIBRARY="true" ;;
827                 no) INIT_LOAD_LIBRARY="false" ;;
828                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
829               esac],
830               [INIT_LOAD_LIBRARY="true"])
831 AC_SUBST(INIT_LOAD_LIBRARY)
834 dnl -----------------------------------------------------------
835 dnl Specify the jar file containing the Eclipse Java Compiler.  If
836 dnl this option is not specified then the com.sun.tools.javac
837 dnl implementation will not be included in tools.zip.
838 dnl -----------------------------------------------------------
839 dnl GCJ LOCAL: default to $multi_basedir/ecj.jar
840 dnl In the default case where $multi_basedir/ecj.jar is found
841 dnl $(jardir)/ecj.jar will not expand properly in GNU Classpath's
842 dnl gnu/classpath/Configuration.java.  That is OK though since libjava's
843 dnl gnu/classpath/Configuration.java overrides GNU Classpath's and
844 dnl ECJ_JAR_FILE will be properly expanded in libjava's
845 dnl gnu/classpath/natConfiguration.cc.
846 AC_ARG_WITH([ecj-jar],
847             [AS_HELP_STRING([--with-ecj-jar=ABS.PATH],
848             [specify jar file containing the Eclipse Java Compiler])],
849             [ECJ_JAR=$withval],
850             [if test -f $multi_basedir/ecj.jar; then
851                ECJ_JAR='$(jardir)/ecj.jar'
852              fi])
853 AC_SUBST(ECJ_JAR)
855 dnl -----------------------------------------------------------
856 dnl Should the VM explicitly run class initialization subfunctions for
857 dnl java.lang.System?   (default is false -- the subfunctions will be run 
858 dnl automatically by the class initializer)
859 dnl -----------------------------------------------------------
860 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
861               [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
862               [case "${enableval}" in 
863                 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
864                 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
865                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
866               esac],
867               [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
868 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
871 dnl -----------------------------------------------------------
872 dnl avoiding automake complaints
873 dnl -----------------------------------------------------------
874 REMOVE=""
875 AC_SUBST(REMOVE)
877 dnl -----------------------------------------------------------
878 dnl This is probably useless.
879 dnl -----------------------------------------------------------
880 AC_PATH_PROG(MKDIR, mkdir)
881 AC_PATH_PROG(CP, cp)
882 AC_PATH_PROG(DATE, date)
884 dnl -----------------------------------------------------------
885 dnl According to the GNU coding guide, we shouldn't require find, 
886 dnl and zip, however GNU provides both so it should be okay 
887 dnl -----------------------------------------------------------
888 AC_PATH_PROG(FIND, find)
890 dnl -----------------------------------------------------------
891 dnl Specify what to install (install only glibj.zip by default)
892 dnl -----------------------------------------------------------
893 CLASSPATH_WITH_GLIBJ
895 dnl -----------------------------------------------------------
896 dnl Enable API documentation generation (disabled by default)
897 dnl -----------------------------------------------------------
898 CLASSPATH_WITH_GJDOC
900 dnl -----------------------------------------------------------
901 dnl Whether to use jay to regenerate parsers.
902 dnl -----------------------------------------------------------
903 REGEN_WITH_JAY
905 dnl -----------------------------------------------------------
906 dnl This sets the build-time default, which can now be overridden 
907 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
908 dnl to "true" or "false".
909 dnl -----------------------------------------------------------
910 AC_ARG_ENABLE([portable-native-sync],
911               [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
912               [case "${enableval}" in 
913                 yes) 
914                      AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
915                      ;;
916                 no)  ;;
917                 *)   
918                      AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync) 
919                      ;;
920               esac],
921               [])
923 AX_CREATE_STDINT_H([include/config-int.h])
925 dnl -----------------------------------------------------------------------
926 dnl                    Support for using a prebuilt class library
927 dnl -----------------------------------------------------------------------
928 AC_ARG_WITH([glibj_zip],
929             AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
930                            [use prebuilt glibj.zip class library]))
932 case "$with_glibj_zip" in
934         use_glibj_zip=false
935         ;;
936 "no" )
937         use_glibj_zip=false
938         ;;
939 "yes")
940         AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
941         ;;
943         use_glibj_zip=true
944         PATH_TO_GLIBJ_ZIP=$with_glibj_zip
945         ;;
946 esac;
948 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
949 AC_SUBST(PATH_TO_GLIBJ_ZIP)
951 # Check for javac if we need to build either the class library,
952 # the examples or the tools
953 if test "x${use_glibj_zip}" = xfalse || \
954    test "x${EXAMPLESDIR}" != x || \
955    test "x${TOOLSDIR}" != x && \
956    test "x${build_class_files}" != xno; then    
957         AC_PROG_JAVAC
958         CLASSPATH_JAVAC_MEM_CHECK
961 dnl -----------------------------------------------------------
962 dnl Build with Escher based X peers.
963 dnl -----------------------------------------------------------
964 AC_ARG_WITH([escher],
965          AS_HELP_STRING([--with-escher=ABS.PATH],
966                         [specify path to escher dir or JAR for X peers]))
967 case "$with_escher" in
969         use_escher=false
970         ;;
971 "no")
972         use_escher=false
973         ;;
974 "yes")
975         AC_MSG_ERROR([Please supply an absolute path to Escher library])
976         ;;
978         use_escher=true
979         PATH_TO_ESCHER=$with_escher
980         ;;
981 esac
983 AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
984 AC_SUBST(PATH_TO_ESCHER)
986 dnl -----------------------------------------------------------
987 dnl Check if local socket support should be included.
988 dnl -----------------------------------------------------------
989 AC_ARG_ENABLE([local-sockets],
990               [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
991               [case "${enableval}" in
992                 yes)
993                   ENABLE_LOCAL_SOCKETS=yes
994                   ;;
995                 *)
996                   ENABLE_LOCAL_SOCKETS=no
997                   ;;
998                esac],
999               [])
1000 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
1001 then
1002   AC_CHECK_HEADER([sys/un.h])
1003   AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
1004                  AC_MSG_ERROR([networking support not available]))
1005   AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
1007 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
1009 dnl -----------------------------------------------------------
1010 dnl Add the default preference peer
1011 dnl -----------------------------------------------------------
1012 AC_SUBST(DEFAULT_PREFS_PEER)
1014 dnl -----------------------------------------------------------
1015 dnl output files
1016 dnl -----------------------------------------------------------
1017 AC_CONFIG_FILES([Makefile
1018 doc/Makefile
1019 doc/api/Makefile
1020 external/Makefile
1021 external/sax/Makefile
1022 external/w3c_dom/Makefile
1023 external/relaxngDatatype/Makefile
1024 external/jsr166/Makefile
1025 gnu/classpath/Configuration.java
1026 gnu/java/security/Configuration.java
1027 include/Makefile
1028 native/Makefile
1029 native/fdlibm/Makefile
1030 native/jawt/Makefile
1031 native/jni/Makefile
1032 native/jni/classpath/Makefile
1033 native/jni/java-io/Makefile
1034 native/jni/java-lang/Makefile
1035 native/jni/java-net/Makefile
1036 native/jni/java-nio/Makefile
1037 native/jni/java-util/Makefile
1038 native/jni/gtk-peer/Makefile
1039 native/jni/gconf-peer/Makefile
1040 native/jni/gstreamer-peer/Makefile
1041 native/jni/qt-peer/Makefile
1042 native/jni/xmlj/Makefile
1043 native/jni/midi-alsa/Makefile
1044 native/jni/midi-dssi/Makefile
1045 native/jni/native-lib/Makefile
1046 native/plugin/Makefile
1047 resource/Makefile
1048 resource/META-INF/services/java.util.prefs.PreferencesFactory
1049 resource/META-INF/services/javax.sound.sampled.spi.AudioFileReader
1050 resource/META-INF/services/javax.sound.sampled.spi.MixerProvider
1051 scripts/Makefile
1052 scripts/classpath.spec
1053 lib/Makefile
1054 lib/gen-classlist.sh
1055 lib/copy-vmresources.sh
1056 scripts/check_jni_methods.sh
1057 tools/Makefile
1058 examples/Makefile
1059 examples/Makefile.jawt
1060 examples/Makefile.java2d])
1062 if test "x${COMPILE_WRAPPERS}" = xno
1063 then
1064 AC_CONFIG_FILES([tools/gappletviewer
1065 tools/gjarsigner
1066 tools/gkeytool
1067 tools/gjar
1068 tools/gnative2ascii
1069 tools/gserialver
1070 tools/grmiregistry
1071 tools/gtnameserv
1072 tools/gorbd
1073 tools/grmid
1074 tools/grmic
1075 tools/gjavah])
1076 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
1077 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
1078 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
1079 AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
1080 AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
1081 AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
1082 AC_CONFIG_COMMANDS([grmiregistry],[chmod 755 tools/grmiregistry])
1083 AC_CONFIG_COMMANDS([gtnameserv],[chmod 755 tools/gtnameserv])
1084 AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
1085 AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
1086 AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
1087 AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
1090 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
1091 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
1092 AC_OUTPUT
1094 # Create standard.omit based on decisions we just made.
1095 cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
1096 if test x$use_escher != xtrue; then
1097    echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit