[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] --disable-swig argument for configure

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2002-09-07 22:07:02 CEST

In the FreeBSD port of subversion, we have to control the building of
the SWIG bindings, because depending on the existence of the correct
version of SWIG on the system, we could have some extra libraries
installed, which the package management tools have to deal with...

Currently, I work around the issue by hacking the makefile at build
time to avoid installing the libraries we build when SWIG is found, but
I'd rather be able to pass a --disable-swig argument to configure (and
also have this be conditional on some option in the port's Makefile, so
we can optionally install the SWIG libraries once there are tools which
use them).

Here's a patch that implements this option. It seems to work, and I'd
commit it now, but I'd like someone with a bit more autoconf knowledge
to look over it first and make sure I didn't make any stupid mistakes.

Thanks,

-garrett

Index: configure.in
===================================================================
--- configure.in
+++ configure.in Sat Sep 7 15:45:28 2002
@@ -308,34 +308,50 @@
    ${PYTHON} ${abs_srcdir}/build/pycheck.py
  fi

+dnl let people turn off the swig bindings here, even if swig exists on
+dnl their system
+LOOK_FOR_SWIG="true"
+AC_ARG_ENABLE(swig,
+[ --disable-swig Do not try to build the SWIG bindings],
+[
+ if test "$enableval" = "yes" ; then
+ AC_MSG_NOTICE([Enabling search for SWIG])
+ else
+ LOOK_FOR_SWIG="false"
+ AC_MSG_NOTICE([Disabling search for SWIG])
+ fi
+])
+
  dnl try to find "swig" to build the SWIG bindings
-AC_PATH_PROG(SWIG, swig, none)
-if test "$SWIG" != "none"; then
- AC_MSG_CHECKING([swig version])
- SWIG_VERSION="`$SWIG -version 2>&1 | sed -ne 's/^.*Version
\(.*\)$/\1/p'`"
- AC_MSG_RESULT([$SWIG_VERSION])
- case $SWIG_VERSION in
- [1.3.1[23]*])
- SWIG_SUITABLE=yes
- ;;
- *)
- SWIG_SUITABLE=no
- AC_MSG_WARN([swig bindings require 1.3.12.])
- ;;
- esac
- if test "$PYTHON" != "none" -a "$SWIG_SUITABLE" = "yes"; then
- SWIG_BUILD_RULES="$SWIG_BUILD_RULES swig-py-lib"
- SWIG_INSTALL_RULES="$SWIG_INSTALL_RULES install-swig-py-lib"
+if test "$LOOK_FOR_SWIG" = "true"; then
+ AC_PATH_PROG(SWIG, swig, none)
+ if test "$SWIG" != "none"; then
+ AC_MSG_CHECKING([swig version])
+ SWIG_VERSION="`$SWIG -version 2>&1 | sed -ne 's/^.*Version
\(.*\)$/\1/p'`"
+ AC_MSG_RESULT([$SWIG_VERSION])
+ case $SWIG_VERSION in
+ [1.3.1[23]*])
+ SWIG_SUITABLE=yes
+ ;;
+ *)
+ SWIG_SUITABLE=no
+ AC_MSG_WARN([swig bindings require 1.3.12.])
+ ;;
+ esac
+ if test "$PYTHON" != "none" -a "$SWIG_SUITABLE" = "yes"; then
+ SWIG_BUILD_RULES="$SWIG_BUILD_RULES swig-py-lib"
+ SWIG_INSTALL_RULES="$SWIG_INSTALL_RULES install-swig-py-lib"

- AC_CACHE_CHECK([for Python includes], [ac_cv_python_includes],[
- ac_cv_python_includes="`$PYTHON
${abs_srcdir}/ac-helpers/get-py-info.py --includes`"
- ])
- SWIG_PY_INCLUDES="-I$ac_cv_python_includes"
+ AC_CACHE_CHECK([for Python includes], [ac_cv_python_includes],[
+ ac_cv_python_includes="`$PYTHON
${abs_srcdir}/ac-helpers/get-py-info.py --includes`"
+ ])
+ SWIG_PY_INCLUDES="-I$ac_cv_python_includes"
+ fi
    fi
+ AC_SUBST(SWIG_BUILD_RULES)
+ AC_SUBST(SWIG_INSTALL_RULES)
+ AC_SUBST(SWIG_PY_INCLUDES)
  fi
-AC_SUBST(SWIG_BUILD_RULES)
-AC_SUBST(SWIG_INSTALL_RULES)
-AC_SUBST(SWIG_PY_INCLUDES)

  dnl try to find the "makeinfo" program
  AC_PATH_PROG(MAKEINFO, makeinfo, [echo cannot run makeinfo])

-- 
garrett rooney                    Remember, any design flaw you're
rooneg@electricjellyfish.net      sufficiently snide about becomes
http://electricjellyfish.net/     a feature.       -- Dan Sugalski
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Sep 7 22:07:33 2002

This is an archived mail posted to the Subversion Dev mailing list.