From: Pieter Lexis Date: Thu, 7 May 2015 12:12:52 +0000 (+0200) Subject: Do away with version_generated.h X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~78^2~9^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea1a7c3986be2fe5dbc818efe69307d03f4df110;p=thirdparty%2Fpdns.git Do away with version_generated.h --- diff --git a/configure.ac b/configure.ac index 80f1cf65df..4c05ab5e95 100644 --- a/configure.ac +++ b/configure.ac @@ -75,8 +75,6 @@ LT_INIT([disable-static dlopen]) MC_TM_GMTOFF -AM_CONDITIONAL([RELEASE_BUILD], [test "$PACKAGE_VERSION" != "git"]) - # Define full_libdir to be the fully expanded (${exec_prefix}, etc.) # "system" library path. # We use this to search for other libraries. diff --git a/pdns/Makefile-recursor b/pdns/Makefile-recursor index 98747621f5..f3cfaee456 100644 --- a/pdns/Makefile-recursor +++ b/pdns/Makefile-recursor @@ -30,7 +30,7 @@ REC_CONTROL_OBJECTS=rec_channel.o rec_control.o arguments.o misc.o \ unix_utility.o logger.o qtype.o # what we need -all: message version_generated.h build +all: message build # OS specific instructions -include sysdeps/$(shell uname).inc @@ -69,26 +69,6 @@ CFLAGS += -DSYSCONFDIR='"$(SYSCONFDIR)"' -DLOCALSTATEDIR='"$(LOCALSTATEDIR)"' dnslabeltext.cc: dnslabeltext.rl ragel $< -o $@ -# Version -build_date := $(shell LC_TIME=C date '+%Y%m%d%H%M%S') -build_host := $(shell id -u -n)@$(shell hostname -f 2>/dev/null || hostname 2>/dev/null || echo localhost) - -.PHONY: version_generated.h -version_generated.h: - @echo "$$create_version_generated_h" > $@ - -define create_version_generated_h -#ifndef VERSION_GENERATED_H -#define VERSION_GENERATED_H -#include "config.h" -#define PDNS_VERSION VERSION -#define BUILD_DATE "$(build_date)" -#define BUILD_HOST "$(build_host)" -#endif //!VERSION_GENERATED_H -endef - -export create_version_generated_h - message: @echo @echo PLEASE READ: If you get an error mentioning \#include '', please read README @@ -128,7 +108,7 @@ clean: binclean -rm -f dep *~ *.gcda *.gcno optional/*.gcda optional/*.gcno binclean: - -rm -f *.o pdns_hw pdns_recursor rec_control optional/*.o build-stamp ext/library/*.o ext/yahttp/yahttp/*.o version_generated.h + -rm -f *.o pdns_hw pdns_recursor rec_control optional/*.o build-stamp ext/library/*.o ext/yahttp/yahttp/*.o dep: $(CXX) $(CXXFLAGS) -MM -MG *.cc *.hh > $@ diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 5429a5dace..10ae888221 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -53,11 +53,9 @@ EXTRA_DIST = \ BUILT_SOURCES = \ bind-dnssec.schema.sqlite3.sql.h \ - version_generated.h \ bindparser.h htmlfiles.h CLEANFILES = \ - version_generated.h \ *.gcda \ *.gcno \ *.gcov \ @@ -1134,42 +1132,5 @@ bind-dnssec.schema.sqlite3.sql.h: bind-dnssec.schema.sqlite3.sql .hh.h: cp $< $@ -build_date := $(shell LC_TIME=C date '+%Y%m%d%H%M%S') -build_host := $(shell id -u -n)@$(shell hostname -f 2>/dev/null || hostname 2>/dev/null || echo localhost) -git_version := $(shell git describe --always --dirty=+ 2>/dev/null) -# Do the test in shell, so we don't confuse automake with ifeq/ifneq. -pdns_version := $(shell test -z "$(git_version)" && echo UNKNOWN || echo "git-$(git_version)") - -version.o: version_generated.h - pubsuffix.cc: $(srcdir)/effective_tld_names.dat ./mkpubsuffixcc - -.PHONY: version_generated.h -version_generated.h: - @echo "$$create_version_generated_h" > $@ - -if RELEASE_BUILD -define create_version_generated_h -#ifndef VERSION_GENERATED_H -#define VERSION_GENERATED_H -#define PDNS_VERSION "$(PACKAGE_VERSION)" -#define DIST_HOST "$(DIST_HOST)" -#define BUILD_DATE "$(build_date)" -#define BUILD_HOST "$(build_host)" -#endif //!VERSION_GENERATED_H -endef - -else -define create_version_generated_h -#ifndef VERSION_GENERATED_H -#define VERSION_GENERATED_H -#define PDNS_VERSION "$(pdns_version)" -#define DIST_HOST "$(build_host)" -#define BUILD_DATE "$(build_date)" -#define BUILD_HOST "$(build_host)" -#endif //!VERSION_GENERATED_H -endef -endif - -export create_version_generated_h diff --git a/pdns/configure-recursor b/pdns/configure-recursor index f18eff6ae3..f88b5a1c3a 100755 --- a/pdns/configure-recursor +++ b/pdns/configure-recursor @@ -20,6 +20,11 @@ CF_PIE="" LD_PIE="" CF_FORTIFY="" CF_STACK="" +BUILD_HOST="$(id -u -n)@$(hostname -f 2>/dev/null || hostname 2>/dev/null || echo localhost)" + +cat >> config.h << EOF +#define BUILD_HOST "${BUILD_HOST}" +EOF test_flags() { # test for relocation diff --git a/pdns/version.cc b/pdns/version.cc index 234ed96d67..2ef0e812c9 100644 --- a/pdns/version.cc +++ b/pdns/version.cc @@ -25,7 +25,6 @@ #endif #include "logger.hh" #include "version.hh" -#include "version_generated.h" #include static ProductType productType; @@ -54,7 +53,7 @@ string productName() { string getPDNSVersion() { - return PDNS_VERSION; + return VERSION; } // REST API product type @@ -70,10 +69,10 @@ string productTypeApiType() { void showProductVersion() { - theL()<