| 1 | dnl SWIG Autoconf glue. Build with SWIG-derived language bindings if SWIG |
| 2 | dnl is available; if it's not, don't build the extra language bindings. |
| 3 | dnl |
| 4 | dnl Specify --without-swig (or --with-swig=no) to override the SWIG check and |
| 5 | dnl disable features which require SWIG. Specify --with-swig=yes to force the |
| 6 | dnl SWIG check and fail if not detected. |
| 7 | dnl |
| 8 | AC_DEFUN([OPENAFS_SWIG], |
| 9 | |
| 10 | [AC_ARG_WITH([swig], |
| 11 | [AS_HELP_STRING([--with-swig], |
| 12 | [use swig to generate language bindings (defaults to autodetect)])], |
| 13 | [], |
| 14 | [with_swig=check]) |
| 15 | |
| 16 | LIBUAFS_BUILD_PERL= |
| 17 | AS_IF([test "x$with_swig" != "xno"], |
| 18 | [AC_CHECK_PROG([SWIG], [swig], [swig]) |
| 19 | AS_IF([test "x$SWIG" = "xswig"], |
| 20 | [LIBUAFS_BUILD_PERL=LIBUAFS_BUILD_PERL]) |
| 21 | AS_IF([test "x$with_swig" = "xyes"], |
| 22 | [AS_IF([test "x$SWIG" != "xswig"], |
| 23 | [AC_MSG_ERROR([swig requested but not found])])])]) |
| 24 | |
| 25 | AC_SUBST(LIBUAFS_BUILD_PERL) |
| 26 | ]) |