build: Compatibility to pkg-config.
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 24 Oct 2018 07:48:12 +0000 (16:48 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 24 Oct 2018 07:48:12 +0000 (16:48 +0900)
* npth-config.in: Support --variable and --modversion.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
npth-config.in

index 1f3a113..a420036 100644 (file)
@@ -70,7 +70,16 @@ while test $# -gt 0; do
        --glib)
            with_glib=yes
            ;;
        --glib)
            with_glib=yes
            ;;
-        --version)
+       --variable=*)
+           case "${1#*=}" in
+               prefix) echo "$prefix" ;;
+               exec_prefix) echo "$exec_prefix" ;;
+               host) echo "@NPTH_CONFIG_HOST@" ;;
+               api_version) echo "@NPTH_CONFIG_API_VERSION@" ;;
+           esac
+           exit 0
+           ;;
+       --modversion|--version)
             echo "@PACKAGE_VERSION@"
            exit 0
            ;;
             echo "@PACKAGE_VERSION@"
            exit 0
            ;;