#! /bin/sh
-# Copyright (C) 2012 Free Software Foundation, Inc.
+# Copyright (C) 2012-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
# An empty "foo_PRIMARY" declaration should *not* cause "make install"
# to create directory $(foodir). See automake bug#10997 and bug#11030.
-. ./defs || Exit 1
+. test-init.sh
cat >> configure.ac <<'END'
AC_SUBST([CC], [whatever])
$AUTOCONF
$AUTOMAKE -a
-cwd=`pwd` || fatal_ "getting current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
doinst ()
{
- $MAKE install install-pdf install-ps install-dvi ${1+"$@"}
+ run_make install install-pdf install-ps install-dvi ${1+"$@"}
}
: > foo.sh
./configure --prefix="$cwd/inst"
doinst
-test ! -d inst || { find inst; Exit 1; }
+test ! -e inst || { find inst; exit 1; }
$MAKE uninstall
-doinst bin_SCRIPTS=foo.sh AM_MAKEFLAGS='bin_SCRIPTS=foo.sh'
+doinst bin_SCRIPTS=foo.sh
test -f inst/bin/foo.sh
-./configure
-doinst DESTDIR="$cwd/dest"
-test ! -d dest || { find dest; Exit 1; }
+# Explicitly pass prefix to avoid spurious influences from
+# global config.site scripts.
+./configure --prefix="/usr/local"
+test ! -e dest || { find dest; exit 1; }
$MAKE uninstall
-doinst DESTDIR="$cwd/dest" bin_SCRIPTS=foo.sh AM_MAKEFLAGS='bin_SCRIPTS=foo.sh'
+doinst DESTDIR="$cwd/dest" bin_SCRIPTS=foo.sh
test -f dest/usr/local/bin/foo.sh
: