+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([