automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another problem with BSD Make


From: Derek R. Price
Subject: Another problem with BSD Make
Date: Tue, 16 Jan 2001 12:19:50 -0500

It seems some BSD makes don't look through VPATH for targets either
(i.e. when they're not found in $(builddir) make assumes they are
missing and rebuilds).

Mostly this isn't a problem, but there are a few cases where it is.  For
example, info targets are rebuilt every time and I can't create a
*_TEXINFOS dependency that works from outside $(srcdir) for both a build
and a make dist without extra configure work.

The following configure.in code will discover if the bug is present and
set an AUTOMAKE conditional switch based on that:

# BSD's logo is a devil for a reason, hey?
AC_CACHE_CHECK(for BSD VPATH bug in make, ccvs_cv_bsd_make_vpath_bug,
[if test ! -d ac_test_dir ; then
        AC_TRY_COMMAND([mkdir ac_test_dir])
fi
cat >conftestmake <<EOF
VPATH = ac_test_dir
ac_test_target: ac_test_dep
        echo BSD VPATH bug present >&2
ac_test_dep: ac_test_dep_dep
EOF
touch ac_test_dir/ac_test_dep_dep
touch ac_test_dir/ac_test_dep
touch ac_test_target
# Don't know why, but the following test doesn't work under FreeBSD 4.2
# without this sleep command
sleep 1
if AC_TRY_COMMAND([make -f conftestmake 2>&1 >/dev/null
                |grep ^BSD\ VPATH\ bug\ present\$ >/dev/null]) ; then
        ccvs_cv_bsd_make_vpath_bug=yes
else
        ccvs_cv_bsd_make_vpath_bug=no
fi
AC_TRY_COMMAND([rm -rf ac_test_dir ac_test_target conftestmake])])
# We also don't need to worry about the bug when $srcdir = $builddir
AM_CONDITIONAL(MAKE_TARGETS_IN_VPATH, \
                test $ccvs_cv_bsd_make_vpath_bug = no \
                || test $srcdir = .)



I used the above test to create a conditional target for my *_TEXINFOS,
but there's nothing I can do about the info_TEXINFOS targets without
sticking my fingers into the automake code again.

Derek

--
Derek Price                      CVS Solutions Architect ( http://CVSHome.org )
mailto:address@hidden     OpenAvenue ( http://OpenAvenue.com )
--
#! perl
@a = ( 0x2E805,0x6B39,0x15B3,0x45993,0x153C,0x1D9F );
for ( @a ) { ( $s, $i )=( 'a', 0 ); $s++ while $i++ < $_; print "$s" }






reply via email to

[Prev in Thread] Current Thread [Next in Thread]