diff options
author | Werner Koch <wk@gnupg.org> | 2014-10-02 13:14:53 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-10-02 13:14:53 +0200 |
commit | 3ecdcb6ac814e3b63aebbf66729ae6cb67c9f6d2 (patch) | |
tree | 282906264ed4edd1568cd9b33a4b284627aa28e5 /src/gpg-error.m4 | |
parent | 74abfcf0c3ba7cd6ce36540c70699fc1719248b3 (diff) | |
download | libgpg-error-3ecdcb6ac814e3b63aebbf66729ae6cb67c9f6d2.tar.gz |
build: Support SYSROOT based config script finding.
* src/gpg-error.m4: Add support for SYSROOT and set
gpg_config_script_warn. Use AC_PATH_PROG instead of AC_PATH_TOOL
because the config script is not expected to be installed with a
prefix for its name.
Diffstat (limited to 'src/gpg-error.m4')
-rw-r--r-- | src/gpg-error.m4 | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/gpg-error.m4 b/src/gpg-error.m4 index 053eceb..1661204 100644 --- a/src/gpg-error.m4 +++ b/src/gpg-error.m4 @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2014-01-24 +# Last-changed: 2014-10-02 dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION, @@ -17,7 +17,12 @@ dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS, dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are -dnl used for programs requireding real multi thread support. +dnl used for programs requireing real multi thread support. +dnl +dnl If a prefix option is not used, the config script is first +dnl searched in $SYSROOT/bin and then along $PATH. If the used +dnl config script does not match the host specification the script +dnl is added to the gpg_config_script_warn variable. dnl AC_DEFUN([AM_PATH_GPG_ERROR], [ AC_REQUIRE([AC_CANONICAL_HOST]) @@ -36,13 +41,26 @@ AC_DEFUN([AM_PATH_GPG_ERROR], AC_ARG_WITH(gpg-error-prefix,, [gpg_error_config_prefix="$withval"]) - if test x$gpg_error_config_prefix != x ; then - if test x${GPG_ERROR_CONFIG+set} != xset ; then - GPG_ERROR_CONFIG=$gpg_error_config_prefix/bin/gpg-error-config + if test x"${GPG_ERROR_CONFIG}" = x ; then + if test x"${gpg_error_config_prefix}" != x ; then + GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config" + else + case "${SYSROOT}" in + /*) + if test -x "${SYSROOT}/bin/gpg-error-config" ; then + GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-config" + fi + ;; + '') + ;; + *) + AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.]) + ;; + esac fi fi - AC_PATH_TOOL(GPG_ERROR_CONFIG, gpg-error-config, no) + AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no) min_gpg_error_version=ifelse([$1], ,0.0,$1) AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version) ok=no @@ -83,8 +101,9 @@ AC_DEFUN([AM_PATH_GPG_ERROR], *** built for $gpg_error_config_host and thus may not match the *** used host $host. *** You may want to use the configure option --with-gpg-error-prefix -*** to specify a matching config script. +*** to specify a matching config script or use \$SYSROOT. ***]]) + gpg_config_script_warn="$gpg_config_script_warn libgpg-error" fi fi else |