* automake.in (handle_LIBOBJS_or_ALLOCA): If we are in the
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 14 Oct 2006 17:12:50 +0000 (17:12 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 14 Oct 2006 17:12:50 +0000 (17:12 +0000)
LIBOBJDIR, then we should not add a DEPDIR prefix.
* tests/pr401.test: Update test.
* tests/pr401b.test: Likewise.
* tests/pr401c.test: Likewise.
Report by Jim Meyering and Eric Blake.

ChangeLog
automake.in
tests/pr401.test
tests/pr401b.test
tests/pr401c.test

index 0c94bb5..9a3268c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2006-10-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * automake.in (handle_LIBOBJS_or_ALLOCA): If we are in the
+       LIBOBJDIR, then we should not add a DEPDIR prefix.
+       * tests/pr401.test: Update test.
+       * tests/pr401b.test: Likewise.
+       * tests/pr401c.test: Likewise.
+       Report by Jim Meyering and Eric Blake.
+
        * lib/depcomp (gcc3): Put dependency extraction flags before the
        `-c' flag, so they appear at the same position as in %FASTDEP%
        mode in depend2.am.  Fixes build failure for FreeBSD's c89,
index 9393615..52d7e15 100755 (executable)
@@ -2180,12 +2180,12 @@ sub handle_LIBOBJS_or_ALLOCA ($)
 {
   my ($var) = @_;
 
-  my $dir = $config_libobj_dir ? "$config_libobj_dir/" : '';
+  my $dir = '';
 
   # If LIBOBJS files must be built in another directory we have
   # to define LIBOBJDIR and ensure the files get cleaned.
   # Otherwise LIBOBJDIR can be left undefined, and the cleaning
-  # is achieved by `rm -f *.($OBJEXT)' in compile.am.
+  # is achieved by `rm -f *.$(OBJEXT)' in compile.am.
   if ($config_libobj_dir
       && $relative_dir ne $config_libobj_dir)
     {
@@ -2195,6 +2195,7 @@ sub handle_LIBOBJS_or_ALLOCA ($)
          # we are already there, and since the targets are built without
          # a $(top_builddir), it helps BSD Make to match them with
          # dependencies.
+         $dir = "$config_libobj_dir/" if $config_libobj_dir ne '.';
          $dir = "$topsrcdir/$dir" if $relative_dir ne '.';
          define_variable ('LIBOBJDIR', "$dir", INTERNAL);
          $clean_files{"\$($var)"} = MOSTLY_CLEAN;
index 5d55c64..238b8bc 100755 (executable)
@@ -53,7 +53,7 @@ cat >>configure.in << 'EOF'
 ## These lines are activated for later tests
 #: AC_CONFIG_LIBOBJ_DIR([lib])
 AC_PROG_CC
-#: AM_PROG_CC_C_O
+#x AM_PROG_CC_C_O
 AC_LIBOBJ([feep])
 AC_LIBSOURCE([feep.c])
 AC_PROG_RANLIB
@@ -89,11 +89,29 @@ $AUTOMAKE
 $MAKE distcheck
 
 
+## ------------------------------------------ ##
+## Traditional LIBOBJS with LIBOBJDIR set.    ##
+## ------------------------------------------ ##
+
+# Invocation of AC_CONFIG_LIBOBJ_DIR may be necessary for reasons
+# unrelated to Automake or Makefile.am layout.
+
+sed 's/#: //' configure.in >configure.int
+mv -f configure.int configure.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+test ! -d lib/lib
+$MAKE distcheck
+
+
 ## -------------------------------------------- ##
 ## Test using LIBOBJS from a sibling directory. ##
 ## -------------------------------------------- ##
 
-sed 's/#: //; s/lib\/Makefile //' configure.in >configure.int
+sed 's/#x //; s/lib\/Makefile //' configure.in >configure.int
 mv -f configure.int configure.in
 
 cat >Makefile.am <<'EOF'
index 66d8b1f..45a19bf 100755 (executable)
@@ -53,7 +53,7 @@ cat >>configure.in << 'EOF'
 ## These lines are activated for later tests
 #: AC_CONFIG_LIBOBJ_DIR([lib])
 AC_PROG_CC
-#: AM_PROG_CC_C_O
+#x AM_PROG_CC_C_O
 AC_LIBOBJ([feep])
 AC_LIBSOURCE([feep.c])
 AC_PROG_LIBTOOL
@@ -90,11 +90,29 @@ $AUTOMAKE -a
 $MAKE distcheck
 
 
+## ------------------------------------------ ##
+## Traditional LIBOBJS with LIBOBJDIR set.    ##
+## ------------------------------------------ ##
+
+# Invocation of AC_CONFIG_LIBOBJ_DIR may be necessary for reasons
+# unrelated to Automake or Makefile.am layout.
+
+sed 's/#: //' configure.in >configure.int
+mv -f configure.int configure.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+test ! -d lib/lib
+$MAKE distcheck
+
+
 ## ---------------------------------------------- ##
 ## Test using LTLIBOBJS from a sibling directory. ##
 ## ---------------------------------------------- ##
 
-sed 's/#: //; s/lib\/Makefile //' configure.in >configure.int
+sed 's/#x //; s/lib\/Makefile //' configure.in >configure.int
 mv -f configure.int configure.in
 
 cat >Makefile.am <<'EOF'
index 456b21b..0cf0869 100755 (executable)
@@ -56,7 +56,7 @@ cat >>configure.in << 'EOF'
 ## These lines are activated for later tests
 #: AC_CONFIG_LIBOBJ_DIR([lib])
 AC_PROG_CC
-#: AM_PROG_CC_C_O
+#x AM_PROG_CC_C_O
 AC_PROG_RANLIB
 AC_FUNC_ALLOCA
 AC_CONFIG_FILES([lib/Makefile src/Makefile])
@@ -91,11 +91,29 @@ $AUTOMAKE
 $MAKE distcheck
 
 
+## ------------------------------------------ ##
+## Traditional LIBOBJS with LIBOBJDIR set.    ##
+## ------------------------------------------ ##
+
+# Invocation of AC_CONFIG_LIBOBJ_DIR may be necessary for reasons
+# unrelated to Automake or Makefile.am layout.
+
+sed 's/#: //' configure.in >configure.int
+mv -f configure.int configure.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+test ! -d lib/lib
+$MAKE distcheck
+
+
 ## ------------------------------------------- ##
 ## Test using ALLOCA from a sibling directory. ##
 ## ------------------------------------------- ##
 
-sed 's/#: //; s/lib\/Makefile //' configure.in >configure.int
+sed 's/#x //; s/lib\/Makefile //' configure.in >configure.int
 mv -f configure.int configure.in
 
 cat >Makefile.am <<'EOF'