])
-AC_DEFUN([AC_LIB_READLINE], [
+AC_DEFUN([VL_LIB_READLINE], [
AC_CACHE_CHECK([for a readline compatible library],
- ac_cv_lib_readline, [
- ORIG_LIBS=$LIBS
+ vl_cv_lib_readline, [
+ ORIG_LIBS="$LIBS"
for readline_lib in readline edit editline; do
for termcap_lib in "" termcap curses ncurses; do
if test -z "$termcap_lib"; then
TRY_LIB="-l$readline_lib -l$termcap_lib"
fi
LIBS="$ORIG_LIBS $TRY_LIB"
- AC_TRY_LINK_FUNC(readline, ac_cv_lib_readline="$TRY_LIB")
- if test -n "$ac_cv_lib_readline"; then
- LIBREADLINE="$TRY_LIB"
- AC_SUBST(LIBREADLINE)
+ AC_TRY_LINK_FUNC(readline, vl_cv_lib_readline="$TRY_LIB")
+ if test -n "$vl_cv_lib_readline"; then
break
fi
done
- if test -n "$ac_cv_lib_readline"; then
+ if test -n "$vl_cv_lib_readline"; then
break
fi
done
- if test -z "$ac_cv_lib_readline"; then
- ac_cv_lib_readline="no"
+ if test -z "$vl_cv_lib_readline"; then
+ vl_cv_lib_readline="no"
+ LIBS="$ORIG_LIBS"
fi
- LIBS=$ORIG_LIBS
])
- if test "$ac_cv_lib_readline" != "no"; then
+ if test "$vl_cv_lib_readline" != "no"; then
AC_DEFINE(HAVE_LIBREADLINE, 1,
[Define if you have a readline compatible library])
AC_CHECK_HEADERS(readline.h readline/readline.h)
AC_CACHE_CHECK([whether readline supports history],
- ac_cv_lib_readline_history, [
- ac_cv_lib_readline_history="no"
- AC_TRY_LINK_FUNC(add_history, ac_cv_lib_readline_history="yes")
+ vl_cv_lib_readline_history, [
+ vl_cv_lib_readline_history="no"
+ AC_TRY_LINK_FUNC(add_history, vl_cv_lib_readline_history="yes")
])
- if test "$ac_cv_lib_readline_history" = "yes"; then
+ if test "$vl_cv_lib_readline_history" = "yes"; then
AC_DEFINE(HAVE_READLINE_HISTORY, 1,
[Define if your readline library has \`add_history'])
AC_CHECK_HEADERS(history.h readline/history.h)
fi
fi
-])
+])dnl
AC_INCLUDE(aclocal.m4)
REGEX_EXTENDED
REGEX_PCRE
REGEX
-LIBREADLINE
DIRNAME
LOCATE
AUTOHEADER
ac_subst_files=''
ac_user_opts='
enable_option_checking
+enable_developer
enable_largefile
with_system_libltdl
with_system_libtool
with_dhcp
with_static_modules
with_modules
-enable_developer
with_experimental_modules
with_openssl
with_openssl_includes
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-developer Enables features of interest to developers.
--disable-largefile omit support for large files
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-strict-dependencies Fail configure on lack of module dependancy.
- --enable-developer Enables features of interest to developers.
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
PACKAGE=freeradius
+# Check whether --enable-developer was given.
+if test "${enable_developer+set}" = set; then :
+ enableval=$enable_developer; case "$enableval" in
+ no)
+ developer=no
+ ;;
+ *)
+ developer=yes
+ esac
+
+fi
+
+
+if test -d $srcdir/.git; then
+ if test "x$developer" != "xno"; then
+ developer="yes"
+ fi
+fi
+
+if test "x$developer" = "xyes"; then
+ : ${CFLAGS=-g3}
+fi
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
fi
-# Check whether --enable-developer was given.
-if test "${enable_developer+set}" = set; then :
- enableval=$enable_developer; case "$enableval" in
- no)
- developer=no
- ;;
- *)
- developer=yes
- esac
-
-fi
-
-
-if test -d $srcdir/.git; then
- if test "x$developer" != "xno"; then
- developer="yes"
- fi
-
- if test $GIT = yes; then
- RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1`
- fi
-fi
-
EXPERIMENTAL=
# Check whether --with-experimental-modules was given.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a readline compatible library" >&5
$as_echo_n "checking for a readline compatible library... " >&6; }
-if ${ac_cv_lib_readline+:} false; then :
+if ${vl_cv_lib_readline+:} false; then :
$as_echo_n "(cached) " >&6
else
- ORIG_LIBS=$LIBS
+ ORIG_LIBS="$LIBS"
for readline_lib in readline edit editline; do
for termcap_lib in "" termcap curses ncurses; do
if test -z "$termcap_lib"; then
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_readline="$TRY_LIB"
+ vl_cv_lib_readline="$TRY_LIB"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- if test -n "$ac_cv_lib_readline"; then
- LIBREADLINE="$TRY_LIB"
-
+ if test -n "$vl_cv_lib_readline"; then
break
fi
done
- if test -n "$ac_cv_lib_readline"; then
+ if test -n "$vl_cv_lib_readline"; then
break
fi
done
- if test -z "$ac_cv_lib_readline"; then
- ac_cv_lib_readline="no"
+ if test -z "$vl_cv_lib_readline"; then
+ vl_cv_lib_readline="no"
+ LIBS="$ORIG_LIBS"
fi
- LIBS=$ORIG_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline" >&5
-$as_echo "$ac_cv_lib_readline" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vl_cv_lib_readline" >&5
+$as_echo "$vl_cv_lib_readline" >&6; }
- if test "$ac_cv_lib_readline" != "no"; then
+ if test "$vl_cv_lib_readline" != "no"; then
$as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5
$as_echo_n "checking whether readline supports history... " >&6; }
-if ${ac_cv_lib_readline_history+:} false; then :
+if ${vl_cv_lib_readline_history+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_cv_lib_readline_history="no"
+ vl_cv_lib_readline_history="no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_readline_history="yes"
+ vl_cv_lib_readline_history="yes"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_history" >&5
-$as_echo "$ac_cv_lib_readline_history" >&6; }
- if test "$ac_cv_lib_readline_history" = "yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vl_cv_lib_readline_history" >&5
+$as_echo "$vl_cv_lib_readline_history" >&6; }
+ if test "$vl_cv_lib_readline_history" = "yes"; then
$as_echo "#define HAVE_READLINE_HISTORY 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for developer gcc flags" >&5
$as_echo_n "checking for developer gcc flags... " >&6; }
-if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
- devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wformat=2"
- CFLAGS="$CFLAGS $devflags"
- INSTALLSTRIP=""
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes. Using $devflags" >&5
+
+
+if test "x$developer" = "xyes"; then
+ if test "x$GCC" = "xyes"; then
+ devflags="-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wformat=2"
+ CFLAGS="$CFLAGS $devflags"
+ INSTALLSTRIP=""
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes. Using $devflags" >&5
$as_echo "yes. Using $devflags" >&6; }
+ fi
+
+ if test $GIT = yes; then
+ RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1`
+ fi
else
devflags=""
CFLAGS="$CFLAGS -DNDEBUG"
AC_CONFIG_SRCDIR(src/main/radiusd.c)
AC_CONFIG_HEADER(src/include/autoconf.h)
-dnl # The version of the software
+dnl #############################################################
+dnl #
+dnl # Custom hackery to discover version at configure time
+dnl #
+dnl #############################################################
RADIUSD_MAJOR_VERSION=`cat VERSION | sed 's/\..*//'`
RADIUSD_MINOR_VERSION=`cat VERSION | sed 's/^[[^\.]]*\.//' | sed 's/\..*$//'`
RADIUSD_VERSION_STRING=`cat VERSION`
PACKAGE=PACKAGE_MAIN
+dnl #############################################################
+dnl #
+dnl # Override some of the default autoconf variables such as
+dnl # CFLAGS if were building in developer mode
+dnl #
+dnl #############################################################
+
+dnl #
+dnl # Enable developer features like debugging symbols.
+dnl # These checks must be done before expanding the AC_PROG_CC
+dnl # and AC_PROG_CXX macros.
+dnl #
+AC_ARG_ENABLE(developer,
+[ --enable-developer Enables features of interest to developers.],
+[ case "$enableval" in
+ no)
+ developer=no
+ ;;
+ *)
+ developer=yes
+ esac ]
+)
+
+if test -d $srcdir/.git; then
+ if test "x$developer" != "xno"; then
+ dnl turn on the developer flag when taken from a git checkout (not a release)
+ developer="yes"
+ fi
+fi
+
+dnl #
+dnl # Autoconf sets -O2 and -g by default, but this is a PITA for debugging
+dnl # so we remove the defaults if were building in developer mode, and set
+dnl # -g3 so nice things like macro values are included. Other arguments are
+dnl # added later when we know what compiler were using.
+dnl #
+if test "x$developer" = "xyes"; then
+ : ${CFLAGS=-g3}
+fi
+
dnl #############################################################
dnl #
dnl # 0. Checks for compiler, libtool, and command line options.
done
])
-dnl #
-dnl # Enable developer C compiler warnings
-dnl #
-AC_ARG_ENABLE(developer,
-[ --enable-developer Enables features of interest to developers.],
-[ case "$enableval" in
- no)
- developer=no
- ;;
- *)
- developer=yes
- esac ]
-)
-
-if test -d $srcdir/.git; then
- if test "x$developer" != "xno"; then
- dnl turn on the developer flag when taken from a git checkout (not a release)
- developer="yes"
- fi
-
- dnl append the current git hash onto the version string
- if test $GIT = yes; then
- RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1`
- fi
-fi
-
dnl extra argument: --with-experimental-modules
EXPERIMENTAL=
AC_ARG_WITH(experimental-modules,
],
[ AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer.]) ])
-AC_LIB_READLINE
+VL_LIB_READLINE
dnl #############################################################
dnl #
AC_SUBST(LIBPREFIX)
AC_MSG_CHECKING(for developer gcc flags)
-if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
- devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wformat=2"
- CFLAGS="$CFLAGS $devflags"
- INSTALLSTRIP=""
- AC_MSG_RESULT(yes. Using $devflags)
+
+
+if test "x$developer" = "xyes"; then
+ if test "x$GCC" = "xyes"; then
+ devflags="-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wformat=2"
+ CFLAGS="$CFLAGS $devflags"
+ INSTALLSTRIP=""
+ AC_MSG_RESULT(yes. Using $devflags)
+ fi
+
+ dnl append the current git hash onto the version string
+ if test $GIT = yes; then
+ RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1`
+ fi
else
devflags=""
CFLAGS="$CFLAGS -DNDEBUG"