-dnl ** check for libdl & RTLD_NEXT
-
-dnl (Mac OS X only) ... but don't check if we already have the
-dnl HaskellSupport.framework
-
-if test $HaveFrameworkHaskellSupport = YES; then
- HaveLibDL=NO
- HaveRtldNext=NO
- HaveRtldLocal=YES
- AC_DEFINE([HAVE_RTLDLOCAL], [1], [Define to 1 if RTLD_LOCAL is available.])
- HaveRtldGlobal=YES
- AC_DEFINE([HAVE_RTLDGLOBAL], [1], [Define to 1 if RTLD_GLOBAL is available.])
- HaveRtldNow=YES
- AC_DEFINE([HAVE_RTLDNOW], [1], [Define to 1 if we can see RTLD_NOW in dlfcn.h.])
- AC_SUBST(HaveLibDL)
- AC_SUBST(HaveRtldNext)
- AC_SUBST(HaveRtldLocal)
- AC_SUBST(HaveRtldGlobal)
- AC_SUBST(HaveRtldNow)
-else
- AC_CHECK_LIB(dl, dlopen,
- [HaveLibDL=YES
- AC_DEFINE([HAVE_LIBDL], [1], [Define to 1 if you need -ldl to get dlopen().])
- LIBS="$LIBS -ldl"],
- [HaveLibDL=NO])
- AC_CHECK_FUNCS(dlopen)
- AC_SUBST(HaveLibDL)
-
- dnl ** sometimes RTLD_NEXT is hidden in #ifdefs we really don't wan to set
- AC_MSG_CHECKING(for RTLD_NEXT from dlfcn.h)
- AC_EGREP_CPP(yes,
- [
- #include <dlfcn.h>
- #ifdef RTLD_NEXT
- yes
- #endif
- ], [
- AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_RTLDNEXT], [1], [Define to 1 if we can see RTLD_NEXT in dlfcn.h.])
- HaveRtldNext=YES
- ], [
- AC_MSG_RESULT(no)
- HaveRtldNext=NO
- ])
- AC_SUBST(HaveRtldNext)
-
- dnl ** RTLD_LOCAL isn't available on cygwin or openbsd
- AC_MSG_CHECKING(for RTLD_LOCAL from dlfcn.h)
- AC_EGREP_CPP(yes,
- [
- #include <dlfcn.h>
- #ifdef RTLD_LOCAL
- yes
- #endif
- ], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_RTLDLOCAL)
- HaveRtldLocal=YES
- ], [
- AC_MSG_RESULT(no)
- HaveRtldLocal=NO
- ])
- AC_SUBST(HaveRtldLocal)
-
- dnl ** RTLD_GLOBAL isn't available on openbsd
- AC_MSG_CHECKING(for RTLD_GLOBAL from dlfcn.h)
- AC_EGREP_CPP(yes,
- [
- #include <dlfcn.h>
- #ifdef RTLD_GLOBAL
- yes
- #endif
- ], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_RTLDGLOBAL)
- HaveRtldGlobal=YES
- ], [
- AC_MSG_RESULT(no)
- HaveRtldGlobal=NO
- ])
- AC_SUBST(HaveRtldGlobal)
-
- dnl ** RTLD_NOW isn't available on openbsd
- AC_MSG_CHECKING(for RTLD_NOW from dlfcn.h)
- AC_EGREP_CPP(yes,
- [
- #include <dlfcn.h>
- #ifdef RTLD_NOW
- yes
- #endif
- ], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_RTLDNOW)
- HaveRtldNow=YES
- ], [
- AC_MSG_RESULT(no)
- HaveRtldNow=NO
- ])
- AC_SUBST(HaveRtldNow)
-fi
-
-dnl ---------- usleep ----------
-dnl --- stolen from guile configure ---
-dnl --- FIXME: /usr/include/unistd.h can't be right?
-
-### On some systems usleep has no return value. If it does have one,
-### we'd like to return it; otherwise, we'll fake it.
-AC_CACHE_CHECK([return type of usleep], cv_func_usleep_return_type,
- [AC_EGREP_HEADER(changequote(<, >)<void[ ]+usleep>changequote([, ]),
- /usr/include/unistd.h,
- [cv_func_usleep_return_type=void],
- [cv_func_usleep_return_type=int])])
-case "$cv_func_usleep_return_type" in
- "void" )
- AC_DEFINE([USLEEP_RETURNS_VOID], [1], [Define if the system headers declare usleep to return void.])
- ;;
-esac
-
-dnl --------------------------------------------------
-dnl * test for in_addr_t
-dnl --------------------------------------------------
-AC_MSG_CHECKING(for in_addr_t in netinet/in.h)
-AC_EGREP_HEADER(in_addr_t, netinet/in.h,
- [ AC_DEFINE([HAVE_IN_ADDR_T], [1], [Define to 1 if in_addr_t is available.]) AC_MSG_RESULT(yes) ],
- AC_MSG_RESULT(no))
-
-dnl --------------------------------------------------
-dnl * test for Linux sendfile(2)
-dnl --------------------------------------------------
-AC_MSG_CHECKING(for sendfile in sys/sendfile.h)
-AC_EGREP_HEADER(sendfile, sys/sendfile.h,
- [ AC_DEFINE([HAVE_LINUX_SENDFILE], [1], [Define to 1 if you have a Linux sendfile(2) implementation.]) AC_MSG_RESULT(yes) ],
- AC_MSG_RESULT(no))
-
-dnl --------------------------------------------------
-dnl * test for BSD sendfile(2)
-dnl --------------------------------------------------
-AC_MSG_CHECKING(for sendfile in sys/socket.h)
-AC_EGREP_HEADER(sendfile, sys/socket.h,
- [ AC_DEFINE([HAVE_BSD_SENDFILE], [1], [Define to 1 if you have a BSDish sendfile(2) implementation.]) AC_MSG_RESULT(yes) ],
- AC_MSG_RESULT(no))
-
-dnl --------------------------------------------------
-dnl * test for GTK+
-dnl --------------------------------------------------