Merge branch 'master' into javascript-binding
[gpgme.git] / src / gpgme-config.in
index db8c7ef..a4d152e 100644 (file)
@@ -32,14 +32,14 @@ gpg_error_libs="@GPG_ERROR_LIBS@"
 # Configure thread packages.
 thread_modules=""
 
-@HAVE_PTH_TRUE@thread_modules="$thread_modules pth"
-libs_pth="@PTH_LDFLAGS@ @PTH_LIBS@"
-cflags_pth="@PTH_CFLAGS@"
-
-@HAVE_PTHREAD_TRUE@thread_modules="$thread_modules pthread"
+# For compatibility we keep proving the
+# thread modules variable.
+thread_modules="$thread_modules pthread"
 libs_pthread="-lpthread"
 cflags_pthread=""
 
+avail_lang='c @GPGME_CONFIG_AVAIL_LANG@'
+
 # Configure glib.
 libs_glib="@GLIB_LIBS@"
 cflags_glib="@GLIB_CFLAGS@"
@@ -52,16 +52,15 @@ usage()
     cat <<EOF
 Usage: gpgme-config [OPTIONS]
 Options:
-       [--thread={${thread_modules}}]
-       [--prefix]
-       [--exec-prefix]
-       [--version]
-        [--api-version]
-        [--host]
-       [--libs]
-       [--cflags]
-        [--get-gpg]
-        [--get-gpgsm]
+       --prefix
+       --exec-prefix
+       --version
+        --api-version
+        --host
+       --libs
+       --cflags
+        --print-lang           Print available language bindings
+        --have-lang=LANG       Return success if LANG is available
 EOF
     exit $1
 }
@@ -114,7 +113,6 @@ while test $# -gt 0; do
             tmp_g=
            case "$thread_module" in
                pthread) tmp_c="$cflags_pthread" ;;
-               pth)     tmp_c="$cflags_pth"     ;;
            esac
            test "x$with_glib" = "xyes" && tmp_g="$cflags_glib"
             for i in $cflags $tmp_c $assuan_cflags $gpg_error_cflags $tmp_g ; do
@@ -142,8 +140,8 @@ while test $# -gt 0; do
             result=
             tmp_x=
            case "$thread_module" in
-               pthread) tmp_l="-lgpgme-pthread"; tmp_x="$libs_pthread" ;;
-               pth)     tmp_l="-lgpgme-pth";     tmp_x="$libs_pth"  ;;
+            # deprecated
+               pthread) tmp_l="-lgpgme" ;;
                *)
                    if test "x$with_glib" = "xyes" ; then
                         tmp_l="-lgpgme-glib"
@@ -184,10 +182,23 @@ while test $# -gt 0; do
                usage 1 1>&2
            fi
            ;;
+       --print-lang)
+            output="$avail_lang"
+           ;;
+       --have-lang=*)
+            for lang in $avail_lang; do
+                if test x"$lang" = x"$optarg"; then
+                    exit 0
+                fi
+            done
+            exit 1
+           ;;
         --get-gpg)
+            # Deprecated
             output="$output @GPG@"
             ;;
         --get-gpgsm)
+            # Deprecated
             output="$output @GPGSM@"
             ;;
        *)