On Feb 26, 2014, at 7:54 PM, NeilBrown <[email protected]> wrote: > > Use of __DATE__ and __TIME__ makes it impossible to recompile after > possibly changing context, and see the context made any real change in > the resulting build. > The Open Build Service can do this (to optimise rebuilds) and so > discourages the use of __DATE__ and __TIME__ > > This patch removes the __DATE__ and __TIME__ leaving just the VERSION. > > Signed-off-by: NeilBrown <[email protected]> > > -- > p.s. I'm not subscribed so didn't get your reply ... but I > checked the archive just in case and found it there.
Applied this patch to my private tree. If all goes well, you should see it in 0.10.1. > For some of my projects I include e.g. > > VERSION = $(shell [ -d .git ] && git describe HEAD | sed 's/mdadm-//') > CFLAGS += $(if $(VERSION),-DVERSION=\"$(VERSION)\",) > > in the Makefile which makes the version message slightly more useful. > I don't know how to integrate that with autoconf. The VERSION macro is defined by the second argument of the AC_INIT macro in configure.ac: AC_INIT([fedfs-utils], [0.10.0], [[email protected]]) Then config.h has “#define VERSION 0.10.0”. > Thanks, > NeilBrown > > > diff --git a/src/fedfsd/main.c b/src/fedfsd/main.c > index f6ca61f7d6e8..4980dc3b09e1 100644 > --- a/src/fedfsd/main.c > +++ b/src/fedfsd/main.c > @@ -164,9 +164,7 @@ int main(int argc, char **argv) > gid = grp->gr_gid; > break; > case '?': > - fprintf(stderr, "Version " VERSION > - ", built on %s at %s\n\n", > - __DATE__, __TIME__); > + fprintf(stderr, "Version " VERSION "\n\n"); > fedfsd_usage(progname); > break; > case 'o': > @@ -230,8 +228,7 @@ int main(int argc, char **argv) > } > } > > - xlog(L_NOTICE, "Version " VERSION " (built %s at %s) starting", > - __DATE__, __TIME__); > + xlog(L_NOTICE, "Version " VERSION " starting"); > > if (!fedfsd_set_up_authenticators()) > exit(EXIT_FAILURE); -- Chuck Lever chuck[dot]lever[at]oracle[dot]com _______________________________________________ fedfs-utils-devel mailing list [email protected] https://oss.oracle.com/mailman/listinfo/fedfs-utils-devel
