Several changes to autoconf and automake files:
- Always build with Python support, if it's available - Better rule for building the TAGS file (optional) - Basic reorganization - Don't run the RegressionTests if no Python interpretor is found
This commit is contained in:
parent
f826854a1a
commit
60b178789f
3 changed files with 89 additions and 141 deletions
32
Makefile.am
32
Makefile.am
|
|
@ -141,7 +141,7 @@ if USE_PCH
|
||||||
nodist_libledger_la_SOURCES = src/system.hh.gch
|
nodist_libledger_la_SOURCES = src/system.hh.gch
|
||||||
|
|
||||||
BUILT_SOURCES = src/system.hh.gch
|
BUILT_SOURCES = src/system.hh.gch
|
||||||
CLEANFILES += src/system.hh.gch
|
CLEANFILES += src/system.hh.gch
|
||||||
|
|
||||||
$(srcdir)/src/system.hh.gch: $(srcdir)/src/system.hh $(top_builddir)/acconf.h
|
$(srcdir)/src/system.hh.gch: $(srcdir)/src/system.hh $(top_builddir)/acconf.h
|
||||||
$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||||
|
|
@ -154,21 +154,27 @@ endif
|
||||||
|
|
||||||
bin_PROGRAMS = ledger
|
bin_PROGRAMS = ledger
|
||||||
|
|
||||||
ledger_CPPFLAGS = $(libledger_la_CPPFLAGS)
|
ledger_CPPFLAGS = $(libledger_la_CPPFLAGS)
|
||||||
ledger_SOURCES = src/main.cc
|
ledger_SOURCES = src/main.cc
|
||||||
ledger_LDADD = $(LIBOBJS) libamounts.la libledger.la
|
ledger_LDADD = $(LIBOBJS) libamounts.la libledger.la
|
||||||
ledger_LDFLAGS = -static
|
ledger_LDFLAGS = -static
|
||||||
|
|
||||||
info_TEXINFOS = doc/ledger.texi
|
info_TEXINFOS = doc/ledger.texi
|
||||||
|
|
||||||
dist_lisp_LISP = lisp/ledger.el lisp/timeclock.el
|
dist_lisp_LISP = lisp/ledger.el lisp/timeclock.el
|
||||||
ELCFILES =
|
ELCFILES =
|
||||||
DISTCLEANFILES = ledger.elc timeclock.elc
|
DISTCLEANFILES = ledger.elc timeclock.elc
|
||||||
|
CLEANFILES += TAGS
|
||||||
|
|
||||||
TAGS: $(libamounts_la_SOURCES) $(libledger_la_SOURCES) \
|
all_sources = $(libamounts_la_SOURCES) \
|
||||||
$(libpyledger_la_SOURCES) python/pyledger.cc
|
$(libledger_la_SOURCES) \
|
||||||
etags $(libamounts_la_SOURCES) $(libledger_la_SOURCES) \
|
$(libpyledger_la_SOURCES) \
|
||||||
$(libpyledger_la_SOURCES) python/pyledger.cc
|
python/pyledger.cc \
|
||||||
|
$(pkginclude_HEADERS)
|
||||||
|
|
||||||
|
TAGS: $(all_sources)
|
||||||
|
@etags $(all_sources)
|
||||||
|
@echo TAGS rebuilt.
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
|
@ -226,8 +232,12 @@ endif
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
TESTS = RegressionTests
|
TESTS =
|
||||||
|
|
||||||
|
if HAVE_PYTHON
|
||||||
|
TESTS += RegressionTests
|
||||||
XFAIL_TESTS = RegressionTests # jww (2008-08-07): for now
|
XFAIL_TESTS = RegressionTests # jww (2008-08-07): for now
|
||||||
|
endif
|
||||||
|
|
||||||
if HAVE_CPPUNIT
|
if HAVE_CPPUNIT
|
||||||
TESTS += UnitTests
|
TESTS += UnitTests
|
||||||
|
|
|
||||||
2
acprep
2
acprep
|
|
@ -22,7 +22,7 @@ echo "m4_define([VERSION_NUMBER], [$COMMIT])" > version.m4
|
||||||
autoreconf --force --install
|
autoreconf --force --install
|
||||||
|
|
||||||
|
|
||||||
SWITCHES="--enable-python --disable-shared"
|
SWITCHES="--disable-shared"
|
||||||
|
|
||||||
if [ -z "$PYTHON_HOME" ]; then
|
if [ -z "$PYTHON_HOME" ]; then
|
||||||
PYTHON_HOME="/usr"
|
PYTHON_HOME="/usr"
|
||||||
|
|
|
||||||
196
configure.ac
196
configure.ac
|
|
@ -110,53 +110,39 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check for expat or xmlparse
|
# check for expat or xmlparse
|
||||||
AC_ARG_ENABLE(xml,
|
AC_CACHE_CHECK(
|
||||||
[ --enable-xml Turn on support for XML parsing],
|
[if libexpat is available],
|
||||||
[case "${enableval}" in
|
[libexpat_avail_cv_],
|
||||||
yes) xml=true ;;
|
[libexpat_save_libs=$LIBS
|
||||||
no) xml=false ;;
|
LIBS="-lexpat $LIBS"
|
||||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-xml) ;;
|
AC_LANG_PUSH(C++)
|
||||||
esac],[xml=true])
|
AC_TRY_LINK(
|
||||||
AM_CONDITIONAL(USE_XML, test x$xml = xtrue)
|
[#include <stdio.h>
|
||||||
|
|
||||||
if [test x$xml = xtrue ]; then
|
|
||||||
AC_CACHE_CHECK(
|
|
||||||
[if libexpat is available],
|
|
||||||
[libexpat_avail_cv_],
|
|
||||||
[libexpat_save_libs=$LIBS
|
|
||||||
LIBS="-lexpat $LIBS"
|
|
||||||
AC_LANG_PUSH(C++)
|
|
||||||
AC_TRY_LINK(
|
|
||||||
[#include <stdio.h>
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <expat.h> // expat XML parser
|
#include <expat.h> // expat XML parser
|
||||||
}],
|
}],
|
||||||
[XML_Parser parser = XML_ParserCreate(NULL);
|
[XML_Parser parser = XML_ParserCreate(NULL);
|
||||||
return parser != NULL;],
|
return parser != NULL;],
|
||||||
[libexpat_avail_cv_=true],
|
[libexpat_avail_cv_=true],
|
||||||
[libexpat_avail_cv_=false])
|
[libexpat_avail_cv_=false])
|
||||||
AC_LANG_POP
|
AC_LANG_POP
|
||||||
LIBS=$libexpat_save_libs])
|
LIBS=$libexpat_save_libs])
|
||||||
|
|
||||||
if [test x$libexpat_avail_cv_ = xtrue ]; then
|
if [test x$libexpat_avail_cv_ = xtrue ]; then
|
||||||
AM_CONDITIONAL(HAVE_EXPAT, true)
|
AM_CONDITIONAL(HAVE_EXPAT, true)
|
||||||
LIBS="-lexpat $LIBS"
|
LIBS="-lexpat $LIBS"
|
||||||
else
|
|
||||||
AM_CONDITIONAL(HAVE_EXPAT, false)
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
AM_CONDITIONAL(HAVE_EXPAT, false)
|
AM_CONDITIONAL(HAVE_EXPAT, false)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [test x$xml = xtrue ]; then
|
if [test x$libexpat_avail_cv_ = xfalse ]; then
|
||||||
if [test x$libexpat_avail_cv_ = xfalse ]; then
|
AC_CACHE_CHECK(
|
||||||
AC_CACHE_CHECK(
|
[if libxmlparse is available],
|
||||||
[if libxmlparse is available],
|
[libxmlparse_avail_cv_],
|
||||||
[libxmlparse_avail_cv_],
|
[libxmlparse_save_libs=$LIBS
|
||||||
[libxmlparse_save_libs=$LIBS
|
LIBS="-lxmlparse -lxmltok $LIBS"
|
||||||
LIBS="-lxmlparse -lxmltok $LIBS"
|
AC_LANG_PUSH(C++)
|
||||||
AC_LANG_PUSH(C++)
|
AC_TRY_LINK(
|
||||||
AC_TRY_LINK(
|
|
||||||
[#include <stdio.h>
|
[#include <stdio.h>
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <xmlparse.h> // expat XML parser
|
#include <xmlparse.h> // expat XML parser
|
||||||
|
|
@ -165,15 +151,12 @@ if [test x$xml = xtrue ]; then
|
||||||
return parser != NULL;],
|
return parser != NULL;],
|
||||||
[libxmlparse_avail_cv_=true],
|
[libxmlparse_avail_cv_=true],
|
||||||
[libxmlparse_avail_cv_=false])
|
[libxmlparse_avail_cv_=false])
|
||||||
AC_LANG_POP
|
AC_LANG_POP
|
||||||
LIBS=$libxmlparse_save_libs])
|
LIBS=$libxmlparse_save_libs])
|
||||||
|
|
||||||
if [test x$libxmlparse_avail_cv_ = xtrue ]; then
|
if [test x$libxmlparse_avail_cv_ = xtrue ]; then
|
||||||
AM_CONDITIONAL(HAVE_XMLPARSE, true)
|
AM_CONDITIONAL(HAVE_XMLPARSE, true)
|
||||||
LIBS="-lxmlparse -lxmltok $LIBS"
|
LIBS="-lxmlparse -lxmltok $LIBS"
|
||||||
else
|
|
||||||
AM_CONDITIONAL(HAVE_XMLPARSE, false)
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
AM_CONDITIONAL(HAVE_XMLPARSE, false)
|
AM_CONDITIONAL(HAVE_XMLPARSE, false)
|
||||||
fi
|
fi
|
||||||
|
|
@ -265,86 +248,40 @@ else
|
||||||
AC_MSG_FAILURE("Could not find boost_filesystem library (set CPPFLAGS and LDFLAGS?)")
|
AC_MSG_FAILURE("Could not find boost_filesystem library (set CPPFLAGS and LDFLAGS?)")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## check for boost_signals
|
|
||||||
#AC_CACHE_CHECK(
|
|
||||||
# [if boost_signals is available],
|
|
||||||
# [boost_signals_cpplib_avail_cv_],
|
|
||||||
# [boost_signals_save_libs=$LIBS
|
|
||||||
# LIBS="-lboost_signals$BOOST_SUFFIX $LIBS"
|
|
||||||
# AC_LANG_PUSH(C++)
|
|
||||||
# AC_LINK_IFELSE(
|
|
||||||
# [AC_LANG_PROGRAM(
|
|
||||||
# [[#include <boost/signal.hpp>]],
|
|
||||||
# [[boost::signal<void (void)> this_signal;]])],
|
|
||||||
# [boost_signals_cpplib_avail_cv_=true],
|
|
||||||
# [boost_signals_cpplib_avail_cv_=false])
|
|
||||||
# AC_LANG_POP
|
|
||||||
# LIBS=$boost_signals_save_libs])
|
|
||||||
#
|
|
||||||
#if [test x$boost_signals_cpplib_avail_cv_ = xtrue ]; then
|
|
||||||
# LIBS="-lboost_signals$BOOST_SUFFIX $LIBS"
|
|
||||||
#else
|
|
||||||
# AC_MSG_FAILURE("Could not find boost_signals library (set CPPFLAGS and LDFLAGS?)")
|
|
||||||
#fi
|
|
||||||
|
|
||||||
# check for libofx
|
# check for libofx
|
||||||
AC_ARG_ENABLE(ofx,
|
AC_CACHE_CHECK(
|
||||||
[ --enable-ofx Turn on support for OFX/OCF parsing],
|
[if libofx is available],
|
||||||
[case "${enableval}" in
|
[libofx_avail_cv_],
|
||||||
yes) ofx=true ;;
|
[libofx_save_libs=$LIBS
|
||||||
no) ofx=false ;;
|
LIBS="-lofx $LIBS"
|
||||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ofx) ;;
|
AC_LANG_PUSH(C++)
|
||||||
esac],[ofx=true])
|
AC_LINK_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM(
|
||||||
AM_CONDITIONAL(USE_OFX, test x$ofx = xtrue)
|
|
||||||
|
|
||||||
if [test x$ofx = xtrue ]; then
|
|
||||||
AC_CACHE_CHECK(
|
|
||||||
[if libofx is available],
|
|
||||||
[libofx_avail_cv_],
|
|
||||||
[libofx_save_libs=$LIBS
|
|
||||||
LIBS="-lofx $LIBS"
|
|
||||||
AC_LANG_PUSH(C++)
|
|
||||||
AC_LINK_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM(
|
|
||||||
[[#include <libofx.h>]],
|
[[#include <libofx.h>]],
|
||||||
[[LibofxContextPtr libofx_context = libofx_get_new_context();]])],
|
[[LibofxContextPtr libofx_context = libofx_get_new_context();]])],
|
||||||
[libofx_avail_cv_=true],
|
[libofx_avail_cv_=true],
|
||||||
[libofx_avail_cv_=false])
|
[libofx_avail_cv_=false])
|
||||||
AC_LANG_POP
|
AC_LANG_POP
|
||||||
LIBS=$libofx_save_libs])
|
LIBS=$libofx_save_libs])
|
||||||
|
|
||||||
if [test x$libofx_avail_cv_ = xtrue ]; then
|
if [test x$libofx_avail_cv_ = xtrue ]; then
|
||||||
AM_CONDITIONAL(HAVE_LIBOFX, true)
|
AM_CONDITIONAL(HAVE_LIBOFX, true)
|
||||||
LIBS="-lofx $LIBS"
|
LIBS="-lofx $LIBS"
|
||||||
else
|
|
||||||
AM_CONDITIONAL(HAVE_LIBOFX, false)
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
AM_CONDITIONAL(HAVE_LIBOFX, false)
|
AM_CONDITIONAL(HAVE_LIBOFX, false)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check for Python
|
# check for Python
|
||||||
AC_ARG_ENABLE(python,
|
AM_PATH_PYTHON(2.4,, :)
|
||||||
[ --enable-python Build the amounts library as a Python module],
|
if [test "$PYTHON" != :]; then
|
||||||
[case "${enableval}" in
|
AM_CONDITIONAL(HAVE_PYTHON, true)
|
||||||
yes) python=true ;;
|
AC_CACHE_CHECK(
|
||||||
no) python=false ;;
|
[if boost_python is available],
|
||||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
|
[boost_python_cpplib_avail_cv_],
|
||||||
esac],[python=false])
|
[boost_python_save_libs=$LIBS
|
||||||
|
LIBS="-lboost_python$BOOST_SUFFIX -lpython$PYTHON_VERSION $LIBS"
|
||||||
AM_CONDITIONAL(USE_PYTHON, test x$python = xtrue)
|
AC_LANG_PUSH(C++)
|
||||||
|
AC_LINK_IFELSE(
|
||||||
if [test x$python = xtrue ]; then
|
|
||||||
AM_PATH_PYTHON(2.2,, :)
|
|
||||||
if [test "$PYTHON" != :]; then
|
|
||||||
AC_CACHE_CHECK(
|
|
||||||
[if boost_python is available],
|
|
||||||
[boost_python_cpplib_avail_cv_],
|
|
||||||
[boost_python_save_libs=$LIBS
|
|
||||||
LIBS="-lboost_python$BOOST_SUFFIX -lpython$PYTHON_VERSION $LIBS"
|
|
||||||
AC_LANG_PUSH(C++)
|
|
||||||
AC_LINK_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM(
|
[AC_LANG_PROGRAM(
|
||||||
[[#include <boost/python.hpp>
|
[[#include <boost/python.hpp>
|
||||||
using namespace boost::python;
|
using namespace boost::python;
|
||||||
|
|
@ -355,19 +292,17 @@ if [test x$python = xtrue ]; then
|
||||||
[[return 0]])],
|
[[return 0]])],
|
||||||
[boost_python_cpplib_avail_cv_=true],
|
[boost_python_cpplib_avail_cv_=true],
|
||||||
[boost_python_cpplib_avail_cv_=false])
|
[boost_python_cpplib_avail_cv_=false])
|
||||||
AC_LANG_POP
|
AC_LANG_POP
|
||||||
LIBS=$boost_python_save_libs])
|
LIBS=$boost_python_save_libs])
|
||||||
|
|
||||||
if [test x$boost_python_cpplib_avail_cv_ = xtrue ]; then
|
if [test x$boost_python_cpplib_avail_cv_ = xtrue ]; then
|
||||||
AM_CONDITIONAL(HAVE_BOOST_PYTHON, true)
|
AM_CONDITIONAL(HAVE_BOOST_PYTHON, true)
|
||||||
LIBS="-lboost_python$BOOST_SUFFIX -lpython$PYTHON_VERSION $LIBS"
|
LIBS="-lboost_python$BOOST_SUFFIX -lpython$PYTHON_VERSION $LIBS"
|
||||||
else
|
|
||||||
AM_CONDITIONAL(HAVE_BOOST_PYTHON, false)
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
AM_CONDITIONAL(HAVE_BOOST_PYTHON, false)
|
AM_CONDITIONAL(HAVE_BOOST_PYTHON, false)
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
AM_CONDITIONAL(HAVE_PYTHON, false)
|
||||||
AM_CONDITIONAL(HAVE_BOOST_PYTHON, false)
|
AM_CONDITIONAL(HAVE_BOOST_PYTHON, false)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -403,16 +338,19 @@ fi
|
||||||
|
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS([sys/stat.h langinfo.h])
|
AC_HEADER_STAT
|
||||||
|
AC_CHECK_HEADERS([langinfo.h])
|
||||||
|
|
||||||
# Checks for typedefs, structures, and compiler characteristics.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_HEADER_STDBOOL
|
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
AC_STRUCT_TM
|
AC_STRUCT_TM
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_HEADER_STDC
|
#AC_FUNC_MKTIME
|
||||||
AC_CHECK_FUNCS([access mktime realpath getpwuid getpwnam nl_langinfo])
|
#AC_FUNC_STAT
|
||||||
|
#AC_FUNC_STRFTIME
|
||||||
|
AC_CHECK_FUNCS([access realpath getpwuid getpwnam nl_langinfo])
|
||||||
|
|
||||||
|
# Pepare the Makefiles
|
||||||
AC_CONFIG_FILES([Makefile])
|
AC_CONFIG_FILES([Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue