Add '--enable-wtmp' option to configure script to let users easily enable WTMP log support. If '--enable-wtmp' was given, check if 'utmp.h' is available on the system and bail out if header file could not be found. -- configure.ac | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index af57577..3706eb4 100644 --- a/configure.ac +++ b/configure.ac @@ -137,6 +137,12 @@ AC_ARG_ENABLE(iproute2, AC_DEFINE(CONFIG_FEATURE_IPROUTE, 1, [enable iproute2 support]) ) +AC_ARG_ENABLE(wtmp, + [ --enable-wtmp Enable WTMP support (--log-wtmp)], + [LOG_WTMP="$enableval"], + [LOG_WTMP="no"] +) + AC_ARG_ENABLE(strict, [ --enable-strict Enable strict compiler warnings (debugging option)], [STRICT="$enableval"], @@ -705,4 +711,13 @@ if test "$PASSWORD_SAVE" = "yes"; then AC_DEFINE(ENABLE_PASSWORD_SAVE, 1, [Allow --askpass and --auth-user-pass passwords to be read from a file]) fi +dnl enable wtmp logging +if test "$LOG_WTMP" = "yes"; then + + AC_CHECK_HEADER(utmp.h, + [AC_DEFINE(ENABLE_WTMP, 1, [Enable wtmp logging support])], + [AC_MSG_ERROR([WTMP headers not found])] + ) +fi + AC_OUTPUT(Makefile openvpn.spec)