]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Do away with version_generated.h
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 7 May 2015 12:12:52 +0000 (14:12 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 10 Jun 2015 07:44:02 +0000 (09:44 +0200)
configure.ac
pdns/Makefile-recursor
pdns/Makefile.am
pdns/configure-recursor
pdns/version.cc

index 80f1cf65df24c145580f97596b086ad987a2d55e..4c05ab5e95aaa4c2fc4d0e007d64bffc926c3bd5 100644 (file)
@@ -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.
index 98747621f5e5054167687e005bb10ff84b30f8ef..f3cfaee45666ddc186b0996096de701159f12769 100644 (file)
@@ -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 '<boost/something.hpp>', 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 > $@
index 5429a5dace51a421879bd8ab4b073941d619c512..10ae888221167e6b29493229e2211473041abcbc 100644 (file)
@@ -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
index f18eff6ae3a2996fc9ea219a9442e3d67699382a..f88b5a1c3a3bd8f2292f4056cd67debdcbf82e0f 100755 (executable)
@@ -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
index 234ed96d67fbc5700d1d3c8722840714e724860d..2ef0e812c9b31e666c6077a50af365042f913779 100644 (file)
@@ -25,7 +25,6 @@
 #endif
 #include "logger.hh"
 #include "version.hh"
-#include "version_generated.h"
 #include <polarssl/version.h>
 
 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()<<Logger::Warning<<productName()<<" "<< PDNS_VERSION <<" (" DIST_HOST ") "
-    "(C) 2001-2015 PowerDNS.COM BV" << endl;
+  theL()<<Logger::Warning<<productName()<<" "<< VERSION << " (C) 2001-2015 "
+    "PowerDNS.COM BV" << endl;
   theL()<<Logger::Warning<<"Using "<<(sizeof(unsigned long)*8)<<"-bits mode. "
-    "Built on " BUILD_DATE " by " BUILD_HOST ", "<<compilerVersion()<<"."<<endl;
+    "Built using " << compilerVersion() << endl;
   theL()<<Logger::Warning<<"PowerDNS comes with ABSOLUTELY NO WARRANTY. "
     "This is free software, and you are welcome to redistribute it "
     "according to the terms of the GPL version 2." << endl;
@@ -126,7 +125,7 @@ void showBuildConfiguration()
 string fullVersionString()
 {
   ostringstream s;
-  s<<productName()<<" " PDNS_VERSION " (" DIST_HOST " built " BUILD_DATE " " BUILD_HOST ")";
+  s<<productName()<<" " VERSION;
   return s.str();
 }