List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:November 26 2007 2:05am
Subject:Rev 293: Further work on making the build system more solid. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel

------------------------------------------------------------
revno: 293
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Sun 2007-11-25 18:05:33 -0800
message:
  Further work on making the build system more solid.
modified:
  acinclude.m4                   acinclude.m4-20070228020914-u2pk759xg7thauwf-8
  configure.in                   configure.in-20070228020914-u2pk759xg7thauwf-13
  csharp/Makefile.am             makefile.in-20070228073157-gkwqutuh9f3nq7s2-1
  lua/Makefile.am                makefile.am-20070727221140-30x3yi1g0lf9rflk-2
  php/Makefile.am                makefile.am-20070414230657-agiyu1zcqcr6ugkn-2
  python/Makefile.am             makefile.am-20070925115907-x2wrdte5kicyfrrw-1
  python/setup.py                setup.py-20071027082659-u3uu8u83f54jtbn4-1
  ruby/Makefile.am               makefile.am-20070228212451-7arjxk90dkwcn5xr-2
  swig/Makefile.am               makefile.am-20071104211339-fod7yzi8t7xd3g0w-3
  swig/SWIG/Makefile.in          makefile.in-20071104211637-mxknek16uhsegtxr-1
  swig/SWIG/Source/Makefile.am   makefile.am-20071104211339-fod7yzi8t7xd3g0w-108
  swig/update_from_swigsvn.sh    update_from_swigsvn.-20071104211339-fod7yzi8t7xd3g0w-5
=== modified file 'acinclude.m4'
--- a/acinclude.m4	2007-11-25 23:22:57 +0000
+++ b/acinclude.m4	2007-11-26 02:05:33 +0000
@@ -8,7 +8,7 @@
     [AS_HELP_STRING([--with-php],
       [Build NDB/PHP @<:@default=no@:>@])],
     [with_php=$withval],
