[git] GPG-ERROR - branch, gniibe/pkg-config-support, updated. libgpg-error-1.32-13-g78be78b

by NIIBE Yutaka cvs at cvs.gnupg.org
Thu Aug 30 06:52:11 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, gniibe/pkg-config-support has been updated
       via  78be78bd3d9129919544781e17c8d2fefea6e1de (commit)
       via  5cbc696fec8ba1e8452e8ad8518636e962caf3bc (commit)
       via  3f96c9c1d103e3e77be474da3a87c3bf69915726 (commit)
       via  ed6f96f26c2b018b73cc3d440d07d1cc50007e10 (commit)
       via  ffebb25cfe236b95480880c2b468ca0034033a8c (commit)
       via  37f627eaca57e227dbfd721a94bb9fa6ab143981 (commit)
       via  6680867dd90c801efdb91b6b150cfd2906bb5d98 (commit)
       via  55603b7a0d2f6b595823214781f91cb4a2bd502e (commit)
      from  07fcb271f7610e7a174bd6a6d54aaa84b01ec060 (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 78be78bd3d9129919544781e17c8d2fefea6e1de
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Aug 30 13:44:23 2018 +0900

    Remove dupulicates.

diff --git a/src/gpg-error-config-main.sh b/src/gpg-error-config-main.sh
index d7b9c56..c8ee06f 100644
--- a/src/gpg-error-config-main.sh
+++ b/src/gpg-error-config-main.sh
@@ -106,14 +106,14 @@ for p in $pkg_list; do
 done
 
 if [ $opt_cflags = yes ]; then
-    output="$output $cflags"
+    output="$output $(list_only_once $cflags)"
     # Backward compatibility to old gpg-error-config
     if [ $mt = yes ]; then
 	output="$output $mtcflags"
     fi
 fi
 if [ $opt_libs = yes ]; then
-    output="$output $libs"
+    output="$output $(list_only_once_for_libs $libs)"
     # Backward compatibility to old gpg-error-config
     if [ $mt = yes ]; then
 	output="$output $mtlibs"
diff --git a/src/pkgconf-funcs.sh b/src/pkgconf-funcs.sh
index a51a8c3..04dabc1 100644
--- a/src/pkgconf-funcs.sh
+++ b/src/pkgconf-funcs.sh
@@ -161,6 +161,45 @@ list_only_once () {
     echo $result
 }
 
+list_only_once_for_libs () {
+    local result=""
+    loca rev_list=""
+    local arg
+
+    # Scan the list and eliminate duplicates for non-"-lxxx"
+    # the resulted list is in reverse order
+    for arg; do
+	case "$arg" in
+	    -l*)
+		# As-is
+		rev_list="$arg $rev_list"
+		;;
+	    *)
+		if not_listed_yet $arg "$rev_list"; then
+		    rev_list="$arg $rev_list"
+		fi
+		;;
+	esac
+    done
+
+    # Scan again
+    for arg in $rev_list; do
+	case "$arg" in
+	    -l*)
+		if not_listed_yet $arg "$result"; then
+		    result="$arg $result"
+		fi
+		;;
+	    *)
+		# As-is
+		result="$arg $result"
+		;;
+	esac
+    done
+
+    echo $result
+}
+
 #
 # Recursively solve package dependencies
 #

commit 5cbc696fec8ba1e8452e8ad8518636e962caf3bc
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Aug 30 13:20:42 2018 +0900

    Handle module dependency (Requires field).

diff --git a/src/gpg-error-config-main.sh b/src/gpg-error-config-main.sh
index 37eb193..d7b9c56 100644
--- a/src/gpg-error-config-main.sh
+++ b/src/gpg-error-config-main.sh
@@ -88,21 +88,36 @@ while test $# -gt 0; do
     shift
 done
 
-if [ opt_cflags = yes ]; then
-    output="$output $(get_attr Cflags)"
+cflags="$(get_attr Cflags)"
+libs="$(get_attr Libs)"
+
+mtcflags="$(get_var mtcflags)"
+mtlibs="$(get_var mtlibs)"
+
+requires="$(get_attr Requires)"
+cleanup_vars_attrs
+pkg_list=$(all_required_config_files $requires)
+
+for p in $pkg_list; do
+    read_config_file $p $PKG_CONFIG_PATH
+    cflags="$cflags $(get_attr Cflags)"
+    libs="$libs $(get_attr Libs)"
+    cleanup_vars_attrs
+done
+
+if [ $opt_cflags = yes ]; then
+    output="$output $cflags"
     # Backward compatibility to old gpg-error-config
     if [ $mt = yes ]; then
