build: Build gpg-pair-tool only when there is newer libgcrypt.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 20 Sep 2019 05:19:18 +0000 (14:19 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Fri, 20 Sep 2019 05:19:18 +0000 (14:19 +0900)
* configure.ac (HAVE_NEWER_LIBGCRYPT): New.
* tools/Makefile.am: Conditionalize build of gpg-pair-tool.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
configure.ac
tools/Makefile.am

index 41dedf7..7ce90aa 100644 (file)
@@ -801,7 +801,26 @@ AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
 #
 AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
         have_libgcrypt=yes,have_libgcrypt=no)
-
+# And, then, check if it's newer than 1.9.0.
+have_libgcrypt_newer=no
+if test $ok = yes; then
+    if test "$major" -gt 1; then
+        have_libgcrypt_newer=yes
+    else
+        if test "$major" -eq 1; then
+            if test "$minor" -gt 9; then
+               have_libgcrypt_newer=yes
+            else
+               if test "$minor" -eq 9; then
+                   if test "$micro" -ge 0; then
+                     have_libgcrypt_newer=yes
+                   fi
+               fi
+            fi
+        fi
+    fi
+fi
+AM_CONDITIONAL(HAVE_NEWER_LIBGCRYPT, [test $have_libgcrypt_newer = yes])
 
 #
 # libassuan is used for IPC
index fb37c05..9df9d4c 100644 (file)
@@ -49,7 +49,7 @@ else
   gpg_wks_server =
 endif
 
-libexec_PROGRAMS = gpg-wks-client gpg-pair-tool
+libexec_PROGRAMS = gpg-wks-client
 
 bin_PROGRAMS = gpgconf gpg-connect-agent gpg-card ${symcryptrun}
 if !HAVE_W32_SYSTEM
@@ -187,6 +187,8 @@ gpg_wks_client_LDADD = $(libcommon) \
                       $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
                       $(LIBINTL) $(LIBICONV)
 
+if HAVE_NEWER_LIBGCRYPT
+libexec_PROGRAMS += gpg-pair-tool
 gpg_pair_tool_SOURCES = \
        gpg-pair-tool.c
 
@@ -194,7 +196,7 @@ gpg_pair_tool_CFLAGS = $(GPG_ERROR_CFLAGS) $(INCICONV)
 gpg_pair_tool_LDADD =  $(libcommon) \
                       $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
                       $(LIBINTL) $(LIBICONV) $(W32SOCKLIBS)
-
+endif
 
 # Make sure that all libs are build before we use them.  This is
 # important for things like make -j2.