Browse Source

build: track config args

Record the ./configure arguments used and make them user-visible.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Paul Jakma <paul@jakma.org>
David Lamparter 4 years ago
parent
commit
7abd875294
3 changed files with 7 additions and 0 deletions
  1. 2 0
      configure.ac
  2. 3 0
      lib/command.c
  3. 2 0
      lib/version.h.in

+ 2 - 0
configure.ac

@@ -8,6 +8,8 @@
 AC_PREREQ(2.53)
 
 AC_INIT(Quagga, 0.99.24-rc1, [https://bugzilla.quagga.net])
+CONFIG_ARGS="$*"
+AC_SUBST(CONFIG_ARGS)
 AC_CONFIG_SRCDIR(lib/zebra.h)
 AC_CONFIG_MACRO_DIR([m4])
 

+ 3 - 0
lib/command.c

@@ -181,6 +181,7 @@ print_version (const char *progname)
 {
   printf ("%s version %s\n", progname, QUAGGA_VERSION);
   printf ("%s\n", QUAGGA_COPYRIGHT);
+  printf ("configured with:\n\t%s\n", QUAGGA_CONFIG_ARGS);
 }
 
 
@@ -2951,6 +2952,8 @@ DEFUN (show_version,
   vty_out (vty, "Quagga %s (%s).%s", QUAGGA_VERSION, host.name?host.name:"",
 	   VTY_NEWLINE);
   vty_out (vty, "%s%s%s", QUAGGA_COPYRIGHT, GIT_INFO, VTY_NEWLINE);
+  vty_out (vty, "configured with:%s    %s%s", VTY_NEWLINE,
+           QUAGGA_CONFIG_ARGS, VTY_NEWLINE);
 
   return CMD_SUCCESS;
 }

+ 2 - 0
lib/version.h.in

@@ -45,6 +45,8 @@
 
 #define QUAGGA_COPYRIGHT "Copyright 1996-2005 Kunihiro Ishiguro, et al."
 
+#define QUAGGA_CONFIG_ARGS "@CONFIG_ARGS@"
+
 pid_t pid_output (const char *);
 
 #ifndef HAVE_DAEMON