-	output="$output $(get_var mtcflags)"
+	output="$output $mtcflags"
     fi
 fi
-if [ opt_libs = yes ]; then
-    output="$output $(get_attr Libs)"
+if [ $opt_libs = yes ]; then
+    output="$output $libs"
     # Backward compatibility to old gpg-error-config
     if [ $mt = yes ]; then
-	output="$output $(get_var mtlibs)"
+	output="$output $mtlibs"
     fi
 fi
 
-# cleanup_vars_attrs
-
 echo $output
diff --git a/src/pkgconf-funcs.sh b/src/pkgconf-funcs.sh
index 38dccf0..a51a8c3 100644
--- a/src/pkgconf-funcs.sh
+++ b/src/pkgconf-funcs.sh
@@ -135,4 +135,57 @@ cleanup_vars_attrs () {
     eval unset $ATTR_list ATTR_list
 }
 
+not_listed_yet () {
+    local m=$1
+    shift
+
+    for arg; do
+	if [ $m = $arg ]; then
+	    return 1
+	fi
+    done
+
+    return 0
+}
+
+list_only_once () {
+    local result=""
+    local arg
+
+    for arg; do
+	if not_listed_yet $arg "$result"; then
+	    result="$result $arg"
+	fi
+    done
+
+    echo $result
+}
+
+#
+# Recursively solve package dependencies
+#
+# XXX: version requirement (version comparison) is not yet supported
+#
+all_required_config_files () {
+    local list="$1"
+    local all_list
+    local new_list
+    local p
+
+    all_list="$list"
+
+    while [ -n "$list" ]; do
+	new_list=""
+	for p in $list; do
+	    read_config_file $p $PKG_CONFIG_PATH
+	    new_list="$new_list $(get_attr Requires)"
+	    cleanup_vars_attrs
+	done
+	all_list="$all_list $new_list"
+	list="$new_list"
+    done
+
+    echo $(list_only_once $all_list)
+}
+
 #### end of pkgconf-funcs

commit 3f96c9c1d103e3e77be474da3a87c3bf69915726
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Aug 30 11:25:10 2018 +0900

    PKG_CONFIG_PATH change.

diff --git a/src/gpg-error-config-head.in b/src/gpg-error-config-head.in
index 1c50fa0..c6219f2 100644
--- a/src/gpg-error-config-head.in
+++ b/src/gpg-error-config-head.in
@@ -13,5 +13,5 @@
 prefix=@prefix@
 datarootdir=@datarootdir@
 datadir=@datadir@
-PKG_CONFIG_PATH="${datadir}/pkgconfig"
+PKG_CONFIG_PATH="$PKG_CONFIG_PATH${PKG_CONFIG_PATH:+:}${datadir}/pkgconfig"
 #

commit ed6f96f26c2b018b73cc3d440d07d1cc50007e10
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Aug 30 11:16:41 2018 +0900

    New func read_config_from_stdin and cleanup_vars_attrs.

diff --git a/src/gpg-error-config-main.sh b/src/gpg-error-config-main.sh
index 637db7d..37eb193 100644
--- a/src/gpg-error-config-main.sh
+++ b/src/gpg-error-config-main.sh
@@ -5,13 +5,6 @@ else
   myname="gpgrt-config"
 fi
 
