diff options
22 files changed, 34 insertions, 23 deletions
diff --git a/Makefile.am b/Makefile.am index 0f2a3737..4544eead 100644 --- a/Makefile.am +++ b/Makefile.am @@ -143,14 +143,36 @@ if HAVE_BOOST_PYTHON noinst_PROGRAMS = ledger.so -# jww (2007-04-14): This is not passing HAVE_EXPAT! +PYLIBS = pyledger ledger boost_python gmp pcre + +if HAVE_EXPAT +PYLIBS += expat +endif +if HAVE_XMLPARSE +PYLIBS += xmlparse xmltok +endif +if HAVE_LIBOFX +PYLIBS += ofx +endif + +if DEBUG +DEBUG_LEVEL = 4 +else +DEBUG_LEVEL = 0 +endif ledger.so: pyledger.cc libledger.la libpyledger.la - CFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) -L. -L.libs" \ + CFLAGS="$(CPPFLAGS)" \ + LDFLAGS="$(LDFLAGS) -L. -L.libs" \ + PYLIBS="$(PYLIBS)" \ + DEBUG_LEVEL="$(DEBUG_LEVEL)" \ python setup.py build --build-lib=. install-exec-hook: - CFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) -L. -L.libs" \ + CFLAGS="$(CPPFLAGS)" \ + LDFLAGS="$(LDFLAGS) -L. -L.libs" \ + PYLIBS="$(PYLIBS)" \ + DEBUG_LEVEL="$(DEBUG_LEVEL)" \ python setup.py install --prefix=$(prefix) endif @@ -166,7 +188,7 @@ check_PROGRAMS = $(TESTS) UnitTests_SOURCES = tests/UnitTests.cc \ \ - tests/corelib/numerics/BasicAmountTestCase.cc + tests/corelib/numerics/BasicAmount.cc UnitTests_LDADD = $(lib_LTLIBRARIES) -lcppunit UnitTests_LDFLAGS = $(LIBADD_DL) @@ -185,8 +207,8 @@ if DEBUG UnitTests_CXXFLAGS += -DDEBUG_LEVEL=4 endif -PyUnitTests: - python tests/python/UnitTests.py +PyUnitTests: PyUnitTests.py + cp PyUnitTests.py PyUnitTests ###################################################################### @@ -3,24 +3,13 @@ from distutils.core import setup, Extension import os +import string defines = [('PYTHON_MODULE', 1)] +if os.environ.has_key("DEBUG_LEVEL"): + defines.extend ([('DEBUG_LEVEL', os.environ["DEBUG_LEVEL"])]) -defines.extend ([('DEBUG_LEVEL', 4)]) - -libs = ["pyledger", "ledger", "boost_python", "gmp", "pcre"] - -if os.environ.has_key ("HAVE_EXPAT") and\ - os.environ["HAVE_EXPAT"] == "true": - libs.extend (["expat"]) - -if os.environ.has_key ("HAVE_XMLPARSE") and\ - os.environ["HAVE_XMLPARSE"] == "true": - libs.extend (["xmlparse", "xmltok"]) - -if os.environ.has_key ("HAVE_LIBOFX") and\ - os.environ["HAVE_LIBOFX"] == "true": - libs.extend (["ofx"]) +libs = os.environ["PYLIBS"].split() setup(name = "Ledger", version = "3.0", @@ -29,5 +18,5 @@ setup(name = "Ledger", author_email = "johnw@newartisans.com", url = "http://johnwiegley.com/", ext_modules = [ - Extension("ledger", ["pyledger.cc"], - define_macros = defines, libraries = libs)]) + Extension("ledger", ["pyledger.cc"], + define_macros = defines, libraries = libs)]) diff --git a/tests/python/baseline/__init__.py b/tests/python/baseline/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/baseline/__init__.py diff --git a/tests/python/cases/__init__.py b/tests/python/cases/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/cases/__init__.py diff --git a/tests/python/corelib/balances/__init__.py b/tests/python/corelib/balances/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/corelib/balances/__init__.py diff --git a/tests/python/corelib/values/__init__.py b/tests/python/corelib/values/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/corelib/values/__init__.py diff --git a/tests/python/driver/__init__.py b/tests/python/driver/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/driver/__init__.py diff --git a/tests/python/journal/__init__.py b/tests/python/journal/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/journal/__init__.py diff --git a/tests/python/parsers/__init__.py b/tests/python/parsers/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/parsers/__init__.py diff --git a/tests/python/parsers/binary/__init__.py b/tests/python/parsers/binary/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/parsers/binary/__init__.py diff --git a/tests/python/parsers/gnucash/__init__.py b/tests/python/parsers/gnucash/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/parsers/gnucash/__init__.py diff --git a/tests/python/parsers/ofx/__init__.py b/tests/python/parsers/ofx/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/parsers/ofx/__init__.py diff --git a/tests/python/parsers/qif/__init__.py b/tests/python/parsers/qif/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/parsers/qif/__init__.py diff --git a/tests/python/parsers/textual/__init__.py b/tests/python/parsers/textual/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/parsers/textual/__init__.py diff --git a/tests/python/python/__init__.py b/tests/python/python/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/python/__init__.py diff --git a/tests/python/reports/__init__.py b/tests/python/reports/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/reports/__init__.py diff --git a/tests/python/reports/balance/__init__.py b/tests/python/reports/balance/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/reports/balance/__init__.py diff --git a/tests/python/reports/emacs/__init__.py b/tests/python/reports/emacs/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/reports/emacs/__init__.py diff --git a/tests/python/reports/equity/__init__.py b/tests/python/reports/equity/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/reports/equity/__init__.py diff --git a/tests/python/reports/print/__init__.py b/tests/python/reports/print/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/reports/print/__init__.py diff --git a/tests/python/reports/register/__init__.py b/tests/python/reports/register/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/reports/register/__init__.py diff --git a/tests/python/transforms/__init__.py b/tests/python/transforms/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/python/transforms/__init__.py |