re PR libgcj/37636 (java tools are unable to find resource files)
[gcc.git] / libjava / classpath / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
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
8
9 AC_INIT([GNU Classpath],[0.98-pre],[classpath@gnu.org],[classpath])
10 AC_CONFIG_SRCDIR(java/lang/System.java)
11
12 dnl GCJ LOCAL
13 AC_CONFIG_AUX_DIR(../..)
14 dnl END GCJ LOCAL
15
16 AC_CANONICAL_TARGET
17
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
24
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.
31
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)
41
42 AC_MSG_RESULT($generated_files_in_srcdir)
43 AM_CONDITIONAL(GENINSRC, test x$generated_files_in_srcdir = xyes)
44 dnl END GCJ LOCAL
45
46 # Find the rest of the source tree framework.
47 AM_ENABLE_MULTILIB(, ../..)
48
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
53
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
67
68 CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
69 AC_SUBST(CLASSPATH_MODULE)
70
71 CLASSPATH_CONVENIENCE="-no-undefined"
72 AC_SUBST(CLASSPATH_CONVENIENCE)
73
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)
78
79 dnl GCC LOCAL
80 GCC_NO_EXECUTABLES
81
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)
95
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)
108
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)
122
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)
138
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)
151
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]))
156
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)
169
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]))
174
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])
186
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
196 fi
197 AC_SUBST(default_toolkit)
198
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)
211
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)
226
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)
241
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)
254
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]))
259
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)
272
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)
285
286 dnl -----------------------------------------------------------
287 dnl Native java.math.BigInteger (enabled by default)
288 dnl -----------------------------------------------------------
289 AC_ARG_ENABLE([gmp],
290 [AS_HELP_STRING(--enable-gmp,
291 compile native java.math.BigInteger library (disabled by --disable-gmp) [default=yes])],
292 [case "${enableval}" in
293 yes|true) COMPILE_GMP=yes ;;
294 no|false) COMPILE_GMP=no ;;
295 *) COMPILE_GMP=yes ;;
296 esac],
297 [COMPILE_GMP=yes])
298
299 dnl -----------------------------------------------------------
300 dnl GJDoc (enabled by default)
301 dnl -----------------------------------------------------------
302 AC_ARG_ENABLE([gjdoc],
303 [AS_HELP_STRING(--disable-gjdoc,compile GJDoc (disabled by --disable-gjdoc) [default=yes])],
304 [case "${enableval}" in
305 yes) COMPILE_GJDOC=yes ;;
306 no) COMPILE_GJDOC=no ;;
307 *) COMPILE_GJDOC=yes ;;
308 esac],
309 [COMPILE_GJDOC=yes])
310 AM_CONDITIONAL(CREATE_GJDOC, test "x${COMPILE_GJDOC}" = xyes)
311
312 dnl GCJ LOCAL: Calculates and substitutes toolexeclibdir. $libdir is
313 dnl defined to the same value for all multilibs. We define toolexeclibdir
314 dnl so that we can refer to the multilib installation directories from
315 dnl classpath's build files.
316 dnl -----------------------------------------------------------
317 CLASSPATH_TOOLEXECLIBDIR
318
319 dnl -----------------------------------------------------------
320 dnl Sets the native libraries installation dir
321 dnl -----------------------------------------------------------
322 dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}-${libgcj_soversion}
323 AC_ARG_WITH([native-libdir],
324 [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
325 [
326 nativeexeclibdir=${withval}
327 ],
328 [
329 nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`-`awk -F: '/^[[^#]].*:/ { print $1 }' ${srcdir}/../libtool-version`
330 ])
331
332 AC_SUBST(nativeexeclibdir)
333
334 dnl -----------------------------------------------------------
335 dnl Sets the Java library installation dir.
336 dnl -----------------------------------------------------------
337 AC_ARG_WITH([glibj-dir],
338 [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
339 [
340 glibjdir=${withval}
341 ],
342 [
343 glibjdir='${datadir}/${PACKAGE}'
344 ])
345
346 AC_SUBST(glibjdir)
347
348 dnl -----------------------------------------------------------
349 dnl Sets the Antlr jar to use for compiling gjdoc
350 dnl -----------------------------------------------------------
351 AC_ARG_WITH([antlr-jar],
352 [AS_HELP_STRING([--with-antlr-jar=file],[Use ANTLR from the specified jar file])],
353 [
354 ANTLR_JAR=$withval
355 ],
356 [
357 ANTLR_JAR="$ANTLR_JAR"
358 ])
359
360 dnl -----------------------------------------------------------
361 dnl Regenerate headers at build time (enabled if not found)
362 dnl -----------------------------------------------------------
363 AC_MSG_CHECKING([whether to regenerate the headers])
364 AC_ARG_ENABLE([regen-headers],
365 [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=yes if headers don't exist])],
366 [case "${enableval}" in
367 yes) REGENERATE_JNI_HEADERS=yes ;;
368 no) REGENERATE_JNI_HEADERS=no ;;
369 *) REGENERATE_JNI_HEADERS=yes ;;
370 esac],
371 [if test -e ${srcdir}/include/java_lang_VMSystem.h; then
372 REGENERATE_JNI_HEADERS=no ;
373 else
374 REGENERATE_JNI_HEADERS=yes ;
375 fi])
376 AC_MSG_RESULT(${REGENERATE_JNI_HEADERS})
377 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
378
379 dnl ------------------------------------------------------------------------
380 dnl Regenerate GJDoc parser at build time (enabled if not found)
381 dnl ------------------------------------------------------------------------
382 AC_MSG_CHECKING([whether to regenerate the GJDoc parser])
383 AC_ARG_ENABLE([regen-gjdoc-parser],
384 [AS_HELP_STRING(--enable-regen-gjdoc-parser,automatically regenerate the GJDoc parser [default=yes if generated source doesn't exist])],
385 [case "${enableval}" in
386 yes) REGENERATE_GJDOC_PARSER=yes ;;
387 no) REGENERATE_GJDOC_PARSER=no ;;
388 *) REGENERATE_GJDOC_PARSER=yes ;;
389 esac],
390 [if test -e ${srcdir}/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.java; then
391 REGENERATE_GJDOC_PARSER=no ;
392 else
393 REGENERATE_GJDOC_PARSER=yes ;
394 fi])
395 AC_MSG_RESULT(${REGENERATE_GJDOC_PARSER})
396 AM_CONDITIONAL(CREATE_GJDOC_PARSER, test "x${REGENERATE_GJDOC_PARSER}" = xyes)
397
398 dnl -----------------------------------------------------------
399 dnl Enable tool wrapper binaries (disabled by default)
400 dnl -----------------------------------------------------------
401 AC_ARG_ENABLE([tool-wrappers],
402 [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
403 [case x"${enableval}" in
404 xyes)
405 COMPILE_WRAPPERS=yes;
406 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
407 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
408 ;;
409 xno) COMPILE_WRAPPERS=no ;;
410 x) COMPILE_WRAPPERS=yes ;;
411 *) COMPILE_WRAPPERS=yes ;;
412 esac],
413 [COMPILE_WRAPPERS=no])
414 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
415
416 AC_PROG_LN_S
417 AC_PROG_INSTALL
418
419 dnl -----------------------------------------------------------
420 dnl Checks for programs.
421 dnl -----------------------------------------------------------
422
423 dnl Initialize libtool
424 AC_DISABLE_STATIC
425 AC_PROG_LIBTOOL
426 AC_PROG_AWK
427 AC_PROG_CC
428 AM_PROG_CC_C_O
429 AC_PROG_CPP
430 AC_PROG_CXX
431
432 # Handle -Werror default case.
433 if test "$ENABLE_WERROR" = default; then
434 case "$host_os" in
435 *linux*)
436 if test "$GCC" = yes; then
437 ENABLE_WERROR=yes
438 fi
439 ;;
440 esac
441 fi
442
443 if test "x${COMPILE_COLLECTIONS}" = xyes; then
444 AC_PATH_PROG(PERL, [perl])
445 AC_SUBST(PERL)
446 AC_SUBST(COLLECTIONS_PREFIX)
447 AC_CONFIG_FILES([lib/mkcollections.pl])
448 AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
449 fi
450
451 if test "x${COMPILE_JNI}" = xyes; then
452 GCC_ATTRIBUTE_UNUSED
453
454 AC_HEADER_STDC
455
456 dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
457 dnl at least.
458 AC_COMPILE_CHECK_SIZEOF(void *)
459
460 dnl Checking for endianess.
461 AC_C_BIGENDIAN_CROSS
462
463 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
464 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
465 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
466 dnl Check for crt_externs.h on Darwin.
467 dnl Check for netinet/in_systm.h, netinet/ip.h and net/if.h for Windows CE.
468 dnl Check for sys/loadavg.h for getloadavg() on Solaris 9.
469 dnl Check for sys/sockio.h for SIOCGIFFLAGS on OpenSolaris.
470 AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
471 asm/ioctls.h \
472 inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
473 sys/time.h \
474 sys/select.h \
475 crt_externs.h \
476 fcntl.h \
477 sys/mman.h \
478 magic.h \
479 sys/event.h sys/epoll.h \
480 ifaddrs.h \
481 netinet/in_systm.h netinet/ip.h net/if.h \
482 sys/loadavg.h sys/sockio.h])
483
484 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
485 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
486 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]))
487 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]))
488
489 AC_SEARCH_LIBS([inet_pton],[nsl])
490 AC_CHECK_LIB([socket], [gethostname])
491 AC_CHECK_FUNCS([ftruncate fsync select \
492 gethostname socket strerror fork pipe execve open close \
493 lseek fstat read readv write writev htonl memset htons connect \
494 getsockname getpeername bind listen accept \
495 recvfrom send sendto setsockopt getsockopt time mktime \
496 gethostbyname_r localtime_r \
497 strerror_r \
498 fcntl \
499 statvfs \
500 mmap munmap mincore msync madvise getpagesize sysconf \
501 lstat readlink \
502 inet_aton inet_addr inet_pton \
503 getifaddrs kqueue kevent epoll_create \
504 getloadavg])
505
506 LIBMAGIC=
507 AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
508 AC_SUBST(LIBMAGIC)
509
510 AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
511 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
512 [AC_DEFINE(HAVE_INET6, 1,
513 [Define if inet6 structures are defined in netinet/in.h.])
514 AC_MSG_RESULT(yes)],
515 [AC_MSG_RESULT(no)])
516
517 AC_HEADER_TIME
518 AC_STRUCT_TM
519 AC_STRUCT_TIMEZONE
520
521 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
522 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
523 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
524 AC_MSG_RESULT(yes)],
525 [AC_MSG_RESULT(no)
526 AC_MSG_CHECKING([for global timezone variable])
527 dnl FIXME: we don't want a link check here because that won't work
528 dnl when cross-compiling. So instead we make an assumption that
529 dnl the header file will mention timezone if it exists.
530 dnl Don't find the win32 function timezone
531 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
532 [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
533 AC_MSG_RESULT(yes)],
534 [AC_MSG_RESULT(no)
535 AC_MSG_CHECKING([for global _timezone variable])
536 dnl FIXME: As above, don't want link check
537 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
538 [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
539 [Define if your platform has the global _timezone variable.])
540 AC_MSG_RESULT(yes)],
541 [AC_MSG_RESULT(no)])])])
542
543 AC_C_CONST
544 AC_C_INLINE
545 AC_C_ATTRIBUTE
546 AX_FUNC_WHICH_GETHOSTBYNAME_R
547
548 dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
549 AM_ICONV
550
551 dnl When using gcc we want warnings, lots of warnings :-)
552 if test "x${GCC}" = xyes; then
553 dnl We want ISO C90 ansi, but with longlong (jlong) support
554 dnl and modern POSIX and BSD C library functions/prototypes.
555
556 dnl Warning flags for (almost) everybody.
557 dnl Should probably be configurable
558 WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
559 AC_SUBST(WARNING_CFLAGS)
560
561 dnl CFLAGS that are used for all native code. We want to compile
562 dnl everything with unwinder data so that backtrace() will always
563 dnl work.
564 EXTRA_CFLAGS='-fexceptions -fasynchronous-unwind-tables'
565 AC_SUBST(EXTRA_CFLAGS)
566
567 dnl Strict warning flags which not every module uses.
568 dnl Should probably be configurable.
569 STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
570 AC_SUBST(STRICT_WARNING_CFLAGS)
571
572 dnl Whether or not to add -Werror, also not used by all modueles.
573 dnl Can be configured by --disable-Werror
574 ERROR_CFLAGS=
575 if test "x${ENABLE_WERROR}" = xyes; then
576 ERROR_CFLAGS='-Werror'
577 fi
578 AC_SUBST(ERROR_CFLAGS)
579 fi
580
581 dnl Check for libxml and libxslt libraries (when xmlj is enabled).
582 if test "x${COMPILE_XMLJ}" = xyes; then
583 PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
584 PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
585 AC_SUBST(XML_LIBS)
586 AC_SUBST(XML_CFLAGS)
587 AC_SUBST(XSLT_LIBS)
588 AC_SUBST(XSLT_CFLAGS)
589 fi
590
591 dnl Check for AWT related gthread/gtk
592 if test "x${COMPILE_GTK_PEER}" = xyes; then
593 AC_PATH_XTRA
594 if test "$no_x" = yes; then
595 AC_MSG_ERROR([GTK+ peers requested but no X library available])
596 fi
597 dnl Check if we can link against the XTest library and set
598 dnl HAVE_XTEST accordingly.
599 AC_CHECK_LIB([Xtst], [XTestQueryExtension],
600 [AC_DEFINE(HAVE_XTEST, 1, [Define to 1 if you have libXtst.])[XTEST_LIBS="$XTEST_LIBS -X11 -lXtst"]],
601 [true],
602 [${X_LIBS}])
603
604
605 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
606 PKG_CHECK_MODULES(FREETYPE2, freetype2)
607 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
608 PKG_CHECK_MODULES(CAIRO, cairo >= 1.1.8)
609 dnl Check if we can link against the XRender library and set
610 dnl HAVE_XRENDER accordingly.
611 AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
612 [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
613 [true],
614 [${X_LIBS}])
615
616 dnl Check if we can link against the XRandR library and set
617 dnl HAVE_XRANDR accordingly.
618 AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
619 [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
620 [true],
621 [${X_LIBS}])
622
623 AC_SUBST(GTK_CFLAGS)
624 AC_SUBST(GTK_LIBS)
625 AC_SUBST(FREETYPE2_LIBS)
626 AC_SUBST(FREETYPE2_CFLAGS)
627 AC_SUBST(PANGOFT2_LIBS)
628 AC_SUBST(PANGOFT2_CFLAGS)
629 AC_SUBST(XTEST_LIBS)
630 fi
631
632 dnl gconf-peer
633 if test "x${COMPILE_GCONF_PEER}" = xyes; then
634 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6.0)
635 AC_SUBST(GCONF_CFLAGS)
636 AC_SUBST(GCONF_LIBS)
637 dnl we also need gdk for locking
638 PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
639 AC_SUBST(GDK_CFLAGS)
640 AC_SUBST(GDK_LIBS)
641 dnl check if the config value was given form the command line,
642 dnl if not, overwrite the default if we have the gconf backend
643 dnl compiled in
644 USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
645 if test "$USE_GCONF_PREFS_PEER" = ""; then
646 DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
647 fi
648 fi
649
650 dnl gstreamer-peer
651 if test "x${COMPILE_GSTREAMER_PEER}" = xyes; then
652 GST_MAJORMINOR=0.10
653 GST_REQUIRED=0.10.10
654
655 dnl gstreamer
656 PKG_CHECK_MODULES(GSTREAMER, gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED)
657 AC_SUBST(GSTREAMER_CFLAGS)
658 AC_SUBST(GSTREAMER_LIBS)
659
660 dnl gstreamer-base
661 PKG_CHECK_MODULES(GSTREAMER_BASE,
662 gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED)
663 AC_SUBST(GSTREAMER_BASE_CFLAGS)
664 AC_SUBST(GSTREAMER_BASE_LIBS)
665
666 dnl gstreamer-plugin-base
667 PKG_CHECK_MODULES(GSTREAMER_PLUGINS_BASE,
668 gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_REQUIRED)
669 AC_SUBST(GSTREAMER_PLUGINS_BASE_CFLAGS)
670 AC_SUBST(GSTREAMER_PLUGINS_BASE_LIBS)
671
672 GST_PLUGIN_LDFLAGS='-module -avoid-version -Wno-unused-parameter -no-undefined'
673 AC_SUBST(GST_PLUGIN_LDFLAGS)
674
675 PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
676 AC_SUBST(GDK_CFLAGS)
677 AC_SUBST(GDK_LIBS)
678
679 dnl set the gstreamer based file reader, writer and mixer
680 GSTREAMER_FILE_READER=gnu.javax.sound.sampled.gstreamer.io.GstAudioFileReader
681 GSTREAMER_MIXER_PROVIDER=gnu.javax.sound.sampled.gstreamer.GStreamerMixerProvider
682 fi
683 dnl add the gstreamer resources
684 AC_SUBST(GSTREAMER_FILE_READER)
685 AC_SUBST(GSTREAMER_MIXER_PROVIDER)
686
687 dnl Check for AWT related Qt4
688 if test "x${COMPILE_QT_PEER}" = xyes; then
689 PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
690 if test "x$HAVE_QT4" = "xyes"; then
691 dnl Check needed because in some cases the QtGui includedir
692 dnl doesn't contain the subsystem dir.
693 QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
694 EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
695 AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
696 AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
697 AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
698 QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
699 AC_MSG_WARN([QWidget not found])))
700 AC_CHECK_PROG(MOC, [moc], [moc])
701 AC_CHECK_PROG(MOC, [moc-qt4], [moc-qt4])
702 fi
703 if test "x$HAVE_QT4" = "xno"; then
704 AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
705 case "$host_os" in
706 darwin*)
707 AC_ARG_WITH([qt4dir],
708 [AS_HELP_STRING([--with-qt4dir=DIR],
709 [Qt4 installation directory used for OS-X.
710 For other systems use pkg-config.])],
711 [QT4DIR=$withval]
712 )
713 if test x"$QT4DIR" = x ; then
714 AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
715 fi
716 AC_MSG_RESULT([QT4DIR... $QT4DIR])
717 AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
718 if test x"$MOC" = x; then
719 AC_MSG_ERROR([*** This is not the right Qt installation])
720 fi
721 QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
722 QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
723 QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
724 QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
725 ;;
726 *)
727 AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
728 of your installed Qt4 installation.])
729 ;;
730 esac
731 fi
732 AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
733 AC_SUBST(QT_CFLAGS)
734 AC_SUBST(QT_LIBS)
735 fi
736 dnl **********************************************************************
737 dnl Check for MSG_NOSIGNAL
738 dnl **********************************************************************
739 AC_MSG_CHECKING(for MSG_NOSIGNAL)
740 AC_TRY_COMPILE([#include <sys/socket.h>],
741 [ int f = MSG_NOSIGNAL; ],
742 [ AC_MSG_RESULT(yes)
743 AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
744 [Define this symbol if you have MSG_NOSIGNAL]) ],
745 [ AC_MSG_RESULT(no)]
746 )
747 dnl **********************************************************************
748 dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
749 dnl **********************************************************************
750 AC_MSG_CHECKING(for SO_NOSIGPIPE )
751 AC_TRY_COMPILE([#include <sys/socket.h>],
752 [ int f = SO_NOSIGPIPE; ],
753 [ AC_MSG_RESULT(yes)
754 AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
755 [Define this symbol if you have SO_NOSIGPIPE]) ],
756 [ AC_MSG_RESULT(no)]
757 )
758 dnl **********************************************************************
759 dnl Check for MSG_WAITALL
760 dnl **********************************************************************
761 AC_MSG_CHECKING(for MSG_WAITALL)
762 AC_TRY_COMPILE([#include <sys/socket.h>],
763 [ int f = MSG_WAITALL; ],
764 [ AC_MSG_RESULT(yes)
765 AC_DEFINE(HAVE_MSG_WAITALL, 1,
766 [Define this symbol if you have MSG_WAITALL]) ],
767 [ AC_MSG_RESULT(no)]
768 )
769
770 dnl Check for plugin support headers and libraries.
771 if test "x${COMPILE_PLUGIN}" = xyes; then
772 PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
773 if test "x${MOZILLA_FOUND}" = xno; then
774 PKG_CHECK_MODULES(MOZILLA, firefox-plugin firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
775 fi
776 if test "x${MOZILLA_FOUND}" = xno; then
777 PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin xulrunner-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
778 fi
779 if test "x${MOZILLA_FOUND}" = xno; then
780 PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin mozilla-firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
781 fi
782 if test "x${MOZILLA_FOUND}" = xno; then
783 PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin seamonkey-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
784 fi
785 if test "x${MOZILLA_FOUND}" = xno; then
786 PKG_CHECK_MODULES(MOZILLA, iceape-plugin iceape-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
787 fi
788 if test "x${MOZILLA_FOUND}" = xno; then
789 AC_MSG_ERROR([Couldn't find plugin support headers and libraries, try --disable-plugin])
790 fi
791
792 PKG_CHECK_MODULES(GLIB, glib-2.0)
793 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
794
795 AC_SUBST(MOZILLA_CFLAGS)
796 AC_SUBST(MOZILLA_LIBS)
797 AC_SUBST(GLIB_CFLAGS)
798 AC_SUBST(GLIB_LIBS)
799 AC_SUBST(GTK_CFLAGS)
800 AC_SUBST(GTK_LIBS)
801
802 AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
803 fi
804
805 dnl Check for GNU MP library and header file
806 dnl for GNU MP versions >= 4.2 use __gmpz_combit; otherwise look for
807 dnl __gmpz_mul_si for earlier versions (>= 3.1).
808 dnl IMPORTANT: if you decide to look for __gmpz_combit, don't forget to
809 dnl change the name of the corresponding ac_ variable on lines 860...
810 if test "x${COMPILE_GMP}" = xyes; then
811 AC_CHECK_LIB(gmp, __gmpz_mul_si,
812 [GMP_CFLAGS=-I/usr/include
813 GMP_LIBS=-lgmp ],
814 [GMP_CFLAGS=
815 GMP_LIBS= ])
816 AC_SUBST(GMP_CFLAGS)
817 AC_SUBST(GMP_LIBS)
818
819 AC_CHECK_HEADERS([gmp.h])
820 fi
821
822 else
823 COMPILE_GMP=no
824 fi
825
826 if test "x${REGENERATE_JNI_HEADERS}" = xyes; then
827 CLASSPATH_WITH_JAVAH
828 fi
829
830 dnl -----------------------------------------------------------
831 dnl Add the include files for the native abstraction layer.
832 dnl Used by AM_CPPFLAGS in the different modules.
833 dnl -----------------------------------------------------------
834 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
835 AC_SUBST(CLASSPATH_INCLUDES)
836
837 dnl -----------------------------------------------------------
838 if test "x${COMPILE_JNI}" = xyes; then
839 AC_MSG_CHECKING(jni_md.h support)
840 if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
841 AC_MSG_RESULT(yes)
842 else
843 target_cpu=x86
844 target_os=linux-gnu
845 AC_MSG_WARN(no, using x86-linux-gnu)
846 fi
847 ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
848 ac_dests="include/jni_md.h"
849 while test -n "$ac_sources"; do
850 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
851 set $ac_sources; ac_source=$1; shift; ac_sources=$*
852 ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
853 done
854 AC_CONFIG_LINKS([$ac_config_links_1])
855 fi
856
857 CLASSPATH_WITH_CLASSLIB
858
859 dnl -----------------------------------------------------------
860 dnl Initialize maintainer mode
861 dnl -----------------------------------------------------------
862 AM_MAINTAINER_MODE
863
864 dnl -----------------------------------------------------------
865 dnl Enable debugging statements at compile time. By default
866 dnl these statements should be optimized out of the bytecode
867 dnl produced by an optimizing Java compiler and not hinder
868 dnl performance because debugging is turned off by default.
869 dnl -----------------------------------------------------------
870 AC_ARG_ENABLE([debug],
871 [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
872 [case "${enableval}" in
873 yes)
874 LIBDEBUG="true"
875 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
876 ;;
877 no) LIBDEBUG="false" ;;
878 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
879 esac],
880 [LIBDEBUG="false"])
881 AC_SUBST(LIBDEBUG)
882
883 dnl -----------------------------------------------------------
884 dnl Enable execution of all static initializer loadLibrary()
885 dnl calls at compile time. By default most people will not
886 dnl want to disable this, but some VMs (gcj) don't need or want
887 dnl them.
888 dnl -----------------------------------------------------------
889 AC_ARG_ENABLE([load-library],
890 [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
891 [case "${enableval}" in
892 yes) INIT_LOAD_LIBRARY="true" ;;
893 no) INIT_LOAD_LIBRARY="false" ;;
894 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
895 esac],
896 [INIT_LOAD_LIBRARY="true"])
897 AC_SUBST(INIT_LOAD_LIBRARY)
898
899
900 dnl -----------------------------------------------------------
901 dnl Specify the jar file containing the Eclipse Java Compiler. If
902 dnl this option is not specified then the com.sun.tools.javac
903 dnl implementation will not be included in tools.zip.
904 dnl -----------------------------------------------------------
905 dnl GCJ LOCAL: default to $multi_basedir/ecj.jar
906 dnl In the default case where $multi_basedir/ecj.jar is found
907 dnl $(jardir)/ecj.jar will not expand properly in GNU Classpath's
908 dnl gnu/classpath/Configuration.java. That is OK though since libjava's
909 dnl gnu/classpath/Configuration.java overrides GNU Classpath's and
910 dnl ECJ_JAR_FILE will be properly expanded in libjava's
911 dnl gnu/classpath/natConfiguration.cc.
912 AC_ARG_WITH([ecj-jar],
913 [AS_HELP_STRING([--with-ecj-jar=ABS.PATH],
914 [specify jar file containing the Eclipse Java Compiler])],
915 [ECJ_JAR=$withval],
916 [if test -f $multi_basedir/ecj.jar; then
917 ECJ_JAR='$(jardir)/ecj.jar'
918 fi])
919 AC_SUBST(ECJ_JAR)
920
921 dnl -----------------------------------------------------------
922 dnl Should the VM explicitly run class initialization subfunctions for
923 dnl java.lang.System? (default is false -- the subfunctions will be run
924 dnl automatically by the class initializer)
925 dnl -----------------------------------------------------------
926 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
927 [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
928 [case "${enableval}" in
929 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
930 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
931 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
932 esac],
933 [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
934 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
935
936
937 dnl -----------------------------------------------------------
938 dnl avoiding automake complaints
939 dnl -----------------------------------------------------------
940 REMOVE=""
941 AC_SUBST(REMOVE)
942
943 dnl -----------------------------------------------------------
944 dnl This is probably useless.
945 dnl -----------------------------------------------------------
946 AC_PATH_PROG(MKDIR, mkdir)
947 AC_PATH_PROG(CP, cp)
948 AC_PATH_PROG(DATE, date)
949
950 dnl -----------------------------------------------------------
951 dnl According to the GNU coding guide, we shouldn't require find,
952 dnl and zip, however GNU provides both so it should be okay
953 dnl -----------------------------------------------------------
954 AC_PATH_PROG(FIND, find)
955
956 dnl -----------------------------------------------------------
957 dnl Specify what to install (install only glibj.zip by default)
958 dnl -----------------------------------------------------------
959 CLASSPATH_WITH_GLIBJ
960
961 dnl -----------------------------------------------------------
962 dnl Enable API documentation generation (disabled by default)
963 dnl -----------------------------------------------------------
964 CLASSPATH_WITH_GJDOC
965
966 dnl -----------------------------------------------------------
967 dnl Whether to use jay to regenerate parsers.
968 dnl -----------------------------------------------------------
969 REGEN_WITH_JAY
970
971 dnl -----------------------------------------------------------
972 dnl This sets the build-time default, which can now be overridden
973 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
974 dnl to "true" or "false".
975 dnl -----------------------------------------------------------
976 AC_ARG_ENABLE([portable-native-sync],
977 [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
978 [case "${enableval}" in
979 yes)
980 AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
981 ;;
982 no) ;;
983 *)
984 AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
985 ;;
986 esac],
987 [])
988
989 AX_CREATE_STDINT_H([include/config-int.h])
990
991 dnl -----------------------------------------------------------------------
992 dnl Support for using a prebuilt class library
993 dnl -----------------------------------------------------------------------
994 AC_ARG_WITH([glibj_zip],
995 AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
996 [use prebuilt glibj.zip class library]))
997
998 case "$with_glibj_zip" in
999 "")
1000 use_glibj_zip=false
1001 ;;
1002 "no" )
1003 use_glibj_zip=false
1004 ;;
1005 "yes")
1006 AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
1007 ;;
1008 *)
1009 use_glibj_zip=true
1010 PATH_TO_GLIBJ_ZIP=$with_glibj_zip
1011 ;;
1012 esac;
1013
1014 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
1015 AC_SUBST(PATH_TO_GLIBJ_ZIP)
1016
1017 if test "x${TOOLSDIR}" != x; then
1018 if test "x${COMPILE_WRAPPERS}" = xno && test "x${enable_java_maintainer_mode}" = xyes; then
1019 AC_PROG_JAVA
1020 fi
1021 if test "x${COMPILE_GJDOC}" = xyes; then
1022 AC_LIB_ANTLR
1023 if test "x${REGENERATE_GJDOC_PARSER}" = xyes; then
1024 dnl GCJ LOCAL
1025 if test "x${enable_java_maintainer_mode}" = xyes; then
1026 AC_PROG_JAVA
1027 AC_PROG_ANTLR(2,7,1)
1028 fi
1029 dnl END GCJ LOCAL
1030 fi
1031 fi
1032 fi
1033
1034
1035 # Check for javac if we need to build either the class library,
1036 # the examples or the tools
1037 if test "x${use_glibj_zip}" = xfalse || \
1038 test "x${EXAMPLESDIR}" != x || \
1039 test "x${TOOLSDIR}" != x && \
1040 test "x${build_class_files}" != xno; then
1041 AC_PROG_JAVAC
1042 CLASSPATH_JAVAC_MEM_CHECK
1043 fi
1044
1045 dnl -----------------------------------------------------------
1046 dnl Build with Escher based X peers.
1047 dnl -----------------------------------------------------------
1048 AC_ARG_WITH([escher],
1049 AS_HELP_STRING([--with-escher=ABS.PATH],
1050 [specify path to escher dir or JAR for X peers]))
1051 case "$with_escher" in
1052 "")
1053 use_escher=false
1054 ;;
1055 "no")
1056 use_escher=false
1057 ;;
1058 "yes")
1059 AC_MSG_ERROR([Please supply an absolute path to Escher library])
1060 ;;
1061 *)
1062 use_escher=true
1063 PATH_TO_ESCHER=$with_escher
1064 ;;
1065 esac
1066
1067 AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
1068 AC_SUBST(PATH_TO_ESCHER)
1069
1070 dnl -----------------------------------------------------------
1071 dnl Check if local socket support should be included.
1072 dnl -----------------------------------------------------------
1073 AC_ARG_ENABLE([local-sockets],
1074 [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
1075 [case "${enableval}" in
1076 yes)
1077 ENABLE_LOCAL_SOCKETS=yes
1078 ;;
1079 *)
1080 ENABLE_LOCAL_SOCKETS=no
1081 ;;
1082 esac],
1083 [])
1084 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
1085 then
1086 AC_CHECK_HEADER([sys/un.h])
1087 AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
1088 AC_MSG_ERROR([networking support not available]))
1089 AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
1090 fi
1091 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
1092
1093 dnl -----------------------------------------------------------
1094 dnl Add the default preference peer
1095 dnl -----------------------------------------------------------
1096 AC_SUBST(DEFAULT_PREFS_PEER)
1097
1098 dnl -----------------------------------------------------------
1099 dnl Set GNU MP related params
1100 dnl -----------------------------------------------------------
1101 WANT_NATIVE_BIG_INTEGER=false
1102 if test "x${COMPILE_GMP}" = xyes; then
1103 if test "x${ac_cv_lib_gmp___gmpz_mul_si}" = xyes; then
1104 if test "x${ac_cv_header_gmp_h}" = xyes; then
1105 WANT_NATIVE_BIG_INTEGER=true
1106 AC_DEFINE(WITH_GNU_MP, 1, [Define to 1 if gmp is usable])
1107 else
1108 COMPILE_GMP=no
1109 fi
1110 else
1111 COMPILE_GMP=no
1112 fi
1113 fi
1114 AC_SUBST(WANT_NATIVE_BIG_INTEGER)
1115 AM_CONDITIONAL(CREATE_GMPBI_LIBRARY, test "x${COMPILE_GMP}" = xyes)
1116
1117 dnl -----------------------------------------------------------
1118 dnl output files
1119 dnl -----------------------------------------------------------
1120 AC_CONFIG_FILES([Makefile
1121 doc/Makefile
1122 doc/api/Makefile
1123 external/Makefile
1124 external/sax/Makefile
1125 external/w3c_dom/Makefile
1126 external/relaxngDatatype/Makefile
1127 external/jsr166/Makefile
1128 gnu/classpath/Configuration.java
1129 gnu/java/security/Configuration.java
1130 include/Makefile
1131 native/Makefile
1132 native/fdlibm/Makefile
1133 native/jawt/Makefile
1134 native/jni/Makefile
1135 native/jni/classpath/Makefile
1136 native/jni/java-io/Makefile
1137 native/jni/java-lang/Makefile
1138 native/jni/java-math/Makefile
1139 native/jni/java-net/Makefile
1140 native/jni/java-nio/Makefile
1141 native/jni/java-util/Makefile
1142 native/jni/gtk-peer/Makefile
1143 native/jni/gconf-peer/Makefile
1144 native/jni/gstreamer-peer/Makefile
1145 native/jni/qt-peer/Makefile
1146 native/jni/xmlj/Makefile
1147 native/jni/midi-alsa/Makefile
1148 native/jni/midi-dssi/Makefile
1149 native/jni/native-lib/Makefile
1150 native/plugin/Makefile
1151 resource/Makefile
1152 resource/META-INF/services/java.util.prefs.PreferencesFactory
1153 resource/META-INF/services/javax.sound.sampled.spi.AudioFileReader
1154 resource/META-INF/services/javax.sound.sampled.spi.MixerProvider
1155 scripts/Makefile
1156 scripts/classpath.spec
1157 lib/Makefile
1158 lib/gen-classlist.sh
1159 lib/copy-vmresources.sh
1160 scripts/check_jni_methods.sh
1161 tools/Makefile
1162 examples/Makefile
1163 examples/Makefile.jawt
1164 examples/Makefile.java2d])
1165
1166 CLASSPATH_COND_IF([CREATE_WRAPPERS], [test "x${COMPILE_WRAPPERS}" = xyes], [],
1167 [AC_CONFIG_FILES([tools/gappletviewer
1168 tools/gjarsigner
1169 tools/gkeytool
1170 tools/gjar
1171 tools/gnative2ascii
1172 tools/gserialver
1173 tools/grmiregistry
1174 tools/gtnameserv
1175 tools/gorbd
1176 tools/grmid
1177 tools/grmic
1178 tools/gjavah])
1179
1180 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
1181 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
1182 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
1183 AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
1184 AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
1185 AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
1186 AC_CONFIG_COMMANDS([grmiregistry],[chmod 755 tools/grmiregistry])
1187 AC_CONFIG_COMMANDS([gtnameserv],[chmod 755 tools/gtnameserv])
1188 AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
1189 AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
1190 AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
1191 AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
1192 ])
1193
1194 if test "x${COMPILE_GJDOC}" = xyes
1195 then
1196 AC_CONFIG_FILES([tools/gjdoc])
1197 AC_CONFIG_COMMANDS([gjdoc], [chmod 755 tools/gjdoc])
1198 fi
1199
1200 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
1201 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
1202 AC_OUTPUT
1203
1204 # Create standard.omit based on decisions we just made.
1205 cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
1206 if test x$use_escher != xtrue; then
1207 echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit
1208 fi