AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([dlsym() is required])])
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],[enable debug output])],
+ [if test "x$enableval" = xyes; then
+ AC_DEFINE([DEBUG], 1, [Define to 1 enable debug output.])
+ fi])
+
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
/* Necessary for RTLD_NEXT. */
#define _GNU_SOURCE
+#include <config.h>
+
#include <assert.h>
#include <dlfcn.h>
#include <errno.h>
static int get_log_level(void) {
const char *level = getenv("SOCKET2UNIX_DEBUG");
if (!level) {
+#ifdef DEBUG
+ return LOG_LEVEL_DEBUG;
+#else
return LOG_LEVEL_WARNING;
+#endif
}
int number = atoi(level);
if (number <= 0 || number > LOG_LEVEL_DEBUG) {