diff options
Diffstat (limited to 'libjava/acinclude.m4')
-rw-r--r-- | libjava/acinclude.m4 | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/libjava/acinclude.m4 b/libjava/acinclude.m4 index e005c02aadd..2559adcccb0 100644 --- a/libjava/acinclude.m4 +++ b/libjava/acinclude.m4 @@ -12,23 +12,39 @@ AC_ARG_ENABLE(multilib, dnl We may get other options which we dont document: dnl --with-target-subdir, --with-multisrctop, --with-multisubdir -if test "[$]{srcdir}" = "."; then - if test "[$]{with_target_subdir}" != "."; then - libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" +# When building with srcdir == objdir, links to the source files will +# be created in directories within the target_subdir. We have to +# adjust toplevel_srcdir accordingly, so that configure finds +# install-sh and other auxiliary files that live in the top-level +# source directory. +if test "${srcdir}" = "."; then + if test -z "${with_target_subdir}"; then + toprel=".." else - libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + if test "${with_target_subdir}" != "."; then + toprel="${with_multisrctop}../.." + else + toprel="${with_multisrctop}.." + fi fi else - libgcj_basedir="[$]{srcdir}/$1" + toprel=".." fi + +libgcj_basedir=$srcdir/$toprel/$1/libjava AC_SUBST(libgcj_basedir) -AC_CONFIG_AUX_DIR($libgcj_basedir/..) + +AC_CONFIG_AUX_DIR(${srcdir}/$toprel) 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 +# This works around an automake problem. +mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" +AC_SUBST(mkinstalldirs) + AC_CANONICAL_SYSTEM dnl This shouldn't be needed, as long as top-level dependencies are @@ -85,11 +101,6 @@ libgcj_javaflags= . [$]{srcdir}/configure.host -case [$]{libgcj_basedir} in -/* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;; -*) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;; -esac - LIBGCJ_CFLAGS="[$]{libgcj_cflags}" LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}" LIBGCJ_JAVAFLAGS="[$]{libgcj_javaflags}" |