From e966a6b3e056aafcb4760066efc9c0b0e31c1e29 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 5 Aug 1999 10:21:28 +0000 Subject: [PATCH] Add check for syslog facilities and priorities tables in syslog.h --- aclocal.m4 | 20 ++++++++++++++++ config.h.in | 3 +++ configure | 68 ++++++++++++++++++++++++++++++++++++++++------------ configure.in | 7 +++++- 4 files changed, 82 insertions(+), 16 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 12e8adc6d..3fafe9d86 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -304,3 +304,23 @@ rm -f conftestdata AC_MSG_RESULT($sudo_cv_uid_t_len) AC_DEFINE_UNQUOTED(MAX_UID_T_LEN, $sudo_cv_uid_t_len) ]) + +dnl +dnl check for facilitynames and prioritynames in syslog.h +dnl 4.4BSD has these but most others do not. +dnl +AC_DEFUN(SUDO_SYSLOG_NAMES, +[AC_MSG_CHECKING(for facilitynames and prioritynames in syslog.h) +AC_CACHE_VAL(sudo_cv_syslog_names, +[ +AC_TRY_COMPILE([ +#define SYSLOG_NAMES +#include +#include +], [ CODE *p=&prioritynames[0]; CODE *f=&facilitynames[0]; ], +sudo_cv_syslog_names=yes, sudo_cv_syslog_names=no)])dnl +AC_MSG_RESULT($sudo_cv_syslog_names) +if test $sudo_cv_syslog_names = yes; then + AC_DEFINE(HAVE_SYSLOG_NAMES) +fi +]) diff --git a/config.h.in b/config.h.in index 8763714f1..1d9d7de83 100644 --- a/config.h.in +++ b/config.h.in @@ -426,6 +426,9 @@ /* Define to be the max chars per log line (for line wrapping). */ #undef MAXLOGFILELEN +/* Define if your syslog.h has the prioritynames and facilitynames tables. */ +#undef HAVE_SYSLOG_NAMES + /* Define if you want to ignore '.' and '' in $PATH */ #undef IGNORE_DOT_PATH diff --git a/configure b/configure index f13905217..618c81962 100755 --- a/configure +++ b/configure @@ -1087,7 +1087,7 @@ if test "${with_logging+set}" = set; then yes) echo "Must give --with-logging an argument." exit 1 ;; - no) echo "Sorry, --without-logfile not supported." + no) echo "Sorry, --without-logging not supported." exit 1 ;; syslog) cat >> confdefs.h <<\EOF @@ -7288,9 +7288,47 @@ fi fi +echo $ac_n "checking for facilitynames and prioritynames in syslog.h""... $ac_c" 1>&6 +echo "configure:7293: checking for facilitynames and prioritynames in syslog.h" >&5 +if eval "test \"`echo '$''{'sudo_cv_syslog_names'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +#include + +int main() { + CODE *p=&prioritynames[0]; CODE *f=&facilitynames[0]; +; return 0; } +EOF +if { (eval echo configure:7310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + sudo_cv_syslog_names=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + sudo_cv_syslog_names=no +fi +rm -f conftest* +fi +echo "$ac_t""$sudo_cv_syslog_names" 1>&6 +if test $sudo_cv_syslog_names = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYSLOG_NAMES 1 +EOF + +fi + + if test "$with_kerb5" = "yes"; then echo $ac_n "checking for krb5_get_init_creds_opt in -lkrb5""... $ac_c" 1>&6 -echo "configure:7294: checking for krb5_get_init_creds_opt in -lkrb5" >&5 +echo "configure:7332: checking for krb5_get_init_creds_opt in -lkrb5" >&5 if test -n ""; then ac_lib_var=`echo krb5'_'krb5_get_init_creds_opt | sed 'y% ./+-%___p_%'` else @@ -7302,7 +7340,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lkrb5 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7372,21 +7410,21 @@ EOF if test "$with_kerb5" = "yes"; then echo $ac_n "checking for -lkrb4""... $ac_c" 1>&6 -echo "configure:7376: checking for -lkrb4" >&5 +echo "configure:7414: checking for -lkrb4" >&5 if eval "test \"`echo '$''{'ac_cv_lib_krb4'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lkrb4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_lib_krb4=yes else @@ -7407,21 +7445,21 @@ else fi echo $ac_n "checking for -ldes""... $ac_c" 1>&6 -echo "configure:7411: checking for -ldes" >&5 +echo "configure:7449: checking for -ldes" >&5 if eval "test \"`echo '$''{'ac_cv_lib_des'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldes $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_lib_des=yes else @@ -7442,21 +7480,21 @@ fi SUDO_LIBS="${SUDO_LIBS} -ldes425 -lkrb5 -lcrypto -lcom_err" else echo $ac_n "checking for -ldes""... $ac_c" 1>&6 -echo "configure:7446: checking for -ldes" >&5 +echo "configure:7484: checking for -ldes" >&5 if eval "test \"`echo '$''{'ac_cv_lib_des'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldes $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_lib_des=yes else @@ -7580,7 +7618,7 @@ if test "$with_authenticate" = "yes"; then fi echo $ac_n "checking for log file location""... $ac_c" 1>&6 -echo "configure:7584: checking for log file location" >&5 +echo "configure:7622: checking for log file location" >&5 if test -n "$with_logpath"; then echo "$ac_t""$with_logpath" 1>&6 cat >> confdefs.h <&6 -echo "configure:7614: checking for timestamp file location" >&5 +echo "configure:7652: checking for timestamp file location" >&5 if test -n "$with_timedir"; then echo "$ac_t""$with_timedir" 1>&6 cat >> confdefs.h <