summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2018-09-04 10:45:49 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2018-09-04 10:45:49 +0900
commitaa697dae4c363b3d24ec9be3a0cd41df3bf806ce (patch)
treecb1dcfb13ba6c20f4b4cc635e5946a243415c14e
parent19f9902b004cb980de4da908fa571103bfe2b630 (diff)
downloadlibgpg-error-aa697dae4c363b3d24ec9be3a0cd41df3bf806ce.tar.gz
gpg-error-config: Determine output at configure time.
* src/gpg-error-config.in (isubdirafter): Remove. Also for --cflags and --libs. * configure.ac (GPG_ERROR_CONFIG_ISUBDIRAFTER): Remove. (GPG_ERROR_CONFIG_CFLAGS): Add -idirafter gpg-extra for W32CE. (GPG_ERROR_CONFIG_CFLAGS): Decide here if adding -I$includedir. (GPG_ERROR_CONFIG_LIBS): Decide here if adding -L$libdir. -- Don't do string substitution at the time of its command invocation, but let it determine at configure time.
-rw-r--r--configure.ac43
-rw-r--r--src/gpg-error-config.in15
2 files changed, 39 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index b5c01ba..089cb7e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -483,19 +483,55 @@ if test "x$LIBMULTITHREAD" != x; then
else
GPG_ERROR_CONFIG_MT_LIBS=""
fi
-GPG_ERROR_CONFIG_CFLAGS=""
+if test "$have_w32ce_system" = yes; then
+ GPG_ERROR_CONFIG_CFLAGS="-idirafter \${includedir}/gpg-extra"
+else
+ GPG_ERROR_CONFIG_CFLAGS=""
+fi
if test "x$THREADLIB_CPPFLAGS" != x; then
GPG_ERROR_CONFIG_MT_CFLAGS="${THREADLIB_CPPFLAGS}"
else
GPG_ERROR_CONFIG_MT_CFLAGS=""
fi
-GPG_ERROR_CONFIG_ISUBDIRAFTER=""
GPG_ERROR_CONFIG_HOST="$host"
+
+case "$includedir" in
+ /usr/include|/include) ;;
+ '${prefix}/include')
+ if test "$prefix" != / -a "$prefix" != /usr; then
+ if test -z "$GPG_ERROR_CONFIG_CFLAGS"; then
+ GPG_ERROR_CONFIG_CFLAGS="-I$includedir"
+ else
+ GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS"
+ fi
+ fi
+ ;;
+ *)
+ if test -z "$GPG_ERROR_CONFIG_CFLAGS"; then
+ GPG_ERROR_CONFIG_CFLAGS="-I$includedir"
+ else
+ GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS"
+ fi
+ ;;
+esac
+case "$libdir" in
+ /usr/lib|/usr/lib64|/lib|/lib64) ;;
+ '${exec_prefix}/lib')
+ if test "$exec_prefix" = "NONE"; then
+ if test "$prefix" != / -a "$prefix" != /usr; then
+ GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS"
+ fi
+ elif test "$exec_prefix" != / -a "$exec_prefix" != /usr; then
+ GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS"
+ fi
+ ;;
+ *) GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" ;;
+esac
+
AC_SUBST(GPG_ERROR_CONFIG_LIBS)
AC_SUBST(GPG_ERROR_CONFIG_CFLAGS)
AC_SUBST(GPG_ERROR_CONFIG_MT_LIBS)
AC_SUBST(GPG_ERROR_CONFIG_MT_CFLAGS)
-AC_SUBST(GPG_ERROR_CONFIG_ISUBDIRAFTER)
AC_SUBST(GPG_ERROR_CONFIG_HOST)
@@ -510,7 +546,6 @@ if test "$have_w32_system" = yes; then
fi
if test "$have_w32ce_system" = yes; then
AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE])
- GPG_ERROR_CONFIG_ISUBDIRAFTER="gpg-extra"
fi
force_use_syscfg=yes
fi
diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in
index aa7cb67..93f25f7 100644
--- a/src/gpg-error-config.in
+++ b/src/gpg-error-config.in
@@ -14,7 +14,6 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
libdir=@libdir@
-isubdirafter="@GPG_ERROR_CONFIG_ISUBDIRAFTER@"
if echo "$0" | grep gpg-error-config 2>/dev/null >/dev/null; then
myname="gpg-error-config"
@@ -69,26 +68,12 @@ while test $# -gt 0; do
exit 0
;;
--cflags)
- if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then
- output="$output -I$includedir"
- fi
- # Note: -idirafter is a gcc extension. It is only used on
- # systems where gcc is the only compiler we support (WindowsCE).
- for i in $isubdirafter; do
- output="$output -idirafter ${includedir}/${i}"
- done
output="$output @GPG_ERROR_CONFIG_CFLAGS@"
if test $mt = yes ; then
output="$output @GPG_ERROR_CONFIG_MT_CFLAGS@"
fi
;;
--libs)
- case "$libdir" in
- /usr/lib|/usr/lib64|/lib|/lib64) ;;
- *)
- output="$output -L$libdir"
- ;;
- esac
output="$output @GPG_ERROR_CONFIG_LIBS@"
if test $mt = yes ; then
output="$output @GPG_ERROR_CONFIG_MT_LIBS@"