Check for gperf, add support to the build system

This commit is contained in:
Julien BLACHE 2011-03-31 17:33:12 +02:00
parent ac73ee0ce5
commit ac95530585
2 changed files with 28 additions and 0 deletions

View File

@ -12,6 +12,12 @@ AC_PROG_CC
AM_PROG_CC_C_O
LT_INIT([disable-static])
AC_CHECK_PROG(GPERF, [gperf], [gperf])
if test "x$GPERF" = x; then
AC_MSG_ERROR([GNU gperf not found, please install it])
fi
AC_SUBST(GPERF)
AC_CHECK_PROG(ANTLR, [antlr3], [antlr3])
if test "x$ANTLR" = x; then
if test -d $srcdir/src/pregen; then

View File

@ -21,6 +21,10 @@ if COND_OSS4
OSS4SRC=laudio_oss4.c
endif
GPERF_FILES =
GPERF_PRODUCTS =
ANTLR_GRAMMARS = \
RSP.g RSP2SQL.g \
DAAP.g DAAP2SQL.g
@ -82,15 +86,33 @@ forked_daapd_SOURCES = main.c \
nodist_forked_daapd_SOURCES = \
$(ANTLR_SOURCES)
BUILT_SOURCES = \
$(GPERF_PRODUCTS)
EXTRA_DIST = \
$(ANTLR_GRAMMARS) \
scan-mpc.c \
scan-flac.c
CLEANFILES = \
$(GPERF_PRODUCTS)
# Let's help the dependencies a little.
rsp_query.c: RSPLexer.h RSPParser.h RSP2SQL.h
daap_query.c: DAAPLexer.h DAAPParser.h DAAP2SQL.h
# gperf construction rules
%_hash.c: %.gperf
if $(GPERF) $< > $@.tmp; then \
mv $@.tmp $@; \
elif $(GPERF) --version >/dev/null 2>&1; then \
rm $@.tmp; \
exit 1; \
else \
rm $@.tmp; \
touch $@; \
fi
# Support for building the parsers when ANTLR3 is available
if COND_ANTLR
SUFFIXES = .g .u