centralized the handling of the version number, prior to going
authoraland <aland>
Fri, 4 May 2001 16:58:04 +0000 (16:58 +0000)
committeraland <aland>
Fri, 4 May 2001 16:58:04 +0000 (16:58 +0000)
to beta.

Make.inc.in
configure.in
src/include/radiusd.h
src/main/radius_snmp.c
src/main/radiusd.c
src/main/version.c

index 53776ec..8a1666d 100644 (file)
@@ -68,3 +68,5 @@ SQL_ODBC_INCLUDE = @ODBC_INCLUDE@
 
 SQL_ORACLE_LIBS = @ORACLE_LIBS@
 SQL_ORACLE_INCLUDE = @ORACLE_INCLUDE@
+
+RADIUSD_VERSION                = @RADIUSD_VERSION@
index 926a74a..6d0d728 100644 (file)
@@ -23,7 +23,9 @@ dnl #############################################################
 AC_INIT(src/main/radiusd.c)
 AC_CONFIG_HEADER(src/include/autoconf.h)
 AC_REVISION($Revision$)dnl
-dnl AC_PREFIX_DEFAULT(/usr/local)
+
+dnl # The version of the software, first beta, is 0.1
+RADIUSD_VERSION=0.1
 
 dnl #############################################################
 dnl #
@@ -642,6 +644,7 @@ AC_SUBST(USE_SHARED_LIBS)
 USE_STATIC_LIBS=$enable_static
 AC_SUBST(USE_STATIC_LIBS)
 AC_SUBST(STATIC_MODULES)
+AC_SUBST(RADIUSD_VERSION)
 export CFLAGS LIBS
 
 AC_OUTPUT(\
@@ -666,5 +669,6 @@ AC_OUTPUT_COMMANDS([
 cat >> src/include/autoconf.h <<EOF
 
 #define HOSTINFO       "$host"
+#define RADIUSD_VERSION "$RADIUSD_VERSION"
 EOF
 ],host=$host)
index 1abad34..9d4b9ea 100644 (file)
@@ -174,6 +174,7 @@ extern int          proxyfd;
 extern int             proxy_retry_count;
 extern int             proxy_retry_delay;
 extern int             spawn_flag;
+extern const char      *radiusd_version;
 
 /* Define a global config structure */
 extern struct main_config_t mainconfig;
index f5dcc2f..5515efa 100644 (file)
@@ -560,8 +560,8 @@ radius_snmp_init (void) {
         */
        memset(&rad_snmp, 0, sizeof(rad_snmp));
 
-       rad_snmp.auth.ident = "FreeRADIUS v0.1.0 " HOSTINFO;
-       rad_snmp.acct.ident = "FreeRADIUS v0.1.0 " HOSTINFO;
+       rad_snmp.auth.ident = radiusd_version;
+       rad_snmp.acct.ident = radiusd_version;
 
        rad_snmp.smux_event = SMUX_NONE;
        rad_snmp.smux_password = NULL;
index 771ef47..cb00b57 100644 (file)
@@ -110,6 +110,7 @@ int proxy_retry_count = RETRY_COUNT;
 int proxy_synchronous = TRUE;
 int need_reload = FALSE;
 struct main_config_t mainconfig;
+const char *radiusd_version = "FreeRADIUS Version " RADIUSD_VERSION ", for host " HOSTINFO ", built on " __DATE__ " at " __TIME__;
 
 static int got_child = FALSE;
 static int authfd;
index bae8d23..7c5d5f2 100644 (file)
@@ -32,18 +32,12 @@ static const char rcsid[] = "$Id$";
 #include "radiusd.h"
 
 /*
- *     Version number. This should ideally be created by autoconf
- *     or similar, so that this would always be up to date.
- */
-#define VERSION "FreeRADIUS ALPHA, built on " __DATE__ " at " __TIME__
-
-/*
  *     Display the revision number for this program
  */
 void version(void)
 {
 
-       fprintf(stderr, "%s: RADIUS version " VERSION ".\n", progname);
+       fprintf(stderr, "%s: %s\n", progname, radiusd_version);
        fprintf(stderr, "Compilation flags: ");
 
        /* here are all the conditional feature flags */