2 # Copyright (C) 2008 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 3, 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 # Installing many files should not exceed the command line length limit.
19 # This is the mans sister test of instmany.test, see there for details.
21 required
=non-root
# hope to catch 'chmod a-r'-challenged file systems.
26 # In order to have a useful test on modern systems (which have a high
27 # limit, if any), use a fake install program that errors out for more
28 # than 2K characters in a command line. The POSIX limit is 4096, but
29 # that may include space taken up by the environment.
32 subdir
=long_subdir_name_with_many_characters
35 # Let's use `seq' if available, it's faster than the loop.
36 list
=`(seq 1 $nfiles) 2>/dev/null || {
38 while test $i -le $nfiles; do
43 sed "s|@limit@|$limit|g" >myinstall.
in <<'END'
45 # Fake install script. This doesn't really install
46 # (the INSTALL path below would be wrong outside this directory).
49 len=`expr "$INSTALL $*" : ".*" 2>/dev/null || echo $limit`
50 if test $len -ge $limit; then
51 echo "$0: safe command line limit of $limit characters exceeded" >&2
57 # Creative quoting in the next line to please maintainer-check.
58 sed "s|@limit@|$limit|g" >'rm' <<'END'
64 len=`expr "$RM $*" : ".*" 2>/dev/null || echo $limit`
65 if test $len -ge $limit; then
66 echo "$0: safe command line limit of $limit characters exceeded" >&2
75 cat >>configure.
in <<END
76 AC_CONFIG_FILES([myinstall], [chmod +x ./myinstall])
77 AC_CONFIG_FILES([$subdir/Makefile])
81 cat >Makefile.am
<<END
88 cat >Makefile.am
<<'END'
96 cat >>Makefile.am
<<END
98 man3_MANS += page$n.man
99 notrans_man_MANS += npage$n.1
100 notrans_man3_MANS += npage$n.man
111 $AUTOMAKE --add-missing
116 ..
/configure
--prefix="$instdir"
118 # Try whether native install (or install-sh) works.
120 # Multiple uninstall should work, too.
123 test `find "$instdir" -type f -print | wc -l` = 0
125 # Try whether we don't exceed the low limit.
126 INSTALL
='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
127 env save_PATH
="$PATH" PATH
="`pwd`/..:$PATH" $MAKE uninstall
132 # Ensure 'make install' fails when 'install' fails.
134 # We cheat here, for efficiency, knowing the internal rule names.
135 # For correctness, one should `$MAKE install' here always, or at
136 # least use install-exec or install-data.
138 for file in page3.1 page
$nfiles.1 npage3.1 npage
$nfiles.1; do
139 chmod a-r
$srcdir/$file
140 $MAKE install-man1
&& Exit
1
141 chmod u
+r
$srcdir/$file
144 for file in page3.man page
$nfiles.man npage3.man npage
$nfiles.man
; do
145 chmod a-r
$srcdir/$file
146 $MAKE install-man3
&& Exit
1
147 chmod u
+r
$srcdir/$file