[git] GPG-ERROR - branch, master, updated. libgpg-error-1.32-21-g6167f3c

by NIIBE Yutaka cvs at cvs.gnupg.org
Wed Oct 10 03:16:42 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Error codes used by GnuPG et al.".

The branch, master has been updated
       via  6167f3c461a4e53ccc5af620cdbfa28bfa9234f5 (commit)
      from  f4f0da74f526d7e35cedbc2e93454df6440dbfa5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6167f3c461a4e53ccc5af620cdbfa28bfa9234f5
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Oct 10 10:14:26 2018 +0900

    gpg-error-config: Add PKG_CONFIG_SYSROOT_DIR support.
    
    * src/gpg-error-config-new.in (sysroot): New function.
    (want_cflags, want_libs): Use sysroot.
    * src/gpg-error-config-test.sh: Test with PKG_CONFIG_SYSROOT_DIR.
    
    --
    
    PKG_CONFIG_SYSROOT_DIR is for cross build.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/src/gpg-error-config-new.in b/src/gpg-error-config-new.in
index 3b31a68..8bf92cf 100644
--- a/src/gpg-error-config-new.in
+++ b/src/gpg-error-config-new.in
@@ -395,6 +395,29 @@ all_required_config_files () {
     PKG_LIST=$(list_only_once $all_list)
 }
 
+#
+# Modify -I or -L by PKG_CONFIG_SYSROOT_DIR variable
+#
+sysroot () {
+    _opt="$1"
+    _result=""
+    shift
+
+    while [ $# -gt 0 ]; do
+	if [ $1 = $_opt ]; then
+	    _result="$_result${_result:+ }$_opt"
+	    shift
+	    _result="$_result $PKG_CONFIG_SYSROOT_DIR$1"
+	elif expr "$1" : "^$_opt" >/dev/null; then
+	    _result="$_result${_result:+ }$_opt$PKG_CONFIG_SYSROOT_DIR$(expr "$1" : "^$_opt\(.*\)")"
+	else
+	    _result="$_result${_result:+ }$1"
+	fi
+	shift
+    done
+    echo "$_result"
+}
+
 #### end of functions for this script
 
 myname=${0##*/}
@@ -446,6 +469,13 @@ mtlibs=""
 delimiter=" "
 output=""
 
+VAR_list=VAR_pc_sysrootdir
+if [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
+    VAR_pc_sysrootdir="/"
+else
+    VAR_pc_sysrootdir="$PKG_CONFIG_SYSROOT_DIR"
+fi
+
 while test $# -gt 0; do
     case $1 in
 	--prefix)
@@ -524,14 +554,14 @@ done
 
 if [ -z "$want_var" -a -z "$want_attr" ]; then
     if [ -n "$want_cflags" ]; then
-	output="$output${output:+ }$(list_only_once $cflags)"
+	output="$output${output:+ }$(sysroot -I $(list_only_once $cflags))"
 	# Backward compatibility to old gpg-error-config
 	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)"
+	output="$output${output:+ }$(sysroot -L $(list_only_once_for_libs $libs))"
 	# Backward compatibility to old gpg-error-config
 	if [ $mt = yes -a -n "$mtlibs" ]; then
 	    output="$output${output:+ }$mtlibs"
diff --git a/src/gpg-error-config-test.sh b/src/gpg-error-config-test.sh
index 0501c8d..527e118 100755
--- a/src/gpg-error-config-test.sh
+++ b/src/gpg-error-config-test.sh
@@ -7,6 +7,8 @@ export PKG_CONFIG_PATH
 if [ "$1" = --old-new ]; then
     PKG_CONFIG_CMD=./gpg-error-config-old
 else
+    PKG_CONFIG_SYSROOT_DIR="/var/example-target"
+    export PKG_CONFIG_SYSROOT_DIR
     PKG_CONFIG_CMD="pkg-config gpg-error"
     if ! $PKG_CONFIG_CMD --exists >/dev/null; then
 	exit 77			# Skip tests

-----------------------------------------------------------------------

Summary of changes:
 src/gpg-error-config-new.in  | 34 ++++++++++++++++++++++++++++++++--
 src/gpg-error-config-test.sh |  2 ++
 2 files changed, 34 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Error codes used by GnuPG et al.
http://git.gnupg.org




More information about the Gnupg-commits mailing list