tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / instdir-no-empty.sh
blob66ca794e4c1b38191a418c8c0fec2b4f669d141d
1 #! /bin/sh
2 # Copyright (C) 2012-2018 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 . test-init.sh
22 cat >> configure.ac <<'END'
23 AC_SUBST([CC], [whatever])
24 AC_SUBST([JAVAC], [whatever])
25 AM_PATH_PYTHON(,,:)
26 AC_OUTPUT
27 END
29 cat > Makefile.am << 'END'
30 AUTOMAKE_OPTIONS = no-dependencies
31 mydir = $(prefix)/my
32 myexecdir = $(prefix)/myexec
33 javadir = $(prefix)/java
34 END
36 # Write Makefile.am.
39 for dir in sbin bin libexec pkglibexec myexec; do
40 for dst in '' dist_ nodist_; do
41 echo "${dst}${dir}_SCRIPTS ="
42 done
43 echo "${dir}_PROGRAMS ="
44 done
46 for dir in lib pkglib myexec my; do
47 echo "${dir}_LIBRARIES ="
48 echo "${dir}_LTLIBRARIES ="
49 done
51 for p1 in '' notrans_; do
52 for p2 in '' dist_ nodist_; do
53 for s in '' 1 2 3 4 5 6 7 8 9; do
54 echo "${p1}${p2}man${s}_MANS ="
55 done
56 done
57 done
59 for dst in '' dist_ nodist_; do
60 for dir in dataroot data pkgdata doc lisp my; do
61 echo "${dst}${dir}_DATA ="
62 done
63 for dir in include pkginclude oldinclude my; do
64 echo "${dst}${dir}_HEADERS ="
65 done
66 for dir in python my; do
67 echo "${dst}${dir}_PYTHON ="
68 done
69 for dir in info my; do
70 echo "${dst}${dir}_TEXINFOS ="
71 done
72 for dir in java my; do
73 echo "${dst}${dir}_JAVA ="
74 done
75 for dir in lisp my; do
76 echo "${dst}${dir}_LISP ="
77 done
78 done
80 } > t
82 cat t >> Makefile.am
83 sed 's/^/nobase_/' t >> Makefile.am
84 rm -f t
86 cat Makefile.am # For debugging.
88 # Sanity check.
89 grep '^oldinclude_HEADERS =' Makefile.am \
90 && grep '^nodist_my_PYTHON =' Makefile.am \
91 && grep '^notrans_dist_man5_MANS =' Makefile.am \
92 || fatal_ "creating Makefile.am"
94 $ACLOCAL
95 $AUTOCONF
96 $AUTOMAKE -a
98 cwd=$(pwd) || fatal_ "getting current working directory"
100 doinst ()
102 run_make install install-pdf install-ps install-dvi ${1+"$@"}
105 : > foo.sh
107 ./configure --prefix="$cwd/inst"
108 doinst
109 test ! -e inst || { find inst; exit 1; }
110 $MAKE uninstall
111 doinst bin_SCRIPTS=foo.sh
112 test -f inst/bin/foo.sh
114 # Explicitly pass prefix to avoid spurious influences from
115 # global config.site scripts.
116 ./configure --prefix="/usr/local"
117 test ! -e dest || { find dest; exit 1; }
118 $MAKE uninstall
119 doinst DESTDIR="$cwd/dest" bin_SCRIPTS=foo.sh
120 test -f dest/usr/local/bin/foo.sh