2 # Copyright (C) 2003-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Test to make sure that adding a new directory works, even from
18 # subdirectories. The sister test 'subdir-add-pr46.sh' makes sure
19 # it works when make is run from the top-level directory.
24 cat >> configure.ac
<< 'END'
25 AC_CONFIG_MACRO_DIR
([m4])
26 m4_include
([confiles.
m4])
31 echo 'AC_CONFIG_FILES([sub/Makefile])' > confiles.
m4
33 cat > Makefile.am
<< 'END'
42 echo 'AC_DEFUN([MORE_DEFS], [])' > m
4/moredefs.
m4
50 # Now add new directories.
52 # The first step users typically do when adding a new subdir is editing
53 # configure.ac. That is already tested by 'subdir-add-pr46.sh' though,
54 # so here we try to just edit a file that is included by configure.ac,
55 # without touching configure.ac itself.
58 cat > sub
/maude
/Makefile.am
<< 'END'
59 include_HEADERS
= foo.h
64 echo 'SUBDIRS = maude' >> sub
/Makefile.am
69 # Update confiles.m4 *after* updating sub/Makefile.am; the sister test
70 # 'subdir-add-pr46.sh' does it the in other way: it updates configure.ac
71 # before Makefile.am. We sleep here because modified configure
72 # dependencies must be newer than config.status.
74 echo 'AC_CONFIG_FILES([maude/Makefile sub/maude/Makefile])' >> confiles.
m4
76 # We want a simple rebuild from sub/ to create sub/maude/Makefile
77 # and maude/Makefile automatically.
81 grep '^SUBDIRS = *maude *$' sub
/Makefile.
in
82 grep '^SUBDIRS = *maude *$' sub
/Makefile
83 test -f maude
/Makefile
84 test -f sub
/maude
/Makefile
86 # Make sure the dependencies of aclocal.m4 or honored at least from
87 # the top-level directory.
88 echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m
4/moredefs.
m4
91 for ext
in '.in' ''; do
92 for d
in . maude sub sub
/maude
; do
93 grep '^GREPME =' $d/Makefile
$ext