1 AC_INIT([mbuffer],[20150412])
2 AC_CONFIG_HEADER([config.h])
3 AC_CONFIG_SRCDIR([mbuffer.c])
8 if test "${LD_LIBRARY_PATH}" != "" ; then
10 echo " WARNING: LD_LIBRARY_PATH is set. This can cause severe problems!!!"
11 echo " Please learn about using RUNPATH instead of LD_LIBRARY_PATH - e.g. here:"
12 echo " - http://prefetch.net/articles/linkers.badldlibrary.html"
13 echo " - http://blogs.sun.com/ali/entry/avoiding_ld_library_path_the"
14 echo " For gcc, you can pass LDFLAGS=\"-R/usr/local/lib\" to configure,"
15 echo " instead of setting LD_LIBRARY_PATH."
20 AC_PREFIX_DEFAULT(/usr/local)
21 test "$prefix" = NONE && prefix=/usr/local
22 test "$exec_prefix" = NONE && exec_prefix=$prefix
32 if test "${USRCFLAGS}" = "" ; then
33 if test "${GCC}" = "yes" ; then
34 CFLAGS="${CFLAGS} -O2 -Wall"
35 cflags_tmp="${CFLAGS}"
36 CFLAGS="${CFLAGS} -m64"
37 AC_MSG_CHECKING([whether $CC supports $CFLAGS])
38 AC_RUN_IFELSE([AC_LANG_PROGRAM([])],
39 [AC_MSG_RESULT([yes])],
44 SUNCCVERSION=`${CC} -V 2>&1 | grep Sun`
46 if test "${SUNCC}" == "0" ; then
49 HAS_M64=`${CC} -flags | grep m64`
50 if test "${HAS_M64}" != "" ; then
51 CFLAGS="${CFLAGS} -m64"
52 AC_MSG_CHECKING([whether $CC supports $CFLAGS])
53 AC_RUN_IFELSE([AC_LANG_PROGRAM([])],
54 [AC_MSG_RESULT([yes])],
59 CFLAGS="${CFLAGS} -xarch=generic64"
60 AC_MSG_CHECKING([whether $CC supports $CFLAGS])
61 AC_RUN_IFELSE([AC_LANG_PROGRAM([])],
62 [AC_MSG_RESULT([yes])],
78 AC_PATH_PROG(MT,mt,AC_MSG_WARN(could not find the program mt - you might need this if you want autoloader support))
84 AC_CHECK_LIB(pthread, pthread_mutex_init)
85 AC_SEARCH_LIBS(clock_gettime,rt,,AC_MSG_ERROR(could not find the library containing clock_gettime!))
86 AC_SEARCH_LIBS(sem_init,rt posix,,AC_MSG_ERROR(could not find semaphore functions!))
87 AC_SEARCH_LIBS(rint,m,,AC_MSG_ERROR(unable to find rint))
88 AC_SEARCH_LIBS(seteuid,c,AC_DEFINE([HAVE_SETEUID], [1], [Define to 1 if you have the seteuid() function]),)
89 AC_SEARCH_LIBS(atoll,c,,AC_DEFINE([atoll],[atol],[Define to 1 if you do not have the atoll() function to use atol() instead]))
90 AC_SEARCH_LIBS(hstrerror,resolv socket nsl,AC_DEFINE([HAVE_HSTRERROR], [1], [Define to 1 if you have the hstrerror() function]),)
91 AC_SEARCH_LIBS(getaddrinfo,resolv socket nsl,AC_DEFINE([HAVE_GETADDRINFO], [1], [Define to 1 if you have the getaddrinfo() function]),)
92 AC_SEARCH_LIBS(socket,socket,,AC_MSG_ERROR(could not find the library containing network functions!))
93 AC_SEARCH_LIBS(gethostbyname,nsl,,AC_MSG_ERROR(could not find the library containing name convertion functions!))
94 AC_SEARCH_LIBS(sendfile,sendfile,AC_DEFINE([HAVE_SENDFILE],[1],[libsendfile is available]),)
95 AC_CHECK_HEADER(sys/sendfile.h,AC_DEFINE([HAVE_SENDFILE_H],[1],[sendfile in sendfile.h]),)
100 [ --disable-debug disable verbose logging to console for debugging purpose],
103 if test x$enable_debug = xyes ; then
104 AC_DEFINE([DEBUG], [1], [Define to 1 to build in debugging mode])
108 [ --disable-md5 disable md5 hash generation],
111 if test x$enable_md5 != xno ; then
112 AC_SEARCH_LIBS(mhash_init,mhash,AC_DEFINE([HAVE_LIBMHASH], [1], [Define to 1 if you have the mhash library]),
113 AC_SEARCH_LIBS(MD5Init,md5,AC_DEFINE([HAVE_LIBMD5], [1], [Define to 1 if you have the md5 library]),
114 AC_SEARCH_LIBS(MD5_Init,crypto,AC_DEFINE([HAVE_LIBCRYPTO], [1], [Define to 1 if you have the OpenSSL crypto library]),
115 if test x$enable_md5 = xauto ; then
116 AC_MSG_WARN(could not find a library containing the md5 hash functions - md5 support disabled)
118 AC_MSG_ERROR(could not find the mhash library)
126 AC_DEFINE(_REENTRANT,1,Needed for thread safe compilation)
128 AC_OUTPUT(Makefile mbuffer.1)