summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-08-25 15:30:07 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2022-08-25 15:30:07 +0900
commit4615816f71e91f4c3bb8b0e4122dd153ec7c1927 (patch)
treeed7a8f7ea2439cb980e2724bc485d7116dc94c3f
parentfcb19dbfd49338e5c282e2853d71d66a0594d3c1 (diff)
downloadlibgpg-error-4615816f71e91f4c3bb8b0e4122dd153ec7c1927.tar.gz
gpgrt-config: Strip system paths for --cflags and --libs.
* src/gpgrt-config.in: Strip -I and -L with system paths. -- This behavior is more compatible to pkg-config. GnuPG-bug-id: 6136 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--src/gpgrt-config.in14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gpgrt-config.in b/src/gpgrt-config.in
index 3aaa243..85d21b4 100644
--- a/src/gpgrt-config.in
+++ b/src/gpgrt-config.in
@@ -1,6 +1,6 @@
#!@INSTALLSHELLPATH@
# -*- mode: shell-script; sh-shell: "/bin/sh" -*-
-# Copyright (C) 2018, 2021 g10 Code GmbH
+# Copyright (C) 2018, 2021, 2022 g10 Code GmbH
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -193,9 +193,14 @@ list_only_once () {
__arg=""
for __arg; do
- if not_listed_yet $__arg $__result; then
- __result="$__result${__result:+ }$__arg"
- fi
+ case "$__arg" in
+ -I/usr/include|-I/include) ;;
+ *)
+ if not_listed_yet $__arg $__result; then
+ __result="$__result${__result:+ }$__arg"
+ fi
+ ;;
+ esac
done
echo $__result
@@ -210,6 +215,7 @@ list_only_once_for_libs () {
# the resulted list is in reverse order
for __arg; do
case "$__arg" in
+ -L/usr/lib|-L/usr/lib64|-L/lib|-L/lib64) ;;
-l*)
# As-is
__rev_list="$__arg${__rev_list:+ }$__rev_list"