-if find_file_in_path ${myname%-config}.pc $PKG_CONFIG_PATH; then
-    CONFIG_FILE=$RESULT
-else
-    echo "Can't find ${myname%-config}.pc" 1>&2
-    exit 1
-fi
-
 usage()
 {
     cat <<EOF
@@ -39,7 +32,7 @@ else
     shift
 fi
 
-read_config_file < "$CONFIG_FILE"
+read_config_file ${myname%-config} $PKG_CONFIG_PATH
 
 opt_cflags=no
 opt_libs=no
@@ -110,11 +103,6 @@ if [ opt_libs = yes ]; then
     fi
 fi
 
-#
-# Clean up
-#
-# eval unset $VAR_list VAR_list
-# eval unset $ATTR_list ATTR_list
-#
+# cleanup_vars_attrs
 
 echo $output
diff --git a/src/pkgconf-funcs.sh b/src/pkgconf-funcs.sh
index fd144c8..38dccf0 100644
--- a/src/pkgconf-funcs.sh
+++ b/src/pkgconf-funcs.sh
@@ -65,7 +65,7 @@ substitute_vars () {
 }
 
 #
-# Read a config file
+# Read a config from stdin
 #
 # Variables:
 # For VAR=VALUE, value is stored in the shell variable VAR_*.
@@ -73,7 +73,7 @@ substitute_vars () {
 # Attributes:
 # For KEY: VALUE, value is stored in the shell variable ATTR_*.
 #
-read_config_file () {
+read_config_from_stdin () {
     local line
     local varname
     local value
@@ -116,4 +116,23 @@ find_file_in_path () {
     RESULT=""
     return 1
 }
+
+read_config_file () {
+    local config_file
+    local RESULT
+
+    if find_file_in_path $1.pc $2; then
+	config_file=$RESULT
+    else
+	echo "Can't find $1.pc" 1>&2
+	exit 1
+    fi
+    read_config_from_stdin < $config_file
+}
+
+cleanup_vars_attrs () {
+    eval unset $VAR_list VAR_list
+    eval unset $ATTR_list ATTR_list
+}
+
 #### end of pkgconf-funcs

commit ffebb25cfe236b95480880c2b468ca0034033a8c
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Aug 30 10:34:43 2018 +0900

    Add note for the compatibility.
    
    * src/gpg-error-config-main.sh (--modversion): New.
    Add comments.
    
    --
    
    Not supported by pkg-config:
        No such options:
          --prefix
          --exec-prefix
          --host
        Conditional flag which change the output: --mt
        Different semantics: --version which print the tool version
    
    We keep the backward compatibility for older gpg-error-config
    for --mt and other options for a while.
    
    New usage (pkg-config compatible way) is encouraged.

diff --git a/src/gpg-error-config-main.sh b/src/gpg-error-config-main.sh
index e2ff26d..637db7d 100644
--- a/src/gpg-error-config-main.sh
+++ b/src/gpg-error-config-main.sh
@@ -12,8 +12,6 @@ else
     exit 1
 fi
 
-output=""
-
 usage()
 {
     cat <<EOF
@@ -36,12 +34,17 @@ fi
 if [ "$1" != "--mt" ]; then
     mt=no
 else
+    # In future, use --variable=mtcflags or --variable=mtlibs
     mt=yes
     shift
 fi
 
 read_config_file < "$CONFIG_FILE"
 
+opt_cflags=no
+opt_libs=no
+output=""
+
 while test $# -gt 0; do
     case "$1" in
 	-*=*)
@@ -54,32 +57,34 @@ while test $# -gt 0; do
 
     case $1 in
 	--prefix)
+	    # In future, use --variable=prefix instead.
 	    output="$output $(get_var prefix)"
 	    ;;
 	--exec-prefix)
+	    # In future, use --variable=exec_prefix instead.
 	    output="$output $(get_var exec_prefix)"
 	    ;;
 	--version)
+	    # In future, use --modversion instead.
+	    echo "$(get_attr Version)"
+	    exit 0
+	    ;;
+	--modversion)
 	    echo "$(get_attr Version)"
 	    exit 0
 	    ;;
 	--cflags)
-	    output="$output $(get_attr Cflags)"
-            if test $mt = yes ; then
-                output="$output $(get_var mtcflags)"
-            fi
+	    opt_cflags=yes
 	    ;;
 	--libs)
-	    output="$output $(get_attr Libs)"
-            if test $mt = yes ; then
-                output="$output $(get_var mtlibs)"
-            fi
+	    opt_libs=yes
 	    ;;
 	--variable=*)
 	    echo "$(get_var ${1#*=})"
 	    exit 0
 	    ;;
 	--host)
+	    # In future, use --variable=host instead.
 	    echo "$(get_var host)"
 	    exit 0
 	    ;;
@@ -90,6 +95,21 @@ while test $# -gt 0; do
     shift
 done
 
+if [ opt_cflags = yes ]; then
+    output="$output $(get_attr Cflags)"
+    # Backward compatibility to old gpg-error-config
+    if [ $mt = yes ]; then
+	output="$output $(get_var mtcflags)"
+    fi
+fi
+if [ opt_libs = yes ]; then
+    output="$output $(get_attr Libs)"
+    # Backward compatibility to old gpg-error-config
+    if [ $mt = yes ]; then
+	output="$output $(get_var mtlibs)"
+    fi
+fi
+
 #
 # Clean up
 #

