aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am1
-rw-r--r--src/gpg-error-config-new.in15
-rwxr-xr-xsrc/gpg-error-config-test.sh35
3 files changed, 45 insertions, 6 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index c1efb94..5ba1496 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -115,6 +115,7 @@ CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \
gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) $(tmp_files) lock-obj-pub.native.h
+TESTS=gpg-error-config-test.sh
#
# {{{ Begin Windows part
diff --git a/src/gpg-error-config-new.in b/src/gpg-error-config-new.in
index 307b3df..ddf6af2 100644
--- a/src/gpg-error-config-new.in
+++ b/src/gpg-error-config-new.in
@@ -16,7 +16,7 @@ datadir=@datadir@
PKG_CONFIG_PATH="$PKG_CONFIG_PATH${PKG_CONFIG_PATH:+:}${datadir}/pkgconfig"
#
-#### start of pkgconf-funcs
+#### start of functions for this script
#
# Bourne shell functions for config file in pkg-config style, so that
@@ -394,9 +394,12 @@ all_required_config_files () {
pkg_list=$(list_only_once $all_list)
}
-#### end of pkgconf-funcs
+#### end of functions for this script
myname=${0##*/}
+# Just for a while for testing
+myname=${myname%-new}
+##############################
if [ $myname = gpgrt-config ]; then
myname="gpg-error-config"
fi
@@ -522,15 +525,15 @@ if [ -z "$want_var" -a -z "$want_attr" ]; then
if [ -n "$want_cflags" ]; then
output="$output${output:+ }$(list_only_once $cflags)"
# Backward compatibility to old gpg-error-config
- if [ $mt = yes ]; then
- output="$output $mtcflags"
+ if [ $mt = yes -a -n "$mtcflags" ]; then
+ output="$output${output:+ }$mtcflags"
fi
fi
if [ -n "$want_libs" ]; then
output="$output${output:+ }$(list_only_once_for_libs $libs)"
# Backward compatibility to old gpg-error-config
- if [ $mt = yes ]; then
- output="$output $mtlibs"
+ if [ $mt = yes -a -n "$mtlibs" ]; then
+ output="$output${output:+ }$mtlibs"
fi
fi
fi
diff --git a/src/gpg-error-config-test.sh b/src/gpg-error-config-test.sh
new file mode 100755
index 0000000..d65c06d
--- /dev/null
+++ b/src/gpg-error-config-test.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+PKG_CONFIG_PATH="."
+
+export PKG_CONFIG_PATH
+
+OUTPUT_OLD=$(./gpg-error-config --version)
+OUTPUT_NEW=$(./gpg-error-config-new --version)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99
+
+OUTPUT_OLD=$(./gpg-error-config --libs)
+OUTPUT_NEW=$(./gpg-error-config-new --libs)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99
+
+OUTPUT_OLD=$(./gpg-error-config --cflags)
+OUTPUT_NEW=$(./gpg-error-config-new --cflags)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99
+
+OUTPUT_OLD=$(./gpg-error-config --mt --libs)
+OUTPUT_NEW=$(./gpg-error-config-new --mt --libs)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99
+
+OUTPUT_OLD=$(./gpg-error-config --mt --cflags)
+OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99
+
+OUTPUT_OLD=$(./gpg-error-config --cflags --libs)
+OUTPUT_NEW=$(./gpg-error-config-new --cflags --libs)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99
+
+OUTPUT_OLD=$(./gpg-error-config --mt --cflags --libs)
+OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags --libs)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99
+
+exit 0