From a358449ab17f4e3c400d2a96acc900cfd0022f95 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sat, 24 Nov 2001 04:57:41 +0000 Subject: [PATCH] Set rsync version in configure.in Show IPv6 availability in --version. --- Makefile.in | 3 +++ clientserver.c | 3 ++- configure.in | 22 ++++++++++++++-------- options.c | 12 ++++++++---- rsync.h | 1 - version.h | 1 - 6 files changed, 27 insertions(+), 15 deletions(-) delete mode 100644 version.h diff --git a/Makefile.in b/Makefile.in index 140f2233..5574842f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -17,6 +17,8 @@ srcdir=@srcdir@ VPATH=$(srcdir) SHELL=/bin/sh +VERSION=@VERSION@ + .SUFFIXES: .SUFFIXES: .c .o @@ -132,3 +134,4 @@ installcheck: $(CHECK_PROGS) $(OBJS): config.h *.h */*.h +# TODO: Add 'dist' target; need to know which files will be included \ No newline at end of file diff --git a/clientserver.c b/clientserver.c index 4a16b6a6..318a0ec9 100644 --- a/clientserver.c +++ b/clientserver.c @@ -508,7 +508,8 @@ int daemon_main(void) log_init(); - rprintf(FINFO, "rsyncd version %s starting, listening on port %d\n", VERSION, + rprintf(FINFO, "rsyncd version %s starting, listening on port %d\n", + RSYNC_VERSION, rsync_port); /* TODO: If listening on a particular address, then show that * address too. */ diff --git a/configure.in b/configure.in index a1feacf0..f28eb9c2 100644 --- a/configure.in +++ b/configure.in @@ -15,6 +15,10 @@ AC_PROG_CPP AC_PROG_INSTALL AC_SUBST(SHELL) +RSYNC_VERSION=2.4.7pre2 +AC_SUBST(RSYNC_VERSION) +AC_DEFINE_UNQUOTED(RSYNC_VERSION, ["$RSYNC_VERSION"], [rsync release version]) + # compile with optimisation and without debugging by default, unless # --debug is given. We must decide this before testing the compiler. @@ -120,7 +124,8 @@ if test "$ipv6" = "yes"; then yes #endif], [ipv6type=$i; - CFLAGS="-DINET6 $CFLAGS"]) + AC_DEFINE(INET6, 1, [true if you have IPv6]) + ]) ;; kame) # http://www.kame.net/ @@ -129,8 +134,8 @@ yes #ifdef __KAME__ yes #endif], - [ipv6type=$i; - CFLAGS="-DINET6 $CFLAGS"]) + [ipv6type=$i; + AC_DEFINE(INET6, 1, [true if you have IPv6])]) ;; linux-glibc) # http://www.v6.linux.or.jp/ @@ -140,7 +145,7 @@ yes yes #endif], [ipv6type=$i; - CFLAGS="-DINET6 $CFLAGS"]) +AC_DEFINE(INET6, 1, [true if you have IPv6])]) ;; linux-inet6) # http://www.v6.linux.or.jp/ @@ -149,7 +154,8 @@ yes ipv6lib=inet6 ipv6libdir=/usr/inet6/lib ipv6trylibc=yes; - CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS" + AC_DEFINE(INET6, 1, [true if you have IPv6]) + CFLAGS="-I/usr/inet6/include $CFLAGS" fi ;; toshiba) @@ -161,7 +167,7 @@ yes [ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib; - CFLAGS="-DINET6 $CFLAGS"]) + AC_DEFINE(INET6, 1, [true if you have IPv6])]) ;; v6d) AC_EGREP_CPP(yes, [ @@ -172,7 +178,7 @@ yes [ipv6type=$i; ipv6lib=v6; ipv6libdir=/usr/local/v6/lib; - CFLAGS="-I/usr/local/v6/include $CFLAGS"]) + AC_DEFINE(INET6, 1, [true if you have IPv6])]) ;; zeta) AC_EGREP_CPP(yes, [ @@ -183,7 +189,7 @@ yes [ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib; - CFLAGS="-DINET6 $CFLAGS"]) + AC_DEFINE(INET6, 1, [true if you have IPv6])]) ;; esac if test "$ipv6type" != "unknown"; then diff --git a/options.c b/options.c index 0316be7d..01f4d827 100644 --- a/options.c +++ b/options.c @@ -111,6 +111,7 @@ static void print_rsync_version(int f) char const *got_socketpair = "no "; char const *hardlinks = "no "; char const *links = "no "; + char const *ipv6 = "no "; #ifdef HAVE_SOCKETPAIR got_socketpair = ""; @@ -124,16 +125,19 @@ static void print_rsync_version(int f) links = ""; #endif +#if INET6 + ipv6 = ""; +#endif + rprintf(f, "%s version %s protocol version %d\n", - RSYNC_NAME, VERSION, PROTOCOL_VERSION); + RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION); rprintf(f, "Copyright (C) 1996-2001 by Andrew Tridgell and others\n"); rprintf(f, "\n"); rprintf(f, "Capabilities: %d-bit files, %ssocketpairs, " - "%shard links, %ssymlinks, batchfiles\n\n", + "%shard links, %ssymlinks, batchfiles, %sIPv6\n\n", (int) (sizeof(OFF_T) * 8), - got_socketpair, - hardlinks, links); + got_socketpair, hardlinks, links, ipv6); #ifdef NO_INT64 rprintf(f, "WARNING: no 64-bit integers on this platform!\n"); diff --git a/rsync.h b/rsync.h index 5091a9e5..c634bc39 100644 --- a/rsync.h +++ b/rsync.h @@ -387,7 +387,6 @@ static inline int flist_up(struct file_list *flist, int i) } #include "byteorder.h" -#include "version.h" #include "proto.h" #include "lib/mdfour.h" diff --git a/version.h b/version.h deleted file mode 100644 index 84c95358..00000000 --- a/version.h +++ /dev/null @@ -1 +0,0 @@ -#define VERSION "2.4.6dev" -- 2.34.1