dnl Process this with autoconf to create configure
+AC_PREREQ(2.13)
AC_INIT(java/lang/System.java)
# This works around the fact that libtool configuration may change LD
AC_ARG_WITH(newlib,
[ --with-newlib Configuring with newlib])
+AC_ARG_ENABLE(version-specific-runtime-libs,
+[ --enable-version-specific-runtime-libs
+ specify that runtime libraries should be installed in a compiler-specific
+ directory ],
+ [case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+ [version_specific_libs=no]
+)
+
+
LIBGCJ_CONFIGURE(.)
AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h)
dnl Typically faster and more space-efficient
AC_ARG_ENABLE(hash-synchronization,
[ --enable-hash-synchronization
- Use global hash table for monitor locks])
+ use global hash table for monitor locks])
if test -z "$enable_hash_synchronization"; then
enable_hash_synchronization=$enable_hash_synchronization_default
fi
+# Do we allow intermodule optimizations (i.e. compiling many files at once)?
+AC_ARG_ENABLE(libgcj-multifile,
+[ --enable-libgcj-multifile
+ allow compilation of several files at once],
+[case "${enableval}" in
+ yes) enable_libgcj_multifile=yes ;;
+ no) enable_libgcj_multifile=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-libgcj-multifile) ;;
+esac],[enable_libgcj_multifile=no])
+AM_CONDITIONAL(ONESTEP, test "$enable_libgcj_multifile" = yes)
+
+# What is the native OS API for MinGW?
+AC_ARG_WITH(win32-nlsapi,
+changequote(<<,>>)dnl
+<< --with-win32-nlsapi=ansi, unicows or unicode
+ native MinGW libgcj Win32 OS API [ansi]>>,
+changequote([,])
+[case "${withval}" in
+ ansi) with_win32_nlsapi=ansi ;;
+ unicows) with_win32_nlsapi=unicows ;;
+ unicode) with_win32_nlsapi=unicode ;;
+ *) AC_MSG_ERROR(Bad value ${withval} for --with-win32-nlsapi.) ;;
+esac],[with_win32_nlsapi=ansi])
+
+case "${with_win32_nlsapi}" in
+ unicows | unicode)
+ AC_DEFINE(MINGW_LIBGCJ_UNICODE, 1,
+ [Define if MinGW libgcj uses the Windows UNICODE OS API.])
+ ;;
+esac
+
dnl configure.host sets slow_pthread_self if the synchronization code should
dnl try to avoid pthread_self calls by caching thread IDs in a hashtable.
if test "${slow_pthread_self}" = "yes"; then
TARGET_ECOS="$with_ecos"
)
+EXTRA_CC_FILES=
+AC_SUBST(EXTRA_CC_FILES)
+
PLATFORMOBJS=
case "$TARGET_ECOS" in
no) case "$host" in
AC_EGREP_HEADER(localtime, time.h, AC_DEFINE(HAVE_LOCALTIME, 1,
[Define is you have 'localtime' in <time.h>]))
-dnl Create the subdirectory for natFileDescriptor.cc, or the attempt
+dnl Create the subdirectory for natFile.cc, or the attempt
dnl to create the link will fail.
test -d java || mkdir java
test -d java/io || mkdir java/io
test -d gnu || mkdir gnu
AC_LINK_FILES(java/io/natFile${FILE-${PLATFORM}}.cc, java/io/natFile.cc)
-AC_LINK_FILES(java/io/natFileDescriptor${FILE-${PLATFORM}}.cc, java/io/natFileDescriptor.cc)
dnl Likewise for ConcreteProcess.java and natConcreteProcess.cc.
test -d java/lang || mkdir java/lang
AC_LINK_FILES(java/net/natInetAddress${PLATFORMNET}.cc, java/net/natInetAddress.cc)
AC_LINK_FILES(java/net/natNetworkInterface${PLATFORMNET}.cc, java/net/natNetworkInterface.cc)
-dnl Likewise for natPlainSocketImpl.cc and natPlainDatagramSocketImpl.ca.c
+dnl Likewise for natPlainSocketImpl.cc and natPlainDatagramSocketImpl.cc.
test -d gnu/java || mkdir gnu/java
test -d gnu/java/net || mkdir gnu/java/net
AC_LINK_FILES(gnu/java/net/natPlainSocketImpl${PLATFORMNET}.cc, gnu/java/net/natPlainSocketImpl.cc)
AC_LINK_FILES(gnu/java/net/natPlainDatagramSocketImpl${PLATFORMNET}.cc, gnu/java/net/natPlainDatagramSocketImpl.cc)
+dnl Likewise for natPipeImpl.cc and natSelectorImpl.cc.
+test -d gnu/java/nio || mkdir gnu/java/nio
+AC_LINK_FILES(gnu/java/nio/natPipeImpl${PLATFORM}.cc, gnu/java/nio/natPipeImpl.cc)
+AC_LINK_FILES(gnu/java/nio/natSelectorImpl${PLATFORM}.cc, gnu/java/nio/natSelectorImpl.cc)
+test -d gnu/java/nio/channels || mkdir gnu/java/nio/channels
+AC_LINK_FILES(gnu/java/nio/channels/natFileChannel${FILE-${PLATFORM}}.cc, gnu/java/nio/channels/natFileChannelImpl.cc)
+
case "${host}" in
*mingw*)
SYSTEMSPEC="-lgdi32 -lwsock32 -lws2_32"
+ if test "${with_win32_nlsapi}" = "unicows"; then
+ SYSTEMSPEC="-lunicows $SYSTEMSPEC"
+ fi
;;
*)
SYSTEMSPEC=
AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes)
AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes)
+dnl determine whether to enable the cairo GTK Graphics2D backend
+AC_ARG_ENABLE(gtk-cairo, [ --enable-gtk-cairo build the cairo Graphics2D implementation on GTK])
+AM_CONDITIONAL(GTK_CAIRO, test "x${enable_gtk_cairo}" = xyes)
+if test "x${enable_gtk_cairo}" = xyes
+then
+ PKG_CHECK_MODULES(CAIRO, cairo)
+ PKG_CHECK_MODULES(PANGOFT2, pangoft2)
+fi
+AC_SUBST(CAIRO_LIBS)
+AC_SUBST(CAIRO_CFLAGS)
+AC_SUBST(PANGOFT2_LIBS)
+AC_SUBST(PANGOFT2_CFLAGS)
dnl FIXME: this should be _libs on some hosts.
libsubdir=.libs
AC_DEFINE(HAVE_TIME, 1, [Define if you have time.])
AC_DEFINE(HAVE_GMTIME_R, 1, [Define if you have the 'gmtime_r' function])
AC_DEFINE(HAVE_LOCALTIME_R, 1, [Define if you have the 'localtime_r' function.])
+ AC_DEFINE(HAVE_USLEEP_DECL, 1, [Define if usleep is declared in <unistd.h>.])
dnl This is only for POSIX threads.
AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT, 1, [Define if using POSIX threads that have the mutexattr functions.])
dnl We also assume we are using gcc, which provides alloca.
ia64-*-linux*)
# Has broken backtrace()
;;
+ mips*-*-linux*)
+ # Has broken backtrace(), but we supply our own.
+ if test -d sysdep; then true; else mkdir -p sysdep; fi
+ EXTRA_CC_FILES="${EXTRA_CC_FILES} sysdep/dwarf2-backtrace.cc"
+ AC_DEFINE(HAVE_BACKTRACE, 1,
+ [Define if your platform has a working backtrace() function.])
+ ;;
*)
AC_DEFINE(HAVE_BACKTRACE, 1,
[Define if your platform has a working backtrace() function.])
])
AC_CHECK_LIB(dl, dladdr, [
- AC_DEFINE(HAVE_DLADDR, 1, [Define if you have dladdr()])])
+ if test "x${disable_dladdr}" = "xyes"; then
+ #Broken dladdr().
+ true
+ else
+ AC_DEFINE(HAVE_DLADDR, 1, [Define if you have dladdr()])
+ fi
+ ])
if test x"$build" = x"$host"; then
AC_CHECK_FILES(/proc/self/exe, [
AC_DEFINE(HAVE_PROC_SELF_EXE, 1, [Define if you have /proc/self/exe])])
# Test for Gtk stuff, if asked for.
if test "$use_gtk_awt" = yes; then
- AM_PATH_GTK_2_0(2.0.0,,exit 1)
- AM_PATH_GLIB_2_0(2.0.0,,exit 1,gthread)
- dnl XXX Fix me when libart.m4 has the compile test fixed!
- enable_libarttest=no
- AM_PATH_LIBART(2.1.0,,exit 1)
+ PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.2)
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+
+ PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.2 gthread-2.0 >= 2.2)
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)
+
+ PKG_CHECK_MODULES(LIBART, libart-2.0 >= 2.1)
+ AC_SUBST(LIBART_CFLAGS)
+ AC_SUBST(LIBART_LIBS)
fi
# On Solaris, and maybe other architectures, the Boehm collector
AM_CONDITIONAL(NEEDS_DATA_START, test "$NEEDS_DATA_START" = yes && test "$NATIVE" = yes)
AC_SUBST(GCC_UNWIND_INCLUDE)
-if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- toolexecdir='$(exec_prefix)/$(target_alias)'
- toolexecmainlibdir='$(toolexecdir)/lib'
-else
- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- toolexecmainlibdir='$(libdir)'
-fi
-multi_os_directory=`$CC -print-multi-os-directory`
-case $multi_os_directory in
- .) toolexeclibdir=$toolexecmainlibdir ;; # Avoid trailing /.
- *) toolexeclibdir=$toolexecmainlibdir/$multi_os_directory ;;
+# Process the option "--enable-version-specific-runtime-libs"
+# Calculate toolexeclibdir
+case ${version_specific_libs} in
+ yes)
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ includedir='${libdir}/gcc/${target_alias}/'$gcc_version/include/
+ toolexecdir='$(libdir)/gcc/$(target_alias)'
+ toolexecmainlibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
+ toolexeclibdir=$toolexecmainlibdir
+ ;;
+ no)
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+ toolexecmainlibdir='$(toolexecdir)/lib'
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexecmainlibdir='$(libdir)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+ .) toolexeclibdir=$toolexecmainlibdir ;; # Avoid trailing /.
+ *) toolexeclibdir=$toolexecmainlibdir/$multi_os_directory ;;
+ esac
+ ;;
esac
AC_SUBST(toolexecdir)
AC_SUBST(toolexecmainlibdir)
AC_CHECK_PROGS(PERL, perl, false)
SYSDEP_SOURCES=
+SIGNAL_HANDLER_AUX=
case "${host}" in
i?86-*-linux*)
ia64-*-linux*)
SIGNAL_HANDLER=include/dwarf2-signal.h
;;
- powerpc-*-linux*)
+ powerpc*-*-linux*)
SIGNAL_HANDLER=include/powerpc-signal.h
;;
alpha*-*-linux*)
;;
x86_64*-*-linux*)
SIGNAL_HANDLER=include/x86_64-signal.h
+ SIGNAL_HANDLER_AUX=include/i386-signal.h
;;
sparc*-*-linux*)
SIGNAL_HANDLER=include/dwarf2-signal.h
*mingw*)
SIGNAL_HANDLER=include/win32-signal.h
;;
+ mips*-*-linux*)
+ SIGNAL_HANDLER=include/mips-signal.h
+ ;;
*)
SIGNAL_HANDLER=include/default-signal.h
;;
# If we're using sjlj exceptions, forget what we just learned.
if test "$enable_sjlj_exceptions" = yes; then
SIGNAL_HANDLER=include/default-signal.h
+ SIGNAL_HANDLER_AUX=
fi
# Define here any compiler flags that you need in order to make backtrace() work.
BACKTRACESPEC=
case "${host}" in
- x86_64*-*-linux*)
+ x86_64*-*-linux*|i?86-*)
BACKTRACESPEC=-fno-omit-frame-pointer
;;
esac
AC_SUBST(SYSDEP_SOURCES)
-AC_LINK_FILES($SIGNAL_HANDLER, include/java-signal.h)
+if test -z "$SIGNAL_HANDLER_AUX"; then
+ SIGNAL_HANDLER_AUX=$SIGNAL_HANDLER
+fi
+
+AC_LINK_FILES($SIGNAL_HANDLER $SIGNAL_HANDLER_AUX,
+ include/java-signal.h include/java-signal-aux.h)
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"