dnl ---------------------------------------------------------- 4nl configure.in for ircii, 2.3. copyright (c) matthew green, 1993, dnl except those bits attributed otherwise. dnl thanks to the screen 3.3 configure.in for giving me examples to dnl work from and steal ;) dnl AC_INIT([epic5],[2]) AC_CONFIG_SRCDIR([source/irc.c]) AC_CONFIG_HEADERS([include/defs.h]) AC_LANG(C) dnl ---------------------------------------------------------- dnl dnl grok the version number - from source/irc.c dnl VERSION=`sed -n -e 's/;$//' -e '/const unsigned long commit_id = /s///p' -e '/const unsigned long commit_id/q' < $srcdir/source/irc.c` AC_SUBST([VERSION]) echo this is EPIC5 commit $VERSION echo AC_PROG_CC AC_PROG_CPP dnl ---------------------------------------------------------- AC_MSG_CHECKING([for an extra library directory]) AC_ARG_WITH([localdir], [ --with-localdir=/usr/local An extra directory to look for stuff.],[ if test "x$withval" = "x" ; then if test -d /usr/local/lib ; then withval="/usr/local" elif test -d /usr/pkg/lib ; then withval="/usr/pkg" elif test -d /opt/lib ; then withval="/opt" fi fi if test "x$withval" != "x" && \ test -d "$withval"; then with_extra_libdir="yes" else with_extra_libdir="no" fi if test "x$with_extra_libdir" = "xyes" ; then LIBS="-L$withval/lib $LIBS" CFLAGS="-I$withval/include/ $CFLAGS" localdir=$withdir fi ],[ if test "x$withval" = "x" ; then if test -d /usr/local/lib ; then withval="/usr/local" elif test -d /usr/pkg/lib ; then withval="/usr/pkg" elif test -d /opt/lib ; then withval="/opt" fi fi if test "x$withval" != "x" && \ test -d "$withval"; then with_extra_libdir="yes" else with_extra_libdir="no" fi if test "x$with_extra_libdir" = "xyes" ; then LIBS="-L$withval/lib $LIBS" CFLAGS="-I$withval/include/ $CFLAGS" localdir=$withdir fi ]) AC_MSG_RESULT([$with_extra_libdir, $withval]) dnl ---------------------------------------------------------- dnl ---------------------------------------------------------- dnl dnl System specific checks dnl dnl ---------------------------------------------------------- dnl ---------------------------------------------------------- AC_CHECK_LIB([cext], [setenv], [LIBS="$LIBS -lcext"],) dnl dnl Checking for Macintosh OS X (Written by Zach) dnl Please note -- MAC OS X perl support only works with macports! dnl AC_MSG_CHECKING([for Macintosh OS X]) ( $CC --version 2>&1 | grep 'apple-darwin' > /dev/null ) && \ apple_compiler="yes" \ perl_arch_flags="$(perl -MExtUtils::Embed -e 'ccopts;print "\n"; ldopts' | grep -o -- '-arch [-_0-9a-zA-Z]*' | sort -u)" \ CFLAGS="$CFLAGS $perl_arch_flags" AC_MSG_RESULT([ok]) dnl ---------------------------------------------------------- dnl Where does this belong? AC_MSG_CHECKING([which multiplexer function to use]) AC_ARG_WITH(multiplex, [ --with-multiplex[=TYPE] Multiplexer type (select,poll,freebsd-kqueue,pthread,solaris-ports)],[ if test "x$withval" = "x"; then with_multiplex="select" elif test "x$withval" = "xselect"; then with_multiplex="select" elif test "x$withval" = "xpoll"; then with_multiplex="poll" elif test "x$withval" = "xfreebsd-kqueue"; then with_multiplex="kqueue" elif test "x$withval" = "xsolaris-ports"; then with_multiplex="port_create" elif test "x$withval" = "xpthread"; then with_multiplex="pthread_create" if [ "x$sun_compiler" = "xyes" ] ; then CFLAGS="CFLAGS -mt" else CFLAGS="$CFLAGS -pthread" fi else with_multiplex="select" fi ],[ with_multiplex="select" ]) AC_MSG_RESULT($with_multiplex) AC_CHECK_FUNC($with_multiplex, [ if test "x$with_multiplex" = "xselect" ; then AC_DEFINE([USE_SELECT], 1, [Define this if you want to use select as the multiplexer]) threading=0 elif test "x$with_multiplex" = "xpoll" ; then AC_DEFINE([USE_POLL], 1, [Define this if you want to use poll as the multiplexer]) threading=0 elif test "x$with_multiplex" = "xkqueue" ; then AC_DEFINE([USE_FREEBSD_KQUEUE], 1, [Define this if you want to use freebsd kqueue() as the multiplexer]) threading=0 elif test "x$with_multiplex" = "xport_create" ; then AC_DEFINE([USE_SOLARIS_PORTS], 1, [Define this if you want to use Solaris ports as the multiplexer]) threading=0 elif test "x$with_multiplex" = "xpthread_create" ; then AC_DEFINE([USE_PTHREAD], 1, [Define this if you want to use pthreads as the multiplexer]) threading=1 fi ],[ AC_DEFINE([USE_SELECT], 1, [Define this if you want to use select as the multiplexer]) threading=0 ]) dnl ---------------------------------------------------------- dnl dnl Check for libraries before we check for functions! dnl if test -z "$libsocket"; then AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket",) fi dnl Check to see if libarchive actually works dnl XXX I don't understand why this is even necessary. AC_ARG_WITH([libarchive], [ --without-libarchive Disable libarchive support.], [], [with_libarchive=maybe]) if test "x$with_libarchive" != "xno" ; then have_libarchive="" orig_LIBS="$LIBS" AC_CHECK_LIB(archive, archive_read_new, [LIBS="$LIBS -larchive"]) AC_MSG_CHECKING(whether libarchive works the way I expect) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ struct archive *x; const char *s = "bogus.zip"; x = archive_read_new(); archive_read_support_format_all(x); archive_read_open_file(x, s, 10240); ]])], [have_libarchive="yes"]) if test "x$have_libarchive" = "x"; then LIBS="$orig_LIBS" AC_MSG_RESULT(no) if test "x$with_libarchive" = "xyes" ; then AC_MSG_ERROR([--with-libarchive was specified but libarchive could not be found. Please install libarchive, or do not specify --with-libarchive.]) fi else AC_MSG_RESULT(yes) AC_DEFINE([HAVE_LIBARCHIVE], 1, [Define this if you have a working libarchive]) fi fi dnl ----- AC_ARG_WITH(ssl, [ --with-ssl[=PATH] Help me find your SSL installation (DIR is OpenSSL's install dir).],[ if test -z "$withval"; then with_ssl="yes" fi ]) AC_MSG_CHECKING(whether to include SSL support) if test "x$with_ssl" = "xno"; then AC_MSG_RESULT(no) AC_MSG_ERROR([You cannot explicitly turn off OpenSSL support any more. This error is intentional. Please remove --without-ssl and try again.]) else saved_LIBS="$LIBS" saved_CFLAGS="$CFLAGS" # First, let's see if the user overrode the openssl location ssldir="$with_ssl" if test "x$ssldir" != "x" -a "x$ssldir" != "xyes"; then if test -f "$ssldir/include/openssl/ssl.h" && test -f "$ssldir/lib/libssl.a"; then LIBS="$saved_LIBS -L$ssldir/lib -lssl -lcrypto" CFLAGS="$saved_CFLAGS -I$ssldir/include" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ SSL_library_init(); ]])], [have_ssl="yes"]) fi if test "x$have_ssl" != "xyes"; then AC_MSG_RESULT([no]) AC_MSG_ERROR([I could not find the OpenSSL installed at $with_ssl you asked me to use with --with-ssl=$with_ssl. Please ensure that directory contains the files 'include/openssl/ssl.h' and 'lib/libssl.a'. If you are unsure, remove --with-ssl and just let me auto-detect it.]) fi else # Second, let's see if it just works by default LIBS="$saved_LIBS -lssl -lcrypto" CFLAGS="$saved_CFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ SSL_library_init(); ]])], [have_ssl="yes"]) # Otherwise, go hunting for it. if test "x$have_ssl" = "x" ; then for ssldir in $localdir/ssl $localdir/openssl; do if test "x$have_ssl" != "x"; then break; fi if test "x$ssldir" = "x"; then continue; fi if test -f "$ssldir/include/openssl/ssl.h" && test -f "$ssldir/lib/libssl.a"; then CFLAGS="$saved_CFLAGS -I$ssldir/include" LIBS="$saved_LIBS -L$ssldir/lib -lssl -lcrypto" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ SSL_library_init(); ]])], [have_ssl="yes"]) fi done fi fi # If we found it somewhere, great! Otherwise, revert. if test ! -n "$have_ssl"; then LIBS="$saved_LIBS" CFLAGS="$saved_CFLAGS" AC_MSG_RESULT([no]) if test "x$with_ssl" != "x"; then AC_MSG_ERROR([You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL]) fi AC_MSG_ERROR([I was unable to find OpenSSL. If it is not installed, please install it. If it is installed, please help me find it using --with-ssl=/usr/local or similar.]) else if test "x$threading" = "x1" ; then AC_MSG_RESULT([yes]) AC_MSG_CHECKING([whether your SSL is threading compatable]) AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #define OPENSSL_THREAD_DEFINES #include #include ]],[[ #if defined(THREADS) return 0; #else return 1; #endif ]])], AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_SSL], 1, [Define this if you have a working ssl]), AC_MSG_RESULT([no. Your system can not do SSL with pthreads]),:) else AC_DEFINE([HAVE_SSL], 1, [Define this if you have a working ssl]) AC_MSG_RESULT([yes]) fi fi fi AC_CHECK_LIB(sun, getpwnam, LIBS="$LIBS -lsun",) AC_CHECK_LIB(dgc, inet_addr, LIBS="$LIBS -ldgc",) AC_CHECK_LIB(resolv, gethostbyname, LIBS="$LIBS -lresolv",) AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt",) AC_CHECK_LIB(m, pow, LIBS="$LIBS -lm",) AC_CHECK_LIB(rt, clock_gettime, LIBS="$LIBS -lrt",) termcap=0; warn_again=0; AC_MSG_CHECKING(whether you want to use termcap instead of terminfo/ncurses) AC_ARG_WITH(termcap, [ --with-termcap Force use of termcap even if terminfo/ncurses is available ], [ AC_MSG_RESULT(yes) AC_CHECK_LIB(termcap, tgetent, termcap=1;LIBS="-ltermcap $LIBS", AC_CHECK_LIB(termlib, tgetent, termcap=1;LIBS="-ltermlib $LIBS", AC_CHECK_LIB(curses, tgetent, termcap=1;LIBS="-lcurses $LIBS", AC_MSG_WARN(I cant find tgetent. Youll have to help me.))))], [ AC_MSG_RESULT(no) AC_CHECK_LIB(ncurses, setupterm, LIBS="-lncurses $LIBS", AC_CHECK_LIB(tinfo, setupterm, LIBS="-ltinfo $LIBS", AC_CHECK_LIB(curses, setupterm, LIBS="-lcurses $LIBS", AC_CHECK_LIB(curses, tgetent, termcap=1;LIBS="-lcurses $LIBS", AC_CHECK_LIB(termlib, tgetent, termcap=1;LIBS="-ltermlib $LIBS", AC_CHECK_LIB(termcap, tgetent, termcap=1;LIBS="-ltermcap $LIBS", AC_MSG_WARN(I cant find tgetent. Youll have to help me.) warn_again=1))))))]) dnl ---------------------------------------------------------- dnl dnl Checking for headers, functions, and a type declarations dnl sigh. I used to check for sys/fcntl.h dnl AC_CHECK_HEADERS(fcntl.h ieeefp.h inttypes.h locale.h math.h ndbm.h netdb.h regex.h stdargs.h stddef.h stdint.h sys/cdefs.h sys/file.h sys/filio.h sys/select.h sys/syslimits.h sys/time.h sys/un.h sys/param.h termios.h sys/termios.h xlocale.h,) if test $termcap -eq 0 ; then AC_CHECK_HEADERS(term.h,) else AC_CHECK_HEADERS(termcap.h,) fi AC_CHECK_FUNC(arc4random, AC_DEFINE([HAVE_ARC4RANDOM], 1, [Define this if you have arc4random()]),) AC_CHECK_FUNC(clock_gettime, AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [Define if you have clock_gettime()]),) AC_CHECK_FUNC(crypt, AC_DEFINE([HAVE_CRYPT], 1, [Define if you have crypt()]),) AC_CHECK_FUNC(fchdir, AC_DEFINE([HAVE_FCHDIR], 1, [Define if you have fchdir()]),) AC_CHECK_FUNC(fpathconf, AC_DEFINE([HAVE_FPATHCONF], 1, [Define if you have fpathconf()] ),) AC_CHECK_FUNC(getlogin, AC_DEFINE([HAVE_GETLOGIN], 1, [Define if you have getlogin()]),) AC_CHECK_FUNC(getaddrinfo, AC_DEFINE([HAVE_GETADDRINFO], 1, [Define if you have getaddrinfo()]),) AC_CHECK_FUNC(getnameinfo, AC_DEFINE([HAVE_GETNAMEINFO], 1, [Define if you have getnameinfo()]),) AC_CHECK_FUNC(getpass, AC_DEFINE([HAVE_GETPASS], 1, [Define if you have getpass()]),) AC_CHECK_FUNC(getpgid, AC_DEFINE([HAVE_GETPGID], 1, [Define if you have getpgid()]),) AC_CHECK_FUNC(getservbyport, AC_DEFINE([HAVE_GETSERVBYPORT], 1, [Define if you have getservbyport()]),) AC_CHECK_FUNC(gettimeofday, AC_DEFINE([HAVE_GETTIMEOFDAY], 1, [Define if you have gettimeofday()]),) AC_CHECK_FUNC(killpg, AC_DEFINE([HAVE_KILLPG], 1, [Define if you have killpg()]),) AC_CHECK_FUNC(memmove, AC_DEFINE([HAVE_MEMMOVE], 1, [Define if you have have_memmove()]),) AC_CHECK_FUNC(nanosleep, AC_DEFINE([HAVE_NANOSLEEP], 1, [Define if you have nanosleep()]),) AC_CHECK_FUNC(uname, AC_DEFINE([HAVE_UNAME], 1, [Define if you have uname()]),) AC_CHECK_FUNC(realpath, AC_DEFINE([HAVE_REALPATH], 1, [Define if you have realpath()]),) AC_CHECK_FUNC(setenv, AC_DEFINE([HAVE_SETENV], 1, [Define if you have setenv()]),) AC_CHECK_FUNC(setsid, AC_DEFINE([HAVE_SETSID], 1, [Define if you have setsid()]),) AC_CHECK_FUNC(tcsetpgrp, AC_DEFINE([HAVE_TCSETPGRP], 1, [Define if you have tcsetpgrp()]),) if test $termcap -eq 0 ; then AC_CHECK_FUNC(setupterm, AC_DEFINE([HAVE_TERMINFO], 1, [Define if you have terminfo()]),) fi AC_CHECK_FUNC(snprintf, AC_DEFINE([HAVE_SNPRINTF], 1, [Define if you have snprintf()]),) AC_CHECK_FUNC(strerror, AC_DEFINE([HAVE_STRERROR], 1, [Define if you have strerror()]),) AC_CHECK_FUNC(strlcat, AC_DEFINE([HAVE_STRLCAT], 1, [Define if you have strlcat()]),) AC_CHECK_FUNC(strlcpy, AC_DEFINE([HAVE_STRLCPY], 1, [Define if you have strlcpy()]),) AC_CHECK_FUNC(strptime, AC_DEFINE([HAVE_STRPTIME], 1, [Define if you have strptime()]),) AC_CHECK_FUNC(strtoul, AC_DEFINE([HAVE_STRTOUL], 1, [Define if you have strtoul()]),) AC_CHECK_FUNC(sysconf, AC_DEFINE([HAVE_SYSCONF], 1, [Define if you have sysconf()]),) AC_CHECK_FUNC(unsetenv, AC_DEFINE([HAVE_UNSETENV], 1, [Define if you have unsetenv()]),) AC_CHECK_FUNC(vsnprintf, AC_DEFINE([HAVE_VSNPRINTF], 1, [Define if you have vsnprintf()]),) AC_MSG_CHECKING(for isfinite) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]],[[ int x = isfinite(0.0); return 0; ]])], [ AC_MSG_RESULT(yes) AC_DEFINE([HAVE_ISFINITE], 1, [Define if you have isfinite()]) ], [ AC_MSG_RESULT(no) ]) AC_CHECK_FUNC(finite, AC_DEFINE([HAVE_FINITE], 1, [Define if you have finite()]),) AC_CHECK_FUNC(tparm, AC_DEFINE([HAVE_TPARM], 1, [Define if you have tparm()]),) AC_CHECK_FUNC(newlocale, AC_DEFINE([HAVE_NEWLOCALE], 1, [Define if you have newlocale()]),) AC_CHECK_FUNC(unveil, AC_DEFINE([HAVE_UNVEIL], 1, [Define if you have unveil()]),) AC_CHECK_FUNC(pledge, AC_DEFINE([HAVE_PLEDGE], 1, [Define if you have pledge()]),) dnl -- Because someone is trying to use CentOS 5.11... AC_MSG_CHECKING(whether you are using a gnu libc that is so old it needs a hack to use newlocale) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]],[[ locale_t utf8_locale; utf8_locale = newlocale(LC_ALL_MASK, "en_US.UTF-8", 0); return 0; ]])], [ AC_MSG_RESULT(no, good) ], [ AC_MSG_RESULT(yes, ugh.) AC_MSG_CHECKING(whether we can fix that with _GNU_SOURCE) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define _GNU_SOURCE #include #include #include ]],[[ locale_t utf8_locale; utf8_locale = newlocale(LC_ALL_MASK, "en_US.UTF-8", 0); return 0; ]])], [ AC_MSG_RESULT(yes) AC_DEFINE(NEWLOCALE_REQUIRES__GNU_SOURCE, 1, [Define this if newlocale() requires #define __GNU_SOURCE to work]) ], [ AC_MSG_RESULT(no. well...) AC_MSG_CHECKING(whether we can fix that with _XOPEN_SOURCE 700) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #define _XOPEN_SOURCE 700 #include ]],[[ locale_t utf8_locale; utf8_locale = newlocale(LC_ALL_MASK, "en_US.UTF-8", 0); return 0; ]])], [ AC_MSG_RESULT(yes. Yay!) AC_DEFINE(NEWLOCALE_REQUIRES__XOPEN_SOURCE_700, 1, [Define this if newlocale() requires #define __XOPEN_SOURCE 700 to work]) ], [ AC_MSG_RESULT(no. bummer for you) AC_DEFINE(NEWLOCALE_DOESNT_WORK, 1, [Define this if newlocale() doesn't work the way I expect]) ], :), ], :) ] ) dnl -- Oh why does this have to be so painful? -- AC_MSG_CHECKING(whether term.h works by itself) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]],[[ return 0; ]])], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) AC_MSG_CHECKING(whether term.h requires termio.h and curses.h) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include ]],[[ return 0; ]])], [ AC_MSG_RESULT(yes) AC_DEFINE([TERM_H_REQUIRES_CURSES_H], 1, [Define if requires to be included first]) ], [ AC_MSG_RESULT(no, ugh) AC_DEFINE([DONT_USE_TERM_H], 1, [Define if should be avoided]) ], :), ] :) dnl -- oh autoconf, never change -- AC_HEADER_TIME AC_HEADER_DIRENT AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UID_T AC_FUNC_ALLOCA dnl --------------------------------------------------------- dnl dnl Check for a useful SO_SNDLOWAT. dnl Some systems (eg, linux) can be bothered to #define SO_SNDLOWAT dnl but can't be bothered to implement it, instead returning an error. dnl How completely bogus. Don't #define it if you don't support it! dnl AC_MSG_CHECKING(for useful SO_SNDLOWAT) AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]],[[ #ifndef SO_SNDLOWAT return 1; #else int d = socket(AF_INET, SOCK_STREAM, 0); int size = 256; if (setsockopt(d, SOL_SOCKET, SO_SNDLOWAT, &size, sizeof(size)) < 0) return 1; return 0; #endif ]])], AC_MSG_RESULT(yes, your SO_SNDLOWAT is useful) AC_DEFINE([HAVE_SO_SNDLOWAT], 1, [Define this if you have SO_SNDLOWAT]), AC_MSG_RESULT(no, your SO_SNDLOWAT is broken and/or worthless), :) dnl ---------------------------------------------------------- dnl dnl Check for a realpath() that works. dnl AC_MSG_CHECKING(for useful realpath) AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #include ]],[[ char resolved_path[PATH_MAX]; if (realpath("/etc/filethatdoesnotexist", resolved_path) == 0) return 1; return 0; ]])], AC_MSG_RESULT(yes), AC_MSG_RESULT(no, your realpath is broken and/or worthless) AC_DEFINE([HAVE_BROKEN_REALPATH], 1, [Define this if your realpath() doesn't work for nonexistant files]), :) dnl ---------------------------------------------------------- dnl dnl Check for sys_siglist declaration dnl AC_MSG_CHECKING(for sys_siglist declaration) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include #include ]],[[ char *s = sys_siglist[0]; return 0; ]])], [ AC_MSG_RESULT(yes) AC_DEFINE([HAVE_SYS_SIGLIST], 1, [Define if you have sys_siglist]) ], [ AC_MSG_RESULT(no) ], :) dnl ------------------------------------------------------------------ AC_TYPE_INT8_T AC_TYPE_UINT8_T AC_TYPE_INT16_T AC_TYPE_UINT16_T AC_TYPE_INT32_T AC_TYPE_UINT32_T AC_TYPE_INT64_T AC_TYPE_UINT64_T AC_TYPE_INTMAX_T AC_TYPE_UINTMAX_T AC_TYPE_INTPTR_T AC_CHECK_TYPE([socklen_t], [AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have socklen_t])], , [[ #include ]]) AC_CHECK_TYPE([struct linger], , [AC_DEFINE([NO_STRUCT_LINGER], 1, [Define if you do not have struct linger])], [[ #include ]]) dnl ---------------------------------------------------------- dnl dnl It makes a big difference if your system's (struct sockaddr) dnl structures look like this: dnl dnl struct sockaddr { dnl u_char sa_len; dnl u_char sa_family; dnl char sa_data[14]; dnl }; dnl dnl or this dnl dnl struct sockaddr { dnl u_short sa_family; dnl char sa_data[14]; dnl }; dnl dnl so check for that here. dnl dnl ----------------------------------------------------------- AC_MSG_CHECKING([to see if your struct sockaddr includes a length field]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]],[[ struct sockaddr sa; sa.sa_len = 0; return 0; ]])], [ AC_DEFINE([HAVE_SA_LEN], 1, [Define this if your struct sockaddr has a sa_len field]) AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) ], :) dnl ---------------------------------------------------------- dnl dnl checks for ipv6-related things dnl AC_MSG_CHECKING([whether to support ipv6]) AC_ARG_WITH(ipv6, [ --without-ipv6 Refuse to support IPv6],[ if test "x$withval" = "xno" ; then AC_MSG_RESULT([no]) AC_DEFINE([DO_NOT_USE_IPV6], 1, [Define this if ipv6 was forbidden by user]) else AC_MSG_RESULT([yes]) fi ],[AC_MSG_RESULT([yes])]) AC_CHECK_TYPE([struct sockaddr_storage], [AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], 1, [Define if you have struct sockaddr_storage])], , [[ #include ]]) AC_CHECK_TYPE([struct sockaddr_in6], [AC_DEFINE([HAVE_STRUCT_SOCKADDR_IN6], 1, [Define if you have struct sockaddr_in6])], , [[ #include ]]) AC_CHECK_TYPE([struct addrinfo], [AC_DEFINE([HAVE_STRUCT_ADDRINFO], 1, [Define if you have struct addrinfo])], , [[ #include ]]) dnl ---------------------------------------------------------- dnl dnl Some implementations of getaddrinfo (*cough*KAME*cough*) don't dnl support the AF_UNIX protocol family. For these partially incomplete dnl implementations, we must add our own support in a wrapper. dnl AC_MSG_CHECKING([to see if your getaddrinfo supports AF_UNIX]) AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include #include #include ]],[[ struct addrinfo hints; struct addrinfo *results; int retval; memset(&hints, 0, sizeof(hints)); hints.ai_flags = 0; hints.ai_family = AF_UNIX; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; retval = getaddrinfo(0, "/tmp/.ircd/6667", &hints, &results); if (retval != 0) return 1; else return 0; ]])], AC_MSG_RESULT([yes]), AC_DEFINE([GETADDRINFO_DOES_NOT_DO_AF_UNIX], 1, [Define this if your getaddrinfo() does not support AF_UNIX]) AC_MSG_RESULT([no. ugh]), :) dnl ---------------------------------------------------------- dnl dnl Socks4 or Socks5 or neither? dnl AC_MSG_CHECKING(whether to support SOCKS) AC_ARG_WITH(socks, [ --with-socks[=PATH] Compile with SOCKS (libsocks without socks.h) firewall traversal support.], [ case "$withval" in no) AC_MSG_RESULT(no) ;; *) if test "x$withval" != "xyes"; then LIBS="$LIBS -L$withval" fi AC_MSG_RESULT(yes) LIBS="$LIBS -lsocks" AC_DEFINE([SOCKS], 1, [Define this if you wanted to use SOCKS]) AC_DEFINE([connect], [Rconnect], [Defined when using SOCKS]) AC_DEFINE([getsockname], [Rgetsockname], [Defined when using SOCKS]) AC_DEFINE([bind], [Rbind], [Defined when using SOCKS]) AC_DEFINE([accept], [Raccept], [Defined when using SOCKS]) AC_DEFINE([listen], [Rlisten], [Defined when using SOCKS]) AC_DEFINE([select], [Rselect], [Defined when using SOCKS]) ;; esac ], AC_MSG_RESULT(no) ) AC_MSG_CHECKING(whether to support SOCKS5) AC_ARG_WITH(socks5, [ --with-socks5[=PATH] Compile with SOCKS5 (libsocks with socks.h) firewall traversal support.], [ case "$withval" in no) AC_MSG_RESULT(no) ;; *) if test "x$withval" != "xyes"; then LIBS="$LIBS -L$withval" CFLAGS="$CFLAGS -I$withval/../include/" fi AC_MSG_RESULT(yes) LIBS="$LIBS -lsocks" AC_DEFINE([SOCKS], 1, [Define this if you wanted to use SOCKS]) AC_DEFINE([USE_SOCKS5], 1, [Define this if you wanted to use SOCKS5]) ;; esac ], AC_MSG_RESULT(no) ) dnl ---------------------------------------------------------- dnl dnl Iconv support? dnl AC_ARG_WITH(iconv, [ --with-iconv[=PATH] Include iconv support (PATH is (eg) /usr/local).],[ if test -z "$withval"; then with_iconv="/usr" fi ]) AC_MSG_CHECKING(whether to include iconv support) if test "x$with_iconv" = "xno"; then AC_MSG_RESULT([Iconv support is required; I'm afraid I must insist.]) AC_MSG_CHECKING([whether to include iconv support]) with_iconv=yes fi saved_LIBS="$LIBS" saved_CFLAGS="$CFLAGS" dnl First try to see if it's in libc AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]],[[ iconv_open(0, 0); ]])], have_iconv="yes") dnl If it's not in libc, look in -liconv if test "x$have_iconv" = "x"; then LIBS="$saved_LIBS -liconv" CFLAGS="$saved_CFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]],[[ iconv_open(0, 0); ]])], have_iconv="yes") fi dnl whatever. if test "x$with_iconv" = "xyes" ; then unset with_iconv fi dnl Otherwise, go hunting for it. if test "x$have_iconv" = "x"; then for iconvdir in "$with_iconv" "$prefix" $localdir /usr/local /usr/pkg /opt /usr/opt; do if test "x$have_iconv" != "x"; then break fi if test "x$iconvdir" = "x"; then continue fi dnl if test -f "$iconvdir/include/iconv.h" && dnl test -f "$iconvdir/lib/libiconv.a"; then if test -f "$iconvdir/include/iconv.h" ; then CFLAGS="$saved_CFLAGS -I$iconvdir/include" LIBS="$saved_LIBS -L$iconvdir/lib -liconv" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]],[[ iconv_open(0, 0); ]])], have_iconv="yes") fi if test "x$with_iconv" != "x"; then break fi done fi # If we found it somewhere, great! Otherwise, revert. if test "x$have_iconv" = "x"; then LIBS="$saved_LIBS" CFLAGS="$saved_CFLAGS" AC_MSG_RESULT(looked but did not find it) if test "x$with_iconv" != "x" ; then AC_MSG_ERROR([You specified --with-iconv=$with_iconv but that directory did not contain files include/iconv.h and lib/iconv.a. Either specify a different directory or let me auto-detect it for you]) else AC_MSG_ERROR([Iconv support is required. I could not find your system's iconv support. If you have iconv installed, please re-run configure with the --with-iconv=/path/to/dir option where include/iconv.h and lib/iconv.a exist.]) fi else AC_MSG_RESULT(yes) AC_DEFINE([HAVE_ICONV], 1, [Define this if you have a useful iconv()]) fi dnl #sigh# dnl AC_CHECK_FUNC(iconv_open, AC_DEFINE([HAVE_ICONV], 1, [Define this if you have a useful iconv())],) dnl ---------------------------------------------------------- dnl dnl Job Control / Wserv support? dnl AC_MSG_CHECKING(whether you have posix-like job control) if test "x$ac_cv_func_tcsetpgrp" = "xyes" -a "x$ac_cv_func_setsid" = "xyes"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_DEFINE([NO_JOB_CONTROL], 1, [Define this if you don't have job control]) no_job_control=1 fi AC_MSG_CHECKING(whether to include wserv support) include_wserv="yes" AC_ARG_WITH(wserv, [ --without-wserv Refuse to support wserv (for multiple screens)],[ if test -z "$withval"; then include_wserv="yes" else include_wserv="$withval" fi ]) if test "x$no_job_control" = "x1" ; then include_wserv="no" fi AC_MSG_RESULT($include_wserv) if test "x$include_wserv" = "xyes" ; then WSERV_BIN="wserv4" WSERV_INSTALL="installwserv4" fi dnl ---------------------------------------------------------- dnl dnl Valgrind assistance support? dnl AC_MSG_CHECKING(whether to include Valgrind Memcheck support) AC_ARG_WITH(valgrind, [ --with-valgrind Include support for Valgrind Memcheck ], [], [with_valgrind=no]) if test "x$with_valgrind" != "xno"; then AC_MSG_RESULT(yes) AC_CHECK_HEADERS([valgrind/memcheck.h]) else AC_MSG_RESULT(no) fi dnl ---------------------------------------------------------- dnl dnl clang 15 sanitizing support? dnl AC_MSG_CHECKING(whether to include clang15 sanitizing support) AC_ARG_WITH(clang-sanitizing, [ --with-clang-sanitizing Include support for clang sanitizing ], [], [with_clang_sanitizing=no]) if test "x$with_clang_sanitizing" != "xno"; then AC_MSG_RESULT(yes) AC_MSG_CHECKING(whether your compiler supports -fsanitize) old_cflags="$CFLAGS" CFLAGS="$CFLAGS -fsanitize=undefined,implicit-integer-truncation,implicit-integer-arithmetic-value-change,implicit-conversion,integer,nullability,object-size,local-bounds" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ return 0; ]])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) CFLAGS="$old_cflags"]) else AC_MSG_RESULT(no) fi dnl ---------------------------------------------------------- dnl dnl Perl support? dnl AC_ARG_WITH([perl], [ --with-perl=[PATH_TO_PERL_EXE] Compile with perl support.], [], [with_perl=maybe]) if test "x$with_perl" = "xno" ; then AC_MSG_CHECKING(whether to support Perl) AC_MSG_RESULT(no) else with_perl_errormsg="You specified --with-perl=$with_perl but I could not find a working perl. Please run ./configure with --without-perl or specify a path to a working perl executable." if test "x$with_perl" = "xyes" -o "x$with_perl" = "xmaybe" ; then perlexe=perl else perlexe="$with_perl" fi dnl Allow a full path to be specified in --with-perl if test -x "$perlexe" ; then PERLPROG=yes else AC_CHECK_PROG(PERLPROG, $perlexe, "yes", "no") fi AC_MSG_CHECKING([whether to support Perl]) if test $PERLPROG != "yes" ; then if test "x$with_perl" != "xmaybe" ; then AC_MSG_ERROR([$with_perl_errormsg]) fi AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) PERLCFLAGS=`$perlexe -MExtUtils::Embed -e ccopts` PERLLIBS=`$perlexe -MExtUtils::Embed -e ldopts` AC_MSG_CHECKING(whether embedded perl works the way I expect) have_embedded_perl="no" old_CFLAGS="$CFLAGS" old_LIBS="$LIBS" CFLAGS="$CFLAGS $PERLCFLAGS" LIBS="$LIBS $PERLLIBS" AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include int dummy_retval = -1; /* I "borrowed" this from the perlembed(1) man page */ PerlInterpreter *my_perl; int startup_perl(int argc, char **argv, char **env) { char *embedding[] = {"", "-e", "0" }; my_perl = perl_alloc(); perl_construct(my_perl); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; perl_parse(my_perl, NULL, 3, embedding, NULL); if (SvTRUE(ERRSV)) (void)SvPV_nolen(ERRSV); perl_run(my_perl); if (SvTRUE(ERRSV)) (void)SvPV_nolen(ERRSV); perl_destruct(my_perl); perl_free(my_perl); PERL_SYS_TERM(); dummy_retval = 0; return 0; } int main (int argc, char **argv, char **environ) { startup_perl(argc, argv, environ); return dummy_retval; } ]])], have_embedded_perl="yes", have_embedded_perl="no",:) CFLAGS="$old_CFLAGS" LIBS="$old_LIBS" if test $have_embedded_perl = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE([HAVE_PERL], 1, [Define this if you have perl]) AC_DEFINE([PERLCFLAGS], 1, [Add this to CLFAGS for perl support]) AC_DEFINE([PERLLIBS], 1, [Add this to LDFLAGS for perl support]) PERLDOTOH="perl.o" else if test "x$with_perl" != "xmaybe"; then AC_MSG_ERROR([$with_perl_errormsg]) fi PERLCFLAGS="" PERLLIBS="" AC_MSG_RESULT(no, sorry) PERLCFLAGS="" PERLLIBS="" fi fi fi dnl ---------------------------------------------------------- dnl dnl Ruby support? dnl AC_ARG_WITH([ruby], [ --with-ruby[=PATH_TO_RUBY_EXE] Compile with ruby support.], [], [with_ruby=maybe]) with_ruby_errormsg="--with-ruby was specified but I could not locate ruby. Please try specifying --with-ruby=/path/to/ruby or --without-ruby." AC_MSG_CHECKING([whether to support Ruby]) if test "x$with_ruby" = "xno" ; then AC_MSG_CHECKING(whether to support Ruby) AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) if test "x$with_ruby" = "xyes" -o "x$with_ruby" = "xmaybe" ; then rubyexe=ruby else rubyexe="$with_ruby" fi dnl Support --with-ruby being passed a full path instead of just an executable name. if test -x "$rubyexe" ; then RUBYPROG=yes else AC_CHECK_PROG([RUBYPROG], [$rubyexe], [yes], [no]) fi if test "x$RUBYPROG" = xno ; then if test "x$with_ruby" != "xmaybe" ; then AC_MSG_ERROR([$with_ruby_errormsg]) fi else dnl ---- dnl Look first for Ruby 1.9 incdir=`$rubyexe -rrbconfig -e 'puts RbConfig::CONFIG[["rubyhdrdir"]]'` archincdir=`$rubyexe -rrbconfig -e 'puts RbConfig::CONFIG[["rubyarchhdrdir"]]'` dnl -- Ruby 1.8 if test "x$incdir" = "xnil" ; then incdir=`$rubyexe -rrbconfig -e 'puts RbConfig::CONFIG[["archdir"]]'` RUBYCFLAGS="-I$incdir" dnl -- Ruby 1.9 and 2.0 else arch=`$rubyexe -rrbconfig -e 'puts RbConfig::CONFIG[["arch"]]'` RUBYCFLAGS="-I$incdir -I$incdir/$arch/ -I$archincdir" fi rubylibs=`$rubyexe -rrbconfig -e 'puts RbConfig::CONFIG[["LIBRUBYARG"]]'` extralibs=`$rubyexe -rrbconfig -e 'puts RbConfig::CONFIG[["LIBS"]]'` RUBYLIBS="$rubylibs $extralibs" RUBYDOTOH="ruby.o" AC_MSG_CHECKING(whether embedded ruby works the way I expect) have_embedded_ruby="no" old_CFLAGS="$CFLAGS" old_LIBS="$LIBS" CFLAGS="$CFLAGS $RUBYCFLAGS" LIBS="$LIBS $RUBYLIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include VALUE epic_echo (VALUE module, VALUE string) { VALUE x; char *my_string; x = rb_obj_as_string(string); my_string = StringValuePtr(x); return Qnil; } ]], [[ VALUE rubyclass; ruby_init(); ruby_init_loadpath(); rubyclass = rb_define_class("EPIC", rb_cObject); rb_define_singleton_method(rubyclass, "echo", epic_echo, 1); rb_gc_register_address(&rubyclass); ]])], have_embedded_ruby="yes") if ! test $have_embedded_ruby = "yes" ; then AC_MSG_RESULT(no) AC_MSG_CHECKING(whether ruby requires -pthread to link) RUBYCFLAGS="$RUBYCFLAGS -pthread" RUBYLIBS="$RUBYLIBS -pthread" CFLAGS="$old_CFLAGS $RUBYCFLAGS" LIBS="$old_LIBS $RUBYLIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include VALUE epic_echo (VALUE module, VALUE string) { VALUE x; char *my_string; x = rb_obj_as_string(string); my_string = StringValuePtr(x); return Qnil; } ]], [[ VALUE rubyclass; ruby_init(); ruby_init_loadpath(); rubyclass = rb_define_class("EPIC", rb_cObject); rb_define_singleton_method(rubyclass, "echo", epic_echo, 1); rb_gc_register_address(&rubyclass); ]])], have_embedded_ruby="yes") fi CFLAGS="$old_CFLAGS" LIBS="$old_LIBS" if test $have_embedded_ruby = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE([HAVE_RUBY], 1, [Define this if you want to suppor ruby]) AC_DEFINE([RUBYCFLAGS], 1, [Stuff to add to CFLAGS to support ruby]) AC_DEFINE([RUBYLIBS], 1, [Stuff to add to LDFLAGS to support ruby]) else if test "x$with_ruby" != "xmaybe" ; then AC_MSG_ERROR([$with_ruby_errormsg]) fi RUBYDOTOH="" HAVE_RUBY="" RUBYCFLAGS="" RUBYLIBS="" AC_MSG_RESULT(no, sorry) fi fi fi dnl ---------------------------------------------------------- dnl dnl Python support? dnl AC_ARG_WITH([python], [ --with-python[=PATH_TO_PYTHON_CONFIG_EXE] Compile with Python support.], [], [with_python=maybe]) with_python_errormsg="--with-python was specified but I could not locate python3-config. Please try specifying --with-path=/path/to/python3-config or --without-python." AC_MSG_CHECKING([whether to support Python]) if test "x$with_python" = "xno" ; then AC_MSG_CHECKING(whether to support Python) AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) if test "x$with_python" = "xyes" -o "x$with_python" = "xmaybe" ; then python_cfg_exe=python3-config else python_cfg_exe="$with_python" fi dnl Support --with-python being passed a full path instead of just an executable name. if test -x "$python_cfg_exe" ; then PYTHON_CFG_EXE=yes else AC_CHECK_PROG([PYTHON_CFG_EXE], [$python_cfg_exe], [yes], [no]) fi if test "x$PYTHON_CFG_EXE" = xno ; then if test "x$with_python" != "xmaybe" ; then AC_MSG_ERROR([$with_python_errormsg]) fi else dnl --- dnl First, we have to determine if this is 3.7 or lower; or 3.8 or higher dnl The 3.8 or higher versions require --embed and 3.7 or lower versions dnl forbid it. What fun! dnl if $python_cfg_exe --cflags --embed > /dev/null ; then use_embed="--embed" else use_embed="" fi dnl ---- dnl Look first for Python 3 PYTHON_CFLAGS=`$python_cfg_exe --cflags $use_embed` PYTHON_LDFLAGS=`$python_cfg_exe --ldflags $use_embed` PYTHON_O="python.o" AC_MSG_CHECKING(whether embedded Python works the way I expect) have_embedded_python="no" old_CFLAGS="$CFLAGS" old_LIBS="$LIBS" CFLAGS="$CFLAGS $PYTHON_CFLAGS" LIBS="$LIBS $PYTHON_LDFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include static PyObject * epic_null (PyObject *self, PyObject *args) { char * str; if (!PyArg_ParseTuple(args, "s", &str)) { return PyLong_FromLong(-1); } Py_INCREF(Py_None); /* This test is important! */ Py_XDECREF(Py_None); return Py_BuildValue("s", ""); } static PyMethodDef epicMethods[] = { { "null", epic_null, METH_VARARGS, "null" }, { NULL, NULL, 0, NULL } }; static PyModuleDef epicModule = { PyModuleDef_HEAD_INIT, "_epic", NULL, -1, epicMethods, NULL, NULL, NULL, NULL }; static PyObject * PyInit_epic (void) { return PyModule_Create(&epicModule); } ]], [[ PyImport_AppendInittab("_epic", &PyInit_epic); Py_Initialize(); ]])], have_embedded_python="yes") if test $have_embedded_python = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE([PYTHON_O], 1, [Define this add stuff....]) AC_DEFINE([HAVE_PYTHON], 1, [Define this to support python]) AC_DEFINE([PYTHON_CFLAGS], 1, [Stuff to add to CFLAGS to support python]) AC_DEFINE([PYTHON_LDFLAGS], 1, [Stuff to add to LDFLAGS to support python]) else if test "x$with_python" != "xmaybe" ; then AC_MSG_ERROR([$with_python_errormsg]) fi PYTHON_O="" HAVE_PYTHON="" PYTHON_CFLAGS="" PYTHON_LDFLAGS="" AC_MSG_RESULT(no, sorry) fi CFLAGS="$old_CFLAGS" LIBS="$old_LIBS" fi fi dnl ---------------------------------------------------------- dnl ---------------------------------------------------------- dnl dnl closing stuff dnl dnl ---------------------------------------------------------- dnl ---------------------------------------------------------- dnl ---------------------------------------------------------- dnl dnl set some last minute sanity defaults dnl if test -z "$CFLAGS"; then CFLAGS="-g -O"; fi if test -z "$LDFLAGS"; then LDFLAGS= ; fi if test -z "$PERLDOTOH"; then PERLDOTOH= ; fi if test -z "$RUBYDOTOH"; then RUBYDOTOH= ; fi if test -z "$PYTHON_O"; then PYTHON_OH= ; fi if test -z "$WSERV_BIN"; then WSERV_BIN= ; fi if test -z "$WSERV_INSTALL"; then WSERV_INSTALL= ; fi if test -z "$bindir"; then bindir=\${prefix}/bin; fi if test -z "$libdir"; then libdir=\${prefix}/lib; fi if test -z "$irclibdir"; then irclibdir=\${libdir}/irc; fi if test -z "$libexecdir"; then libexecdir=\${prefix}/libexec; fi epic5=`echo "epic5" | sed -e "$program_transform_name"` if test "$program_prefix" = "NONE" ; then program_prefix= fi dnl AC_MSG_CHECKING(whether your compiler supports -Wno-pointer-sign) dnl old_cflags="$CFLAGS" dnl CFLAGS="$CFLAGS -Wno-pointer-sign" dnl AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ return 0; ]])], dnl [AC_MSG_RESULT(yes)], dnl [AC_MSG_RESULT(no) dnl CFLAGS="$old_cflags"]) AC_MSG_CHECKING(whether your compiler supports -Wno-compound-token-split-by-macro) old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ return 0; ]])], [AC_MSG_RESULT(yes) PERL_EXTRA_CFLAGS="-Wno-compound-token-split-by-macro" AC_DEFINE([PERL_EXTRA_CFLAGS], 1, [Add this to CLFAGS for perl support]) CFLAGS="$old_cflags"], [AC_MSG_RESULT(no) CFLAGS="$old_cflags"]) AC_MSG_CHECKING(whether your compiler supports -fno-strict-aliasing) old_cflags="$CFLAGS" CFLAGS="$CFLAGS -fno-strict-aliasing" AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[]],[[ return 0; ]])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(whether your compiler supports -fwrapv) old_cflags="$CFLAGS" CFLAGS="$CFLAGS -fwrapv" AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[]],[[ return 0; ]])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(whether your compiler supports -fno-delete-null-pointer-checks) old_cflags="$CFLAGS" CFLAGS="$CFLAGS -fno-delete-null-pointer-checks" AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[]],[[ return 0; ]])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(whether your compiler supports __attribute__((fallthrough))) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]],[[ int x = 1; switch (x) { case 1: x++; __attribute__((fallthrough)); case 0: x++; } ]])], [have_attribute_fallthrough=1], [have_attribute_fallthrough=0]) if test "x$have_attribute_fallthrough" = "x1" ; then AC_MSG_RESULT(yes) AC_DEFINE([HAVE_ATTRIBUTE_FALLTHROUGH], 1, [Define if you can use __attribute__((fallthrough))]) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(whether your compiler supports __attribute__((may_alias))) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ typedef int __attribute__ ((may_alias)) int_; ]],[[ long a = 0x12345678; int_ *b = (int_ *)&a; ]])], [have_attribute_may_alias=1], [have_attribute_may_alias=0]) if test "x$have_attribute_may_alias" = "x1" ; then AC_MSG_RESULT(yes) AC_DEFINE([HAVE_ATTRIBUTE_MAY_ALIAS], 1, [Define if you can use __attribute__((may_alias))]) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(whether your compiler supports extra warning flags) old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wwrite-strings -W -Wall -Wextra" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ return 0; ]])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) CFLAGS="$old_cflags"]) AC_MSG_CHECKING(whether your compiler supports -Wno-unused-parameter) old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wno-unused-parameter" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ return 0; ]])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) CFLAGS="$old_cflags"]) AC_MSG_CHECKING(whether your compiler supports -Wno-unused-function) old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wno-unused-function" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ return 0; ]])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) CFLAGS="$old_cflags"]) AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(RUBYDOTOH) AC_SUBST(RUBYCFLAGS) AC_SUBST(RUBYLIBS) AC_SUBST(PERLDOTOH) AC_SUBST(PERLCFLAGS) AC_SUBST(PERL_EXTRA_CFLAGS) AC_SUBST(PERLLIBS) AC_SUBST(PYTHON_O) AC_SUBST(PYTHON_CFLAGS) AC_SUBST(PYTHON_LDFLAGS) AC_SUBST(WSERV_BIN) AC_SUBST(WSERV_INSTALL) AC_SUBST(bindir) AC_SUBST(irclibdir) AC_SUBST(libexecdir) AC_SUBST(srcdir) AC_SUBST(includedir) AC_SUBST(epic5) AC_SUBST(program_transform_name) AC_SUBST(program_prefix) AC_SUBST(mandir) AC_SUBST(datadir) AC_SUBST(datarootdir) AC_CONFIG_FILES([Makefile source/Makefile source/info.c.sh]) AC_OUTPUT dnl ---------------------------------------------------------- dnl dnl Commencement dnl echo echo "There you go. Look at include/config.h for any options that " echo "you might want to change before you 'make'. Don't forget to " echo "do a 'make install' before you're done." echo if test "x$warn_again" != "x0" ; then echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@' echo '@@@ IMPORTANT WARNING! @@@' echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@' echo '' echo 'I was unable to find tgetent() which means the build will fail.' echo 'If you are using linux, you _MUST_ install the ncurses-dev' echo 'or ncurses-devel package and then "make distclean" and ' echo 'then run configure again.' echo '' echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@' echo '@@@ IMPORTANT WARNING! @@@' echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@' fi