summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorNicolas Viennot <nicolas@viennot.biz>2015-12-23 05:41:41 -0500
committerNicolas Viennot <nicolas@viennot.biz>2015-12-23 05:46:44 -0500
commit9b2778c4391db858fa81d4c638a036e32f006902 (patch)
treef6ac341d1f3085eca8523a4f2dcfad8b66008837 /configure.ac
parentf0d60cb1c83480a1da43e498e5b973d1650f7a10 (diff)
parent5083e93957169d0d595e6fca05db350c63478011 (diff)
Merge with latest tmux
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac228
1 files changed, 145 insertions, 83 deletions
diff --git a/configure.ac b/configure.ac
index 2941fe92..ed55b42e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,9 @@
-# $Id$
+# configure.ac
-# Miscellaneous autofoo bullshit.
-AC_INIT(tmate, 1.8.10)
+AC_INIT(tmate, 2.2.0)
AC_CONFIG_AUX_DIR(etc)
-AM_INIT_AUTOMAKE([foreign])
+AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CANONICAL_HOST
@@ -16,64 +15,44 @@ AC_CANONICAL_HOST
# Set up the compiler in two different ways and say yes we may want to install.
AC_PROG_CC
AM_PROG_CC_C_O
+AC_PROG_CPP
+AC_PROG_EGREP
AC_PROG_INSTALL
+PKG_PROG_PKG_CONFIG
-# Check for various headers. Alternatives included from compat.h.
-AC_CHECK_HEADERS(
- [ \
- bitstring.h \
- curses.h \
- dirent.h \
- fcntl.h \
- inttypes.h \
- libutil.h \
- ncurses.h \
- ndir.h \
- paths.h \
- pty.h \
- stdint.h \
- sys/dir.h \
- sys/ndir.h \
- sys/tree.h \
- term.h \
- util.h \
- ]
-)
+# Default tmux.conf goes in /etc not ${prefix}/etc.
+test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
-# Is this a debug build?
-#found_debug=yes
+# Is this --enable-debug?
+found_debug=yes
AC_ARG_ENABLE(
debug,
- AC_HELP_STRING(--enable-debug, create a debug build),
+ AC_HELP_STRING(--enable-debug, enable debug build flags),
found_debug=$enable_debug
)
AM_CONDITIONAL(IS_DEBUG, test "x$found_debug" = xyes)
+# Is this --enable-coverage?
+AC_ARG_ENABLE(
+ coverage,
+ AC_HELP_STRING(--enable-coverage, enable coverage build flags),
+ found_coverage=$enable_coverage
+)
+AM_CONDITIONAL(IS_COVERAGE, test "x$found_coverage" = xyes)
+
# Is this a static build?
AC_ARG_ENABLE(
- static,
- AC_HELP_STRING(--enable-static, create a static build),
- found_static=$enable_static
+ static,
+ AC_HELP_STRING(--enable-static, create a static build),
+ found_static=$enable_static
)
if test "x$found_static" = xyes; then
- LDFLAGS="$LDFLAGS -static"
+ LDFLAGS="$LDFLAGS -static"
+ PKG_CONFIG="pkg-config --static"
fi
# Is this gcc?
AM_CONDITIONAL(IS_GCC, test "x$GCC" = xyes)
-AC_MSG_CHECKING(for gcc that whines about -I)
-AC_EGREP_CPP(
- yes,
- [
- #if __GNUC__ > 3
- yes
- #endif
- ],
- found_gcc4=yes,
- found_gcc4=no
-)
-AM_CONDITIONAL(IS_GCC4, test "x$found_gcc4" = xyes)
-AC_MSG_RESULT($found_gcc4)
# Is this Sun CC?
AC_EGREP_CPP(
@@ -104,16 +83,45 @@ AC_EGREP_CPP(
AM_CONDITIONAL(IS_GLIBC, test "x$found_glibc" = xyes)
AC_MSG_RESULT($found_glibc)
+# Check for various headers. Alternatives included from compat.h.
+AC_CHECK_HEADERS(
+ [ \
+ bitstring.h \
+ curses.h \
+ dirent.h \
+ fcntl.h \
+ inttypes.h \
+ libutil.h \
+ ncurses.h \
+ ndir.h \
+ paths.h \
+ pty.h \
+ stdint.h \
+ sys/dir.h \
+ sys/ndir.h \
+ sys/tree.h \
+ term.h \
+ util.h \
+ ]
+)
+
+# Look for library needed for flock.
+AC_SEARCH_LIBS(flock, bsd)
+
+# Check for some functions that are replaced or omitted.
+AC_CHECK_FUNCS(
+ [ \
+ dirfd \
+ flock \
+ setproctitle \
+ sysconf \
+ cfmakeraw \
+ ]
+)
+
# Look for clock_gettime. Must come before event_init.
AC_SEARCH_LIBS(clock_gettime, rt)
-AC_CHECK_LIB(z, inflate, [],
- [AC_MSG_ERROR([zlib library required])])
-AC_CHECK_LIB(crypto,CRYPTO_new_ex_data, [],
- [AC_MSG_ERROR([OpenSSL library required])])
-AC_CHECK_LIB(ssl, SSL_library_init, [],
- [AC_MSG_ERROR([OpenSSL library required])])
-
# Look for libevent.
PKG_CHECK_MODULES(
LIBEVENT,
@@ -136,20 +144,38 @@ if test "x$found_libevent" = xno; then
AC_MSG_ERROR("libevent not found")
fi
-# Look for curses.
-AC_SEARCH_LIBS(
- setupterm,
- [terminfo curses ncurses],
- found_curses=yes,
- found_curses=no
+# Look for ncurses
+PKG_CHECK_MODULES(
+ LIBNCURSES,
+ ncurses,
+ [
+ CPPFLAGS="$LIBNCURSES_CFLAGS $CPPFLAGS"
+ LIBS="$LIBNCURSES_LIBS $LIBS"
+ found_curses=yes
+ ],
+ [
+ AC_SEARCH_LIBS(
+ setupterm,
+ [ncurses curses terminfo],
+ found_curses=yes,
+ found_curses=no
+ )
+ ]
)
if test "x$found_curses" = xno; then
- AC_MSG_ERROR("curses not found")
+ AC_MSG_ERROR("curses not found")
+fi
+
+# Look for utempter.
+AC_CHECK_HEADER(utempter.h, have_utempter=yes, have_utempter=no)
+if test "x$have_utempter" = xyes; then
+ AC_DEFINE(HAVE_UTEMPTER)
+ LIBS="$LIBS -lutempter"
fi
PKG_CHECK_MODULES(
MSGPACK,
- msgpack,
+ msgpack >= 1.1.0,
[
CPPFLAGS="$MSGPACK_CFLAGS $CPPFLAGS"
LIBS="$MSGPACK_LIBS $LIBS"
@@ -158,13 +184,12 @@ PKG_CHECK_MODULES(
found_msgpack=no
)
if test "x$found_msgpack" = xno; then
- AC_MSG_ERROR("msgpack not found")
+ AC_MSG_ERROR("msgpack >= 1.1.0 not found")
fi
-
PKG_CHECK_MODULES(
LIBSSH,
- libssh,
+ libssh >= 0.6.0,
[
CPPFLAGS="$LIBSSH_CFLAGS $CPPFLAGS"
LIBS="$LIBSSH_LIBS $LIBS"
@@ -173,7 +198,7 @@ PKG_CHECK_MODULES(
found_libssh=no
)
if test "x$found_libssh" = xno; then
- AC_MSG_ERROR("libssh not found")
+ AC_MSG_ERROR("libssh >= 0.6.0 not found")
fi
# Check for b64_ntop.
@@ -253,7 +278,7 @@ if test "x$found_cmsg_data" = xno; then
if test "x$found_cmsg_data" = xyes; then
XOPEN_DEFINES="-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED"
else
- AC_MSG_ERROR("CMSG_DATA not found")
+ AC_MSG_ERROR("CMSG_DATA not found")
fi
fi
AC_SUBST(XOPEN_DEFINES)
@@ -321,6 +346,13 @@ if test "x$found_fgetln" = xyes; then
fi
AM_CONDITIONAL(NO_FGETLN, [test "x$found_fgetln" = xno])
+# Look for fparseln, compat/fparseln.c used if missing.
+AC_CHECK_FUNC(fparseln, found_fparseln=yes, found_fparseln=no)
+if test "x$found_fparseln" = xyes; then
+ AC_DEFINE(HAVE_FPARSELN)
+fi
+AM_CONDITIONAL(NO_FPARSELN, [test "x$found_fparseln" = xno])
+
# Look for strcasestr, compat/strcasestr.c used if missing.
AC_CHECK_FUNC(strcasestr, found_strcasestr=yes, found_strcasestr=no)
if test "x$found_strcasestr" = xyes; then
@@ -342,12 +374,43 @@ if test "x$found_strtonum" = xyes; then
fi
AM_CONDITIONAL(NO_STRTONUM, [test "x$found_strtonum" = xno])
-# Look for strnvis, compat/{vis,unvis}.c used if missing.
-AC_CHECK_FUNC(strnvis, found_strnvis=yes, found_strnvis=no)
-if test "x$found_strnvis" = xyes; then
+# Look for stravis, compat/{vis,unvis}.c used if missing.
+AC_CHECK_FUNC(stravis, found_stravis=yes, found_stravis=no)
+if test "x$found_stravis" = xyes; then
+ AC_MSG_CHECKING(if strnvis is broken)
+ AC_EGREP_HEADER([strnvis\(char \*, const char \*, size_t, int\)],
+ vis.h,
+ AC_MSG_RESULT(no),
+ [found_stravis=no])
+ if test "x$found_stravis" = xno; then
+ AC_MSG_RESULT(yes)
+ fi
+fi
+if test "x$found_stravis" = xyes; then
AC_DEFINE(HAVE_VIS)
fi
-AM_CONDITIONAL(NO_VIS, [test "x$found_strnvis" = xno])
+AM_CONDITIONAL(NO_VIS, [test "x$found_stravis" = xno])
+
+# Look for cfmakeraw, compat/cfmakeraw.c used if missing.
+AC_CHECK_FUNC(cfmakeraw, found_cfmakeraw=yes, found_cfmakeraw=no)
+if test "x$found_cfmakeraw" = xyes; then
+ AC_DEFINE(HAVE_CFMAKERAW)
+fi
+AM_CONDITIONAL(NO_CFMAKERAW, [test "x$found_cfmakeraw" = xno])
+
+# Look for openat, compat/openat.c used if missing.
+AC_CHECK_FUNC(openat, found_openat=yes, found_openat=no)
+if test "x$found_openat" = xyes; then
+ AC_DEFINE(HAVE_OPENAT)
+fi
+AM_CONDITIONAL(NO_OPENAT, [test "x$found_openat" = xno])
+
+# Look for reallocarray, compat/reallocarray.c used if missing.
+AC_CHECK_FUNC(reallocarray, found_reallocarray=yes, found_reallocarray=no)
+if test "x$found_reallocarray" = xyes; then
+ AC_DEFINE(HAVE_REALLOCARRAY)
+fi
+AM_CONDITIONAL(NO_REALLOCARRAY, [test "x$found_reallocarray" = xno])
# Look for getopt. glibc's getopt does not enforce argument order and the ways
# of making it do so are stupid, so just use our own instead.
@@ -374,16 +437,6 @@ if test "x$found_getopt" != xno; then
fi
AM_CONDITIONAL(NO_GETOPT, [test "x$found_getopt" = xno])
-# Check for some functions that are replaced or omitted.
-AC_CHECK_FUNCS(
- [ \
- bzero \
- dirfd \
- setproctitle \
- sysconf \
- ]
-)
-
# Check for BSD-style integer types.
AC_MSG_CHECKING(for BSD-style unsigned types)
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
@@ -393,10 +446,10 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE(
#include <stdint.h>
#else
#include <inttypes.h>
- #endif
+ #endif
int main(void)
{ u_int8_t u8; u_int16_t u16; u_int32_t u32; u_int64_t u64; }
- ])],
+ ])],
[AC_DEFINE(HAVE_BSD_TYPES) AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no)
)
@@ -430,7 +483,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE(
printf("%s\n", cp);
exit(0);
}
- ])],
+ ])],
[AC_DEFINE(HAVE___PROGNAME) AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no)
)
@@ -452,6 +505,10 @@ else
AC_MSG_RESULT(no)
fi
+# Man page defaults to mdoc.
+MANFORMAT=mdoc
+AC_SUBST(MANFORMAT)
+
# Figure out the platform for osdep-*.c and forkpty-*.c.
AC_MSG_CHECKING(platform)
case "$host_os" in
@@ -491,11 +548,16 @@ case "$host_os" in
*solaris*)
AC_MSG_RESULT(sunos)
PLATFORM=sunos
+ MANFORMAT=man
;;
*hpux*)
AC_MSG_RESULT(hpux)
PLATFORM=hpux
;;
+ *cygwin*)
+ AC_MSG_RESULT(cygwin)
+ PLATFORM=cygwin
+ ;;
*)
AC_MSG_RESULT(unknown)
PLATFORM=unknown
@@ -513,5 +575,5 @@ AM_CONDITIONAL(IS_SUNOS, test "x$PLATFORM" = xsunos)
AM_CONDITIONAL(IS_HPUX, test "x$PLATFORM" = xhpux)
AM_CONDITIONAL(IS_UNKNOWN, test "x$PLATFORM" = xunknown)
-# autoconf should create a Makefile. A shock!
+# autoconf should create a Makefile.
AC_OUTPUT(Makefile)