cf: Disable swig if shared libraries are disabled 06/14606/4
authorCheyenne Wills <cwills@sinenomine.net>
Mon, 26 Apr 2021 22:17:39 +0000 (16:17 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 27 May 2021 15:24:25 +0000 (11:24 -0400)
When building with the option --disable-shared and swig is also enabled
(either explicitly, or autodetected) a build failure occurs when trying
to link libuafs/PERLUAFS/ukernel.so

Update the configure test for swig to disable the swig autodetection
when --disable-shared was specified, as well as emitting a notice
message stating that the swig autodetection has been disabled.

If --with-swig=yes was specified along with --disable-shared, generate a
configure error stating --with-swig is incompatible with
--disable-shared.

Change-Id: I766cf13b41c1d160e98eb160e0f907d5de2472c9
Reviewed-on: https://gerrit.openafs.org/14606
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/cf/swig.m4

index 81a8999..1d1eae2 100644 (file)
@@ -14,6 +14,16 @@ AC_DEFUN([OPENAFS_SWIG],
   [with_swig=check])
 
 LIBUAFS_BUILD_PERL=
+
+dnl Building with swig requires shared library support.  If --disable-shared
+dnl was specified, turn off auto detection (with a notice).  If --with-swig=yes
+dnl generate an error message
+AS_IF([test "x$enable_shared" != "yes" && test "x$with_swig" != "xno"],
+  [AS_IF([test "x$with_swig" = "xyes"],
+     [AC_MSG_ERROR([--with-swig is incompatible with --disable-shared])],
+     [with_swig=no
+      AC_MSG_NOTICE([--disable-shared specified, swig autodetection is disabled])])])
+
 AS_IF([test "x$with_swig" != "xno"],
   [AC_CHECK_PROG([SWIG], [swig], [swig])
   AS_IF([test "x$SWIG" = "xswig"],