#! /bin/sh
-# Copyright (C) 2008-2012 Free Software Foundation, Inc.
+# Copyright (C) 2008-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
# For texinfos, we expand names using $(srcdir) in the first place.
# Let's hope nobody uses many texinfos.
-. ./defs || Exit 1
+. test-init.sh
# In order to have a useful test on modern systems (which have a high
# limit, if any), use a fake install program that errors out for more
limit=2500
subdir=long_subdir_name_with_many_characters
nfiles=81
-list=`seq_ 1 $nfiles`
+list=$(seq_ 1 $nfiles)
-sed "s|@limit@|$limit|g" >myinstall.in <<'END'
+oPATH=$PATH; export oPATH
+nPATH=$(pwd)/x-bin$PATH_SEPARATOR$PATH; export nPATH
+
+mkdir x-bin
+
+sed "s|@limit@|$limit|g" >x-bin/my-install <<'END'
#! /bin/sh
# Fake install script. This doesn't really install
# (the INSTALL path below would be wrong outside this directory).
limit=@limit@
-INSTALL='@INSTALL@'
-len=`expr "$INSTALL $*" : ".*" 2>/dev/null || echo $limit`
+PATH=$oPATH; export PATH
+if test -z "$orig_INSTALL"; then
+ echo "$0: \$orig_INSTALL variable not set" >&2
+ exit 1
+fi
+len=`expr "$orig_INSTALL $*" : ".*" 2>/dev/null || echo $limit`
if test $len -ge $limit; then
echo "$0: safe command line limit of $limit characters exceeded" >&2
exit 1
fi
-exit 0
+exec $orig_INSTALL "$@"
+exit 1
END
# Creative quoting in the next line to please maintainer-check.
-sed "s|@limit@|$limit|g" >'rm' <<'END'
+sed "s|@limit@|$limit|g" >x-bin/'rm' <<'END'
#! /bin/sh
limit=@limit@
-PATH=$save_PATH
-export PATH
+PATH=$oPATH; export PATH
RM='rm -f'
len=`expr "$RM $*" : ".*" 2>/dev/null || echo $limit`
if test $len -ge $limit; then
exit 1
END
-chmod +x rm
+# Creative quoting in the next line to please maintainer-check.
+chmod +x x-bin/'rm' x-bin/my-install
+
+cat > setenv.in <<'END'
+orig_INSTALL='@INSTALL@'; export orig_INSTALL
+END
cat >>configure.ac <<END
-AC_CONFIG_FILES([myinstall], [chmod +x ./myinstall])
+AC_CONFIG_FILES([setenv.sh:setenv.in])
AC_CONFIG_FILES([$subdir/Makefile])
AC_OUTPUT
END
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst
mkdir build
cd build
../configure --prefix="$instdir"
+. ./setenv.sh
+test -n "$orig_INSTALL"
$MAKE
# Try whether native install (or install-sh) works.
$MAKE install
+test -f "$instdir/bin/script1"
# Multiple uninstall should work, too.
$MAKE uninstall
$MAKE uninstall
-test `find "$instdir" -type f -print | wc -l` = 0
+test $(find "$instdir" -type f -print | wc -l) -eq 0
# Try whether we don't exceed the low limit.
-INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+PATH=$nPATH; export PATH
+run_make INSTALL=my-install install
+test -f "$instdir/bin/script1"
+run_make INSTALL=my-install uninstall
+test $(find "$instdir" -type f -print | wc -l) -eq 0
+PATH=$oPATH; export PATH
cd $subdir
srcdir=../../$subdir
do
chmod a-r $srcdir/$file
test ! -r $srcdir/$file || skip_ "cannot drop file read permissions"
- $MAKE install-binSCRIPTS && Exit 1
+ $MAKE install-binSCRIPTS && exit 1
chmod u+r $srcdir/$file
done
for file in nscript3 nscript$nfiles
do
chmod a-r $srcdir/$file
- $MAKE install-nobase_binSCRIPTS && Exit 1
+ $MAKE install-nobase_binSCRIPTS && exit 1
chmod u+r $srcdir/$file
done
for file in data3 data$nfiles
do
chmod a-r $srcdir/$file
- $MAKE install-dataDATA && Exit 1
+ $MAKE install-dataDATA && exit 1
chmod u+r $srcdir/$file
done
for file in ndata3 ndata$nfiles
do
chmod a-r $srcdir/$file
- $MAKE install-nobase_dataDATA && Exit 1
+ $MAKE install-nobase_dataDATA && exit 1
chmod u+r $srcdir/$file
done
for file in header3.h header$nfiles.h
do
chmod a-r $srcdir/$file
- $MAKE install-includeHEADERS && Exit 1
+ $MAKE install-includeHEADERS && exit 1
chmod u+r $srcdir/$file
done
for file in nheader3.h nheader$nfiles.h
do
chmod a-r $srcdir/$file
- $MAKE install-nobase_includeHEADERS && Exit 1
+ $MAKE install-nobase_includeHEADERS && exit 1
chmod u+r $srcdir/$file
done