SQL_ODBC_INCLUDE = @ODBC_INCLUDE@
#
-# Make version info available to the build targets and linker
+# Version to use for packaging and other Make related things
#
-RADIUSD_MAJOR_VERSION = @RADIUSD_MAJOR_VERSION@
-RADIUSD_MINOR_VERSION = @RADIUSD_MINOR_VERSION@
-RADIUSD_INCRM_VERSION = @RADIUSD_INCRM_VERSION@
-RADIUSD_VERSION = @RADIUSD_VERSION@
-RADIUSD_VERSION_STRING = @RADIUSD_VERSION_STRING@
-RADIUSD_VERSION_COMMIT = @RADIUSD_VERSION_COMMIT@
-
-CFLAGS += -DRADIUSD_MAJOR_VERSION=\"${RADIUSD_MAJOR_VERSION}\"
-CFLAGS += -DRADIUSD_MINOR_VERSION=\"${RADIUSD_MINOR_VERSION}\"
-CFLAGS += -DRADIUSD_INCRM_VERSION=\"${RADIUSD_INCRM_VERSION}\"
-CFLAGS += -DRADIUSD_VERSION=\"${RADIUSD_VERSION}\"
-CFLAGS += -DRADIUSD_VERSION_STRING=\"${RADIUSD_VERSION_STRING}\"
-
-ifdef RADIUSD_VERSION_COMMIT
-CFLAGS += -DRADIUSD_VERSION_COMMIT=\"${RADIUSD_VERSION_COMMIT}\"
-endif
+RADIUSD_VERSION_STRING = @RADIUSD_VERSION_STRING@
#
# This allows dlopen to do runtime checks for version mistmatches
#
ifeq "$(BOILER)" "yes"
-# Require at least GNU Make 3.81 for the new build system
-# Don't allow 3.80. Allow any 3.8x. This will need to be changed
-# in a decade or two when GNU Make 3.90 is released.
-BOILERMAKE=$(subst 3.8,yes,$(subst 3.80,,$(MAKE_VERSION)))
-
-# The version of GNU Make is too old, don't use it.
-ifeq "" "$(findstring yes,$(BOILERMAKE))"
+# The version of GNU Make is too old, don't use it (.FEATURES variable was
+# wad added in 3.81)
+ifndef .FEATURES
$(error The build system requires GNU Make 3.81 or later.)
endif
enable_option_checking=no
ac_subst_vars='LTLIBOBJS
LIBOBJS
-RADIUSD_VERSION_COMMIT
-RADIUSD_VERSION_STRING
-RADIUSD_VERSION
-RADIUSD_INCRM_VERSION
-RADIUSD_MINOR_VERSION
-RADIUSD_MAJOR_VERSION
STATIC_MODULES
USE_STATIC_LIBS
USE_SHARED_LIBS
CFLAGS
CC
MAKEFLAGS
+RADIUSD_VERSION_STRING
target_alias
host_alias
build_alias
'{ printf "%02i%02i%02i", major, minor, incrm }'`
RADIUSD_VERSION_STRING=`cat VERSION`
-PACKAGE=freeradius
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define RADIUSD_VERSION ${RADIUSD_VERSION}
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define RADIUSD_VERSION_STRING "${RADIUSD_VERSION_STRING}"
+_ACEOF
+
# Check whether --enable-developer was given.
if test -d $srcdir/.git -a "x$GIT" = "xyes"; then
RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1`
+
+cat >>confdefs.h <<_ACEOF
+#define RADIUSD_VERSION_COMMIT "${RADIUSD_VERSION_COMMIT}"
+_ACEOF
+
fi
-
-
-
-
-
-
unset ac_cv_env_LIBS_set
unset ac_cv_env_LIBS_value
AC_PREREQ([2.59])
export CFLAGS LIBS LDFLAGS CPPFLAGS
-m4_define(PACKAGE_MAIN, freeradius)
-
-AC_INIT(PACKAGE_MAIN,[$]Id[$],http://bugs.freeradius.org,,http://www.freeradius.org)
-AC_CONFIG_SRCDIR(src/main/radiusd.c)
-AC_CONFIG_HEADER(src/include/autoconf.h)
+AC_INIT([freeradius],[$]Id[$],[http://bugs.freeradius.org],,[http://www.freeradius.org])
+AC_CONFIG_SRCDIR([src/main/radiusd.c])
+AC_CONFIG_HEADER([src/include/autoconf.h])
dnl #############################################################
dnl #
dnl # Still useful for custom builds
RADIUSD_VERSION_STRING=`cat VERSION`
-PACKAGE=PACKAGE_MAIN
+
+dnl #
+dnl # Add definitions to Make.inc as it's used by various build targets
+dnl #
+AC_SUBST([RADIUSD_VERSION_STRING])
+
+dnl #
+dnl # Add definitions to autoconf.h, so that the headers that we install
+dnl # contain the version number of the server.
+dnl #
+AC_DEFINE_UNQUOTED([RADIUSD_VERSION], [${RADIUSD_VERSION}], [Version integer in format <ma><ma><mi><mi><in><in>])
+AC_DEFINE_UNQUOTED([RADIUSD_VERSION_STRING], ["${RADIUSD_VERSION_STRING}"], [Raw version string from VERSION file])
dnl #############################################################
dnl #
dnl append the current git hash onto the version string
if test -d $srcdir/.git -a "x$GIT" = "xyes"; then
RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1`
+ AC_DEFINE_UNQUOTED([RADIUSD_VERSION_COMMIT],["${RADIUSD_VERSION_COMMIT}"],[Commit HEAD at time of configuring])
fi
FR_TLS
USE_STATIC_LIBS=$enable_static
AC_SUBST(USE_STATIC_LIBS)
AC_SUBST(STATIC_MODULES)
-AC_SUBST(RADIUSD_MAJOR_VERSION)
-AC_SUBST(RADIUSD_MINOR_VERSION)
-AC_SUBST(RADIUSD_INCRM_VERSION)
-AC_SUBST(RADIUSD_VERSION)
-AC_SUBST(RADIUSD_VERSION_STRING)
-AC_SUBST(RADIUSD_VERSION_COMMIT)
AC_OUTPUT(\
./Make.inc \
@$(ECHO) HEADER $@
@cp $< $@
@grep "^#define[[:blank:]]\{1,\}WITH_" src/include/autoconf.h >> $@
+ @grep "^#define[[:blank:]]\{1,\}RADIUSD_VERSION" src/include/autoconf.h >> $@
src/include/missing.h: src/include/missing-h src/include/autoconf.sed
@$(ECHO) HEADER $@
/* Posix-Style ctime_r */
#undef POSIXSTYLE
+/* Version integer in format <ma><ma><mi><mi><in><in> */
+#undef RADIUSD_VERSION
+
+/* Commit HEAD at time of configuring */
+#undef RADIUSD_VERSION_COMMIT
+
+/* Raw version string from VERSION */
+#undef RADIUSD_VERSION_STRING
+
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
#define DHCP_VEND_LEN (308)
#define DHCP_OPTION_MAGIC_NUMBER (0x63825363)
+const char *dhclient_version = "dhclient version " RADIUSD_VERSION_STRING
+#ifdef RADIUSD_VERSION_COMMIT
+" (git #" RADIUSD_VERSION_COMMIT ")"
+#endif
+", built on " __DATE__ " at " __TIME__;
+
static void NEVER_RETURNS usage(void)
{
fprintf(stderr, "Usage: dhclient [options] server[:port] <command>\n");
timeout = atof(optarg);
break;
case 'v':
- printf("dhclient: $Id$ built on " __DATE__ " at " __TIME__ "\n");
+ printf("%s\n", dhclient_version);
exit(0);
break;
case 'x':
timeout = atof(optarg);
break;
case 'v':
- printf("%s", radclient_version);
+ printf("%s\n", radclient_version);
exit(0);
break;
case 'x':
#ifdef RADIUSD_VERSION_COMMIT
" (git #" RADIUSD_VERSION_COMMIT ")"
#endif
-;
+", built on " __DATE__ " at " __TIME__;
/*
#ifdef RADIUSD_VERSION_COMMIT
" (git #" RADIUSD_VERSION_COMMIT ")"
#endif
-;
+", built on " __DATE__ " at " __TIME__;
static int filter_packet(RADIUS_PACKET *packet)
{