commit 37f627eaca57e227dbfd721a94bb9fa6ab143981
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Aug 30 09:50:01 2018 +0900

    Fix test condition for pkg-conf-funcs.
    
    * src/pkgconf-funcs.sh: Use -r (was: -e).

diff --git a/src/pkgconf-funcs.sh b/src/pkgconf-funcs.sh
index d06b68b..fd144c8 100644
--- a/src/pkgconf-funcs.sh
+++ b/src/pkgconf-funcs.sh
@@ -108,7 +108,7 @@ find_file_in_path () {
     local IFS=":"		# On Windows it should be ";"???
 
     for d in $p; do
-	if [ -e $d/$f ]; then
+	if [ -r $d/$f ]; then
 	    RESULT="$d/$f"
 	    return 0
 	fi

commit 6680867dd90c801efdb91b6b150cfd2906bb5d98
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Aug 30 09:49:08 2018 +0900

    Simplify configure substitution.
    
    * configure (GPG_ERROR_CONFIG_INCLUDEDIR): Remove.
    (GPG_ERROR_CONFIG_LIBDIR): Remove.

diff --git a/configure.ac b/configure.ac
index 5b460bf..9a2d8ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -495,12 +495,12 @@ else
 fi
 GPG_ERROR_CONFIG_HOST="$host"
 case "$includedir" in
-  '${prefix}/include'|/usr/include|/include) GPG_ERROR_CONFIG_INCLUDEDIR="" ;;
-  *) GPG_ERROR_CONFIG_INCLUDEDIR="-I$includedir" ;;
+  '${prefix}/include'|/usr/include|/include) ;;
+  *) GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS" ;;
 esac
 case "$libdir" in
-  '${exec_prefix}/lib'|/usr/lib|/usr/lib64|/lib|/lib64) GPG_ERROR_CONFIG_LIBDIR="" ;;
-  *) GPG_ERROR_CONFIG_LIBDIR="-L$libdir" ;;
+  '${exec_prefix}/lib'|/usr/lib|/usr/lib64|/lib|/lib64) ;;
+  *) GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" ;;
 esac
 
 AC_SUBST(GPG_ERROR_CONFIG_LIBS)
@@ -508,8 +508,6 @@ 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_HOST)
-AC_SUBST(GPG_ERROR_CONFIG_INCLUDEDIR)
-AC_SUBST(GPG_ERROR_CONFIG_LIBDIR)
 
 #
 # Special defines for certain platforms
diff --git a/src/gpg-error.pc.in b/src/gpg-error.pc.in
index 3e8d328..e6ab104 100644
--- a/src/gpg-error.pc.in
+++ b/src/gpg-error.pc.in
@@ -9,6 +9,6 @@ mtlibs=@GPG_ERROR_CONFIG_MT_LIBS@
 Name: gpg-error
 Description: GPG Runtime
 Version: @PACKAGE_VERSION@
-Cflags: @GPG_ERROR_CONFIG_INCLUDEDIR@ @GPG_ERROR_CONFIG_CFLAGS@
-Libs: @GPG_ERROR_CONFIG_LIBDIR@ @GPG_ERROR_CONFIG_LIBS@
+Cflags: @GPG_ERROR_CONFIG_CFLAGS@
+Libs: @GPG_ERROR_CONFIG_LIBS@
 URL: https://www.gnupg.org/software/libgpg-error/index.html

commit 55603b7a0d2f6b595823214781f91cb4a2bd502e
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Aug 30 09:27:24 2018 +0900

    Fix the previous commit.

diff --git a/src/gpg-error.m4 b/src/gpg-error.m4
index ab29273..0564219 100644
--- a/src/gpg-error.m4
+++ b/src/gpg-error.m4
@@ -89,7 +89,9 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
     GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
     GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
     GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --variable=mtcflags 2>/dev/null`
+    GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS"
     GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --variable=mtlibs 2>/dev/null`
+    GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS"
     AC_MSG_RESULT([yes ($gpg_error_config_version)])
     ifelse([$2], , :, [$2])
     gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --variable=host 2>/dev/null || echo none`

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

Summary of changes:
 configure.ac                 |  10 ++--
 src/gpg-error-config-head.in |   2 +-
 src/gpg-error-config-main.sh |  71 +++++++++++++++++---------
 src/gpg-error.m4             |   2 +
 src/gpg-error.pc.in          |   4 +-
 src/pkgconf-funcs.sh         | 117 +++++++++++++++++++++++++++++++++++++++++--
 6 files changed, 170 insertions(+), 36 deletions(-)


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




More information about the Gnupg-commits mailing list