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

Re: [PATCH] --disable-swig argument for configure

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2002-09-08 01:53:00 CEST

On Saturday, September 7, 2002, at 06:43 PM, Garrett Rooney wrote:

> as much as i hate to admit it (because admitting it means i get to
> write more m4, and i hate writing m4), you have a point, AC_ARG_WITH
> does sound more appropriate. i'll see what i can do about making it
> use that instead.

Ok, here's a patch that uses AC_ARG_WITH.

It also moves the code to check the SWIG version into
ac-helpers/swig.m4, since it was going to have to be used in more than
one place and it seems like our stuff seems to do that as soon as you
need to AC_DEFUN something.

-garrett

Index: configure.in
===================================================================
--- configure.in
+++ configure.in Sat Sep 7 19:44:49 2002
@@ -34,6 +34,7 @@
  sinclude(ac-helpers/apr.m4)
  sinclude(ac-helpers/find_apu.m4)
  sinclude(ac-helpers/aprutil.m4)
+sinclude(ac-helpers/swig.m4)

  dnl Grab the libtool macros
  sinclude(ac-helpers/libtool.m4)
@@ -308,34 +309,22 @@
    ${PYTHON} ${abs_srcdir}/build/pycheck.py
  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"
-
- 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_ARG_WITH(swig,
+ [AC_HELP_STRING([--with-swig],
+ [Try to find a suitable SWIG and build the
SWIG
+ bindings with it.])],
+[
+ if test "$withval" = "no" ; then
+ SWIG_SUITABLE=no
+ else
+ AC_PATH_PROG(SWIG, swig, none)
+ SVN_CHECK_SWIG
    fi
-fi
-AC_SUBST(SWIG_BUILD_RULES)
-AC_SUBST(SWIG_INSTALL_RULES)
-AC_SUBST(SWIG_PY_INCLUDES)
+],
+[
+ AC_PATH_PROG(SWIG, swig, none)
+ SVN_CHECK_SWIG
+])

  dnl try to find the "makeinfo" program
  AC_PATH_PROG(MAKEINFO, makeinfo, [echo cannot run makeinfo])
Index: ac-helpers/swig.m4
===================================================================
--- ac-helpers/swig.m4
+++ ac-helpers/swig.m4 Sat Sep 7 19:30:16 2002
@@ -0,0 +1,36 @@
+dnl check to see if SWIG is current enough.
+dnl
+dnl if it is, then check to see if we have the correct version of
pyton.
+dnl
+dnl if we do, then set up the appropriate SWIG_ variables to build the
+dnl python bindings.
+
+AC_DEFUN(SVN_CHECK_SWIG,
+[
+ 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"
+ fi
+ fi
+ AC_SUBST(SWIG_BUILD_RULES)
+ AC_SUBST(SWIG_INSTALL_RULES)
+ AC_SUBST(SWIG_PY_INCLUDES)
+])

-- 
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 Sun Sep 8 01:53:33 2002

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