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.17+cvs],[classpath@gnu.org],[classpath])
10 AC_CONFIG_SRCDIR(java/lang/System.java)
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 CLASSPATH_MODULE="-module -version-info ${LIBVERSION} -no-undefined"
25 AC_SUBST(CLASSPATH_MODULE)
28 AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar])
29 AC_CONFIG_HEADERS([include/config.h])
30 AC_PREFIX_DEFAULT(/usr/local/classpath)
32 dnl -----------------------------------------------------------
33 dnl Enable JNI libraries (enabled by default)
34 dnl -----------------------------------------------------------
36 [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
37 [case "${enableval}" in
38 yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
40 *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
43 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
45 dnl -----------------------------------------------------------
46 dnl Enable core JNI libraries (enabled by default)
47 dnl -----------------------------------------------------------
48 AC_ARG_ENABLE([core-jni],
49 [AS_HELP_STRING(--enable-core-jni,
50 compile JNI sources for core [default=yes])],
51 [case "${enableval}" in
52 yes) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
53 no) COMPILE_CORE_JNI=no ;;
54 *) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
56 [COMPILE_CORE_JNI=yes])
57 AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
59 dnl -----------------------------------------------------------
60 dnl Whether to compile with -Werror or not (enabled by default)
61 dnl -----------------------------------------------------------
62 AC_ARG_ENABLE([Werror],
63 [AS_HELP_STRING(--disable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
64 [case "${enableval}" in
65 yes) ENABLE_WERROR=yes ;;
66 no) ENABLE_WERROR=no ;;
67 *) ENABLE_WERROR=yes ;;
71 dnl -----------------------------------------------------------
72 dnl Default AWT toolkit
73 dnl -----------------------------------------------------------
74 AC_ARG_ENABLE(default-toolkit,
75 AS_HELP_STRING([--enable-default-toolkit],
76 [fully qualified class name of default AWT toolkit]))
77 default_toolkit=$enable_default_toolkit
78 if test "$default_toolkit" = ""; then
79 default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
81 AC_SUBST(default_toolkit)
83 dnl -----------------------------------------------------------
84 dnl Native libxml/xslt library (disabled by default)
85 dnl -----------------------------------------------------------
87 [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
88 [case "${enableval}" in
89 yes) COMPILE_XMLJ=yes ;;
90 no) COMPILE_XMLJ=no ;;
94 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
96 dnl -----------------------------------------------------------
97 dnl GTK native peer (enabled by default)
98 dnl -----------------------------------------------------------
99 AC_ARG_ENABLE([gtk-peer],
100 [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
101 [case "${enableval}" in
102 yes) COMPILE_GTK_PEER=yes ;;
103 no) COMPILE_GTK_PEER=no ;;
104 *) COMPILE_GTK_PEER=yes ;;
106 [COMPILE_GTK_PEER=yes])
107 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
109 dnl -----------------------------------------------------------
110 dnl GTK native peer error checking
111 dnl -----------------------------------------------------------
112 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
114 dnl ------------------------------------------------------------
115 dnl determine whether to enable the cairo GTK Graphics2D backend
116 dnl ------------------------------------------------------------
117 AC_ARG_ENABLE([gtk-cairo],
118 [AS_HELP_STRING(--enable-gtk-cairo,build the cairo Graphics2D implementation on GTK [default=no])],
119 [case "${enableval}" in
120 yes) GTK_CAIRO_ENABLED=true ;;
121 no) GTK_CAIRO_ENABLED=false ;;
122 *) GTK_CAIRO_ENABLED=true ;;
124 [GTK_CAIRO_ENABLED=false])
125 AC_SUBST(GTK_CAIRO_ENABLED)
126 if test "x${GTK_CAIRO_ENABLED}" = xtrue; then
127 AC_DEFINE(GTK_CAIRO, 1, [defined if cairo support was built in])
129 AM_CONDITIONAL(GTK_CAIRO, test "x${GTK_CAIRO_ENABLED}" = xtrue)
131 dnl -----------------------------------------------------------
132 dnl Regenerate headers at build time (disabled by default)
133 dnl -----------------------------------------------------------
134 AC_ARG_ENABLE([regen-headers],
135 [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=no])],
136 [case "${enableval}" in
137 yes) REGENERATE_JNI_HEADERS=yes ;;
138 no) REGENERATE_JNI_HEADERS=no ;;
139 *) REGENERATE_JNI_HEADERS=no ;;
141 [REGENERATE_JNI_HEADERS=no])
142 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
147 dnl -----------------------------------------------------------
148 dnl Checks for programs.
149 dnl -----------------------------------------------------------
151 dnl Initialize libtool
158 if test "x${COMPILE_JNI}" = xyes; then
161 dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
163 AC_COMPILE_CHECK_SIZEOF(void *)
165 dnl Checking for endianess.
168 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
169 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
170 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
171 dnl Check for crt_externs.h on Darwin.
172 AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
174 inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
180 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
181 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
182 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]))
183 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]))
185 AC_CHECK_FUNCS([ftruncate fsync select \
186 gethostname socket strerror fork pipe execve open close \
187 lseek fstat read write htonl memset htons connect \
188 getsockname getpeername bind listen accept \
189 recvfrom send sendto setsockopt getsockopt time mktime \
198 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
199 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
200 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
203 AC_MSG_CHECKING([for global timezone variable])
204 dnl FIXME: we don't want a link check here because that won't work
205 dnl when cross-compiling. So instead we make an assumption that
206 dnl the header file will mention timezone if it exists.
207 dnl Don't find the win32 function timezone
208 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
209 [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
212 AC_MSG_CHECKING([for global _timezone variable])
213 dnl FIXME: As above, don't want link check
214 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
215 [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
216 [Define if your platform has the global _timezone variable.])
218 [AC_MSG_RESULT(no)])])])
222 dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
225 dnl When using gcc we want warnings, lots of warnings :-)
226 if test "x${GCC}" = xyes; then
227 dnl We want ISO C90 pedantic ansi, but with longlong (jlong) support
228 dnl and modern POSIX and BSD C library functions/prototypes.
230 dnl Warning flags for (almost) everybody.
231 dnl Should probably be configurable
232 WARNING_CFLAGS='-pedantic -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
233 AC_SUBST(WARNING_CFLAGS)
235 dnl Strict warning flags which not every module uses.
236 dnl Should probably be configurable.
237 STRICT_WARNING_CFLAGS=-Wstrict-prototypes
238 AC_SUBST(STRICT_WARNING_CFLAGS)
240 dnl Whether or not to add -Werror, also not used by all modueles.
241 dnl Can be configured by --disable-Werror
243 if test "x${ENABLE_WERROR}" = xyes; then
244 ERROR_CFLAGS='-Werror'
246 AC_SUBST(ERROR_CFLAGS)
249 dnl Check for libxml and libxslt libraries (when xmlj is enabled).
250 if test "x${COMPILE_XMLJ}" = xyes; then
251 PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
252 PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
256 AC_SUBST(XSLT_CFLAGS)
259 dnl Check for AWT related gthread/gtk
260 if test "x${COMPILE_GTK_PEER}" = xyes; then
262 if test "$no_x" = yes; then
263 AC_MSG_ERROR([GTK+ peers requested but no X library available])
265 dnl We explicitly want the XTest Extension for Robot support.
266 AC_CHECK_LIB([Xtst], [XTestQueryExtension], [true],
267 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
269 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
274 if test "x${enable_gtk_cairo}" = xyes; then
275 PKG_CHECK_MODULES(CAIRO, cairo >= 0.5.0)
276 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
279 AC_SUBST(CAIRO_CFLAGS)
280 AC_SUBST(PANGOFT2_LIBS)
281 AC_SUBST(PANGOFT2_CFLAGS)
286 dnl -----------------------------------------------------------
287 dnl Add the include files for the native abstraction layer.
288 dnl Used by AM_CPPFLAGS in the different modules.
289 dnl -----------------------------------------------------------
290 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/target/Linux -I\$(top_srcdir)/native/target/generic"
291 AC_SUBST(CLASSPATH_INCLUDES)
293 dnl -----------------------------------------------------------
294 if test "x${COMPILE_JNI}" = xyes; then
295 AC_MSG_CHECKING(jni_md.h support)
296 if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
301 AC_MSG_WARN(no, using x86-linux-gnu)
303 ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
304 ac_dests="include/jni_md.h"
305 while test -n "$ac_sources"; do
306 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
307 set $ac_sources; ac_source=$1; shift; ac_sources=$*
308 ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
310 AC_CONFIG_LINKS([$ac_config_links_1])
315 CLASSPATH_WITH_CLASSLIB
317 dnl -----------------------------------------------------------
318 dnl Initialize maintainer mode
319 dnl -----------------------------------------------------------
322 dnl -----------------------------------------------------------
323 dnl Enable debugging statements at compile time. By default
324 dnl these statements should be optimized out of the bytecode
325 dnl produced by an optimizing Java compiler and not hinder
326 dnl performance because debugging is turned off by default.
327 dnl -----------------------------------------------------------
328 AC_ARG_ENABLE([debug],
329 [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
330 [case "${enableval}" in
333 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
335 no) LIBDEBUG="false" ;;
336 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
341 dnl -----------------------------------------------------------
342 dnl Enable execution of all static initializer loadLibrary()
343 dnl calls at compile time. By default most people will not
344 dnl want to disable this, but some VMs (gcj) don't need or want
346 dnl -----------------------------------------------------------
347 AC_ARG_ENABLE([load-library],
348 [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
349 [case "${enableval}" in
350 yes) INIT_LOAD_LIBRARY="true" ;;
351 no) INIT_LOAD_LIBRARY="false" ;;
352 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
354 [INIT_LOAD_LIBRARY="true"])
355 AC_SUBST(INIT_LOAD_LIBRARY)
358 dnl -----------------------------------------------------------
359 dnl Should the VM explicitly run class initialization subfunctions for
360 dnl java.lang.System? (default is false -- the subfunctions will be run
361 dnl automatically by the class initializer)
362 dnl -----------------------------------------------------------
363 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
364 [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
365 [case "${enableval}" in
366 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
367 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
368 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
370 [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
371 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
374 dnl -----------------------------------------------------------
375 dnl avoiding automake complaints
376 dnl -----------------------------------------------------------
380 dnl -----------------------------------------------------------
381 dnl This is probably useless.
382 dnl -----------------------------------------------------------
384 AC_PATH_PROG(MKDIR, mkdir)
386 AC_PATH_PROG(DATE, date)
388 dnl -----------------------------------------------------------
389 dnl According to the GNU coding guide, we shouldn't require find,
390 dnl and zip, however GNU provides both so it should be okay
391 dnl -----------------------------------------------------------
392 AC_PATH_PROG(FIND, find)
394 dnl -----------------------------------------------------------
395 dnl Specify what to install (install only glibj.zip by default)
396 dnl -----------------------------------------------------------
399 dnl -----------------------------------------------------------
400 dnl Enable API documentation generation (disabled by default)
401 dnl -----------------------------------------------------------
404 dnl -----------------------------------------------------------
405 dnl Whether to use jay to regenerate parsers.
406 dnl -----------------------------------------------------------
409 dnl -----------------------------------------------------------
410 dnl This sets the build-time default, which can now be overridden
411 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
412 dnl to "true" or "false".
413 dnl -----------------------------------------------------------
414 AC_ARG_ENABLE([portable-native-sync],
415 [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
416 [case "${enableval}" in
418 AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
422 AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
427 dnl -----------------------------------------------------------
429 dnl -----------------------------------------------------------
430 AC_CONFIG_FILES([Makefile
434 external/sax/Makefile
435 external/w3c_dom/Makefile
436 gnu/classpath/Configuration.java
439 native/fdlibm/Makefile
441 native/jni/classpath/Makefile
442 native/jni/java-io/Makefile
443 native/jni/java-lang/Makefile
444 native/jni/java-net/Makefile
445 native/jni/java-nio/Makefile
446 native/jni/java-util/Makefile
447 native/jni/gtk-peer/Makefile
448 native/jni/xmlj/Makefile
449 native/target/Makefile
450 native/target/Linux/Makefile
451 native/target/generic/Makefile
454 scripts/classpath.spec
458 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])