Added back the --version option, and changed acprep so that it hacks on the
generated Makefile to greatly reduce unneeded verbosity.
This commit is contained in:
parent
ac5cc7796f
commit
8601a2a8bf
4 changed files with 36 additions and 3 deletions
14
acprep
14
acprep
|
|
@ -19,7 +19,10 @@ if [ -x "$cmd" ]; then
|
||||||
export LIBTOOLIZE="$cmd"
|
export LIBTOOLIZE="$cmd"
|
||||||
fi
|
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
|
autoreconf --force --install
|
||||||
|
|
||||||
|
|
@ -142,3 +145,12 @@ fi
|
||||||
"$HERE/configure" --srcdir="$HERE" CXX="$CXX" \
|
"$HERE/configure" --srcdir="$HERE" CXX="$CXX" \
|
||||||
CPPFLAGS="$CPPFLAGS" CXXFLAGS="$CXXFLAGS $local_cxxflags" \
|
CPPFLAGS="$CPPFLAGS" CXXFLAGS="$CXXFLAGS $local_cxxflags" \
|
||||||
LDFLAGS="$LDFLAGS" LIBS="$LIBS" $SWITCHES "$@"
|
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,
|
void process_arguments(int argc, char ** argv, const bool anywhere,
|
||||||
expr::scope_t& scope,
|
expr::scope_t& scope, std::list<string>& args)
|
||||||
std::list<string>& args)
|
|
||||||
{
|
{
|
||||||
for (char ** i = argv; *i; i++) {
|
for (char ** i = argv; *i; i++) {
|
||||||
if ((*i)[0] != '-') {
|
if ((*i)[0] != '-') {
|
||||||
|
|
|
||||||
|
|
@ -290,6 +290,8 @@ expr::ptr_op_t session_t::lookup(const string& name)
|
||||||
case 'v':
|
case 'v':
|
||||||
if (! *(p + 1) || std::strcmp(p, "verbose") == 0)
|
if (! *(p + 1) || std::strcmp(p, "verbose") == 0)
|
||||||
return MAKE_FUNCTOR(session_t::option_verbose);
|
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)
|
else if (std::strcmp(p, "verify") == 0)
|
||||||
return MAKE_FUNCTOR(session_t::option_verify);
|
return MAKE_FUNCTOR(session_t::option_verify);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
20
session.h
20
session.h
|
|
@ -136,6 +136,26 @@ class session_t : public expr::symbol_scope_t
|
||||||
|
|
||||||
virtual expr::ptr_op_t lookup(const string& name);
|
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
|
// Debug options
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue