]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - configure.ac
database: Correctly handle error codes from OpenSSL
[people/ms/libloc.git] / configure.ac
index 57c5b0499c3f17131d0c2f84e37299188de35d47..518f5b5d469b84e2659abcff7db86e33a91110cd 100644 (file)
@@ -1,6 +1,6 @@
 AC_PREREQ(2.60)
 AC_INIT([libloc],
-        [0],
+        [0.9.0],
         [michael.tremer@ipfire.org],
         [libloc],
         [https://www.ipfire.org/])
@@ -62,7 +62,8 @@ AS_IF([test "x$enable_debug" = "xyes"], [
 
 AC_CHECK_HEADERS_ONCE([
        arpa/inet.h \
-    arpa/nameser.h \
+       arpa/nameser.h \
+       arpa/nameser_compat.h \
        endian.h \
        netinet/in.h \
     resolv.h \
@@ -149,8 +150,22 @@ AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl], [do not build the perl modu
 AM_CONDITIONAL(ENABLE_PERL, test "$enable_perl" = "yes")
 
 dnl Checking for libresolv
-AC_CHECK_LIB(resolv, ns_msg_getflag, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
+case "${host}" in
+       *-gnu*)
+               AC_CHECK_LIB(resolv, ns_msg_getflag, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
+               ;;
+       *)
+               AC_CHECK_LIB(resolv, res_init, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
+               ;;
+esac
 RESOLV_LIBS="${LIBS}"
+AC_SUBST(RESOLV_LIBS)
+
+dnl Checking for OpenSSL
+LIBS=
+AC_CHECK_LIB(crypto, EVP_EncryptInit,, AC_MSG_ERROR([libcrypto has not been found]))
+OPENSSL_LIBS="${LIBS}"
+AC_SUBST(OPENSSL_LIBS)
 
 AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_FILES([