[Pkg-gnupg-commit] [gpgme] 33/412: Add enable-languages build option

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Sep 22 21:26:09 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gpgme.

commit a313b3e28cc42785365822519b25d6a87dfdf0c9
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Mar 2 14:00:48 2016 +0100

    Add enable-languages build option
    
    * acinclude.m4 (LIST_MEMBER): New macro.
    * configure.ac (enable-languages): New option. Add info output.
    * lang/Makefile.am: Only add enabled language subdirs.
---
 acinclude.m4     | 16 ++++++++++++++++
 configure.ac     | 32 +++++++++++++++++++++++++++-----
 lang/Makefile.am |  2 +-
 3 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index cdfe6e4..575e526 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -58,3 +58,19 @@ AC_DEFUN([GNUPG_CHECK_VA_COPY],
     AC_MSG_RESULT($gnupg_cv_must_copy_va_byval)
   fi
 ])
+
+dnl LIST_MEMBER()
+dnl Check wether an element ist contained in a list.  Set `found' to
+dnl `1' if the element is found in the list, to `0' otherwise.
+AC_DEFUN([LIST_MEMBER],
+[
+name=$1
+list=$2
+found=0
+
+for n in $list; do
+  if test "x$name" = "x$n"; then
+    found=1
+  fi
+done
+])
diff --git a/configure.ac b/configure.ac
index fb6fa73..fc5f99e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,6 +146,8 @@ have_w32_system=no
 have_w64_system=no
 build_w32_glib=no
 build_w32_qt=no
+available_languages="cpp cl"
+default_languages="cpp cl"
 case "${host}" in
     x86_64-*mingw32*)
         have_w64_system=yes
@@ -245,6 +247,24 @@ if test x$fixed_search_path != x ; then
                     [Locate binaries only via this PATH])
 fi
 
+AC_ARG_ENABLE([languages],
+              AC_HELP_STRING([--enable-languages=languages],
+                             [enable only specific language bindings]),
+                             [enabled_languages=`echo $enableval | \
+                             tr ',:' '  ' | tr '[A-Z]' '[a-z]' | \
+                             sed 's/c++/cpp/'`],
+                             [enabled_languages="$default_languages"])
+if test "x$enabled_languages" = "x" \
+   -o "$enabled_languages" = "no"; then
+   enabled_languages=
+fi
+for language in $enabled_languages; do
+    LIST_MEMBER($language, $available_languages)
+    if test "$found" = "0"; then
+       AC_MSG_ERROR([unsupported language binding specified])
+    fi
+done
+AC_SUBST(ENABLED_LANGUAGES, $enabled_languages)
 
 #
 # Provide information about the build.
@@ -639,12 +659,14 @@ AC_OUTPUT
 echo "
         GPGME v${VERSION} has been configured as follows:
 
-        Revision:        mym4_revision  (mym4_revision_dec)
-        Platform:        $host
+        Revision:          mym4_revision  (mym4_revision_dec)
+        Platform:          $host
+
+        UI Server:         $uiserver
+        FD Passing:        $use_descriptor_passing
+        GPGME Pthread:     $have_pthread
 
-        UI Server:       $uiserver
-        FD Passing:      $use_descriptor_passing
-        GPGME Pthread:   $have_pthread
+        Language bindings: $enabled_languages
 "
 if test "x${gpg_config_script_warn}" != x; then
 cat <<G10EOF
diff --git a/lang/Makefile.am b/lang/Makefile.am
index a8d33f5..bb75cf0 100644
--- a/lang/Makefile.am
+++ b/lang/Makefile.am
@@ -17,6 +17,6 @@
 # License along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
-SUBDIRS = cl cpp
+SUBDIRS = $(ENABLED_LANGUAGES)
 
 EXTRA_DIST = README

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git



More information about the Pkg-gnupg-commit mailing list