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