-dnl $Id: configure.ac 26260 2008-12-10 04:08:39Z androsyn $
dnl Process this file with autoconf to produce a configure script.
dnl TODO: clean up all the OpenSSL and shared module checking stuff;
AC_PREREQ(2.63)
AUTOMAKE_OPTIONS = 1.10
dnl Sneaky way to get an Id tag into the configure script
-AC_COPYRIGHT([$Id: configure.ac 26260 2008-12-10 04:08:39Z androsyn $])
-AC_INIT([libratbox],[devel])
+AC_INIT([librb],[devel])
AM_INIT_AUTOMAKE([subdir-objects])
AM_SILENT_RULES([yes])
-AM_CONFIG_HEADER(include/libratbox_config.h)
+AM_CONFIG_HEADER(include/librb_config.h)
-AC_PREFIX_DEFAULT(/usr/local/libratbox)
+AC_PREFIX_DEFAULT(/usr/local/librb)
AC_GNU_SOURCE
dnl Checks for programs.
AC_PROG_CC_C99
if test x"$ac_cv_prog_cc_c99" = "xno"; then
- AC_ERROR([ircd-ratbox requires a C99 capable compiler])
+ AC_ERROR([charybdis requires a C99 capable compiler])
fi
AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
;;
-*mingw*)
+*mingw* | *msys*)
AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
AC_CHECK_HEADER(windows.h, , [AC_MSG_ERROR([** MinGW and no windows.h. I give up.])])
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([crypt.h unistd.h sys/socket.h sys/stat.h sys/time.h time.h netinet/in.h arpa/inet.h errno.h sys/uio.h spawn.h sys/poll.h sys/epoll.h sys/select.h sys/devpoll.h sys/event.h port.h signal.h sys/signalfd.h sys/timerfd.h linux/tcp.h])
+AC_CHECK_HEADERS([crypt.h unistd.h sys/socket.h sys/stat.h sys/time.h time.h netinet/in.h netinet/tcp.h arpa/inet.h errno.h sys/uio.h spawn.h sys/poll.h sys/epoll.h sys/select.h sys/devpoll.h sys/event.h port.h signal.h sys/signalfd.h sys/timerfd.h])
AC_HEADER_TIME
dnl Networking Functions
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
+#include <ws2tcpip.h>
#endif
int getpeername (int, $arg2 *, $t *);
],[
dnl Check for stdarg.h - if we cant find it, halt configure
-AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - libratbox will not compile without it **])])
+AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - librb will not compile without it **])])
AC_CHECK_TYPE([sa_family_t], [],
[AC_DEFINE(sa_family_t, [u_int16_t], [If system does not define sa_family_t, define it here.])],
dnl check for various functions...
-AC_CHECK_FUNCS([snprintf vsnprintf socketpair gettimeofday writev sendmsg gmtime_r strtok_r usleep posix_spawn strlcpy strlcat strnlen fstat signalfd select poll kevent port_create epoll_ctl arc4random getrusage timerfd_create])
+AC_CHECK_FUNCS([snprintf vsnprintf socketpair gettimeofday writev sendmsg gmtime_r strtok_r usleep posix_spawn getexecname strlcpy strlcat strnlen strcasestr strcasecmp strncasecmp fstat signalfd select poll kevent port_create epoll_ctl arc4random getrusage timerfd_create])
+AC_SEARCH_LIBS(dlinfo, dl, AC_DEFINE(HAVE_DLINFO, 1, [Define if you have dlinfo]))
AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have nanosleep]))
AC_SEARCH_LIBS(timer_create, rt, AC_DEFINE(HAVE_TIMER_CREATE, 1, [Define if you have timer_create]))
RB_CHECK_TIMER_CREATE
if test "$ac_cv_c_compiler_gnu" = yes; then
CFLAGS="$CFLAGS -pg -static"
AC_MSG_RESULT([yes, adding -pg -static])
- AC_DEFINE(RATBOX_PROFILE, 1, [Defined to mark profiling is enabled])
+ AC_DEFINE(RB_PROFILE, 1, [Defined to mark profiling is enabled])
else
AC_MSG_RESULT([no, profile builds only work with gcc])
fi
AC_SUBST(MBEDTLS_LIBS)
if test "$prefix" = "NONE"; then
- AC_DEFINE_UNQUOTED(RB_PREFIX, "$ac_default_prefix", [Prefix where libratbox is installed.])
+ AC_DEFINE_UNQUOTED(RB_PREFIX, "$ac_default_prefix", [Prefix where librb is installed.])
else
dnl a custom prefix with a trailing slash
prefix=`echo $prefix | sed 's/\/$//'`
- AC_DEFINE_UNQUOTED(RB_PREFIX, "$prefix", [Prefix where libratbox is installed.])
+ AC_DEFINE_UNQUOTED(RB_PREFIX, "$prefix", [Prefix where librb is installed.])
fi
outfile=include/librb-config.h.tmp
cat > $outfile <<\_______EOF
/*
- * librb-config.h: libratbox config file. Please modify configure.ac
+ * librb-config.h: librb config file. Please modify configure.ac
*/
#ifndef __LIBRB_CONFIG_H
echo '#define WIN32_LEAN_AND_MEAN 1' >> $outfile
echo '#include <windows.h>' >> $outfile
echo '#include <winsock2.h>' >> $outfile
+ echo '#include <ws2tcpip.h>' >> $outfile
echo '#include <iphlpapi.h>' >> $outfile
fi
echo '#include <netinet/in.h>' >> $outfile
fi
+if test "x$rb_netinet_tcp_h" == "xyes"; then
+ echo '#include <netinet/tcp.h>' >> $outfile
+fi
+
if test "x$rb_arpa_inet_h" = "xyes"; then
echo '#include <arpa/inet.h>' >> $outfile
fi
if test x$ac_cv_header_netinet_in_h = xyes; then
rb_netinet_in_h=yes
fi
+ if test x$ac_cv_header_netinet_tcp_h = xyes; then
+ rb_netinet_tcp_h=yes
+ fi
if test x$ac_cv_header_crypt_h = xyes; then
rb_crypt_h=yes