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:
John Wiegley 2008-08-10 18:56:40 -04:00
parent f826854a1a
commit 60b178789f
3 changed files with 89 additions and 141 deletions

View file

@ -164,11 +164,17 @@ 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
View file

@ -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"

View file

@ -110,17 +110,7 @@ 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],
[case "${enableval}" in
yes) xml=true ;;
no) xml=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-xml) ;;
esac],[xml=true])
AM_CONDITIONAL(USE_XML, test x$xml = xtrue)
if [test x$xml = xtrue ]; then
AC_CACHE_CHECK(
[if libexpat is available], [if libexpat is available],
[libexpat_avail_cv_], [libexpat_avail_cv_],
[libexpat_save_libs=$LIBS [libexpat_save_libs=$LIBS
@ -138,18 +128,14 @@ if [test x$xml = xtrue ]; then
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_],
@ -174,9 +160,6 @@ if [test x$xml = xtrue ]; then
else else
AM_CONDITIONAL(HAVE_XMLPARSE, false) AM_CONDITIONAL(HAVE_XMLPARSE, false)
fi fi
else
AM_CONDITIONAL(HAVE_XMLPARSE, false)
fi
else else
AM_CONDITIONAL(HAVE_XMLPARSE, false) AM_CONDITIONAL(HAVE_XMLPARSE, false)
fi fi
@ -265,41 +248,8 @@ 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],
[case "${enableval}" in
yes) ofx=true ;;
no) ofx=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ofx) ;;
esac],[ofx=true])
AM_CONDITIONAL(USE_OFX, test x$ofx = xtrue)
if [test x$ofx = xtrue ]; then
AC_CACHE_CHECK(
[if libofx is available], [if libofx is available],
[libofx_avail_cv_], [libofx_avail_cv_],
[libofx_save_libs=$LIBS [libofx_save_libs=$LIBS
@ -314,30 +264,17 @@ if [test x$ofx = xtrue ]; then
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 ;;
no) python=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
esac],[python=false])
AM_CONDITIONAL(USE_PYTHON, test x$python = xtrue)
if [test x$python = xtrue ]; then
AM_PATH_PYTHON(2.2,, :)
if [test "$PYTHON" != :]; then
AC_CACHE_CHECK( AC_CACHE_CHECK(
[if boost_python is available], [if boost_python is available],
[boost_python_cpplib_avail_cv_], [boost_python_cpplib_avail_cv_],
@ -364,10 +301,8 @@ if [test x$python = xtrue ]; then
else else
AM_CONDITIONAL(HAVE_BOOST_PYTHON, false) AM_CONDITIONAL(HAVE_BOOST_PYTHON, false)
fi fi
else
AM_CONDITIONAL(HAVE_BOOST_PYTHON, false)
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