doc: typos in test file.
[automake.git] / t / instdir-no-empty.sh
blob29306f11ca55926ce4aba4112156b8666bcb4fbe
1 #! /bin/sh
2 # Copyright (C) 2012-2024 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # An empty "foo_PRIMARY" declaration should *not* cause "make install"
18 # to create directory $(foodir). See automake bug#10997 and bug#11030.
20 required='makeinfo tex texi2dvi dvips'
21 . test-init.sh
23 cat >> configure.ac <<'END'
24 AC_SUBST([CC], [whatever])
25 AC_SUBST([JAVAC], [whatever])
26 AM_PATH_PYTHON(,,:)
27 AC_OUTPUT
28 END
30 cat > Makefile.am << 'END'
31 AUTOMAKE_OPTIONS = no-dependencies
32 mydir = $(prefix)/my
33 myexecdir = $(prefix)/myexec
34 javadir = $(prefix)/java
35 END
37 # Write Makefile.am.
40 for dir in sbin bin libexec pkglibexec myexec; do
41 for dst in '' dist_ nodist_; do
42 echo "${dst}${dir}_SCRIPTS ="
43 done
44 echo "${dir}_PROGRAMS ="
45 done
47 for dir in lib pkglib myexec my; do
48 echo "${dir}_LIBRARIES ="
49 echo "${dir}_LTLIBRARIES ="
50 done
52 for p1 in '' notrans_; do
53 for p2 in '' dist_ nodist_; do
54 for s in '' 1 2 3 4 5 6 7 8 9; do
55 echo "${p1}${p2}man${s}_MANS ="
56 done
57 done
58 done
60 for dst in '' dist_ nodist_; do
61 for dir in dataroot data pkgdata doc lisp my; do
62 echo "${dst}${dir}_DATA ="
63 done
64 for dir in include pkginclude oldinclude my; do
65 echo "${dst}${dir}_HEADERS ="
66 done
67 for dir in python my; do
68 echo "${dst}${dir}_PYTHON ="
69 done
70 for dir in info my; do
71 echo "${dst}${dir}_TEXINFOS ="
72 done
73 for dir in java my; do
74 echo "${dst}${dir}_JAVA ="
75 done
76 for dir in lisp my; do
77 echo "${dst}${dir}_LISP ="
78 done
79 done
81 } > t
83 cat t >> Makefile.am
84 sed 's/^/nobase_/' t >> Makefile.am
85 rm -f t
87 cat Makefile.am # For debugging.
89 # Sanity check.
90 grep '^oldinclude_HEADERS =' Makefile.am \
91 && grep '^nodist_my_PYTHON =' Makefile.am \
92 && grep '^notrans_dist_man5_MANS =' Makefile.am \
93 || fatal_ "creating Makefile.am"
95 $ACLOCAL
96 $AUTOCONF
97 $AUTOMAKE -a
99 cwd=$(pwd) || fatal_ "getting current working directory"
101 doinst ()
103 run_make install install-pdf install-ps install-dvi ${1+"$@"}
106 : > foo.sh
108 ./configure --prefix="$cwd/inst"
109 doinst
110 test ! -e inst || { find inst; exit 1; }
111 $MAKE uninstall
112 doinst bin_SCRIPTS=foo.sh
113 test -f inst/bin/foo.sh
115 # Explicitly pass prefix to avoid spurious influences from
116 # global config.site scripts.
117 ./configure --prefix="/usr/local"
118 test ! -e dest || { find dest; exit 1; }
119 $MAKE uninstall
120 doinst DESTDIR="$cwd/dest" bin_SCRIPTS=foo.sh
121 test -f dest/usr/local/bin/foo.sh