tests: expose automake bug#14560
[platform/upstream/automake.git] / t / subpkg.sh
old mode 100755 (executable)
new mode 100644 (file)
index 82bf338..6f59ac5
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
 # Check subpackage handling.
 
 required=cc
-. ./defs || Exit 1
+. test-init.sh
 
 mkdir m4
 
@@ -29,6 +29,7 @@ AC_DEFUN([FOO],[
 EOF
 
 cat >>configure.ac <<'END'
+AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SUBDIRS([lib])
 FOO
 END
@@ -46,8 +47,6 @@ distdir = subpack-1
 dist-hook:
        test -f $(distdir)/LDADD.c
        test -f $(top_distdir)/LDADD.c
-
-ACLOCAL_AMFLAGS = -I m4
 EOF
 
 cat >LDADD.c <<'EOF'
@@ -64,6 +63,7 @@ mkdir lib/src
 cat >lib/configure.ac <<'EOF'
 AC_INIT([lib], [2.3])
 AM_INIT_AUTOMAKE
+AC_CONFIG_MACRO_DIR([../m4])
 AM_PROG_AR
 AC_PROG_RANLIB
 AC_CONFIG_HEADERS([config.h:config.hin])
@@ -80,8 +80,6 @@ dist-hook:
        test -f $(top_distdir)/LDADD.c
        test -f $(distdir)/src/x.c
        test ! -f $(top_distdir)/src/x.c
-
-ACLOCAL_AMFLAGS = -I ../m4
 EOF
 
 cat >lib/src/x.c <<'EOF'
@@ -92,12 +90,12 @@ int lib (void)
 }
 EOF
 
-$ACLOCAL -I m4
+$ACLOCAL
 $AUTOCONF
 $AUTOMAKE -Wno-override
 
 cd lib
-$ACLOCAL -I ../m4
+$ACLOCAL
 $FGREP 'm4_include([../m4/foo.m4])' aclocal.m4
 $AUTOCONF
 $AUTOHEADER
@@ -107,7 +105,7 @@ cd ..
 ./configure
 $MAKE
 $MAKE distcheck
-test ! -d subpack-1 # Make sure distcheck cleans up after itself.
+test ! -e subpack-1 # Make sure distcheck cleans up after itself.
 test -f subpack-1.tar.gz
 
 :