List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:December 1 2007 3:11am
Subject:Rev 316: If the installed version of SWIG is recent enough, use that instead of building our own. in http://bazaar.launchpad.net/~ndb-connectors/ndb-c...
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel

------------------------------------------------------------
revno: 316
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Fri 2007-11-30 19:11:00 -0800
message:
  If the installed version of SWIG is recent enough, use that instead of building our own.
modified:
  Makefile.am                    makefile.am-20070228020914-u2pk759xg7thauwf-4
  configure.in                   configure.in-20070228020914-u2pk759xg7thauwf-13
  m4/ac_pkg_swig.m4              ac_pkg_swig.m4-20070414215316-ojjacm446lab2l0c-1
=== modified file 'Makefile.am'
--- a/Makefile.am	2007-11-26 09:56:22 +0000
+++ b/Makefile.am	2007-12-01 03:11:00 +0000
@@ -1,5 +1,8 @@
 ACLOCAL_AMFLAGS = -I m4 
 AUTOMAKE_OPTIONS = foreign
+if BUILD_SWIG_SUBDIR
+  d_swig = swig
+endif
 if BUILD_LUA_SUBDIR
   d_lua = lua
 endif
@@ -21,7 +24,7 @@
 if BUILD_PHP_SUBDIR
   d_php = php
 endif
-SUBDIRS = swig $(d_java) $(d_python) $(d_perl) $(d_csharp) $(d_ruby) $(d_php) $(d_lua) 
+SUBDIRS = $(d_swig) $(d_java) $(d_python) $(d_perl) $(d_csharp) $(d_ruby) $(d_php)
$(d_lua) 
 EXTRA_DIST = testndbapi interface autogen.sh 
 
 distclean-local:

=== modified file 'configure.in'
--- a/configure.in	2007-11-27 10:49:07 +0000
+++ b/configure.in	2007-12-01 03:11:00 +0000
@@ -1,4 +1,4 @@
-AC_INIT([ndb-connectors], [0.5.1.22.7])
+AC_INIT([ndb-connectors], [0.5.1.22.8])
 AC_CONFIG_AUX_DIR([.])
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(config.h)
@@ -36,9 +36,15 @@
   fi 
 fi
 
-
-SWIG_LIB="\${top_srcdir}/swig/SWIG/Lib"
-SWIG="SWIG_LIB=${SWIG_LIB} \${top_builddir}/swig/SWIG/swig -c++"
+AC_PROG_SWIG(1.3.32)
+AS_IF([test "x$SWIG" = "xno"],[
+  SWIG_LIB="\${top_srcdir}/swig/SWIG/Lib"
+  SWIG="SWIG_LIB=${SWIG_LIB} \${top_builddir}/swig/SWIG/swig"
+  build_swig=yes
+],[
+  build_swig=no
+])  
+SWIG_ENABLE_CXX()
 AC_SUBST(SWIG)
 AC_SUBST(SWIG_LIB)
 
@@ -89,6 +95,7 @@
 CXXFLAGS="-I\$(top_srcdir) ${CXXFLAGS}"
 
 
+AM_CONDITIONAL(BUILD_SWIG_SUBDIR, test "$build_swig" = "yes") 
 AM_CONDITIONAL(BUILD_PYTHON_SUBDIR, test "$with_python" != "no")
 AM_CONDITIONAL(BUILD_PHP_SUBDIR, test "$with_php" != "no")
 AM_CONDITIONAL(BUILD_PERL_SUBDIR, test "$with_perl" != "no")

=== modified file 'm4/ac_pkg_swig.m4'
--- a/m4/ac_pkg_swig.m4	2007-05-04 20:58:35 +0000
+++ b/m4/ac_pkg_swig.m4	2007-12-01 03:11:00 +0000
@@ -28,8 +28,8 @@
 AC_DEFUN([AC_PROG_SWIG],[
         AC_PATH_PROG([SWIG],[swig])
         if test -z "$SWIG" ; then
-                AC_MSG_WARN([cannot find 'swig' program. You should look at
http://www.swig.org])
-                SWIG='echo "Error: SWIG is not installed. You should look at
http://www.swig.org" ; false'
+                AC_MSG_WARN([cannot find 'swig' program installed, using bundled
version])
+                SWIG=no
         elif test -n "$1" ; then
                 AC_MSG_CHECKING([for SWIG version])
                 [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed
's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
@@ -70,16 +70,16 @@
                         if test $available_major -ne $required_major \
                                 -o $available_minor -ne $required_minor \
                                 -o $available_patch -lt $required_patch ; then
-                                AC_MSG_WARN([SWIG version >= $1 is required.  You have
$swig_version.  You should look at http://www.swig.org])
-                                SWIG=false
+                                AC_MSG_WARN([SWIG version >= $1 is required. Using
bundled version])
+                                SWIG=no
                         else
                                 AC_MSG_NOTICE([SWIG executable is '$SWIG'])
                                 SWIG_LIB=`$SWIG -swiglib`
                                 AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
                         fi
                 else
-                        AC_MSG_WARN([cannot determine SWIG version])
-                        SWIG='echo "Error: Cannot determine SWIG version.  You should
look at http://www.swig.org" ; false'
+                        AC_MSG_WARN([cannot determine SWIG version. using bundled])
+                        SWIG=no
                 fi
         fi
         AC_SUBST([SWIG_LIB])

Thread
Rev 316: If the installed version of SWIG is recent enough, use that instead of building our own. in http://bazaar.launchpad.net/~ndb-connectors/ndb-c...Monty Taylor3 Dec