summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorToby Gray <toby.gray@realvnc.com>2013-07-09 16:05:39 +0100
committerPete Batard <pete@akeo.ie>2013-08-09 01:55:04 +0100
commit9222a548bdea026c89057b65caf2832785ea702e (patch)
tree741eb234bb044a1f367fbd4f9393b117f647767c /configure.ac
parentb50a433c164996761344efb6c90594de7906fe56 (diff)
downloadlibusb-9222a548bdea026c89057b65caf2832785ea702e.tar.gz
Core: Add compile time option to use native OS logging facility
* This change makes it easier to debug issues in UI applications which don't necessarily have a console connected to stderr. * Outputting to the debugger shouldn't occur in normal situations so this change has to be explicitly enabled by a build-time config flag. * Uses OutputDebugString() on Windows platforms or the syslog facility on other OSes, if available. * Also align the report of configure defaults to autotool's.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 20 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 669fcf8..72ed647 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,7 @@ linux)
AC_SUBST(OS_LINUX)
AC_SEARCH_LIBS(clock_gettime, rt, [], [], -pthread)
AC_ARG_ENABLE([udev],
- [AC_HELP_STRING([--enable-udev], [use udev for device enumeration and hotplug support (recommended, default: yes)])],
+ [AC_HELP_STRING([--enable-udev], [use udev for device enumeration and hotplug support (recommended) [default=yes]])],
[], [enable_udev="yes"])
if test "x$enable_udev" = "xyes" ; then
# system has udev. use it or fail!
@@ -158,7 +158,7 @@ fi
AC_CHECK_HEADER([sys/timerfd.h], [timerfd_h=1], [timerfd_h=0])
AC_ARG_ENABLE([timerfd],
[AS_HELP_STRING([--enable-timerfd],
- [use timerfd for timing (default auto)])],
+ [use timerfd for timing [default=auto]])],
[use_timerfd=$enableval], [use_timerfd='auto'])
if test "x$use_timerfd" = "xyes" -a "x$timerfd_h" = "x0"; then
@@ -193,23 +193,38 @@ if test "x$log_enabled" != "xno"; then
fi
AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log],
- [start with debug message logging enabled (default n)])],
+ [start with debug message logging enabled [default=no]])],
[debug_log_enabled=$enableval],
[debug_log_enabled='no'])
if test "x$debug_log_enabled" != "xno"; then
AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Start with debug message logging enabled])
fi
+AC_ARG_ENABLE([system-log], [AS_HELP_STRING([--enable-system-log],
+ [output logging messages to system wide log, if supported by the OS [default=no]])],
+ [system_log_enabled=$enableval],
+ [system_log_enabled='no'])
+if test "x$system_log_enabled" != "xno"; then
+ AC_DEFINE([USE_SYSTEM_LOGGING_FACILITY], 1, [Enable output to system log])
+fi
+
+# Check if syslog is available in standard C library
+AC_CHECK_HEADERS(syslog.h)
+AC_CHECK_FUNC([syslog], [have_syslog=yes], [have_syslog=no])
+if test "x$have_syslog" != "xno"; then
+ AC_DEFINE([HAVE_SYSLOG_FUNC], 1, [syslog() function available])
+fi
+
# Examples build
AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],
- [build example applications (default n)])],
+ [build example applications [default=no]])],
[build_examples=$enableval],
[build_examples='no'])
AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"])
# Tests build
AC_ARG_ENABLE([tests-build], [AS_HELP_STRING([--enable-tests-build],
- [build test applications (default n)])],
+ [build test applications [default=no]])],
[build_tests=$enableval],
[build_tests='no'])
AM_CONDITIONAL([BUILD_TESTS], [test "x$build_tests" != "xno"])