aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2018-09-05 02:45:45 +0000
committerNIIBE Yutaka <[email protected]>2018-09-05 02:45:45 +0000
commitfa2855d9470ed4f367ca90cd46c27050359cfb62 (patch)
tree2f53d237da5818fb5ab9f35b52811ba0b2e8e9bb
parentMerge branch 'master' into gniibe/pkg-config-support (diff)
downloadlibgpg-error-fa2855d9470ed4f367ca90cd46c27050359cfb62.tar.gz
libgpg-error-fa2855d9470ed4f367ca90cd46c27050359cfb62.zip
Forward compatibility support by gpg-error-config-old (--variable=*).
-rw-r--r--src/Makefile.am2
-rwxr-xr-xsrc/gpg-error-config-test.sh12
-rw-r--r--src/gpg-error-config.in10
3 files changed, 23 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index d631ee2..180f269 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -336,7 +336,7 @@ gpgrt-config: gpg-error-config
cp gpg-error-config gpgrt-config
gpg-error-config: gpg-error-config-new gpg-error-config-old
- @echo "Confirm gpg-error-config works... "
+ @echo -n "Confirm gpg-error-config works... "
@if $(srcdir)/gpg-error-config-test.sh --old-new; then \
echo "good"; \
cp gpg-error-config-new $@; \
diff --git a/src/gpg-error-config-test.sh b/src/gpg-error-config-test.sh
index a9a6b8d..7f97ead 100755
--- a/src/gpg-error-config-test.sh
+++ b/src/gpg-error-config-test.sh
@@ -61,6 +61,18 @@ if [ "$PKG_CONFIG_CMD" = ./gpg-error-config-old ]; then
OUTPUT_OLD=$($PKG_CONFIG_CMD --mt --cflags --libs)
OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags --libs)
[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --cflags --libs
+
+ OUTPUT_OLD=$($PKG_CONFIG_CMD --variable=mtcflags)
+ OUTPUT_NEW=$(./gpg-error-config-new --variable=mtcflags)
+ [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=mtcflags
+
+ OUTPUT_OLD=$($PKG_CONFIG_CMD --variable=mtlibs)
+ OUTPUT_NEW=$(./gpg-error-config-new --variable=mtlibs)
+ [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=mtlibs
+
+ OUTPUT_OLD=$($PKG_CONFIG_CMD --variable=host)
+ OUTPUT_NEW=$(./gpg-error-config-new --variable=host)
+ [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=host
fi
if [ -n "$test_failed" ]; then
diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in
index 93f25f7..e050632 100644
--- a/src/gpg-error-config.in
+++ b/src/gpg-error-config.in
@@ -67,6 +67,16 @@ while test $# -gt 0; do
echo "@PACKAGE_VERSION@"
exit 0
;;
+ --variable=*)
+ case "${1#*=}" in
+ prefix) echo "$prefix" ;;
+ exec_prefix) echo "$exec_prefix" ;;
+ host) echo "@GPG_ERROR_CONFIG_HOST@" ;;
+ mtcflags) echo "@GPG_ERROR_CONFIG_MT_CFLAGS@" ;;
+ mtlibs) echo "@GPG_ERROR_CONFIG_MT_LIBS@";;
+ esac
+ exit 0
+ ;;
--cflags)
output="$output @GPG_ERROR_CONFIG_CFLAGS@"
if test $mt = yes ; then