pkg-config/check/check-define-variable
Dan Nicholson 305913a6b1 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.
2012-08-19 08:03:00 -07:00

18 lines
313 B
Bash
Executable file

#! /bin/sh
set -e
. ${srcdir}/common
case ${MACHTYPE} in
*-msys)
# Make sure path doesn't get mangled on MSYS
ARGS="--define-variable=includedir=\\/includedir/ --cflags simple"
;;
*)
ARGS="--define-variable=includedir=/includedir/ --cflags simple"
;;
esac
RESULT="-I/includedir/"
run_test