* openbsd has no -lresolv, its in their libc.
authorWilfried Göesgens <willi@citadel.org>
Sun, 13 Jan 2008 19:39:55 +0000 (19:39 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 13 Jan 2008 19:39:55 +0000 (19:39 +0000)
* TODO: can we get rid of AM macros, as we don't require automake in the whole other configure?
* socket.h requires types.h

citadel/configure.ac
citadel/threads.c

index cb7ed9be863357c5004bf0ca36e52cfcdede4b57..8f7f4495ace31e885b8918ff0079fb6bb9e8d5e2 100644 (file)
@@ -289,9 +289,9 @@ AC_SUBST(DEPEND_FLAG)
 
 AC_PROG_INSTALL
 AC_PROG_YACC
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+dnl missing_dir=`cd $ac_aux_dir && pwd`
+dnl AC_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+dnl AC_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
 
 dnl Checks for system services.
 
@@ -381,13 +381,20 @@ dnl (Linux shadow passwords)
                fi
        fi
 
-test -f /usr/local/lib/libresolv.a && LDFLAGS="$LDFLAGS -L/usr/local/lib"
-AC_CHECK_LIB(resolv, res_query,
-       RESOLV="$RESOLV -lresolv",
-       [
-               AC_MSG_ERROR(libresolv was not found.  Citadel requires the resolver library.)
-       ]
-)
+case "`uname -a`" in 
+ OpenBSD*)
+       echo "we don't need to check for resolv on openbsd"  
+       ;;
+ *)
+       test -f /usr/local/lib/libresolv.a && LDFLAGS="$LDFLAGS -L/usr/local/lib"
+       AC_CHECK_LIB(resolv, res_query,
+               RESOLV="$RESOLV -lresolv",
+               [
+                       AC_MSG_ERROR(libresolv was not found.  Citadel requires the resolver library.)
+               ]
+       )
+       ;;
+esac
 
 if test "x$with_ncurses" != "xno"; then
        AC_SEARCH_LIBS(tgetent, [ncurses curses termcap])
@@ -759,6 +766,7 @@ dnl AC_CHECK_FUNCS(res_query)
 AC_CACHE_CHECK([for the resolver calls], 
               ac_cv_resquery_ok, 
 [AC_TRY_COMPILE([#include <netinet/in.h>
+#include <sys/types.h>
 #include <arpa/nameser.h>
 #include <resolv.h>], 
                [
index 6e95ed3b3d017d83510e1c84ead9609299de1d85..9dee678ffe350ef1e0575f052dc1ead0fa8a07ae 100644 (file)
@@ -8,6 +8,7 @@
  *
  */
 
+#include <sys/types.h>
 #include <errno.h>
 #include <sys/socket.h>
 #include <unistd.h>