# Copyright (c) 1999, 2000, 2001, 2002, 2003 by Red Hat, Inc. All rights reserved.
+# Copyright 2004 Nathanael Nerode
#
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
# modified is included with the above copyright notice.
#
# Original author: Tom Tromey
+# Modified by Nathanael Nerode
dnl Process this file with autoconf to produce configure.
+AC_PREREQ(2.57)
AC_INIT(gcj_mlc.c)
# This works around the fact that libtool configuration may change LD
# exported.
ORIGINAL_LD_FOR_MULTILIBS=$LD
-dnl Can't be done in GC_CONFIGURE because that confuses automake.
+dnl Can't be done in GC_CONFIGURE because that confuses automake.
AC_CONFIG_AUX_DIR(.)
+dnl Default to --enable-multilib
+AC_ARG_ENABLE(multilib,
+[ --enable-multilib build many library versions (default)],
+[case "${enableval}" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
+ esac], [multilib=yes])dnl
+
+dnl We may get other options which we don't document:
+dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
+
+dnl I needed to add the -n test to allow configuration in src directory - HB
+if test "[$]{srcdir}" = "."; then
+ if test "[$]{with_target_subdir}" != "." -a -n "[$]{with_target_subdir}"; then
+ gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../."
+ else
+ gc_basedir="[$]{srcdir}/[$]{with_multisrctop}."
+ fi
+else
+ gc_basedir="[$]{srcdir}/."
+fi
+AC_SUBST(gc_basedir)
+AC_CONFIG_AUX_DIR($gc_basedir/..)
+if :; then :; else
+ # This overrides the previous occurrence for automake, but not for
+ # autoconf, which is exactly what we want.
+ AC_CONFIG_AUX_DIR(..)
+fi
+
+AC_CANONICAL_SYSTEM
+
+# Get the 'noncanonical' system names.
+sinclude(../config/acx.m4)
+_GCC_TOPLEV_NONCANONICAL_BUILD
+_GCC_TOPLEV_NONCANONICAL_HOST
+_GCC_TOPLEV_NONCANONICAL_TARGET
+
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
+AC_SUBST(mkinstalldirs)
+
GC_CONFIGURE(.)
AM_PROG_LIBTOOL
[ --with-cross-host=HOST configuring with a cross compiler])
AM_MAINTAINER_MODE
-# automake wants to see AC_EXEEXT. But we don't need it. And having
-# it is actually a problem, because the compiler we're passed can't
-# necessarily do a full link. So we fool automake here.
-if false; then
- # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
- # to nothing, so nothing would remain between `then' and `fi' if it
- # were not for the `:' below.
- :
- AC_EXEEXT
-fi
AC_MSG_CHECKING([for thread model used by GCC])
THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
esac
AC_SUBST(THREADLIBS)
-case "$host" in
+case "$host" in
powerpc-*-darwin*)
powerpc_darwin=true
;;
# dyld calls anyway
case "$host" in
*-*-darwin*) ;;
- *)
+ *)
AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
;;
esac
target_all=libgcjgc.la
AC_SUBST(target_all)
-AC_SUBST(target_alias)
+AC_SUBST(target_noncanonical)
dnl If the target is an eCos system, use the appropriate eCos
dnl I/O routines.
# Configuration of machine-dependent code
#
-AC_MSG_CHECKING(which machine-dependent code should be used)
+# We don't set NO_EXECUTE_PERMISSION by default because gcj (and
+# anything else that creates trampolines in gc-allocated memory)
+# always needs exec permission. The exceptions to this are IA-64 and
+# some variations of Power PC, where trampolines don't contain
+# executable code.
+#
+AC_MSG_CHECKING(which machine-dependent code should be used)
machdep=
case "$host" in
alpha*-*-openbsd*)
;;
mips-nec-sysv*|mips-unknown-sysv*)
;;
- mips*-*-linux*)
- ;;
+ mips*-*-linux*)
+ ;;
mips-*-*)
machdep="mips_sgi_mach_dep.lo"
- AC_DEFINE(NO_EXECUTE_PERMISSION)
;;
sparc-*-netbsd*)
machdep="sparc_netbsd_mach_dep.lo"
machdep="sparc_mach_dep.lo"
;;
ia64-*-*)
+ AC_DEFINE(NO_EXECUTE_PERMISSION)
machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
;;
esac
AC_CHECK_HEADER(sys/dg_sys_info.h,
[ac_is_dgux=yes;])
-AC_MSG_RESULT($ac_is_dgux)
+AC_MSG_RESULT($ac_is_dgux)
## :GOTCHA: we do not check anything but sys/dg_sys_info.h
if test $ac_is_dgux = yes; then
if test "$enable_full_debug" = "yes"; then
AC_ARG_WITH(cross-host,
[ --with-cross-host=HOST configuring with a cross compiler])
-# automake wants to see AC_EXEEXT. But we don't need it. And having
-# it is actually a problem, because the compiler we're passed can't
-# necessarily do a full link. So we fool automake here.
-if false; then
- # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
- # to nothing, so nothing would remain between `then' and `fi' if it
- # were not for the `:' below.
- :
- AC_EXEEXT
-fi
-
dnl As of 4.13a2, the collector will not properly work on Solaris when
dnl built with gcc and -O. So we remove -O in the appropriate case.
dnl
dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
AC_DEFINE(SILENT)
AC_DEFINE(NO_SIGNALS)
-AC_DEFINE(NO_EXECUTE_PERMISSION)
AC_DEFINE(ALL_INTERIOR_POINTERS)
dnl By default, make the library as general as possible.
if test -n "$with_cross_host" &&
test x"$with_cross_host" != x"no"; then
- toolexecdir='$(exec_prefix)/$(target_alias)'
+ toolexecdir='$(exec_prefix)/$(target_noncanonical)'
toolexeclibdir='$(toolexecdir)/lib'
else
- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
toolexeclibdir='$(libdir)'
fi
multi_os_directory=`$CC -print-multi-os-directory`