]> git.meshlink.io Git - catta/blobdiff - configure.ac
* many trivial fix to make avahi compile on OpenBSD
[catta] / configure.ac
index ecc112081b674a75025648ed5e23e584aadde154..531e015701966f5cc2d8a30e26a643b9dbfae60e 100644 (file)
@@ -155,26 +155,30 @@ test_gcc_flag() {
 # If using GCC specify some additional parameters
 if test "x$GCC" = "xyes" ; then
 
-    DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wlarger-than-4000 -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter"
-
-    # Test whether rtnetlink.h can be included when compiled with -std=c99
-    # some distributions (e.g. archlinux) have broken headers that dont
-    # define __u64 with -std=c99
-    AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
-    OLDCFLAGS="$CFLAGS"
-    CFLAGS="-std=c99"
-    AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
-        use_stdc99=yes, use_stdc99=no)
-
-    if test x"$use_stdc99" = xyes; then
-        DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
-        AC_MSG_RESULT([yes])
+    DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline"
+
+    if test "x$HAVE_NETLINK" = "xyes" ; then
+        # Test whether rtnetlink.h can be included when compiled with -std=c99
+        # some distributions (e.g. archlinux) have broken headers that dont
+        # define __u64 with -std=c99
+        AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
+        OLDCFLAGS="$CFLAGS"
+        CFLAGS="-std=c99"
+        AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
+            use_stdc99=yes, use_stdc99=no)
+
+        if test x"$use_stdc99" = xyes; then
+            DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
+            AC_MSG_RESULT([yes])
+        else
+            AC_MSG_RESULT([no])
+        fi
+
+        CFLAGS="$OLDCFLAGS"
     else
-        AC_MSG_RESULT([no])
+        DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
     fi
 
-    CFLAGS="$OLDCFLAGS"
-
     for flag in $DESIRED_FLAGS ; do
         AC_MSG_CHECKING([whether $CC accepts $flag])
         if test_gcc_flag $flag ; then 
@@ -202,7 +206,7 @@ AC_FUNC_MEMCMP
 AC_FUNC_SELECT_ARGTYPES
 AC_FUNC_MALLOC
 AC_FUNC_REALLOC
-AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid strcasecmp gettimeofday putenv strncasecmp strlcpy gethostbyname])
+AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid setresgid setregid strcasecmp gettimeofday putenv strncasecmp strlcpy gethostbyname seteuid setegid])
 
 AC_FUNC_CHOWN
 AC_FUNC_STAT
@@ -388,6 +392,28 @@ if test "x$HAVE_EXPAT" = "xyes" ; then
 fi
 AM_CONDITIONAL(HAVE_EXPAT, test "x$HAVE_EXPAT" = "xyes")
 
+#
+# GDBM
+#
+AC_ARG_ENABLE(gdbm,
+        AS_HELP_STRING([--disable-gdbm],[Disable use of GDBM]),
+        [case "${enableval}" in
+                yes) HAVE_GDBM=yes ;;
+                no)  HAVE_GDBM=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --enable-gdbm) ;;
+        esac],
+        [HAVE_GDBM=yes]) 
+
+if test "x$HAVE_GDBM" = "xyes" ; then
+    AC_CHECK_LIB(gdbm, gdbm_open, [ AC_CHECK_HEADERS(gdbm.h, have_gdbm=true, have_gdbm=false) ], have_gdbm=false)
+
+    if ! $have_gdbm ; then
+        AC_MSG_WARN([*** libgdbm not found ***])
+    fi
+    AC_DEFINE([HAVE_GDBM],[],[Support for GDBM])
+fi
+AM_CONDITIONAL(HAVE_GDBM, test "x$HAVE_GDBM" = "xyes")
+
 #
 # libdaemon
 #
@@ -692,6 +718,7 @@ echo "
     Enable GTK:             ${HAVE_GTK}
     Enable D-BUS:           ${HAVE_DBUS}
     Enable Expat:           ${HAVE_EXPAT}
+    Enable GDBM:            ${HAVE_GDBM}
     Enable libdaemon:       ${HAVE_LIBDAEMON}
     Enable Python:          ${HAVE_PYTHON}
     Enable pygtk:           ${HAVE_PYGTK}