am-ft: make the environment available earlier
[platform/upstream/automake.git] / t / subpkg2.sh
old mode 100755 (executable)
new mode 100644 (file)
index af89fc1..7800ad0
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-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 @@
 # Try a DIST_SUBDIRS subpackage with no SUBDIRS.
 # Report from Gary V. Vaughan.
 
-. ./defs || Exit 1
+. test-init.sh
 
 mkdir m4
 
@@ -28,6 +28,7 @@ AC_DEFUN([FOO],[
 EOF
 
 cat >>configure.ac <<'END'
+AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SUBDIRS([sub])
 AC_OUTPUT
 END
@@ -43,20 +44,21 @@ mkdir sub
 cat >sub/configure.ac <<'EOF'
 AC_INIT([sub], [2.3])
 AM_INIT_AUTOMAKE
+AC_CONFIG_MACRO_DIR([../m4])
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_FILES([script])
 FOO
 EOF
 
 : >sub/script.in
-echo ACLOCAL_AMFLAGS = -I ../m4 > sub/Makefile.am
+: >sub/Makefile.am
 
-$ACLOCAL -I m4
+$ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
 cd sub
-$ACLOCAL -I ../m4
+$ACLOCAL
 $FGREP 'm4_include([../m4/foo.m4])' aclocal.m4
 $AUTOCONF
 $AUTOMAKE -Wno-override
@@ -64,3 +66,5 @@ cd ..
 
 ./configure
 $MAKE distcheck
+
+: