-AC_OUTPUT([Makefile src/Makefile cipher/Makefile cipher/blowfish/Makefile
-doc/Makefile lib/Makefile m4/Makefile redhat/Makefile])
+AC_CHECK_LIB(dl, dlopen, [
+ LIBS="$LIBS -ldl"
+])
+
+
+dnl Crypto stuff
+
+libcrypto=none
+AC_CHECK_LIB(crypto, SHA1_version, [
+ libcrypto=yes
+])
+
+if test $libcrypto = none; then
+ AC_MSG_ERROR(It seems like OpenSSL is not installed on this system.)
+else
+ LIBS="$LIBS -lcrypto"
+fi
+
+
+dnl Support for SunOS
+
+AC_CHECK_FUNC(socket, [], [
+ AC_CHECK_LIB(socket, connect)
+])
+AC_CHECK_FUNC(gethostbyname, [], [
+ AC_CHECK_LIB(nsl, gethostbyname)
+])
+
+AC_OUTPUT([Makefile src/Makefile cipher/Makefile
+doc/Makefile intl/Makefile lib/Makefile
+m4/Makefile po/Makefile.in redhat/Makefile debian/Makefile])