From a729670ba7444db13577cb93687f3682bf83651f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Tue, 3 Mar 2015 13:17:36 +0000 Subject: [PATCH] correct macro name and make what/ident optional --- configure.ac | 4 ++-- makefile.am | 2 +- src/mrw/args.hxx | 14 +++++++++----- src/version.cxx.in | 1 + 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 4c305ef..03539bc 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ m4_define(x_package_name, mrw-c++) m4_define(x_major, 4) -m4_define(x_minor, 1) +m4_define(x_minor, 2) m4_include(ax_cxx_compile_stdcxx_11.m4) AC_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR]) @@ -65,7 +65,7 @@ AC_SUBST(HOME) AX_DEFINE_DIR([DATADIR], [datadir]) #AC_SUBST(DATADIR) -AM_CPPFLAGS="-DPACKAGEPACKAGE_VERSION='\"${PACKAGE_VERSION}\"' -DPACKAGE_NAME='\"${PACKAGE_NAME}\"'" +AM_CPPFLAGS="-DPACKAGE_VERSION='\"${PACKAGE_VERSION}\"' -DPACKAGE_NAME='\"${PACKAGE_NAME}\"'" # Get rid of that stupid -O2 -g opions! CXXFLAGS="${CXXFLAGS:-}" diff --git a/makefile.am b/makefile.am index f2c804a..eb517aa 100644 --- a/makefile.am +++ b/makefile.am @@ -65,4 +65,4 @@ distclean-local: depcomp install-sh ltmain.sh makefile makefile.in \ missing mkinstalldirs -MAINTAINERCLEANFILES = debian/control build-string +MAINTAINERCLEANFILES = debian/control diff --git a/src/mrw/args.hxx b/src/mrw/args.hxx index 3466fa6..38db916 100644 --- a/src/mrw/args.hxx +++ b/src/mrw/args.hxx @@ -27,8 +27,12 @@ */ // Add version information for @c what and @c ident -const std::string MRW_IDENT("$Id: " PACKAGE_NAME "-" PACKAGEPACKAGE_VERSION " $"); -const std::string MRW_WHAT("#(@)" PACKAGE_NAME "-" PACKAGEPACKAGE_VERSION); +#if defined(PACKAGE_NAME) && defined(PACKAGE_VERSION) +const std::string MRW_IDENT("$Id: " PACKAGE_NAME "-" PACKAGE_VERSION " $"); +const std::string MRW_WHAT("#(@)" PACKAGE_NAME "-" PACKAGE_VERSION); +#else +# warning pass -DPACKAGE_NAME=name -DPACKAGE_VERSION=version for ident/what +#endif namespace mrw { /// Cool and easy evaluation of commandline arguments in C++11. @@ -340,11 +344,11 @@ namespace mrw { } /// @return version information std::string version_text() { -# ifdef PACKAGEPACKAGE_VERSION +# ifdef PACKAGE_VERSION # ifdef PACKAGE_NAME - std::string v(": " PACKAGE_NAME "-" PACKAGEPACKAGE_VERSION); + std::string v(": " PACKAGE_NAME "-" PACKAGE_VERSION); # else - std::string v("-" PACKAGEPACKAGE_VERSION); + std::string v("-" PACKAGE_VERSION); # endif # else # ifdef PACKAGE_NAME diff --git a/src/version.cxx.in b/src/version.cxx.in index 30f2b3a..88bb552 100644 --- a/src/version.cxx.in +++ b/src/version.cxx.in @@ -14,3 +14,4 @@ namespace mrw { const std::string WHAT("#(@) @PACKAGE_NAME@-@PACKAGE_VERSION@"); const std::string IDENT("$Id: @PACKAGE_NAME@-@PACKAGE_VERSION@ $"); } +