diff --git a/Makefile.am b/Makefile.am index e38e3fb..2e3b36e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,8 +13,12 @@ siccc_CFLAGS = siccc_CXXFLAGS = ${AM_CXXFLAGS} -DDEBUG -ggdb -I./mongoose/ siccc_LDFLAGS = -ldl -pthread EXTRA_DIST= static/* src/eventlist.txt -src/Foohash.H: src/eventrouter.gperf - gperf -LC++ -ZFoohash -Ktxt -H hacksh --null-strings -E -n -t -S1 < $< > $@ + +GPERFFLAGS = -C -k2 -LC++ -ZFoohash -Ktxt -H hacksh --null-strings -E -n -t -S1 + + +src/Foohash.H: src/eventrouter.gperf + $(GPERF) $(GPERFFLAGS) < $< > $@ testfoohash_SOURCES= src/testfoohash.cc src/Foohash.H testfoohash_CXXFLAGS = ${AM_CXXFLAGS} -DDEBUG -ggdb -O0 diff --git a/configure.ac b/configure.ac index 89d96fc..ec1fe52 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,8 @@ AC_PROG_CXX PKG_CHECK_MODULES([LIBEVENTSTUFF], [libevent > 2.0.0]) - +AM_MISSING_PROG([GPERF], [gperf]) + AC_CHECK_PROGS(gengetopt, gengetopt, [false]) GENGETOPT=$gengetopt AC_SUBST(GENGETOPT) diff --git a/src/eventrouter.gperf b/src/eventrouter.gperf index 54f1c87..7d11415 100644 --- a/src/eventrouter.gperf +++ b/src/eventrouter.gperf @@ -1,6 +1,6 @@ struct RouterOp { - const char *txt; + const char *name; int op; }; %% diff --git a/src/testfoohash.cc b/src/testfoohash.cc index 1630944..e7d91c5 100644 --- a/src/testfoohash.cc +++ b/src/testfoohash.cc @@ -9,7 +9,7 @@ using std::cout; using std::endl; /*struct RouterOp {*/ - //const char *txt; + //const char *name; //int op; /*};*/ @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) blub = fh.in_word_set("/static" , sizeof("/static")-1); if(blub) cout << "found! : " - << blub->txt + << blub->name << " ,op:" << blub->op << endl;