aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2018-11-02 02:31:01 +0000
committerNIIBE Yutaka <[email protected]>2018-11-02 02:31:01 +0000
commit78af09ce13969b64f121ae5990e66fb7f1cd3f1d (patch)
treece54d0734be062a49c909af63c32442e56a33c64
parentgpg-error.m4: Emit message when using gpgrt-config. (diff)
downloadlibgpg-error-78af09ce13969b64f121ae5990e66fb7f1cd3f1d.tar.gz
libgpg-error-78af09ce13969b64f121ae5990e66fb7f1cd3f1d.zip
gpgrt-config: Don't support variable reference in --libdir option.
* src/gpgrt-config: Simplify --libdir support, remove variable substituion. * src/gpg-error.m4: Expand possible ${prefix}, ${exec_prefix} in libdir. Simplify invocation of gpgrt-config. * src/gpgrt.m4: Likewise. -- The --libdir option for configure can include variable reference like --libdir='${exec_prefix}/lib/x86_64-linux-gnu', and this expression should be expanded (the variable should be substituted) beforehand to determine if there is gpg-error.pc file or not. Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--src/gpg-error.m420
-rwxr-xr-xsrc/gpgrt-config42
-rw-r--r--src/gpgrt.m418
3 files changed, 36 insertions, 44 deletions
diff --git a/src/gpg-error.m4 b/src/gpg-error.m4
index 3bfa601..a9d572f 100644
--- a/src/gpg-error.m4
+++ b/src/gpg-error.m4
@@ -64,8 +64,20 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
min_gpg_error_version=ifelse([$1], ,1.33,$1)
ok=no
- if test -f $libdir/pkgconfig/gpg-error.pc; then
- gpgrt_libdir=$libdir
+ if test "$prefix" = NONE ; then
+ prefix_option_expanded=/usr/local
+ else
+ prefix_option_expanded="$prefix"
+ fi
+ if test "$exec_prefix" = NONE ; then
+ exec_prefix_option_expanded=$prefix_option_expanded
+ else
+ exec_prefix_option_expanded=$(prefix=$prefix_option_expanded eval echo $exec_prefix)
+ fi
+ libdir_option_expanded=$(prefix=$prefix_option_expanded exec_prefix=$exec_prefix_option_expanded eval echo $libdir)
+
+ if test -f $libdir_option_expanded/pkgconfig/gpg-error.pc; then
+ gpgrt_libdir=$libdir_option_expanded
else
if crt1_path=$(${CC:-cc} -print-file-name=crt1.o 2>/dev/null); then
if possible_libdir=$(cd ${crt1_path%/*} && pwd 2>/dev/null); then
@@ -81,7 +93,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
if test "$GPGRT_CONFIG" = "no"; then
unset GPGRT_CONFIG
else
- GPGRT_CONFIG="$GPGRT_CONFIG --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$gpgrt_libdir"
+ GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then
GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error"
AC_MSG_NOTICE([Use gpgrt-config with $gpgrt_libdir as gpg-error-config])
@@ -117,7 +129,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
if test "$GPGRT_CONFIG" = "no"; then
unset GPGRT_CONFIG
else
- GPGRT_CONFIG="$GPGRT_CONFIG --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$gpgrt_libdir"
+ GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then
GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error"
AC_MSG_NOTICE([Use gpgrt-config with $gpgrt_libdir as gpg-error-config])
diff --git a/src/gpgrt-config b/src/gpgrt-config
index 9ff0b3a..9aec4f6 100755
--- a/src/gpgrt-config
+++ b/src/gpgrt-config
@@ -417,7 +417,7 @@ sysroot () {
# Show usage
usage () {
cat <<EOF
-Usage: gpgrt-config [--prefix=PREFIX] [--libdir=LIBDIR] [OPTIONS] MODULES
+Usage: gpgrt-config [--libdir=LIBDIR] [OPTIONS] MODULES
Options:
[--exists]
[--modversion]
@@ -436,30 +436,13 @@ else
default_module=${myname%-config}
fi
-# First stage to process --prefix, --exec_prefix and --libdir options
-
-prefix_option=""
-exec_prefix_option=""
-libdir_option=""
+# First stage to process --libdir option
+libdir=""
while test $# -gt 0; do
case $1 in
- --prefix=*)
- prefix_option=${1#--prefix=}
- if [ "$prefix_option" = NONE ]; then
- prefix_option=/usr/local
- fi
- shift
- ;;
- --exec-prefix=*)
- exec_prefix_option=${1#--exec-prefix=}
- if [ "$exec_prefix_option" = NONE ]; then
- exec_prefix_option='${prefix}'
- fi
- shift
- ;;
--libdir=*)
- libdir_option=${1#--libdir=}
+ libdir=${1#--libdir=}
shift
;;
*)
@@ -468,28 +451,13 @@ while test $# -gt 0; do
esac
done
-if [ -n "$prefix_option" ]; then
- read_config_from_stdin __gpgrt-config__ <<EOF
-prefix=$prefix_option
-EOF
-fi
-if [ -n "$exec_prefix_option" ]; then
- read_config_from_stdin __gpgrt-config__ <<EOF
-exec_prefix=$exec_prefix_option
-EOF
-fi
-
# --libdir option has precedence over the env var.
-if [ -n "$libdir_option" ]; then
- libdir=$(substitute_vars $libdir_option)
+if [ -n "$libdir" ]; then
PKG_CONFIG_LIBDIR=$libdir/pkgconfig
fi
if [ x"$PKG_CONFIG_PATH" = x -a x"$PKG_CONFIG_LIBDIR" = x ]; then
echo "Please use --libdir=LIBDIR option or set PKG_CONFIG_LIBDIR" 1>&2
- echo "When LIBDIR has variable references for prefix and/or exec_prefix," 1>&2
- echo "you should provide --prefix=PREFIX option and/or" 1>&2
- echo "--exec-prefix=EXEC_PREFIX option, too" 1>&2
exit 1
fi
diff --git a/src/gpgrt.m4 b/src/gpgrt.m4
index 912b103..55c3ff0 100644
--- a/src/gpgrt.m4
+++ b/src/gpgrt.m4
@@ -69,8 +69,20 @@ AC_DEFUN([AM_PATH_GPGRT],
fi
fi
- if test -f $libdir/pkgconfig/gpg-error.pc; then
- gpgrt_libdir=$libdir
+ if test "$prefix" = NONE ; then
+ prefix_option_expanded=/usr/local
+ else
+ prefix_option_expanded="$prefix"
+ fi
+ if test "$exec_prefix" = NONE ; then
+ exec_prefix_option_expanded=$prefix_option_expanded
+ else
+ exec_prefix_option_expanded=$(prefix=$prefix_option_expanded eval echo $exec_prefix)
+ fi
+ libdir_option_expanded=$(prefix=$prefix_option_expanded exec_prefix=$exec_prefix_option_expanded eval echo $libdir)
+
+ if test -f $libdir_option_expanded/pkgconfig/gpg-error.pc; then
+ gpgrt_libdir=$libdir_option_expanded
else
if crt1_path=$(${CC:-cc} -print-file-name=crt1.o 2>/dev/null); then
if possible_libdir=$(cd ${crt1_path%/*} && pwd 2>/dev/null); then
@@ -84,7 +96,7 @@ AC_DEFUN([AM_PATH_GPGRT],
if test -n "$gpgrt_libdir"; then
AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no)
if test "$GPGRT_CONFIG" != "no"; then
- GPGRT_CONFIG="$GPGRT_CONFIG --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$gpgrt_libdir"
+ GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
fi
fi
min_gpgrt_version=ifelse([$1], ,1.33,$1)