]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Set version string in config.h
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 9 Jun 2011 12:32:22 +0000 (14:32 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 9 Jun 2011 12:32:22 +0000 (14:32 +0200)
Makefile.in
client.c
configure
main.c
mkversion [deleted file]
version.txt [deleted file]

index 7b5c5fc64715417437f8ec9f4c265b398bfe0f30..f5ad0bbaf22b0c275eda7cdda84fce65d5b36dd4 100644 (file)
@@ -82,9 +82,6 @@ clean :
        -rm -f *.o *.s chronyc chronyd core *~
        -rm -rf .deps
 
-version.h : version.txt
-       ./mkversion
-
 getdate.c : ;
 getdate :
        bison -o getdate.c getdate.y
@@ -127,8 +124,6 @@ install: chronyd chronyc
 %.s : %.c
        $(CC) $(CFLAGS) $(CPPFLAGS) -S $<
 
-main.o logging.o client.o : version.h
-
 # makeinfo v4 required to generate plain text and html
 MAKEINFO:=makeinfo
 
index d73e3dc4cc1c23465b8c56bbe23b03ac4d9489b5..0f8424715f452e73fffc20b3fa5edd60d9a2e06c 100644 (file)
--- a/client.c
+++ b/client.c
@@ -33,7 +33,6 @@
 #include "candm.h"
 #include "nameserv.h"
 #include "md5.h"
-#include "version.h"
 #include "getdate.h"
 #include "cmdparse.h"
 #include "pktlength.h"
@@ -2662,7 +2661,7 @@ display_gpl(void)
            "chrony comes with ABSOLUTELY NO WARRANTY.  This is free software, and\n"
            "you are welcome to redistribute it under certain conditions.  See the\n"
            "GNU General Public License version 2 for details.\n\n",
-           PROGRAM_VERSION_STRING);
+           CHRONY_VERSION);
 }
 
 /* ================================================== */
@@ -2699,7 +2698,7 @@ main(int argc, char **argv)
       DNS_SetAddressFamily(IPADDR_INET6);
       hostname = "::1";
     } else if (!strcmp("-v", *argv) || !strcmp("--version",*argv)) {
-      printf("chronyc (chrony) version %s\n", PROGRAM_VERSION_STRING);
+      printf("chronyc (chrony) version %s\n", CHRONY_VERSION);
       exit(0);
     } else if (!strncmp(*argv, "-", 1)) {
       fprintf(stderr, "Usage : %s [-h <hostname>] [-p <port-number>] [-n] [-4|-6] [-m] [command]\n", progname);
index 3fa76dbb72ded24b907d613da0776954502cabba..74c92e384792fc6aba6ef36fd3e22da91a10de84 100755 (executable)
--- a/configure
+++ b/configure
@@ -501,6 +501,12 @@ fi
 
 add_def DEFAULT_CONF_DIR "\"$SYSCONFDIR\""
 
+if [ -f version.txt ]; then
+  add_def CHRONY_VERSION "\"`cat version.txt`\""
+else
+  add_def CHRONY_VERSION "\"DEVELOPMENT\""
+fi
+
 sed -e "s%@EXTRA_OBJECTS@%${EXTRA_OBJECTS}%;\
        s%@CC@%${MYCC}%;\
        s%@CFLAGS@%${MYCFLAGS}%;\
diff --git a/main.c b/main.c
index f7db90015756cedca1f99887cb7aaf95239f47d7..3a4ce79d3fdec182dbef25b86eaf2cb561141b3c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -45,7 +45,6 @@
 #include "keys.h"
 #include "acquire.h"
 #include "manual.h"
-#include "version.h"
 #include "rtc.h"
 #include "refclock.h"
 #include "clientlog.h"
@@ -288,7 +287,7 @@ int main
       do_init_rtc = 1;
     } else if (!strcmp("-v", *argv) || !strcmp("--version",*argv)) {
       /* This write to the terminal is OK, it comes before we turn into a daemon */
-      printf("chronyd (chrony) version %s\n", PROGRAM_VERSION_STRING);
+      printf("chronyd (chrony) version %s\n", CHRONY_VERSION);
       exit(0);
     } else if (!strcmp("-n", *argv)) {
       nofork = 1;
@@ -322,7 +321,7 @@ int main
     LOG_OpenSystemLog();
   }
   
-  LOG(LOGS_INFO, LOGF_Main, "chronyd version %s starting", PROGRAM_VERSION_STRING);
+  LOG(LOGS_INFO, LOGF_Main, "chronyd version %s starting", CHRONY_VERSION);
 
   /* Check whether another chronyd may already be running.  Do this after
    * forking, so that message logging goes to the right place (i.e. syslog), in
diff --git a/mkversion b/mkversion
deleted file mode 100755 (executable)
index e76d48f..0000000
--- a/mkversion
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-rm -f version.h
-echo "#ifndef VERSION_H" > version.h
-echo "#define VERSION_H 1" >> version.h
-
-if [ -f version.txt ]; then
-       ver=`cat version.txt`
-       echo "#define PROGRAM_VERSION_STRING \"$ver\"" >> version.h
-else
-       echo "#define PROGRAM_VERSION_STRING \"DEVELOPMENT\"" >> version.h
-fi
-
-echo "#endif /* VERSION_H */" >> version.h
-
diff --git a/version.txt b/version.txt
deleted file mode 100644 (file)
index b8220e1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-DEVELOPMENT