This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: tips for configuring in the source directory?

On Nov 28, 2000, Benjamin Kosnik <> wrote:

> There has recently been some noise on the gcc lists about making gcc
> work for in-source configures and builds. As part of that, I'd like
> to try and get libstdc++-v3 to work with in-source configuring. It
> uses autoconf/automake/libtool.

It also uses some multilib magic that are characteristic of the
so-called Cygnus tree.  Unfortunately, that's the piece that's
responsible for the soft-linking madness.  Part of it is in
`$(CONFIGURE_TARGET_MODULES):' in, part of it is in, where the process appears to be documented (and I only
repeat it here because I typed most of what's below before noticing it
was already there :-)

The reason why the link is created is that, in case the library is
configured for both host and target (as is the case of zlib, just to
point out an example), `configure' would refuse to run for the target,
within <targetname>/[multilibdir/]zlib, because the source tree would
have already been configured for the host.  autoconf won't let the
configure script run for a separate build tree if the source tree is
already configured.  The rationale is that, if it let the configure
and build proceed, all sorts of problems would follow because of VPATH
pointing to files in the source tree (which is also the old build
tree) and causing make to find build files in the source tree, so it
would not build them again for the target.

The problem with libsupc++ is that it sets AC_CONFIG_AUX_DIR as `..',
which is fine when objdir != srcdir, because `..' is relative to
`srcdir', but not when the global objdir == srcdir, because then the
soft-linking magic in takes place, and then srcdir == .

The bad news is that I can't think of an easy solution for the
problem.  We could just omit AC_CONFIG_AUX_DIR from libsupc++ and let
autoconf's default searching in `$srcdir $srcdir/.. $srcdir/../..' to
take place, but this would fail to find install-sh in case libsupc++
is configured in <targetdir>/libstdc++-v3/libsupc++, three levels
deeper than install-sh.

My best bet would be:

AC_CONFIG_AUX_DIR(`if test "x${srcdir}" = x.; then
  if test "x${with_target_subdir}" != x.; then
    echo ${with_multisrctop}../../..
    echo ${with_multisrctop}../..
  echo ${srcdir}/../..

(note that this is similar to the sample snippet in about
how to add it to, but there's one additional `..' in each
set, because libsupc++ is a sub-directory of libstdc++-v3)

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist    *Please* write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]