OSDN Git Service

Imported GNU Classpath 0.90
[pf3gnuchains/gcc-fork.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.91],[classpath@gnu.org],[classpath])
10 AC_CONFIG_SRCDIR(java/lang/System.java)
11
12 AC_CANONICAL_TARGET
13
14 dnl -----------------------------------------------------------
15 dnl Fold all IA-32 CPU architectures into "x86"
16 dnl -----------------------------------------------------------
17 if expr ${target_cpu} : '.*86' > /dev/null; then target_cpu=x86; fi
18
19 dnl -----------------------------------------------------------
20 dnl We will not track/change lib version until we reach version 1.0
21 dnl at which time we'll have to be more anal about such things
22 dnl -----------------------------------------------------------
23 AC_SUBST(LIBVERSION, "0:0:0")
24 case "$host_os" in
25      darwin*)
26         cp_module=""
27         ;;
28         *)
29         cp_module="-module"
30         ;;
31 esac
32
33 CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
34 AC_SUBST(CLASSPATH_MODULE)
35
36 CLASSPATH_CONVENIENCE="-no-undefined"
37 AC_SUBST(CLASSPATH_CONVENIENCE)
38
39 AC_PREREQ(2.59)
40 AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar])
41 AC_CONFIG_HEADERS([include/config.h])
42 AC_PREFIX_DEFAULT(/usr/local/classpath)
43
44 dnl GCC LOCAL
45 GCC_NO_EXECUTABLES
46
47 dnl -----------------------------------------------------------
48 dnl Enable collections.jar (disabled by default)
49 dnl -----------------------------------------------------------
50 AC_ARG_ENABLE([collections],
51               [AS_HELP_STRING(--enable-collections,create collections.jar [default=no])],
52               [case x"${enableval}" in
53                 xyes) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
54                 xno) COMPILE_COLLECTIONS=no ;;
55                 x) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
56                 *) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"${enableval}\"" ;;
57               esac],
58               [COMPILE_COLLECTIONS=no])
59 AM_CONDITIONAL(CREATE_COLLECTIONS, test "x${COMPILE_COLLECTIONS}" = xyes)
60
61 dnl -----------------------------------------------------------
62 dnl Enable JNI libraries (enabled by default)
63 dnl -----------------------------------------------------------
64 AC_ARG_ENABLE([jni],
65               [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
66               [case "${enableval}" in 
67                 yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
68                 no) COMPILE_JNI=no ;;
69                 *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
70               esac],
71               [COMPILE_JNI=yes])
72 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
73
74 dnl -----------------------------------------------------------
75 dnl Enable core JNI libraries (enabled by default)
76 dnl -----------------------------------------------------------
77 AC_ARG_ENABLE([core-jni],
78               [AS_HELP_STRING(--enable-core-jni,
79                               compile JNI sources for core [default=yes])],
80               [case "${enableval}" in 
81                 yes) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
82                 no) COMPILE_CORE_JNI=no ;;
83                 *) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
84               esac],
85               [COMPILE_CORE_JNI=yes])
86 AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
87
88 dnl ------------------------------------------------------------
89 dnl Whether to compile with -Werror or not (disabled by default)
90 dnl ------------------------------------------------------------
91 AC_ARG_ENABLE([Werror],
92               [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
93               [case "${enableval}" in
94                 yes) ENABLE_WERROR=yes ;;
95                 no) ENABLE_WERROR=no ;;
96                 *) ENABLE_WERROR=no ;;
97               esac],
98               [ENABLE_WERROR=no])
99
100 dnl -----------------------------------------------------------
101 dnl Default AWT toolkit
102 dnl -----------------------------------------------------------
103 AC_ARG_ENABLE(default-toolkit,
104   AS_HELP_STRING([--enable-default-toolkit],
105                  [fully qualified class name of default AWT toolkit]))
106 default_toolkit=$enable_default_toolkit
107 if test "$default_toolkit" = ""; then
108    default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
109 fi
110 AC_SUBST(default_toolkit)
111
112 dnl -----------------------------------------------------------
113 dnl Native libxml/xslt library (disabled by default)
114 dnl -----------------------------------------------------------
115 AC_ARG_ENABLE([xmlj],
116               [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
117               [case "${enableval}" in
118                 yes) COMPILE_XMLJ=yes ;;
119                 no) COMPILE_XMLJ=no ;;
120                 *) COMPILE_XMLJ=no ;;
121               esac],
122               [COMPILE_XMLJ=no])
123 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
124
125 dnl -----------------------------------------------------------
126 dnl ALSA code (enabled by default)
127 dnl -----------------------------------------------------------
128 AC_ARG_ENABLE([alsa],
129               [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
130               [case "${enableval}" in
131                 yes) COMPILE_ALSA=yes ;;
132                 no) COMPILE_ALSA=no ;;
133                 *) COMPILE_ALSA=yes ;;
134               esac],
135               [AC_CHECK_HEADERS([alsa/asoundlib.h],
136                                 [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
137                                 COMPILE_ALSA=no)])
138 AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
139
140 dnl -----------------------------------------------------------
141 dnl DSSI code (enabled by default)
142 dnl -----------------------------------------------------------
143 AC_ARG_ENABLE([dssi],
144               [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
145               [case "${enableval}" in
146                 yes) COMPILE_DSSI=yes ;;
147                 no) COMPILE_DSSI=no ;;
148                 *) COMPILE_DSSI=yes ;;
149               esac],
150               [AC_CHECK_HEADERS([dssi.h],COMPILE_DSSI=yes,COMPILE_DSSI=no)])
151 AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
152
153 dnl -----------------------------------------------------------
154 dnl GTK native peer (enabled by default)
155 dnl -----------------------------------------------------------
156 AC_ARG_ENABLE([gtk-peer],
157               [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
158               [case "${enableval}" in
159                 yes) COMPILE_GTK_PEER=yes ;;
160                 no) COMPILE_GTK_PEER=no ;;
161                 *) COMPILE_GTK_PEER=yes ;;
162               esac],
163               [COMPILE_GTK_PEER=yes])
164 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
165
166 dnl -----------------------------------------------------------
167 dnl GTK native peer error checking 
168 dnl -----------------------------------------------------------
169 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
170
171 dnl ------------------------------------------------------------
172 dnl determine whether to enable the cairo GTK Graphics2D backend
173 dnl ------------------------------------------------------------
174 AC_ARG_ENABLE([gtk-cairo],
175               [AS_HELP_STRING(--enable-gtk-cairo,build the cairo Graphics2D implementation on GTK [default=no])],
176               [case "${enableval}" in
177                 yes) GTK_CAIRO_ENABLED=true ;;
178                 no) GTK_CAIRO_ENABLED=false ;;
179                 *) GTK_CAIRO_ENABLED=true ;;
180               esac],
181               [GTK_CAIRO_ENABLED=false])
182 AC_SUBST(GTK_CAIRO_ENABLED)
183 if test "x${GTK_CAIRO_ENABLED}" = xtrue; then
184   AC_DEFINE(GTK_CAIRO, 1, [defined if cairo support was built in])
185 fi
186 AM_CONDITIONAL(GTK_CAIRO, test "x${GTK_CAIRO_ENABLED}" = xtrue)
187
188 dnl -----------------------------------------------------------
189 dnl Qt native peer (disabled by default)
190 dnl -----------------------------------------------------------
191 AC_ARG_ENABLE([qt-peer],
192               [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
193               [case "${enableval}" in
194                 yes) COMPILE_QT_PEER=yes ;;
195                 no) COMPILE_QT_PEER=no ;;
196                 *) COMPILE_QT_PEER=yes ;;
197               esac],
198               [COMPILE_QT_PEER=no])
199 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
200
201
202 dnl -----------------------------------------------------------
203 dnl Sets the native libraries installation dir
204 dnl -----------------------------------------------------------
205 AC_ARG_WITH([native-libdir],
206             [AS_HELP_STRING(--with-native-libdir,sets the installation directore for native libraries [default='${libdir}/${PACKAGE}'])],
207             [
208              nativeexeclibdir=${withval}
209             ],
210             [
211              nativeexeclibdir='${libdir}/${PACKAGE}'
212             ])
213
214 AC_SUBST(nativeexeclibdir)
215
216 dnl -----------------------------------------------------------
217 dnl Sets the Java library installation dir.
218 dnl -----------------------------------------------------------
219 AC_ARG_WITH([glibj-dir],
220             [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
221             [
222              glibjdir=${withval}
223             ],
224             [
225              glibjdir='${datadir}/${PACKAGE}'
226             ])
227
228 AC_SUBST(glibjdir)
229
230 dnl -----------------------------------------------------------
231 dnl Regenerate headers at build time (disabled by default)
232 dnl -----------------------------------------------------------
233 AC_ARG_ENABLE([regen-headers],
234               [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=no])],
235               [case "${enableval}" in
236                 yes) REGENERATE_JNI_HEADERS=yes ;;
237                 no) REGENERATE_JNI_HEADERS=no ;;
238                 *) REGENERATE_JNI_HEADERS=no ;;
239               esac],
240               [REGENERATE_JNI_HEADERS=no])
241 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
242
243 AC_PROG_LN_S
244 AC_PROG_INSTALL
245
246 dnl -----------------------------------------------------------
247 dnl Checks for programs.
248 dnl -----------------------------------------------------------
249
250 dnl Initialize libtool
251 AC_DISABLE_STATIC
252 AC_PROG_LIBTOOL
253 dnl AC_PROG_AWK
254 AC_PROG_CC
255 AC_PROG_CPP
256 AC_PROG_CXX
257
258 if test "x${COMPILE_COLLECTIONS}" = xyes; then
259   AC_PATH_PROG(PERL, [perl])
260   AC_SUBST(PERL)
261   AC_SUBST(COLLECTIONS_PREFIX)
262   AC_CONFIG_FILES([lib/mkcollections.pl])
263   AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
264 fi
265
266 if test "x${COMPILE_JNI}" = xyes; then
267   AC_HEADER_STDC
268
269   dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64, 
270   dnl at least. 
271   AC_COMPILE_CHECK_SIZEOF(void *)
272
273   dnl Checking for endianess.
274   AC_C_BIGENDIAN_CROSS
275   
276   dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
277   dnl On that system, sys/ioctl.h will not include sys/filio.h unless
278   dnl BSD_COMP is defined; just including sys/filio.h is simpler.
279   dnl Check for crt_externs.h on Darwin.
280   AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
281                     asm/ioctls.h \
282                     inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
283                     sys/time.h \
284                     sys/select.h \
285                     crt_externs.h \
286                     fcntl.h \
287                     sys/mman.h])
288
289   AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
290   AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
291   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]))
292   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]))
293
294   AC_CHECK_FUNCS([ftruncate fsync select \
295                   gethostname socket strerror fork pipe execve open close \
296                   lseek fstat read write htonl memset htons connect \
297                   getsockname getpeername bind listen accept \
298                   recvfrom send sendto setsockopt getsockopt time mktime \
299                   localtime_r \
300                   strerror_r \
301                   fcntl \
302                   mmap munmap mincore msync madvise getpagesize sysconf \
303                   ])
304
305   AC_HEADER_TIME
306   AC_STRUCT_TM
307   AC_STRUCT_TIMEZONE
308
309   AC_MSG_CHECKING([for tm_gmtoff in struct tm])
310   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
311   [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
312    AC_MSG_RESULT(yes)],
313   [AC_MSG_RESULT(no)
314    AC_MSG_CHECKING([for global timezone variable])
315    dnl FIXME: we don't want a link check here because that won't work
316    dnl when cross-compiling.  So instead we make an assumption that
317    dnl the header file will mention timezone if it exists.
318    dnl Don't find the win32 function timezone
319    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
320      [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
321       AC_MSG_RESULT(yes)],
322      [AC_MSG_RESULT(no)
323        AC_MSG_CHECKING([for global _timezone variable])
324        dnl FIXME: As above, don't want link check
325        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
326          [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
327             [Define if your platform has the global _timezone variable.])
328           AC_MSG_RESULT(yes)],
329           [AC_MSG_RESULT(no)])])])
330
331   AC_C_CONST
332   AC_C_ATTRIBUTE
333
334   dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
335   AM_ICONV
336
337   dnl When using gcc we want warnings, lots of warnings :-)
338   if test "x${GCC}" = xyes; then
339     dnl We want ISO C90 pedantic ansi, but with longlong (jlong) support
340     dnl and modern POSIX and BSD C library functions/prototypes.
341
342     dnl Warning flags for (almost) everybody.
343     dnl Should probably be configurable
344     WARNING_CFLAGS='-pedantic -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
345     AC_SUBST(WARNING_CFLAGS)
346
347     dnl Strict warning flags which not every module uses.
348     dnl Should probably be configurable.
349     STRICT_WARNING_CFLAGS=-Wstrict-prototypes
350     AC_SUBST(STRICT_WARNING_CFLAGS)
351
352     dnl Whether or not to add -Werror, also not used by all modueles.
353     dnl Can be configured by --disable-Werror
354     ERROR_CFLAGS=
355     if test "x${ENABLE_WERROR}" = xyes; then
356        ERROR_CFLAGS='-Werror'
357     fi
358     AC_SUBST(ERROR_CFLAGS)
359   fi
360
361   dnl Check for libxml and libxslt libraries (when xmlj is enabled).
362   if test "x${COMPILE_XMLJ}" = xyes; then
363     PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
364     PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
365     AC_SUBST(XML_LIBS)
366     AC_SUBST(XML_CFLAGS)
367     AC_SUBST(XSLT_LIBS)
368     AC_SUBST(XSLT_CFLAGS)
369   fi
370
371   dnl Check for AWT related gthread/gtk
372   if test "x${COMPILE_GTK_PEER}" = xyes; then
373     AC_PATH_XTRA
374     if test "$no_x" = yes; then
375         AC_MSG_ERROR([GTK+ peers requested but no X library available])
376     fi
377     dnl We explicitly want the XTest Extension for Robot support.
378     AC_CHECK_LIB([Xtst], [XTestQueryExtension], [true],
379           [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
380           [${X_LIBS}])
381     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
382
383     if test "x${enable_gtk_cairo}" = xyes; then
384       PKG_CHECK_MODULES(CAIRO, cairo >= 0.5.0)
385     fi
386
387     PKG_CHECK_MODULES(FREETYPE2, freetype2)
388     PKG_CHECK_MODULES(PANGOFT2, pangoft2)
389
390     AC_SUBST(GTK_CFLAGS)
391     AC_SUBST(GTK_LIBS)
392     AC_SUBST(CAIRO_LIBS)
393     AC_SUBST(CAIRO_CFLAGS)
394     AC_SUBST(FREETYPE2_LIBS)
395     AC_SUBST(FREETYPE2_CFLAGS)
396     AC_SUBST(PANGOFT2_LIBS)
397     AC_SUBST(PANGOFT2_CFLAGS)
398   fi
399
400   dnl Check for AWT related Qt4
401   if test "x${COMPILE_QT_PEER}" = xyes; then
402     PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
403     if test "x$HAVE_QT4" = "xyes"; then
404       dnl Check needed because in some cases the QtGui includedir
405       dnl doesn't contain the subsystem dir.
406       QT_INCLUDE_DIR=$($PKG_CONFIG --variable=includedir QtGui)
407       EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
408       AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
409       AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
410       AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
411         QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
412         AC_MSG_WARN([QWidget not found])))
413         AC_CHECK_PROG(MOC, [moc], [moc])
414     fi
415     if test "x$HAVE_QT4" = "xno"; then
416       AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
417       case "$host_os" in
418         darwin*)
419           AC_ARG_WITH([qt4dir],
420             [AS_HELP_STRING([--with-qt4dir=DIR],
421             [Qt4 installation directory used for OS-X.
422             For other systems use pkg-config.])],
423             [QT4DIR=$withval]
424             )
425           if test x"$QT4DIR" = x ; then
426             AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
427           fi
428           AC_MSG_RESULT([QT4DIR... $QT4DIR])
429           AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
430           if test x"$MOC" = x; then
431             AC_MSG_ERROR([*** This is not the right Qt installation])
432           fi
433           QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
434           QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
435           QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
436           QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
437           ;;
438         *)
439           AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
440           of your installed Qt4 installation.])
441           ;;
442       esac
443     fi
444     AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
445     AC_SUBST(QT_CFLAGS)
446     AC_SUBST(QT_LIBS)
447   fi
448 fi
449
450 CLASSPATH_WITH_JAVAH
451
452 dnl ----------------------------------------------------------- 
453 dnl Add the include files for the native abstraction layer.
454 dnl Used by AM_CPPFLAGS in the different modules.
455 dnl -----------------------------------------------------------
456 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/target/Linux -I\$(top_srcdir)/native/target/generic"
457 AC_SUBST(CLASSPATH_INCLUDES)
458
459 dnl -----------------------------------------------------------
460 if test "x${COMPILE_JNI}" = xyes; then
461   AC_MSG_CHECKING(jni_md.h support)
462   if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
463     AC_MSG_RESULT(yes)
464   else
465     target_cpu=x86
466     target_os=linux-gnu 
467     AC_MSG_WARN(no, using x86-linux-gnu)
468   fi
469   ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
470   ac_dests="include/jni_md.h"
471   while test -n "$ac_sources"; do
472     set $ac_dests; ac_dest=$1; shift; ac_dests=$*
473     set $ac_sources; ac_source=$1; shift; ac_sources=$*
474     ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
475   done
476   AC_CONFIG_LINKS([$ac_config_links_1])
477 fi
478
479 CLASSPATH_FIND_JAVAC
480
481 CLASSPATH_WITH_CLASSLIB
482
483 dnl -----------------------------------------------------------
484 dnl Initialize maintainer mode
485 dnl -----------------------------------------------------------
486 AM_MAINTAINER_MODE
487
488 dnl -----------------------------------------------------------
489 dnl Enable debugging statements at compile time.  By default
490 dnl these statements should be optimized out of the bytecode
491 dnl produced by an optimizing Java compiler and not hinder 
492 dnl performance because debugging is turned off by default.
493 dnl -----------------------------------------------------------
494 AC_ARG_ENABLE([debug],
495               [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
496               [case "${enableval}" in 
497                 yes) 
498                 LIBDEBUG="true"
499                 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled]) 
500                 ;;
501                 no)   LIBDEBUG="false" ;;
502                 *)      AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
503               esac],
504               [LIBDEBUG="false"])
505 AC_SUBST(LIBDEBUG)
506
507 dnl -----------------------------------------------------------
508 dnl Enable execution of all static initializer loadLibrary() 
509 dnl calls at compile time.  By default most people will not
510 dnl want to disable this, but some VMs (gcj) don't need or want 
511 dnl them.
512 dnl -----------------------------------------------------------
513 AC_ARG_ENABLE([load-library],
514               [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
515               [case "${enableval}" in 
516                 yes) INIT_LOAD_LIBRARY="true" ;;
517                 no) INIT_LOAD_LIBRARY="false" ;;
518                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
519               esac],
520               [INIT_LOAD_LIBRARY="true"])
521 AC_SUBST(INIT_LOAD_LIBRARY)
522
523
524 dnl -----------------------------------------------------------
525 dnl Should the VM explicitly run class initialization subfunctions for
526 dnl java.lang.System?   (default is false -- the subfunctions will be run 
527 dnl automatically by the class initializer)
528 dnl -----------------------------------------------------------
529 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
530               [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
531               [case "${enableval}" in 
532                 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
533                 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
534                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
535               esac],
536               [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
537 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
538
539
540 dnl -----------------------------------------------------------
541 dnl avoiding automake complaints
542 dnl -----------------------------------------------------------
543 REMOVE=""
544 AC_SUBST(REMOVE)
545
546 dnl -----------------------------------------------------------
547 dnl This is probably useless.
548 dnl -----------------------------------------------------------
549 AC_PATH_PROG(MKDIR, mkdir)
550 AC_PATH_PROG(CP, cp)
551 AC_PATH_PROG(DATE, date)
552
553 dnl -----------------------------------------------------------
554 dnl According to the GNU coding guide, we shouldn't require find, 
555 dnl and zip, however GNU provides both so it should be okay 
556 dnl -----------------------------------------------------------
557 AC_PATH_PROG(FIND, find)
558
559 dnl -----------------------------------------------------------
560 dnl Specify what to install (install only glibj.zip by default)
561 dnl -----------------------------------------------------------
562 CLASSPATH_WITH_GLIBJ
563
564 dnl -----------------------------------------------------------
565 dnl Enable API documentation generation (disabled by default)
566 dnl -----------------------------------------------------------
567 CLASSPATH_WITH_GJDOC
568
569 dnl -----------------------------------------------------------
570 dnl Whether to use jay to regenerate parsers.
571 dnl -----------------------------------------------------------
572 REGEN_WITH_JAY
573
574 dnl -----------------------------------------------------------
575 dnl This sets the build-time default, which can now be overridden 
576 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
577 dnl to "true" or "false".
578 dnl -----------------------------------------------------------
579 AC_ARG_ENABLE([portable-native-sync],
580               [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
581               [case "${enableval}" in 
582                 yes) 
583                      AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
584                      ;;
585                 no)  ;;
586                 *)   
587                      AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync) 
588                      ;;
589               esac],
590               [])
591
592 AX_CREATE_STDINT_H([include/config-int.h])
593
594 dnl -----------------------------------------------------------------------
595 dnl                    Support for using a prebuilt class library
596 dnl -----------------------------------------------------------------------
597 AC_ARG_WITH([glibj_zip],
598             AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
599                            [use prebuilt glibj.zip class library]))
600
601 case "$with_glibj_zip" in
602 "")
603         use_glibj_zip=false
604         ;;
605 "no" )
606         use_glibj_zip=false
607         ;;
608 "yes")
609         AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
610         ;;
611 *)
612         use_glibj_zip=true
613         PATH_TO_GLIBJ_ZIP=$with_glibj_zip
614         ;;
615 esac;
616
617 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
618 AC_SUBST(PATH_TO_GLIBJ_ZIP)
619
620
621 dnl -----------------------------------------------------------
622 dnl Check if local socket support should be included.
623 dnl -----------------------------------------------------------
624 AC_ARG_ENABLE([local-sockets],
625               [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
626               [case "${enableval}" in
627                 yes)
628                   ENABLE_LOCAL_SOCKETS=yes
629                   ;;
630                 *)
631                   ENABLE_LOCAL_SOCKETS=no
632                   ;;
633                esac],
634               [])
635 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
636 then
637   AC_CHECK_HEADER([sys/un.h])
638   AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
639                  AC_MSG_ERROR([networking support not available]))
640   AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
641 fi
642 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
643
644
645 dnl -----------------------------------------------------------
646 dnl output files
647 dnl -----------------------------------------------------------
648 AC_CONFIG_FILES([Makefile
649 doc/Makefile
650 doc/api/Makefile
651 external/Makefile
652 external/sax/Makefile
653 external/w3c_dom/Makefile
654 external/relaxngDatatype/Makefile
655 gnu/classpath/Configuration.java
656 include/Makefile
657 native/Makefile
658 native/fdlibm/Makefile
659 native/jawt/Makefile
660 native/jni/Makefile
661 native/jni/classpath/Makefile
662 native/jni/java-io/Makefile
663 native/jni/java-lang/Makefile
664 native/jni/java-net/Makefile
665 native/jni/java-nio/Makefile
666 native/jni/java-util/Makefile
667 native/jni/gtk-peer/Makefile
668 native/jni/qt-peer/Makefile
669 native/jni/xmlj/Makefile
670 native/jni/midi-alsa/Makefile
671 native/jni/midi-dssi/Makefile
672 native/target/Makefile
673 native/target/Linux/Makefile
674 native/target/generic/Makefile
675 resource/Makefile
676 scripts/Makefile
677 scripts/classpath.spec
678 lib/Makefile
679 lib/gen-classlist.sh
680 lib/copy-vmresources.sh
681 tools/Makefile
682 tools/jarsigner.sh
683 tools/keytool.sh
684 examples/Makefile
685 examples/Makefile.jawt])
686 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
687 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
688 AC_OUTPUT