re PR libgcj/27890 (lib/logging.properties pollutes common namespace)
[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.92],[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 -----------------------------------------------------------
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)
57
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)
70
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)
84
85 dnl -----------------------------------------------------------
86 dnl Default Preference Backend
87 dnl -----------------------------------------------------------
88 AC_ARG_ENABLE(default-preferences-peer,
89 AS_HELP_STRING([--enable-default-preferences-peer],
90 [fully qualified class name of default Preferences API Backend]))
91 DEFAULT_PREFS_PEER=$enable_default_preferences_peer
92 if test "$DEFAULT_PREFS_PEER" = ""; then
93 DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory
94 fi
95 dnl AC_SUBST(DEFAULT_PREFS_PEER)
96
97 dnl -----------------------------------------------------------
98 dnl GConf native peer (enabled by default)
99 dnl -----------------------------------------------------------
100 AC_ARG_ENABLE([gconf-peer],
101 [AS_HELP_STRING(--disable-gconf-peer,compile GConf native peers (disabled by --disable-jni) [default=yes])],
102 [case "${enableval}" in
103 yes) COMPILE_GCONF_PEER=yes ;;
104 no) COMPILE_GCONF_PEER=no ;;
105 *) COMPILE_GCONF_PEER=yes ;;
106 esac],
107 [COMPILE_GCONF_PEER=yes])
108 AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
109
110 dnl -----------------------------------------------------------
111 dnl GTK native peer error checking
112 dnl -----------------------------------------------------------
113 AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
114
115 dnl ------------------------------------------------------------
116 dnl Whether to compile with -Werror or not (disabled by default)
117 dnl ------------------------------------------------------------
118 AC_ARG_ENABLE([Werror],
119 [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
120 [case "${enableval}" in
121 yes) ENABLE_WERROR=yes ;;
122 no) ENABLE_WERROR=no ;;
123 *) ENABLE_WERROR=no ;;
124 esac],
125 [ENABLE_WERROR=no])
126
127 dnl -----------------------------------------------------------
128 dnl Default AWT toolkit
129 dnl -----------------------------------------------------------
130 AC_ARG_ENABLE(default-toolkit,
131 AS_HELP_STRING([--enable-default-toolkit],
132 [fully qualified class name of default AWT toolkit]))
133 default_toolkit=$enable_default_toolkit
134 if test "$default_toolkit" = ""; then
135 default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
136 fi
137 AC_SUBST(default_toolkit)
138
139 dnl -----------------------------------------------------------
140 dnl Native libxml/xslt library (disabled by default)
141 dnl -----------------------------------------------------------
142 AC_ARG_ENABLE([xmlj],
143 [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
144 [case "${enableval}" in
145 yes) COMPILE_XMLJ=yes ;;
146 no) COMPILE_XMLJ=no ;;
147 *) COMPILE_XMLJ=no ;;
148 esac],
149 [COMPILE_XMLJ=no])
150 AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
151
152 dnl -----------------------------------------------------------
153 dnl ALSA code (enabled by default)
154 dnl -----------------------------------------------------------
155 AC_ARG_ENABLE([alsa],
156 [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
157 [case "${enableval}" in
158 yes) COMPILE_ALSA=yes ;;
159 no) COMPILE_ALSA=no ;;
160 *) COMPILE_ALSA=yes ;;
161 esac],
162 [AC_CHECK_HEADERS([alsa/asoundlib.h],
163 [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
164 COMPILE_ALSA=no)])
165 AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
166
167 dnl -----------------------------------------------------------
168 dnl DSSI code (enabled by default)
169 dnl -----------------------------------------------------------
170 AC_ARG_ENABLE([dssi],
171 [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
172 [case "${enableval}" in
173 yes) COMPILE_DSSI=yes ;;
174 no) COMPILE_DSSI=no ;;
175 *) COMPILE_DSSI=yes ;;
176 esac],
177 [AC_CHECK_HEADERS([dssi.h],COMPILE_DSSI=yes,COMPILE_DSSI=no)])
178 AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
179
180 dnl -----------------------------------------------------------
181 dnl GTK native peer (enabled by default)
182 dnl -----------------------------------------------------------
183 AC_ARG_ENABLE([gtk-peer],
184 [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
185 [case "${enableval}" in
186 yes) COMPILE_GTK_PEER=yes ;;
187 no) COMPILE_GTK_PEER=no ;;
188 *) COMPILE_GTK_PEER=yes ;;
189 esac],
190 [COMPILE_GTK_PEER=yes])
191 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
192
193 dnl -----------------------------------------------------------
194 dnl GTK native peer error checking
195 dnl -----------------------------------------------------------
196 AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
197
198 dnl -----------------------------------------------------------
199 dnl Qt native peer (disabled by default)
200 dnl -----------------------------------------------------------
201 AC_ARG_ENABLE([qt-peer],
202 [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
203 [case "${enableval}" in
204 yes) COMPILE_QT_PEER=yes ;;
205 no) COMPILE_QT_PEER=no ;;
206 *) COMPILE_QT_PEER=yes ;;
207 esac],
208 [COMPILE_QT_PEER=no])
209 AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
210
211 dnl -----------------------------------------------------------
212 dnl Plugin (enabled by default)
213 dnl -----------------------------------------------------------
214 AC_ARG_ENABLE([plugin],
215 [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
216 [case "${enableval}" in
217 yes) COMPILE_PLUGIN=yes ;;
218 no) COMPILE_PLUGIN=no ;;
219 *) COMPILE_PLUGIN=yes ;;
220 esac],
221 [COMPILE_PLUGIN=yes])
222 AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
223
224 dnl -----------------------------------------------------------
225 dnl GCJ LOCAL: Calculates and substitutes toolexeclibdir. $libdir is
226 dnl defined to the same value for all multilibs. We define toolexeclibdir
227 dnl so that we can refer to the multilib installation directories from
228 dnl classpath's build files.
229 dnl -----------------------------------------------------------
230 CLASSPATH_TOOLEXECLIBDIR
231
232 dnl -----------------------------------------------------------
233 dnl Sets the native libraries installation dir
234 dnl -----------------------------------------------------------
235 dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}
236 AC_ARG_WITH([native-libdir],
237 [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
238 [
239 nativeexeclibdir=${withval}
240 ],
241 [
242 nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
243 ])
244
245 AC_SUBST(nativeexeclibdir)
246
247 dnl -----------------------------------------------------------
248 dnl Sets the Java library installation dir.
249 dnl -----------------------------------------------------------
250 AC_ARG_WITH([glibj-dir],
251 [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
252 [
253 glibjdir=${withval}
254 ],
255 [
256 glibjdir='${datadir}/${PACKAGE}'
257 ])
258
259 AC_SUBST(glibjdir)
260
261 dnl -----------------------------------------------------------
262 dnl Sets the VM name for use in tool wrapper scripts
263 dnl -----------------------------------------------------------
264 AC_ARG_WITH([vm],
265 [AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
266 [
267 VM_BINARY=${withval}
268 ],
269 [
270 VM_BINARY='${prefix}/bin/jamvm'
271 ])
272
273 AC_SUBST(VM_BINARY)
274 AM_CONDITIONAL(FOUND_CACAO, test "x`basename $VM_BINARY`" = xcacao)
275
276 dnl -----------------------------------------------------------
277 dnl Regenerate headers at build time (disabled by default)
278 dnl -----------------------------------------------------------
279 AC_ARG_ENABLE([regen-headers],
280 [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=no])],
281 [case "${enableval}" in
282 yes) REGENERATE_JNI_HEADERS=yes ;;
283 no) REGENERATE_JNI_HEADERS=no ;;
284 *) REGENERATE_JNI_HEADERS=no ;;
285 esac],
286 [REGENERATE_JNI_HEADERS=no])
287 AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
288
289 dnl -----------------------------------------------------------
290 dnl Enable tool wrapper binaries (disabled by default)
291 dnl -----------------------------------------------------------
292 AC_ARG_ENABLE([tool-wrappers],
293 [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
294 [case x"${enableval}" in
295 xyes) COMPILE_WRAPPERS=yes ;;
296 xno) COMPILE_WRAPPERS=no ;;
297 x) COMPILE_WRAPPERS=yes ;;
298 *) COMPILE_WRAPPERS=yes ;;
299 esac],
300 [COMPILE_WRAPPERS=no])
301 AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
302
303 AC_PROG_LN_S
304 AC_PROG_INSTALL
305
306 dnl -----------------------------------------------------------
307 dnl Checks for programs.
308 dnl -----------------------------------------------------------
309 AC_PROG_CXX
310 dnl Initialize libtool
311 AC_DISABLE_STATIC
312 AC_PROG_LIBTOOL
313 dnl AC_PROG_AWK
314 AC_PROG_CC
315 AC_PROG_CPP
316
317 if test "x${COMPILE_COLLECTIONS}" = xyes; then
318 AC_PATH_PROG(PERL, [perl])
319 AC_SUBST(PERL)
320 AC_SUBST(COLLECTIONS_PREFIX)
321 AC_CONFIG_FILES([lib/mkcollections.pl])
322 AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
323 fi
324
325 if test "x${COMPILE_JNI}" = xyes; then
326 AC_HEADER_STDC
327
328 dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
329 dnl at least.
330 AC_COMPILE_CHECK_SIZEOF(void *)
331
332 dnl Checking for endianess.
333 AC_C_BIGENDIAN_CROSS
334
335 dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
336 dnl On that system, sys/ioctl.h will not include sys/filio.h unless
337 dnl BSD_COMP is defined; just including sys/filio.h is simpler.
338 dnl Check for crt_externs.h on Darwin.
339 AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
340 asm/ioctls.h \
341 inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
342 sys/time.h \
343 sys/select.h \
344 crt_externs.h \
345 fcntl.h \
346 sys/mman.h \
347 magic.h])
348
349 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
350 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
351 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]))
352 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]))
353
354 AC_CHECK_FUNCS([ftruncate fsync select \
355 gethostname socket strerror fork pipe execve open close \
356 lseek fstat read write htonl memset htons connect \
357 getsockname getpeername bind listen accept \
358 recvfrom send sendto setsockopt getsockopt time mktime \
359 localtime_r \
360 strerror_r \
361 fcntl \
362 mmap munmap mincore msync madvise getpagesize sysconf \
363 lstat readlink \
364 ])
365
366 LIBMAGIC=
367 AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
368 AC_SUBST(LIBMAGIC)
369
370 AC_HEADER_TIME
371 AC_STRUCT_TM
372 AC_STRUCT_TIMEZONE
373
374 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
375 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
376 [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
377 AC_MSG_RESULT(yes)],
378 [AC_MSG_RESULT(no)
379 AC_MSG_CHECKING([for global timezone variable])
380 dnl FIXME: we don't want a link check here because that won't work
381 dnl when cross-compiling. So instead we make an assumption that
382 dnl the header file will mention timezone if it exists.
383 dnl Don't find the win32 function timezone
384 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
385 [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
386 AC_MSG_RESULT(yes)],
387 [AC_MSG_RESULT(no)
388 AC_MSG_CHECKING([for global _timezone variable])
389 dnl FIXME: As above, don't want link check
390 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
391 [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
392 [Define if your platform has the global _timezone variable.])
393 AC_MSG_RESULT(yes)],
394 [AC_MSG_RESULT(no)])])])
395
396 AC_C_CONST
397 AC_C_ATTRIBUTE
398
399 dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
400 AM_ICONV
401
402 dnl When using gcc we want warnings, lots of warnings :-)
403 if test "x${GCC}" = xyes; then
404 dnl We want ISO C90 pedantic ansi, but with longlong (jlong) support
405 dnl and modern POSIX and BSD C library functions/prototypes.
406
407 dnl Warning flags for (almost) everybody.
408 dnl Should probably be configurable
409 WARNING_CFLAGS='-pedantic -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
410 AC_SUBST(WARNING_CFLAGS)
411
412 dnl Strict warning flags which not every module uses.
413 dnl Should probably be configurable.
414 STRICT_WARNING_CFLAGS=-Wstrict-prototypes
415 AC_SUBST(STRICT_WARNING_CFLAGS)
416
417 dnl Whether or not to add -Werror, also not used by all modueles.
418 dnl Can be configured by --disable-Werror
419 ERROR_CFLAGS=
420 if test "x${ENABLE_WERROR}" = xyes; then
421 ERROR_CFLAGS='-Werror'
422 fi
423 AC_SUBST(ERROR_CFLAGS)
424 fi
425
426 dnl Check for libxml and libxslt libraries (when xmlj is enabled).
427 if test "x${COMPILE_XMLJ}" = xyes; then
428 PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
429 PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
430 AC_SUBST(XML_LIBS)
431 AC_SUBST(XML_CFLAGS)
432 AC_SUBST(XSLT_LIBS)
433 AC_SUBST(XSLT_CFLAGS)
434 fi
435
436 dnl Check for AWT related gthread/gtk
437 if test "x${COMPILE_GTK_PEER}" = xyes; then
438 AC_PATH_XTRA
439 if test "$no_x" = yes; then
440 AC_MSG_ERROR([GTK+ peers requested but no X library available])
441 fi
442 dnl We explicitly want the XTest Extension for Robot support.
443 AC_CHECK_LIB([Xtst], [XTestQueryExtension],
444 [XTEST_LIBS="$XTEST_LIBS -lX11 -lXtst"],
445 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
446 [${X_LIBS}])
447
448 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
449 PKG_CHECK_MODULES(FREETYPE2, freetype2)
450 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
451 dnl Check if we can link against the XRender library and set
452 dnl HAVE_XRENDER accordingly.
453 AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
454 [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
455 [true],
456 [${X_LIBS}])
457
458 dnl Check if we can link against the XRandR library and set
459 dnl HAVE_XRANDR accordingly.
460 AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
461 [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
462 [true],
463 [${X_LIBS}])
464
465 AC_SUBST(GTK_CFLAGS)
466 AC_SUBST(GTK_LIBS)
467 AC_SUBST(FREETYPE2_LIBS)
468 AC_SUBST(FREETYPE2_CFLAGS)
469 AC_SUBST(PANGOFT2_LIBS)
470 AC_SUBST(PANGOFT2_CFLAGS)
471 AC_SUBST(XTEST_LIBS)
472 fi
473
474 dnl gconf-peer
475 if test "x${COMPILE_GCONF_PEER}" = xyes; then
476 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.11.2)
477 AC_SUBST(GCONF_CFLAGS)
478 AC_SUBST(GCONF_LIBS)
479 dnl we also need gdk for locking
480 PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
481 AC_SUBST(GDK_CFLAGS)
482 AC_SUBST(GDK_LIBS)
483 dnl check if the config value was given form the command line,
484 dnl if not, overwrite the default if we have the gconf backend
485 dnl compiled in
486 USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
487 if test "$USE_GCONF_PREFS_PEER" = ""; then
488 DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
489 fi
490 fi
491
492 dnl Check for AWT related Qt4
493 if test "x${COMPILE_QT_PEER}" = xyes; then
494 PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
495 if test "x$HAVE_QT4" = "xyes"; then
496 dnl Check needed because in some cases the QtGui includedir
497 dnl doesn't contain the subsystem dir.
498 QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
499 EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
500 AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
501 AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
502 AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
503 QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
504 AC_MSG_WARN([QWidget not found])))
505 AC_CHECK_PROG(MOC, [moc], [moc])
506 AC_CHECK_PROG(MOC, [moc-qt4], [moc-qt4])
507 fi
508 if test "x$HAVE_QT4" = "xno"; then
509 AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
510 case "$host_os" in
511 darwin*)
512 AC_ARG_WITH([qt4dir],
513 [AS_HELP_STRING([--with-qt4dir=DIR],
514 [Qt4 installation directory used for OS-X.
515 For other systems use pkg-config.])],
516 [QT4DIR=$withval]
517 )
518 if test x"$QT4DIR" = x ; then
519 AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
520 fi
521 AC_MSG_RESULT([QT4DIR... $QT4DIR])
522 AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
523 if test x"$MOC" = x; then
524 AC_MSG_ERROR([*** This is not the right Qt installation])
525 fi
526 QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
527 QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
528 QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
529 QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
530 ;;
531 *)
532 AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
533 of your installed Qt4 installation.])
534 ;;
535 esac
536 fi
537 AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
538 AC_SUBST(QT_CFLAGS)
539 AC_SUBST(QT_LIBS)
540 fi
541
542 dnl Check for plugin support headers and libraries.
543 if test "x${COMPILE_PLUGIN}" = xyes; then
544 PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
545 if test "x${MOZILLA_FOUND}" = xno; then
546 PKG_CHECK_MODULES(MOZILLA, firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
547 fi
548 if test "x${MOZILLA_FOUND}" = xno; then
549 PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
550 fi
551 if test "x${MOZILLA_FOUND}" = xno; then
552 PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
553 fi
554 PKG_CHECK_MODULES(GLIB, glib-2.0)
555
556 AC_SUBST(MOZILLA_CFLAGS)
557 AC_SUBST(MOZILLA_LIBS)
558 AC_SUBST(GLIB_CFLAGS)
559 AC_SUBST(GLIB_LIBS)
560
561 AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
562 fi
563 fi
564
565 CLASSPATH_WITH_JAVAH
566
567 dnl -----------------------------------------------------------
568 dnl Add the include files for the native abstraction layer.
569 dnl Used by AM_CPPFLAGS in the different modules.
570 dnl -----------------------------------------------------------
571 CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/target/Linux -I\$(top_srcdir)/native/target/generic"
572 AC_SUBST(CLASSPATH_INCLUDES)
573
574 dnl -----------------------------------------------------------
575 if test "x${COMPILE_JNI}" = xyes; then
576 AC_MSG_CHECKING(jni_md.h support)
577 if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
578 AC_MSG_RESULT(yes)
579 else
580 target_cpu=x86
581 target_os=linux-gnu
582 AC_MSG_WARN(no, using x86-linux-gnu)
583 fi
584 ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
585 ac_dests="include/jni_md.h"
586 while test -n "$ac_sources"; do
587 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
588 set $ac_sources; ac_source=$1; shift; ac_sources=$*
589 ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
590 done
591 AC_CONFIG_LINKS([$ac_config_links_1])
592 fi
593
594 CLASSPATH_FIND_JAVAC
595
596 CLASSPATH_WITH_CLASSLIB
597
598 dnl -----------------------------------------------------------
599 dnl Initialize maintainer mode
600 dnl -----------------------------------------------------------
601 AM_MAINTAINER_MODE
602
603 dnl -----------------------------------------------------------
604 dnl Enable debugging statements at compile time. By default
605 dnl these statements should be optimized out of the bytecode
606 dnl produced by an optimizing Java compiler and not hinder
607 dnl performance because debugging is turned off by default.
608 dnl -----------------------------------------------------------
609 AC_ARG_ENABLE([debug],
610 [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
611 [case "${enableval}" in
612 yes)
613 LIBDEBUG="true"
614 AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
615 ;;
616 no) LIBDEBUG="false" ;;
617 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
618 esac],
619 [LIBDEBUG="false"])
620 AC_SUBST(LIBDEBUG)
621
622 dnl -----------------------------------------------------------
623 dnl Enable execution of all static initializer loadLibrary()
624 dnl calls at compile time. By default most people will not
625 dnl want to disable this, but some VMs (gcj) don't need or want
626 dnl them.
627 dnl -----------------------------------------------------------
628 AC_ARG_ENABLE([load-library],
629 [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
630 [case "${enableval}" in
631 yes) INIT_LOAD_LIBRARY="true" ;;
632 no) INIT_LOAD_LIBRARY="false" ;;
633 *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
634 esac],
635 [INIT_LOAD_LIBRARY="true"])
636 AC_SUBST(INIT_LOAD_LIBRARY)
637
638
639 dnl -----------------------------------------------------------
640 dnl Should the VM explicitly run class initialization subfunctions for
641 dnl java.lang.System? (default is false -- the subfunctions will be run
642 dnl automatically by the class initializer)
643 dnl -----------------------------------------------------------
644 AC_ARG_ENABLE([java-lang-system-explicit-initialization],
645 [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
646 [case "${enableval}" in
647 yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
648 no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
649 *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
650 esac],
651 [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
652 AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
653
654
655 dnl -----------------------------------------------------------
656 dnl avoiding automake complaints
657 dnl -----------------------------------------------------------
658 REMOVE=""
659 AC_SUBST(REMOVE)
660
661 dnl -----------------------------------------------------------
662 dnl This is probably useless.
663 dnl -----------------------------------------------------------
664 AC_PATH_PROG(MKDIR, mkdir)
665 AC_PATH_PROG(CP, cp)
666 AC_PATH_PROG(DATE, date)
667
668 dnl -----------------------------------------------------------
669 dnl According to the GNU coding guide, we shouldn't require find,
670 dnl and zip, however GNU provides both so it should be okay
671 dnl -----------------------------------------------------------
672 AC_PATH_PROG(FIND, find)
673
674 dnl -----------------------------------------------------------
675 dnl Specify what to install (install only glibj.zip by default)
676 dnl -----------------------------------------------------------
677 CLASSPATH_WITH_GLIBJ
678
679 dnl -----------------------------------------------------------
680 dnl Enable API documentation generation (disabled by default)
681 dnl -----------------------------------------------------------
682 CLASSPATH_WITH_GJDOC
683
684 dnl -----------------------------------------------------------
685 dnl Whether to use jay to regenerate parsers.
686 dnl -----------------------------------------------------------
687 REGEN_WITH_JAY
688
689 dnl -----------------------------------------------------------
690 dnl This sets the build-time default, which can now be overridden
691 dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
692 dnl to "true" or "false".
693 dnl -----------------------------------------------------------
694 AC_ARG_ENABLE([portable-native-sync],
695 [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
696 [case "${enableval}" in
697 yes)
698 AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
699 ;;
700 no) ;;
701 *)
702 AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
703 ;;
704 esac],
705 [])
706
707 AX_CREATE_STDINT_H([include/config-int.h])
708
709 dnl -----------------------------------------------------------------------
710 dnl Support for using a prebuilt class library
711 dnl -----------------------------------------------------------------------
712 AC_ARG_WITH([glibj_zip],
713 AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
714 [use prebuilt glibj.zip class library]))
715
716 case "$with_glibj_zip" in
717 "")
718 use_glibj_zip=false
719 ;;
720 "no" )
721 use_glibj_zip=false
722 ;;
723 "yes")
724 AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
725 ;;
726 *)
727 use_glibj_zip=true
728 PATH_TO_GLIBJ_ZIP=$with_glibj_zip
729 ;;
730 esac;
731
732 AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
733 AC_SUBST(PATH_TO_GLIBJ_ZIP)
734
735 dnl -----------------------------------------------------------
736 dnl Build with Escher based X peers.
737 dnl -----------------------------------------------------------
738 AC_ARG_WITH([escher],
739 AS_HELP_STRING([--with-escher=ABS.PATH],
740 [specify path to escher dir or JAR for X peers]))
741 case "$with_escher" in
742 "")
743 use_escher=false
744 ;;
745 "no")
746 use_escher=false
747 ;;
748 "yes")
749 AC_MSG_ERROR([Please suply an absolute path to Escher library])
750 ;;
751 *)
752 use_escher=true
753 PATH_TO_ESCHER=$with_escher
754 ;;
755 esac;
756
757 AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
758 AC_SUBST(PATH_TO_ESCHER)
759
760 dnl -----------------------------------------------------------
761 dnl Check if local socket support should be included.
762 dnl -----------------------------------------------------------
763 AC_ARG_ENABLE([local-sockets],
764 [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
765 [case "${enableval}" in
766 yes)
767 ENABLE_LOCAL_SOCKETS=yes
768 ;;
769 *)
770 ENABLE_LOCAL_SOCKETS=no
771 ;;
772 esac],
773 [])
774 if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
775 then
776 AC_CHECK_HEADER([sys/un.h])
777 AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
778 AC_MSG_ERROR([networking support not available]))
779 AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
780 fi
781 AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
782
783 dnl -----------------------------------------------------------
784 dnl Add the default preference peer
785 dnl -----------------------------------------------------------
786 AC_SUBST(DEFAULT_PREFS_PEER)
787
788 dnl -----------------------------------------------------------
789 dnl output files
790 dnl -----------------------------------------------------------
791 AC_CONFIG_FILES([Makefile
792 doc/Makefile
793 doc/api/Makefile
794 external/Makefile
795 external/sax/Makefile
796 external/w3c_dom/Makefile
797 external/relaxngDatatype/Makefile
798 gnu/classpath/Configuration.java
799 gnu/java/security/Configuration.java
800 include/Makefile
801 native/Makefile
802 native/fdlibm/Makefile
803 native/jawt/Makefile
804 native/jni/Makefile
805 native/jni/classpath/Makefile
806 native/jni/java-io/Makefile
807 native/jni/java-lang/Makefile
808 native/jni/java-net/Makefile
809 native/jni/java-nio/Makefile
810 native/jni/java-util/Makefile
811 native/jni/gtk-peer/Makefile
812 native/jni/gconf-peer/Makefile
813 native/jni/qt-peer/Makefile
814 native/jni/xmlj/Makefile
815 native/jni/midi-alsa/Makefile
816 native/jni/midi-dssi/Makefile
817 native/plugin/Makefile
818 native/target/Makefile
819 native/target/Linux/Makefile
820 native/target/generic/Makefile
821 resource/Makefile
822 resource/META-INF/services/java.util.prefs.PreferencesFactory
823 scripts/Makefile
824 scripts/classpath.spec
825 lib/Makefile
826 lib/gen-classlist.sh
827 lib/copy-vmresources.sh
828 tools/Makefile
829 examples/Makefile
830 examples/Makefile.jawt
831 examples/Makefile.java2d])
832
833 if test "x${COMPILE_WRAPPERS}" = xno
834 then
835 AC_CONFIG_FILES([tools/gappletviewer
836 tools/gjarsigner
837 tools/gkeytool
838 tools/gjar
839 tools/gnative2ascii
840 tools/gserialver])
841 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
842 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
843 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
844 AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
845 AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
846 AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
847 fi
848
849
850 if test "x${COMPILE_WRAPPERS}" = xno
851 then
852 AC_CONFIG_FILES([tools/appletviewer
853 tools/jarsigner
854 tools/keytool])
855 AC_CONFIG_COMMANDS([appletviewer],[chmod 755 tools/appletviewer])
856 AC_CONFIG_COMMANDS([jarsigner],[chmod 755 tools/jarsigner])
857 AC_CONFIG_COMMANDS([keytool],[chmod 755 tools/keytool])
858 fi
859
860 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
861 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
862 AC_OUTPUT
863
864 # Create standard.omit based on decisions we just made.
865 cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
866 if test x$use_escher != xtrue; then
867 echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit
868 fi
869