diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2015-12-20 15:02:39 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2015-12-20 15:03:26 +0100 |
commit | f694293ad44226e31cb549f6418907c78e8d117f (patch) | |
tree | d554c96242fc5f70e0cb970b8fa44f0799ebdabb | |
parent | c8e673fd7eb836a1750d599586dcd34f5d551528 (diff) |
Better gperf dependencies
Change-Id: Ibd005884f17271763910829595ae64785edae510
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | src/lib/Makefile.am | 38 |
2 files changed, 17 insertions, 35 deletions
diff --git a/configure.ac b/configure.ac index bebc88e..d1725cb 100644 --- a/configure.ac +++ b/configure.ac @@ -223,18 +223,8 @@ AM_CONDITIONAL([WITH_LIBABW_DOCS], [test "x$build_docs" != "xno"]) dnl =================================================================== dnl Check for gperf dnl =================================================================== -AC_ARG_VAR(GPERF, [Setting this variable will override the gperf detection]) -AC_PATH_PROG(GPERF, gperf) -if test -z "$GPERF"; then - AC_MSG_ERROR([gperf not found but needed. Install it.]) -fi -AC_MSG_CHECKING([gperf version]) -if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then - AC_MSG_RESULT([OK]) -else - AC_MSG_ERROR([too old, you need at least 3.0.0]) -fi -AC_SUBST(GPERF) +AM_MISSING_PROG([GPERF], [gperf]) +AM_MISSING_PROG([PERL], [perl]) # =============== # Find librevenge diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 1170d23..cdc0bda 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -29,9 +29,7 @@ AM_CXXFLAGS = -I$(top_srcdir)/inc \ -DBOOST_ERROR_CODE_HEADER_ONLY \ -DBOOST_SYSTEM_NO_DEPRECATED -generated_files = \ - $(top_builddir)/src/lib/tokens.h \ - $(top_builddir)/src/lib/tokenhash.h +BUILT_SOURCES = tokens.h tokenhash.h libabw_@ABW_MAJOR_VERSION@_@ABW_MINOR_VERSION@_la_LIBADD = $(REVENGE_LIBS) $(LIBXML_LIBS) $(ZLIB_LIBS) @LIBABW_WIN32_RESOURCE@ libabw_@ABW_MAJOR_VERSION@_@ABW_MINOR_VERSION@_la_DEPENDENCIES = @LIBABW_WIN32_RESOURCE@ @@ -56,22 +54,17 @@ libabw_@ABW_MAJOR_VERSION@_@ABW_MINOR_VERSION@_la_SOURCES = \ ABWXMLHelper.h \ ABWXMLTokenMap.h \ ABWZlibStream.h \ - libabw_internal.h \ - \ - $(generated_files) - -ABWXMLTokenMap.lo : $(generated_files) -ABWParser.lo : $(generated_files) + libabw_internal.h -$(top_builddir)/src/lib/tokens.h : $(top_builddir)/src/lib/tokens.gperf +tokens.h : tokens.gperf -$(top_builddir)/src/lib/tokenhash.h : $(top_builddir)/src/lib/tokens.gperf - $(GPERF) --compare-strncmp -C -m 20 $(top_builddir)/src/lib/tokens.gperf \ - | $(SED) -e 's/(char\*)0/(char\*)0, 0/g' -e 's/register //g' > $(top_builddir)/src/lib/tokenhash.h +tokenhash.h : tokens.gperf + $(GPERF) --compare-strncmp -C -m 20 tokens.gperf \ + | $(SED) -e 's/(char\*)0/(char\*)0, 0/g' -e 's/register //g' > tokenhash.h -$(top_builddir)/src/lib/tokens.gperf : $(top_srcdir)/src/lib/tokens.txt gentoken.pl - perl $(top_srcdir)/src/lib/gentoken.pl $(top_srcdir)/src/lib/tokens.txt \ - $(top_builddir)/src/lib/tokens.h $(top_builddir)/src/lib/tokens.gperf +tokens.gperf : $(top_srcdir)/src/lib/tokens.txt $(top_srcdir)/src/lib/gentoken.pl + $(PERL) $(top_srcdir)/src/lib/gentoken.pl $(top_srcdir)/src/lib/tokens.txt \ + tokens.h tokens.gperf if OS_WIN32 @@ -80,14 +73,13 @@ if OS_WIN32 WINDRES=@WINDRES@ $(top_srcdir)/build/win32/lt-compile-resource libabw.rc @LIBABW_WIN32_RESOURCE@ endif -distclean-local : - rm -f $(generated_files) $(top_builddir)/src/lib/*.gperf +MOSTLYCLEANFILES = \ + $(BUILT_SOURCES) \ + tokens.gperf EXTRA_DIST = \ + $(BUILT_SOURCES) \ tokens.txt \ - gentoken.pl \ + gentoken.pl \ + libabw.rc \ libabw.rc.in - -# These may be in the builddir too -BUILD_EXTRA_DIST = \ - libabw.rc |