-    [with_php=no])
+    [with_php=yes])
 
   AS_IF([test "x$with_php" != "xno"],[
     AS_IF([test "x$with_php" != "xyes"],
@@ -36,6 +36,41 @@
   AC_SUBST(PHP_EXTDIR)
 ])
 
+
+AC_DEFUN([WITH_LUA],[
+    dnl Check for lua
+    AC_ARG_WITH([lua], 
+    [AS_HELP_STRING([--with-lua],
+      [Build NDB/Lua @<:@default=yes@:>@])],
+    [with_lua=$withval], 
+    [with_lua=yes])
+
+  AS_IF([test "x$with_lua" != "xno"],[
+    AS_IF([test "x$with_lua" = "xyes"],
+      [LUAPC=lua],
+      [LUAPC=$with_lua])
+
+    PKG_CHECK_MODULES(LUA, $LUAPC >= 5.1, [
+      AC_DEFINE([HAVE_LUA], [1], [liblua])
+      AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
+      with_lua=yes
+    ],[
+      PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
+        AC_DEFINE([HAVE_LUA], [1], [liblua])
+        AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
+	with_lua=yes
+      ],[
+        AC_DEFINE([HAVE_LUA],["x"],["x"])
+        with_lua=no
+      ])
+    ])
+
+   AC_SUBST(LUA_CFLAGS)
+   AC_SUBST(LUA_LIBS)
+  ])
+
+])
+
 AC_DEFUN([WITH_PYTHON], [
 
   AC_ARG_WITH([python], 
@@ -98,7 +133,7 @@
     [AS_HELP_STRING([--with-perl],
       [BULD NDB/Perl @<:@default=yes@:>@])],
     [with_perl=$withval], 
-    [with_perl=no])
+    [with_perl=yes])
 
 
   AS_IF([test "x$with_perl" != "xno"],[
@@ -147,6 +182,7 @@
     changequote([, ])dnl
 
     ac_save_CFLAGS="$CFLAGS"
+    ac_save_CPPFLAGS="$CPPFLAGS"
     ac_save_LDFLAGS="$LDFLAGS"
     CFLAGS="$ac_save_CFLAGS $RUBY_INCLUDES"
     CPPFLAGS="$ac_save_CPPFLAGS $RUBY_INCLUDES"
@@ -156,6 +192,7 @@
                        
[with_ruby="yes";AC_MSG_RESULT(found)],[with_ruby="no";AC_MSG_RESULT(missing)])
 
     CPPFLAGS="$ac_save_CPPFLAGS"
+    CFLAGS="$ac_save_CFLAGS"
     LDFLAGS="$ac_save_LDFLAGS"
   ],[
     # This allows 'make clean' in the ruby directory to work when
@@ -223,11 +260,13 @@
 
     LDFLAGS="$LDFLAGS "`$MYSQL_CONFIG --libs_r`
     
-    AC_CHECK_LIB([ndbhelper],[my_malloc],,[
-      AC_CHECK_LIB([mysys],[my_malloc])
-      AC_CHECK_LIB([mystrings],[my_str_free])
+    AC_CHECK_LIB([ndbclient],[decimal_bin_size],,[
+      AC_CHECK_LIB([ndbhelper],[decimal_bin_size],,[
+        AC_CHECK_LIB([mysys],[my_thread_init])
+        AC_CHECK_LIB([mystrings],[deciaml_bin_size])
+      ])
+      AC_CHECK_LIB([ndbclient],[ndb_init],,[AC_MSG_ERROR([Can't link against
libndbclient])])
     ])
-    AC_CHECK_LIB([ndbclient],[ndb_init],,[AC_MSG_ERROR([Can't link against
libndbclient])])
      
     AC_MSG_CHECKING(for NdbApi headers)
      AC_TRY_LINK([#include <NdbApi.hpp>], [int attr=NdbTransaction::Commit; ],

=== modified file 'configure.in'
--- a/configure.in	2007-11-25 23:22:57 +0000
+++ b/configure.in	2007-11-26 02:05:33 +0000
@@ -62,38 +62,7 @@
 WITH_PYTHON()
 
 WITH_PHP()
-
-dnl Check for lua
-AC_MSG_CHECKING(for lua)
-AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua]),
-[WITH_LUA=$withval],[WITH_LUA=yes])
-
-AC_MSG_RESULT($WITH_LUA)
-if test "$WITH_LUA" != "no"; then
- # try pkgconfig
- if test "$WITH_LUA" = "yes"; then
-    LUAPC=lua
-  else
-    LUAPC=$WITH_LUA
-  fi
-
- PKG_CHECK_MODULES(LUA, $LUAPC >= 5.1, [
-   AC_DEFINE([HAVE_LUA], [1], [liblua])
-   AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
- ],[
-   PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
-     AC_DEFINE([HAVE_LUA], [1], [liblua])
-     AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
-   ],[
-       AC_DEFINE([HAVE_LUA],["x"],["x"])
-     ])
- ])
-
- AC_SUBST(LUA_CFLAGS)
- AC_SUBST(LUA_LIBS)
-fi
-
-
+WITH_LUA()
 
 WITH_PERL()
 
@@ -102,10 +71,10 @@
 SWIG_NDB_SOURCES="\${top_srcdir}/interface/globals.i "
 SWIG_MGM_SOURCES="\${top_srcdir}/interface/globals.i "
 
-for f in `find interface/ndbapi` ; do  
+for f in `find interface/ndbapi | grep -v '\#'` ; do  
   SWIG_NDB_SOURCES="\${top_srcdir}/$f ${SWIG_NDB_SOURCES} "
 done
-for f in `find interface/mgmapi` ; do  
+for f in `find interface/mgmapi | grep -v '\#'` ; do  
   SWIG_MGM_SOURCES="\${top_srcdir}/$f ${SWIG_MGM_SOURCES} "
 done
   
@@ -127,7 +96,7 @@
 AM_CONDITIONAL(BUILD_CSHARP_SUBDIR, test "$with_csharp" != "no")
 AM_CONDITIONAL(BUILD_RUBY_SUBDIR, test "$with_ruby" != "no")
 AM_CONDITIONAL(BUILD_JAVA_SUBDIR, test "$with_java" != "no")
-AM_CONDITIONAL(BUILD_LUA_SUBDIR, test "x$HAVE_LUA" != "x") 
+AM_CONDITIONAL(BUILD_LUA_SUBDIR, test "x$with_lua" != "no") 
 
 AC_SUBST(MYSQL_INCLUDES)
 AC_SUBST(SWIG_SOURCES)

=== modified file 'csharp/Makefile.am'
--- a/csharp/Makefile.am	2007-11-25 23:22:57 +0000
+++ b/csharp/Makefile.am	2007-11-26 02:05:33 +0000
@@ -2,16 +2,18 @@
 MYSQL_DLL = MySql.Data.dll
 CLEANFILES = ndbapi.dll *exe ndbapi mgmapi ndbapi.cpp MySql.Cluster.NdbApi.dll ndbapi/*
 
-lib_LTLIBRARIES = libndbsharp.la
-libndbsharp_la_SOURCES = ndbapi.cpp
+lib_LTLIBRARIES = libndbsharp.la libmgmsharp.la
+nodist_libndbsharp_la_SOURCES = ndbapi.cpp
 libndbsharp_la_LDFLAGS = -fpic
 libndbsharp_la_CPPFLAGS = $(PTHREAD_CFLAGS)
-libndbsharp_la_DEPENDENCIES = MySql.Cluster.NdbApi.dll 
-lib_LTLIBRARIES = libmgmsharp.la
-libmgmsharp_la_SOURCES = mgmapi.cpp
+#libndbsharp_la_DEPENDENCIES = MySql.Cluster.NdbApi.dll 
+nodist_libmgmsharp_la_SOURCES = mgmapi.cpp
 libmgmsharp_la_LDFLAGS = -fpic
 libmgmsharp_la_CPPFLAGS = $(PTHREAD_CFLAGS)
-libmgmsharp_la_DEPENDENCIES = MySql.Cluster.MgmApi.dll 
+#libmgmsharp_la_DEPENDENCIES = MySql.Cluster.MgmApi.dll 
+
+EXTRA_DIST = ndbapi.i mgmapi.i exceptions.cs NdbError.cs test*cs
+
 
 test: test.exe test2.exe 
 

=== modified file 'lua/Makefile.am'
--- a/lua/Makefile.am	2007-11-25 23:22:57 +0000
+++ b/lua/Makefile.am	2007-11-26 02:05:33 +0000
@@ -10,6 +10,8 @@
 
 SUFFIXES = .cpp .i .so .o
 
+EXTRA_DIST = ndbapi.i mgmapi.i
+
 ndbapi.cpp: $(SWIG_NDB_SOURCES) 
 
 mgmapi.cpp: $(SWIG_MGM_SOURCES)

=== modified file 'php/Makefile.am'
--- a/php/Makefile.am	2007-11-25 23:22:57 +0000
+++ b/php/Makefile.am	2007-11-26 02:05:33 +0000
@@ -1,23 +1,19 @@
-NDB_BUILT_SOURCES = ndbapi.cpp  php_libndbapi.h  
-MGM_BUILT_SOURCES = mgmapi.cpp   php_libmgmapi.h
-BUILT_SOURCES = $(NDB_BUILT_SOURCES) $(MGM_BUILT_SOURCES) 
+BUILT_SOURCES_NDB = ndbapi.cpp  php_libndbapi.h  
+BUILT_SOURCES_MGM = mgmapi.cpp   php_libmgmapi.h
+BUILT_SOURCES = $(BUILT_SOURCES_NDB) $(BUILT_SOURCES_MGM) 
 NDBAPI_SWIG_SRC = ndbapi.i $(SWIG_NDB_SOURCES)
 MGMAPI_SWIG_SRC = mgmapi.i $(SWIG_MGM_SOURCES)
 
 libdir = $(PHP_EXTDIR)
 lib_LTLIBRARIES = libndbapi.la libmgmapi.la
-libndbapi_la_SOURCES = $(NDB_BUILT_SOURCES)
+nodist_libndbapi_la_SOURCES = $(NDB_BUILT_SOURCES)
 libndbapi_la_CPPFLAGS = $(PHP_CPPFLAGS) $(MYSQL_INCLUDES)
-libmgmapi_la_SOURCES = $(NDB_BUILT_SOURCES)
+nodist_libmgmapi_la_SOURCES = $(NDB_BUILT_SOURCES)
 libmgmapi_la_CPPFLAGS = $(PHP_CPPFLAGS) $(MYSQL_INCLUDES)
-noinst_HEADERS = php_libndbapi.h php_libmgmapi.h
 
 CLEANFILES = $(BUILT_SOURCES) libmgmapi.php libndbapi.php
-
-
-php_libndbapi.h: ndbapi.cpp
-
-php_libmgmapi.h: mgmapi.cpp
+EXTRA_DIST = ndbapi.i mgmapi.i
+
 
 ndbapi.cpp: $(NDBAPI_SWIG_SRC)
 

=== modified file 'python/Makefile.am'
--- a/python/Makefile.am	2007-11-20 01:45:07 +0000
+++ b/python/Makefile.am	2007-11-26 02:05:33 +0000
@@ -5,7 +5,7 @@
 CLEANFILES=ndbapi.cpp ndbapi.h mgmapi.cpp mysql/cluster/ndbapi.py mysql/cluster/mgmapi.py
*.so mysql/cluster/*pyc *pyc mgmapi.h
 EXTRA_DIST = *py mgmapi.i ndbapi.i PKG-INFO README MANIFEST.in mysql/cluster/alchemy.py
mysql/__init__.py mysql/cluster/__init__.py  mysql/cluster/NdbObject mysql/cluster/tests
 
-SWIG_OPTS=-O -I$(srcdir) -I$(top_srcdir) -I$(SWIG_DIR) @MYSQL_INCLUDES@ -outdir
mysql/cluster
+SWIG_OPTS=-O -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(SWIG_DIR) @MYSQL_INCLUDES@
-outdir $(builddir)/mysql/cluster
 
 ndbapi.cpp: ${SWIG_NDB_SOURCES} ndbapi.i
 
@@ -16,8 +16,8 @@
 .i.cpp: $(SWIG_SOURCES)
 	$(SWIG) -c++ -python $(SWIG_OPTS) -o $@ $<
 
-$(srcdir)/mysql/cluster/_ndbapi.so $(srcdir)/mysql/cluster/_mgmapi.so: ndbapi.cpp
mgmapi.cpp
-	 CC="${CXX}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" ${PYTHON}
setup.py build
+$(srcdir)/mysql/cluster/_ndbapi.so $(srcdir)/mysql/cluster/_mgmapi.so:
$(builddir)/ndbapi.cpp $(builddir)/mgmapi.cpp
+	 CC="${CXX}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" ${PYTHON}
setup.py build 
 
 clean-local:
 	${PYTHON} setup.py clean

=== modified file 'python/setup.py'
--- a/python/setup.py	2007-10-27 09:26:42 +0000
+++ b/python/setup.py	2007-11-26 02:05:33 +0000
@@ -22,6 +22,7 @@
 use_setuptools()
 
 from distutils.command.clean import clean
+from distutils.command.build import build
 from setuptools import setup,Extension
 import os.path
 import sys
@@ -54,13 +55,13 @@
                     Extension("mysql.cluster._mgmapi",
                               sources=["mgmapi.cpp"],
                               # FIXME - need to get just the MGMAPI ones
-                              depends=["../swig/%s" % f for f in os.listdir("../swig")],
+                              depends=["../interface/mgmapi/%s" % f for f in
os.listdir("../interface/mgmapi")],
                               language="c++",
                              
                               ),
                     Extension("mysql.cluster._ndbapi",
                               sources=["ndbapi.cpp"],
-                              depends=["../swig/%s" % f for f in os.listdir("../swig")],
+                              depends=["../interface/ndbapi/%s" % f for f in
os.listdir("../interface/ndbapi")],
                               language="c++",
                              
                               )

=== modified file 'ruby/Makefile.am'
--- a/ruby/Makefile.am	2007-11-12 21:30:42 +0000
+++ b/ruby/Makefile.am	2007-11-26 02:05:33 +0000
@@ -8,6 +8,9 @@
 
 SWIG_OPTS=-I$(srcdir) -I$(top_srcdir) -I$(SWIG_DIR) @MYSQL_INCLUDES@ 
 
+EXTRA_DIST = ndbapi.i mgmapi.i test test*rb 
+
+
 SUFFIXES = .cpp .o .so .i
 
 ndbapi.cpp: $(SWIG_NDB_SOURCES) ndbapi.i

=== modified file 'swig/Makefile.am'
--- a/swig/Makefile.am	2007-11-21 18:32:05 +0000
+++ b/swig/Makefile.am	2007-11-26 02:05:33 +0000
@@ -14,6 +14,8 @@
 	cp $(srcdir)/SWIG/aclocal.m4  $(distdir)/SWIG
 	cp $(srcdir)/SWIG/Source/Makefile.in $(distdir)/SWIG/Source
 	cp $(srcdir)/SWIG/Source/Include/swigconfig.h.in $(distdir)/SWIG/Source/Include
+	( cd $(top_builddir)/swig/SWIG && $(MAKE) $(AM_MAKEFLAGS)  dist-hook )
+	cp $(srcdir)/SWIG/Lib/swigwarn.swg $(distdir)/SWIG/Lib
 #	cd $(srcdir)/SWIG && [ -f Makefile ] && $(MAKE) $(AM_MAKEFLAGS) clean
|| true
 #	cp -a $(srcdir)/SWIG $(distdir)
 	

=== modified file 'swig/SWIG/Makefile.in'
--- a/swig/SWIG/Makefile.in	2007-11-25 21:54:50 +0000
+++ b/swig/SWIG/Makefile.in	2007-11-26 02:05:33 +0000
@@ -403,6 +403,8 @@
 	awk '/#define WARN/{$$1="%define"; $$2="SWIG"$$2; $$3=sprintf("%d %%enddef", $$3); print
$$0; next;}\
 	      /#/{next;} {print $0}' < $? >> $@
 
+dist-hook: $(srcdir)/Lib/swigwarn.swg
+
 #####################################################################
 # TARGETS: install & friends
 #####################################################################

=== modified file 'swig/SWIG/Source/Makefile.am'
--- a/swig/SWIG/Source/Makefile.am	2007-11-21 18:32:05 +0000
+++ b/swig/SWIG/Source/Makefile.am	2007-11-26 02:05:33 +0000
@@ -98,11 +98,11 @@
 # The executable is copied to the root directory for installation and running the
test-suite.
 # This occurs on each invocation of make and is a step towards providing support for
multiple 
 # build directories.
-all-local: eswig@EXEEXT@
-	cp -f $(srcdir)/eswig@EXEEXT@ $(top_builddir)/swig@EXEEXT@
+all-local: $(builddir)/eswig@EXEEXT@
+	cp -f $(builddir)/eswig@EXEEXT@ $(top_builddir)/swig@EXEEXT@
 
 clean-local:
-	rm -f ../swig@EXEEXT@
+	rm -f $(top_builddir)/swig@EXEEXT@
 	rm -f core @EXTRA_CLEAN@
 
 

=== modified file 'swig/update_from_swigsvn.sh'
--- a/swig/update_from_swigsvn.sh	2007-11-25 22:01:45 +0000
+++ b/swig/update_from_swigsvn.sh	2007-11-26 02:05:33 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-bzr diff -r231..273 SWIG/Source/Makefile.am > SWIG.patch 
+bzr diff -r231.. SWIG/Source/Makefile.am > SWIG.patch 
 rm -rf SWIG
 svn export https://swig.svn.sourceforge.net/svnroot/swig/tags/rel-1.3.33 SWIG
 rm SWIG/Tools/config/config.guess SWIG/Tools/config/config.sub

Thread
Rev 293: Further work on making the build system more solid. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/develMonty Taylor26 Nov