-AC_CHECK_FUNCS([getaddrinfo])
-AC_CHECK_ICU([3.6],[ICU_CPPFLAGS="$ICU_CPPFLAGS -D HAVE_ICU=1"])
-AC_CONFIG_FILES([
+AC_SEARCH_LIBS([log],[m])
+AC_CHECK_HEADERS([sys/time.h sys/socket.h unistd.h netinet/in.h netdb.h arpa/inet.h])
+checkBoth=0
+AC_CHECK_FUNC([connect])
+if test "$ac_cv_func_connect" = "no"; then
+ AC_CHECK_LIB([socket],[main], LIBS="$LIBS -lsocket", checkBoth=1)
+fi
+if test "$checkBoth" = "1"; then
+ oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ AC_CHECK_FUNC([accept], , [LIBS=$oldLibs])
+fi
+AC_CHECK_FUNC([gethostbyname], ,[AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])])
+AC_CHECK_FUNCS([getaddrinfo mallinfo])
+
+if test -d ${srcdir}/.git; then
+ sha=`git show --pretty=format:%H|head -1`
+else
+ sha=`head -1 ${srcdir}/ChangeLog|awk '{print $2}'`
+fi
+AC_DEFINE_UNQUOTED([PAZPAR2_VERSION_SHA1], ["$sha"], [Git SHA1])
+
+AC_OUTPUT([