]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Look for syslog's facilitynames[]
authorHarlan Stenn <stenn@ntp.org>
Sat, 11 Aug 2012 08:28:13 +0000 (04:28 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 11 Aug 2012 08:28:13 +0000 (04:28 -0400)
bk: 5026179dCHXoJ85LbpOgfW0xQcs6kw

ChangeLog
configure.ac
sntp/configure.ac
sntp/m4/ntp_facilitynames.m4 [new file with mode: 0644]

index f6d0025d763d216994ea9bd803a5e75da64ac81b..503f4295c4ac5635d1b5a50c338476024a79646b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* Look for syslog's facilitynames[].
 (4.2.7p294) 2012/08/08 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2242] configure fails to detect getifaddrs function on Solaris.
 * [Bug 2249] Bad operator for 'test' in 'make check' of libevent.
index 5bb0e22d5695d3e4ffc45e04afe3a4e95b335ef9..a0b1ead124fa34218e16d5bd85adbca043a82930 100644 (file)
@@ -186,6 +186,8 @@ esac
 # HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP
 AC_SEARCH_LIBS([openlog], [gen syslog])
 
+NTP_FACILITYNAMES
+
 dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
 dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
 dnl so only use one of them.  Linux (glibc-2.1.2 and -2.2.2, at least)
index fd56544a7e9117ca728cb5b7283f4304c0eac8ab..348a4fdb97c51d3ddb731a4843aea13cbfec4295 100644 (file)
@@ -110,6 +110,7 @@ AC_SEARCH_LIBS([openlog], [gen syslog])
 
 # Checks for header files.
 AC_CHECK_HEADERS([netdb.h string.h strings.h syslog.h])
+NTP_FACILITYNAMES
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STDBOOL
diff --git a/sntp/m4/ntp_facilitynames.m4 b/sntp/m4/ntp_facilitynames.m4
new file mode 100644 (file)
index 0000000..f58f894
--- /dev/null
@@ -0,0 +1,24 @@
+dnl ######################################################################
+dnl Check syslog.h for 'facilitynames' table
+AC_DEFUN([NTP_FACILITYNAMES], [
+AC_CACHE_CHECK([for facilitynames in syslog.h],ac_cv_HAVE_SYSLOG_FACILITYNAMES,[
+AC_TRY_COMPILE([
+#define SYSLOG_NAMES
+#include <stdlib.h>
+#include <syslog.h>
+],
+[ void *fnames; fnames = facilitynames; ],
+ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes,ac_cv_HAVE_SYSLOG_FACILITYNAMES=no,ac_cv_HAVE_SYSLOG_FACILITYNAMES=cross)])
+case "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" in
+ yes)
+    AC_DEFINE(HAVE_SYSLOG_FACILITYNAMES,1,[ ])
+    ;;
+ no)
+    AC_MSG_WARN([No facilitynames in <syslog.h>])
+    ;;
+ cross)
+    AC_MSG_WARN([facilitynames in <syslog.h> - cross-compiling])
+    ;;
+esac
+])
+dnl ======================================================================