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