summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2012-08-19 07:36:36 -0700
committerDan Nicholson <dbn.lists@gmail.com>2012-08-19 08:03:00 -0700
commit305913a6b182dd57d185420b7eb4a71185dcf6ae (patch)
treeabaf36bb3c0d7e5eb32cdf9c62af99d2239f60f0 /check
parent4bce8b46b2835b43367467ef97e20ea47a1d8c83 (diff)
downloadpkg-config-305913a6b182dd57d185420b7eb4a71185dcf6ae.tar.gz
Handle POSIX shell for tests in configure and Makefile
Although the trick of finding a POSIX shell in the system PATH works fine most of the time, it has some drawbacks. * The commands must be copied into every test script. * The scripts are always forced to re-execute themselves. * There's no guarantee the sh found in `getconf PATH` is a POSIX shell and there's no way to override it. Move the handling of this shell to configure where we can detect it once. This gives preference to bash and ksh since they're typically POSIX compatible. It also uses the current PATH with the getconf PATH at the end which should allow things to work on platforms where getconf might not be available like mingw/msys. By specifying the shell in TESTS_ENVIRONMENT, automake will run each script with this shell and we can drop the re-exec dance.
Diffstat (limited to 'check')
-rw-r--r--check/Makefile.am2
-rwxr-xr-xcheck/check-cflags5
-rwxr-xr-xcheck/check-cmd-options5
-rwxr-xr-xcheck/check-conflicts5
-rwxr-xr-xcheck/check-define-variable5
-rwxr-xr-xcheck/check-idirafter5
-rwxr-xr-xcheck/check-includedir5
-rwxr-xr-xcheck/check-libs5
-rwxr-xr-xcheck/check-libs-private5
-rwxr-xr-xcheck/check-missing5
-rwxr-xr-xcheck/check-requires-private4
-rwxr-xr-xcheck/check-version5
-rwxr-xr-xcheck/check-whitespace5
13 files changed, 2 insertions, 59 deletions
diff --git a/check/Makefile.am b/check/Makefile.am
index fd9cd98..4aa9a62 100644
--- a/check/Makefile.am
+++ b/check/Makefile.am
@@ -1,3 +1,5 @@
+TESTS_ENVIRONMENT = $(TESTS_SHELL)
+
TESTS = \
check-cflags \
check-libs \
diff --git a/check/check-cflags b/check/check-cflags
index eb2d6bc..f662687 100755
--- a/check/check-cflags
+++ b/check/check-cflags
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common
diff --git a/check/check-cmd-options b/check/check-cmd-options
index cd22f17..8b5ef4c 100755
--- a/check/check-cmd-options
+++ b/check/check-cmd-options
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common
diff --git a/check/check-conflicts b/check/check-conflicts
index 8092ba9..7f160db 100755
--- a/check/check-conflicts
+++ b/check/check-conflicts
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common
diff --git a/check/check-define-variable b/check/check-define-variable
index d35e445..b0aaabd 100755
--- a/check/check-define-variable
+++ b/check/check-define-variable
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common
diff --git a/check/check-idirafter b/check/check-idirafter
index 7abd2dc..439d799 100755
--- a/check/check-idirafter
+++ b/check/check-idirafter
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common
diff --git a/check/check-includedir b/check/check-includedir
index d78ec24..26d8ab5 100755
--- a/check/check-includedir
+++ b/check/check-includedir
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common
diff --git a/check/check-libs b/check/check-libs
index 9b1b495..372314d 100755
--- a/check/check-libs
+++ b/check/check-libs
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common
diff --git a/check/check-libs-private b/check/check-libs-private
index 961962b..0678fd7 100755
--- a/check/check-libs-private
+++ b/check/check-libs-private
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common
diff --git a/check/check-missing b/check/check-missing
index 93c2267..5616945 100755
--- a/check/check-missing
+++ b/check/check-missing
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common
diff --git a/check/check-requires-private b/check/check-requires-private
index 45115ee..e9ef2f2 100755
--- a/check/check-requires-private
+++ b/check/check-requires-private
@@ -1,9 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
set -e
. ${srcdir}/common
diff --git a/check/check-version b/check/check-version
index 6e92077..4254d65 100755
--- a/check/check-version
+++ b/check/check-version
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common
diff --git a/check/check-whitespace b/check/check-whitespace
index c328f74..b26ec3d 100755
--- a/check/check-whitespace
+++ b/check/check-whitespace
@@ -1,10 +1,5 @@
#! /bin/sh
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
set -e
. ${srcdir}/common