2005-04-14 Marcus Brinkmann <marcus@g10code.de>
[gpgme.git] / gpgme / gpgme-config.in
index 4e428db..81e599d 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-#    Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
@@ -36,12 +36,13 @@ usage()
     cat <<EOF
 Usage: gpgme-config [OPTIONS]
 Options:
+       [--thread={${thread_modules}}]
        [--prefix]
        [--exec-prefix]
        [--version]
+        [--api-version]
        [--libs]
        [--cflags]
-       [--thread={${thread_modules}}]
 EOF
     exit $1
 }
@@ -61,9 +62,15 @@ while test $# -gt 0; do
     esac
 
     case $1 in
+        --prefix=*)
+            # For compatibility reasons with old M4 macros, we ignore
+            # setting of prefix.
+            ;;
         --prefix)
            output="$output $prefix"
            ;;
+        --exec-prefix=*)
+            ;;
         --exec-prefix)
            output="$output $exec_prefix"
            ;;
@@ -71,8 +78,14 @@ while test $# -gt 0; do
             echo "@VERSION@"
            exit 0
            ;;
+        --api-version)
+           echo "@GPGME_CONFIG_API_VERSION@"
+           exit 0
+           ;;
         --cflags)
-            output="$output -I$includedir"
+           if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then
+               output="$output -I$includedir"
+           fi
            case "$thread_module" in
                pthread)
                    output="$output $cflags_pthread"
@@ -84,7 +97,9 @@ while test $# -gt 0; do
            output="$output $gpg_error_cflags"
            ;;
        --libs)
-            output="$output -L@libdir@"
+           if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/lib"; then
+               output="$output -L$libdir"
+           fi
            case "$thread_module" in
                pthread)
                    output="$output -lgpgme-pthread $libs_pthread"