build: Improve ksba.m4.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 26 Oct 2018 00:23:44 +0000 (09:23 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Fri, 26 Oct 2018 00:23:44 +0000 (09:23 +0900)
* src/ksba.m4: Don't try gpgrt-config when LIBKSBA_CONFIG set.  Fall
back to detecting ksba-config, when gpgrt-config doesn't work well.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
src/ksba.m4

index 43fb1f2..d02954a 100644 (file)
@@ -41,13 +41,15 @@ AC_DEFUN([AM_PATH_KSBA],
       KSBA_CONFIG=$ksba_config_prefix/bin/ksba-config
     fi
   fi
-  if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
+
+  use_gpgrt_config=""
+  if test x"$KSBA_CONFIG" != x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
     if CC=$CC $GPGRT_CONFIG libksba >/dev/null 2>&1; then
       LIBKSBA_CONFIG="$GPGRT_CONFIG libksba"
-    else
-      LIBKSBA_CONFIG=no
+      use_gpgrt_config=yes
     fi
-  else
+  fi
+  if test -z "$use_gpgrt_config"; then
     AC_PATH_TOOL(LIBKSBA_CONFIG, ksba-config, no)
   fi