List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:December 7 2007 10:41am
Subject:Rev 352: Build fixes to make VPATH builds work (at least for everything that isn't perl) in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors...
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel

------------------------------------------------------------
revno: 352
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Fri 2007-12-07 02:40:58 -0800
message:
  Build fixes to make VPATH builds work (at least for everything that isn't perl)
modified:
  configure.in                   configure.in-20070228020914-u2pk759xg7thauwf-13
  java/Makefile.am               makefile.am-20070415032352-9dpe6aurqcnuwcrd-1
  python/Makefile.am             makefile.am-20070925115907-x2wrdte5kicyfrrw-1
  python/setup.py                setup.py-20071027082659-u3uu8u83f54jtbn4-1
=== modified file 'configure.in'
--- a/configure.in	2007-12-06 22:24:17 +0000
+++ b/configure.in	2007-12-07 10:40:58 +0000
@@ -25,8 +25,8 @@
 
 if test "$with_debug" = "yes"
 then
-  CXXFLAGS="-ggdb3 -Wall -I\${top_srcdir}"
-  CFLAGS="-ggdb3 -Wall -I\${top_srcdir}"
+  CXXFLAGS="-ggdb3 -Wall"
+  CFLAGS="-ggdb3 -Wall"
 else
   # -02 causes problems per SWIG... although I think we should get that fixed
   if test -z $CXXFLAGS ; then 
@@ -36,6 +36,8 @@
     CFLAGS="-O0 -g -Wall"
   fi 
 fi
+CXXFLAGS="${CXXFLAGS} -I\${top_srcdir} -I\${top_builddir}"
+CFLAGS="${CXXFLAGS} -ggdb3 -Wall -I\${top_srcdir} -I\${top_builddir}"
 
 AC_PROG_SWIG(1.3.32)
 AS_IF([test "x$SWIG" = "xno"],[

=== modified file 'java/Makefile.am'
--- a/java/Makefile.am	2007-12-06 21:01:46 +0000
+++ b/java/Makefile.am	2007-12-07 10:40:58 +0000
@@ -1,6 +1,6 @@
 package_namespace=com/mysql/cluster
 builddir=.
-classpath=$(srcdir):$(builddir):$(builddir)/lib/mysql-connector-java-5.1.5-bin.jar:$(builddir)/lib/junit.jar
+classpath=$(srcdir):$(builddir):$(srcdir)/lib/mysql-connector-java-5.1.5-bin.jar:$(srcdir)/lib/junit.jar
 package_builddir=$(builddir)/$(package_namespace)
 package_srcdir=$(srcdir)/$(package_namespace)
 ndbapi_examples_dir=$(package_namespace)/ndbapi/examples
@@ -389,7 +389,7 @@
 
 .java.class:
 	@mkdir -p `dirname $*`
-	$(JAVAC) -classpath
$(srcdir):$(srcdir)/lib/mysql-connector-java-5.1.5-bin.jar:$(srcdir)/lib/junit.jar
-sourcepath $(srcdir):$(builddir) -d $(builddir) $<
+	$(JAVAC) -classpath $(classpath) -sourcepath $(srcdir):$(builddir) -d $(builddir) $<
 
 .i.cxx: 
 
@@ -422,9 +422,9 @@
 	@echo "Building ndbj.jar"
 	@$(JAR) cf $@ ${NDBAPI_JAVA_CLASSES} ${package_builddir}/ndbj/*\$$*class
 
-check-local: all-am
-	$(JAVA) -Djava.library.path=$(builddir)/.libs 
-Dcom.mysql.jdbc.testsuite.url=jdbc:mysql://localhost/test -classpath $(classpath) 
junit.textui.TestRunner testsuite.ndbj.AllTests
-	$(JAVA) -Djava.library.path=$(builddir)/.libs 
-Dcom.mysql.jdbc.testsuite.url=jdbc:mysql://localhost/test -classpath $(classpath)
junit.textui.TestRunner testsuite.mgmj.AllTests
+#check-local: all-am
+#	$(JAVA) -Djava.library.path=$(builddir)/.libs 
-Dcom.mysql.jdbc.testsuite.url=jdbc:mysql://localhost/test -classpath $(classpath) 
junit.textui.TestRunner testsuite.ndbj.AllTests
+#	$(JAVA) -Djava.library.path=$(builddir)/.libs 
-Dcom.mysql.jdbc.testsuite.url=jdbc:mysql://localhost/test -classpath $(classpath)
junit.textui.TestRunner testsuite.mgmj.AllTests
 
 install-exec-local: ndbj.jar mgmj.jar
 	mkdir -p $(DESTDIR)$(datadir)/java

=== modified file 'python/Makefile.am'
--- a/python/Makefile.am	2007-12-06 09:25:04 +0000
+++ b/python/Makefile.am	2007-12-07 10:40:58 +0000
@@ -6,7 +6,7 @@
 CLEANFILES=ndbapi.cpp ndbapi.h mgmapi.cpp mysql/cluster/ndbapi.py mysql/cluster/mgmapi.py
mysql/cluster/events.py mysql/cluster/listeners.py *.so mysql/cluster/*pyc *pyc mgmapi.h
events.cpp listeners.cpp events.h listeners.h
 EXTRA_DIST = *py mgmapi.i ndbapi.i events.i listeners.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$(top_builddir) -I$(SWIG_DIR) @MYSQL_INCLUDES@
-outdir $(builddir)/mysql/cluster
+SWIG_OPTS=-O -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/mgmpp
-I$(SWIG_DIR) @MYSQL_INCLUDES@ -outdir $(builddir)/mysql/cluster
 
 
 ${SWIG_BIN}:
@@ -23,17 +23,20 @@
 SUFFIXES = .cpp .i
 
 .i.cpp: $(SWIG_SOURCES) ${SWIG_BIN}
+	@test ! -d $(builddir)/mysql && cp -a $(srcdir)/mysql $(builddir) || true
+	@chmod -R u+w $(builddir)/mysql
 	$(SWIG) -c++ -python $(SWIG_OPTS) -o $@ $<
 
 $(builddir)/mysql/cluster/_ndbapi.so $(builddir)/mysql/cluster/_mgmapi.so
$(builddir)/mysql/cluster/_events.so $(builddir)/mysql/cluster/_listeners.so:
$(builddir)/ndbapi.cpp $(builddir)/mgmapi.cpp $(builddir)/events.cpp
$(builddir)/listeners.cpp
-	 CC="${CXX}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" ${PYTHON}
setup.py build 
+	 CC="${CXX}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
SRCDIR="${srcdir}" TOP_SRCDIR="${top_srcdir}" BUILDDIR="${builddir}"
TOP_BUILDDIR="${top_builddir}" ${PYTHON} $(srcdir)/setup.py build 
--build-base="${top_builddir}/python/build"
 
 clean-local:
-	${PYTHON} setup.py clean
-	rm -rf build
+	${PYTHON} ${srcdir}/setup.py clean
+	rm -rf ${builddir}/build
+	@test ${builddir}/mysql -ef ${srcdir}/mysql || rm -rf ${builddir}/mysql
 
 install: $(builddir)/mysql/cluster/_ndbapi.so $(builddir)/mysql/cluster/_mgmapi.so 
-	CC="${CXX}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" ${PYTHON}
setup.py install --prefix=${DESTDIR}${prefix}
+	CC="${CXX}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" ${PYTHON}
${srcdir}/setup.py install --prefix=${DESTDIR}${prefix}
 
 develop: $(builddir)/mysql/cluster/_ndbapi.so $(builddir)/mysql/cluster/_mgmapi.so
 	CC="${CXX}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" ${PYTHON}
setup.py develop --prefix=${DESTDIR}${prefix}

=== modified file 'python/setup.py'
--- a/python/setup.py	2007-12-06 08:07:23 +0000
+++ b/python/setup.py	2007-12-07 10:40:58 +0000
@@ -16,7 +16,6 @@
 ##    along with this program; if not, write to the Free Software
 ##    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-
 # bootstrap setuptools if necessary
 from ez_setup import use_setuptools
 use_setuptools()
@@ -24,9 +23,14 @@
 from distutils.command.clean import clean
 from distutils.command.build import build
 from setuptools import setup,Extension
-import os.path
+import os.path, os
 import sys
 
+srcdir=os.environ.get("SRCDIR",".")
+top_srcdir=os.environ.get("TOP_SRCDIR","..")
+builddir=os.environ.get("BUILDDIR",".")
+top_builddir=os.environ.get("TOP_BUILDDIR","..")
+
 description = """Python wrapper of the NDBAPI"""
 
 classifiers="""\
@@ -55,30 +59,31 @@
                     Extension("mysql.cluster._mgmapi",
                               sources=["mgmapi.cpp"],
                               libraries=["mgmpp"],
-                             
library_dirs=["/home/mtaylor/src/ndb-connectors/devel/mgmpp/.libs"],
-                              depends=["../interface/mgmapi/%s" % f for f in
os.listdir("../interface/mgmapi")],
+                              library_dirs=["%s/mgmpp/.libs" % top_builddir],
+                              depends=["%s/interface/mgmapi/%s" % (top_srcdir,f) for f in
os.listdir("%s/interface/mgmapi" % top_srcdir)],
                               language="c++",
                              
                               ),
                     Extension("mysql.cluster._ndbapi",
                               sources=["ndbapi.cpp"],
-                              depends=["../interface/ndbapi/%s" % f for f in
os.listdir("../interface/ndbapi")],
+                              library_dirs=["%s/mgmpp/.libs" % top_builddir],
+                              depends=["%s/interface/ndbapi/%s" % (top_srcdir,f) for f in
os.listdir("%s/interface/ndbapi" % top_srcdir)],
                               language="c++",
                              
                               ),
                     Extension("mysql.cluster._events",
                               sources=["events.cpp"],
                               libraries=["mgmpp"],
-                             
library_dirs=["/home/mtaylor/src/ndb-connectors/devel/mgmpp/.libs"],
-                              depends=["../interface/mgmapi/%s" % f for f in
os.listdir("../interface/mgmapi")],
+                              library_dirs=["%s/mgmpp/.libs" % top_builddir],
+                              depends=["%s/interface/mgmapi/%s" % (top_srcdir,f) for f in
os.listdir("%s/interface/mgmapi" % top_srcdir)],
                               language="c++",
                              
                               ),
                     Extension("mysql.cluster._listeners",
                               sources=["listeners.cpp"],
                               libraries=["mgmpp"],
-                             
library_dirs=["/home/mtaylor/src/ndb-connectors/devel/mgmpp/.libs"],
-                              depends=["../interface/mgmapi/%s" % f for f in
os.listdir("../interface/mgmapi")],
+                              library_dirs=["%s/mgmpp/.libs" % top_builddir],
+                              depends=["%s/interface/mgmapi/%s" % (top_srcdir,f) for f in
os.listdir("%s/interface/mgmapi" % top_srcdir)],
                               language="c++",
                              
                               ),

Thread
Rev 352: Build fixes to make VPATH builds work (at least for everything that isn't perl) in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors...Monty Taylor7 Dec