diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-24 12:48:11 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-24 12:48:11 -0400 |
commit | 07fcc3a08af552bd40d4bd5103d4668662acdaf4 (patch) | |
tree | 60894a826aa068227fa85ba108c7d8a5c46ed3b4 | |
parent | 68d41d7dc0781fed86d9c53ebe184154ce72664d (diff) | |
download | fork-ledger-07fcc3a08af552bd40d4bd5103d4668662acdaf4.tar.gz fork-ledger-07fcc3a08af552bd40d4bd5103d4668662acdaf4.tar.bz2 fork-ledger-07fcc3a08af552bd40d4bd5103d4668662acdaf4.zip |
Build Python module using automake, not setup.py
-rw-r--r-- | Makefile.am | 58 | ||||
-rwxr-xr-x | acprep | 2 | ||||
-rwxr-xr-x | python/setup.py | 18 | ||||
-rwxr-xr-x | test/PyUnitTests.py | 2 |
4 files changed, 9 insertions, 71 deletions
diff --git a/Makefile.am b/Makefile.am index a13e9709..6c60202d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -216,61 +216,17 @@ libledger_python_la_SOURCES = \ python/py_utils.cc \ python/py_value.cc \ python/py_post.cc \ - python/pyinterp.cc \ - python/setup.py + python/pyinterp.cc libledger_python_la_CPPFLAGS = $(lib_cppflags) -I$(srcdir)/python -pyexec_PROGRAMS = ledger.so +pyexec_LTLIBRARIES = ledger.la -clean-local: - rm -fr build test/python - -uninstall-hook: - rm -f $(DESTDIR)$(libdir)/Ledger-$(VERSION)-py$(PYTHON_VERSION).egg-info - -install-exec-hook: - BUILD_DIR=`cd $(top_builddir); pwd`; \ - SRC_DIR=`cd $(srcdir); pwd`; \ - (cd $(srcdir); \ - CFLAGS="$(CPPFLAGS) -I$(srcdir) -I$$BUILD_DIR $(libledger_python_la_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \ - LDFLAGS="$(LDFLAGS) -L$$BUILD_DIR -L$$BUILD_DIR/.libs" \ - ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" VERSION="$(VERSION)" \ - SRCDIR="$$SRC_DIR" $(PYTHON) python/setup.py -q install \ - --skip-build \ - --root=$(DESTDIR)/ \ - --prefix=$(prefix) \ - --install-lib=$(libdir) \ - --install-headers=$(pkgincludedir) \ - --install-data=$(datadir)) - -ledger_so_SOURCES = $(all_sources) -ledger_so_DEPENDENCIES = $(lib_LTLIBRARIES) - -PYLIBS = ledger_python \ - ledger_report \ - ledger_data \ - ledger_expr \ - ledger_math \ - ledger_util \ - gmp \ - mpfr \ - boost_system$(BOOST_SUFFIX) \ - boost_date_time$(BOOST_SUFFIX) \ - boost_filesystem$(BOOST_SUFFIX) \ - boost_regex$(BOOST_SUFFIX) \ - boost_python$(BOOST_SUFFIX) - -ledger.so: $(ledger_so_SOURCES) $(ledger_so_DEPENDENCIES) - @echo " PY ledger.so" - @BUILD_DIR=`cd $(top_builddir); pwd`; \ - SRC_DIR=`cd $(srcdir); pwd`; \ - (cd $(srcdir); \ - CFLAGS="$(CPPFLAGS) -I$(srcdir) -I$$BUILD_DIR $(libledger_python_la_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \ - LDFLAGS="$(LDFLAGS) -L$$BUILD_DIR -L$$BUILD_DIR/.libs" \ - ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" VERSION="$(VERSION)" \ - SRCDIR="$$SRC_DIR" $(PYTHON) python/setup.py -q build \ - --build-lib=$$BUILD_DIR/ --build-temp=$$BUILD_DIR/build -f) +ledger_la_CPPFLAGS = $(libledger_python_la_CPPFLAGS) +ledger_la_SOURCES = python/pyledger.cc +ledger_la_DEPENDENCIES = $(lib_LTLIBRARIES) +ledger_la_LDFLAGS = -avoid-version -module +ledger_la_LIBADD = $(LIBOBJS) $(lib_LTLIBRARIES) $(INTLLIBS) endif @@ -33,7 +33,7 @@ git ls-files '*.cc' '*.h' | egrep '^(src|python)/' > po/POTFILES.in aclocal -I m4 -SWITCHES="--disable-shared --with-included-gettext" +SWITCHES="--with-included-gettext" if [ -z "$PYTHON_HOME" ]; then PYTHON_HOME="/usr" diff --git a/python/setup.py b/python/setup.py deleted file mode 100755 index 1e67fb00..00000000 --- a/python/setup.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup, Extension - -import os - -defines = [('PYTHON_MODULE', 1)] -libs = os.environ["PYLIBS"].split() - -setup(name = "Ledger", - version = os.environ["VERSION"], - description = "Ledger Accounting Library", - author = "John Wiegley", - author_email = "johnw@newartisans.com", - url = "http://www.newartisans.com/software/ledger.html", - ext_modules = [ - Extension("ledger", [os.environ["SRCDIR"] + '/python/pyledger.cc'], - define_macros = defines, libraries = libs)]) diff --git a/test/PyUnitTests.py b/test/PyUnitTests.py index acae7781..a77d99ad 100755 --- a/test/PyUnitTests.py +++ b/test/PyUnitTests.py @@ -1,6 +1,6 @@ #!/bin/sh -PYTHONPATH="%builddir%":"%srcdir%":$PYTHONPATH \ +PYTHONPATH="%builddir%/.libs":$PYTHONPATH \ LD_LIBRARY_PATH="%builddir%/.libs":$LD_LIBRARY_PATH \ DYLD_LIBRARY_PATH="%builddir%/.libs":$DYLD_LIBRARY_PATH \ %python% "%builddir%"/test/python/UnitTests.py |