even better
[apps/madtty.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([maddty], 0.0.0)
4
5 AC_SUBST(PACKAGE_NAME)
6 AC_SUBST(PACKAGE_VERSION)
7
8 AC_CONFIG_SRCDIR([madtty/madtty.h])
9
10 dnl Checks for programs.
11 AC_PROG_CC
12
13 dnl Checks for header files.
14 AC_HEADER_STDC
15 AC_HEADER_STDBOOL
16 AC_CHECK_HEADERS([sys/types.h unistd.h stdlib.h string.h])
17
18 dnl Check for libraries
19 AC_ARG_ENABLE([ncurses],
20               AS_HELP_STRING([--disable-ncurses], [disables ncurses support (default enabled)]))
21 if test "${enable_curses}" != "no"; then
22     AC_CHECK_LIB([ncurses], [initscr], [],
23                  AC_MSG_ERROR([Need ncurses to compile ncurses support.]))
24     CFLAGS="$CFLAGS -DUSE_NCURSES"
25 fi
26
27 AC_ARG_ENABLE([pty],
28               AS_HELP_STRING([--disable-pty], [disables pty support (default enabled)]))
29 if test "${enable_pty}" != "no"; then
30     AC_CHECK_LIB([util], [forkpty], [],
31                  AC_MSG_ERROR([Need util library (forkpty function) to compile pty support.]))
32     CFLAGS="$CFLAGS -DUSE_PTY"
33 fi
34
35 dnl Checks for library functions
36 AC_CHECK_FUNCS([memset select setenv])
37 AC_FUNC_MALLOC
38 AC_FUNC_SELECT_ARGTYPES
39
40 dnl Checks for typedefs, structures, and compiler characteristics.
41 AC_C_CONST
42 AC_HEADER_TIME
43 AC_C_INLINE
44 AC_TYPE_PID_T
45 AC_TYPE_SIGNAL
46
47 AC_CONFIG_FILES([am/vars.mk madtty/madtty.pc])
48 AC_OUTPUT
49