diff options
-rwxr-xr-x | acprep | 14 | ||||
-rw-r--r-- | option.cc | 3 | ||||
-rw-r--r-- | session.cc | 2 | ||||
-rw-r--r-- | session.h | 20 |
4 files changed, 36 insertions, 3 deletions
@@ -19,7 +19,10 @@ if [ -x "$cmd" ]; then export LIBTOOLIZE="$cmd" fi -cat configure.tmpl | sed "s/%VERSION%/$(git describe)/" > configure.in +COMMIT=$(git describe --all --long | sed 's/heads\///') + +cat configure.tmpl | \ + sed "s/%VERSION%/$COMMIT/" > configure.in autoreconf --force --install @@ -142,3 +145,12 @@ fi "$HERE/configure" --srcdir="$HERE" CXX="$CXX" \ CPPFLAGS="$CPPFLAGS" CXXFLAGS="$CXXFLAGS $local_cxxflags" \ LDFLAGS="$LDFLAGS" LIBS="$LIBS" $SWITCHES "$@" + +# Alter the Makefile so that it's not nearly so verbose. This makes finding +# errors and warnings much easier. + +if [ -f Makefile ]; then + perl -i -pe 's/^\t(\$\((LIBTOOL|CXX)\).*)/\t\@echo " " CXX \$\@;$1 > \/dev\/null/;' Makefile + perl -i -pe 's/^\tmv -f/\t\@mv -f/;' Makefile + perl -i -pe 's/^\t(\$\((.*?)LINK\).*)/\t\@echo " " LD \$\@;$1 > \/dev\/null/;' Makefile +fi @@ -149,8 +149,7 @@ void process_environment(const char ** envp, const string& tag, } void process_arguments(int argc, char ** argv, const bool anywhere, - expr::scope_t& scope, - std::list<string>& args) + expr::scope_t& scope, std::list<string>& args) { for (char ** i = argv; *i; i++) { if ((*i)[0] != '-') { @@ -290,6 +290,8 @@ expr::ptr_op_t session_t::lookup(const string& name) case 'v': if (! *(p + 1) || std::strcmp(p, "verbose") == 0) return MAKE_FUNCTOR(session_t::option_verbose); + else if (std::strcmp(p, "version") == 0) + return MAKE_FUNCTOR(session_t::option_version); else if (std::strcmp(p, "verify") == 0) return MAKE_FUNCTOR(session_t::option_verify); break; @@ -137,6 +137,26 @@ class session_t : public expr::symbol_scope_t virtual expr::ptr_op_t lookup(const string& name); // + // Help options + // + + value_t option_version(expr::scope_t&) { + std::cout << "Ledger " << ledger::version << ", the command-line accounting tool"; + std::cout << "\n\nCopyright (c) 2003-2008, John Wiegley. All rights reserved.\n\n\ +This program is made available under the terms of the BSD Public License.\n\ +See LICENSE file included with the distribution for details and disclaimer.\n"; + std::cout << "\n(modules: gmp, pcre"; +#if defined(HAVE_EXPAT) || defined(HAVE_XMLPARSE) + std::cout << ", xml"; +#endif +#ifdef HAVE_LIBOFX + std::cout << ", ofx"; +#endif + std::cout << ")\n"; + return NULL_VALUE; + } + + // // Debug options // |