diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-06-09 14:15:39 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-06-09 14:15:39 +0200 |
commit | 8d83f693d78dc88ebcc5a79504f979d1c3bcc2a0 (patch) | |
tree | ae6542d493eb2a7448c3f171a01a111004f43b78 | |
parent | 15f531613d3706ede2ed58ec8f9b6f799ae21e03 (diff) | |
download | memedit-8d83f693d78dc88ebcc5a79504f979d1c3bcc2a0.tar.gz memedit-8d83f693d78dc88ebcc5a79504f979d1c3bcc2a0.tar.xz |
fix genparse version handling
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | configure.ac | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am index 3d6bb29..c0297a7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,9 +15,12 @@ memedit_LDADD = $(READLINE_LIBS) man_MANS = memedit.1 +if HAVE_GENPARSE # only needed to recompile the commandlineparser memedit_parser.c memedit_parser.h: memedit_parser.gp $(GENPARSE) -o memedit_parser memedit_parser.gp + echo "#define GENPARSE_VERS_MAGIC $(GENPARSE_VERS_MAGIC)" >> $(builddir)/memedit_parser.h +endif y.tab.c y.tab.h: memedit.y $(YACC) -d $< diff --git a/configure.ac b/configure.ac index 414e20f..80e3dd3 100644 --- a/configure.ac +++ b/configure.ac @@ -26,12 +26,13 @@ dnl Check for genparse dnl In version 0.6.5 the API of the generated parser changed. We support dnl both conventions. AC_PATH_PROGS(GENPARSE, genparse,, $PATH) -if test -z "$GENPARSE"; then - AC_MSG_ERROR([genparse could not be found, please install the genparse package]) +if test -n "$GENPARSE"; then + GENPARSE_VERS_MAGIC=`set -- \`$GENPARSE --version | awk '{gsub("v", "", $2); gsub("\\\\\\\\.", " ", $2); print $2}'\`; printf "%03d%03d%03d" \$1 \$2 \$3 | sed -e "s/^0*//g"` +elif test ! -e memedit_parser.h; then + AC_MSG_ERROR([genparse could not be found, please install the genparse package]) fi -GENPARSE_VERS_MAGIC=`set -- \`$GENPARSE --version | awk '{gsub("v", "", $2); gsub("\\\\\\\\.", " ", $2); print $2}'\`; printf "%03d%03d%03d" \$1 \$2 \$3 | sed -e "s/^0*//g"` -AC_DEFINE_UNQUOTED(GENPARSE_VERS_MAGIC, $GENPARSE_VERS_MAGIC, "genparse version") - +AM_CONDITIONAL(HAVE_GENPARSE, test -n "$GENPARSE") +AC_SUBST(GENPARSE_VERS_MAGIC, $GENPARSE_VERS_MAGIC) # Checks for libraries. |