From 9bc6fd9312a2be591cc831d9b0afd91e53eec6fc Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Fri, 10 Feb 2017 10:39:09 -0500 Subject: [PATCH] build: add --without-swig to override swig check Add the --without-swig option to disable the automatic swig detection and disable the optional features which depend on swig. This allows builders to avoid swig even if present on the build system. Also, add the --with-swig option to force the check and fail if not detected. This allows builders to declare the swig features are mandatory. The default continues to be to check for swig, and if present, build the optional features which require swig. To disable the automatic check for swig and disable the features which depend on swig: ./configure --without-swig # or --with-swig=no To force the check and fail if swig is not present on the system: ./configure --with-swig # or --with-swig=yes If --with-swig is given and swig is not detected, then configure will fail with the message: configure: error: swig requested but not found The Perl 5 bindings for libuafs is the only feature which requires swig at this time. Change-Id: I0726658a9cc7b1b2a9d5e5d306adb6e36ad3c0f6 Reviewed-on: https://gerrit.openafs.org/12518 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- src/cf/swig.m4 | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/cf/swig.m4 b/src/cf/swig.m4 index 7f615ad..81a8999 100644 --- a/src/cf/swig.m4 +++ b/src/cf/swig.m4 @@ -1,11 +1,26 @@ dnl SWIG Autoconf glue. Build with SWIG-derived language bindings if SWIG dnl is available; if it's not, don't build the extra language bindings. - +dnl +dnl Specify --without-swig (or --with-swig=no) to override the SWIG check and +dnl disable features which require SWIG. Specify --with-swig=yes to force the +dnl SWIG check and fail if not detected. +dnl AC_DEFUN([OPENAFS_SWIG], -[AC_CHECK_PROG([SWIG], [swig], [swig]) + +[AC_ARG_WITH([swig], + [AS_HELP_STRING([--with-swig], + [use swig to generate language bindings (defaults to autodetect)])], + [], + [with_swig=check]) + LIBUAFS_BUILD_PERL= -if test "x$SWIG" = "xswig" ; then - LIBUAFS_BUILD_PERL=LIBUAFS_BUILD_PERL -fi +AS_IF([test "x$with_swig" != "xno"], + [AC_CHECK_PROG([SWIG], [swig], [swig]) + AS_IF([test "x$SWIG" = "xswig"], + [LIBUAFS_BUILD_PERL=LIBUAFS_BUILD_PERL]) + AS_IF([test "x$with_swig" = "xyes"], + [AS_IF([test "x$SWIG" != "xswig"], + [AC_MSG_ERROR([swig requested but not found])])])]) + AC_SUBST(LIBUAFS_BUILD_PERL) ]) -- 1.9.4