diff options
author | NIIBE Yutaka <[email protected]> | 2018-08-30 01:34:43 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2018-08-30 01:34:43 +0000 |
commit | ffebb25cfe236b95480880c2b468ca0034033a8c (patch) | |
tree | 26ef01164e81ca07193e70ac26075743376f23d4 | |
parent | Fix test condition for pkg-conf-funcs. (diff) | |
download | libgpg-error-ffebb25cfe236b95480880c2b468ca0034033a8c.tar.gz libgpg-error-ffebb25cfe236b95480880c2b468ca0034033a8c.zip |
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.
-rw-r--r-- | src/gpg-error-config-main.sh | 40 |
1 files changed, 30 insertions, 10 deletions
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 # |