-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
92 lines (75 loc) · 2.15 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([bvi.c])
AC_CONFIG_HEADER(config.h)
AC_SYS_LARGEFILE
AC_CANONICAL_HOST
CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
dnl On SunOS4 systems you have to use the /usr/5bin/cc compiler
dnl to get the SYSV curses library:
case "$host_os" in
sunos4*)
AC_MSG_RESULT("using /usr/5bin/cc")
CC="/usr/5bin/cc"
ac_objext="o"
;;
*)
AC_PROG_CC
;;
esac
dnl Some curses specials
dnl Solaris needs for tputs 'putc(char)' instead of 'putc(int)'
case "$host_os" in
solaris*)
CPPFLAGS="${CPPFLAGS} -D_MSE_INT_H"
AC_DEFINE(NEED_PUTC_CHAR)
;;
hpux9*) DEFS=${DEFS-"-DMINICURSES"}
;;
esac
dnl Checks for programs.
AC_PROG_INSTALL
dnl Check for typedefs
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(void *)
AC_CHECK_TYPE(size_t, unsigned int)
AC_CHECK_TYPE(off_t, int)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h termcap.h termio.h termios.h unistd.h term.h ncurses/term.h)
dnl Check if ncurses requested
_cppflags="${CPPFLAGS}"
_ldflags="${LDFLAGS}"
AC_ARG_WITH(ncurses,
[ --with-ncurses[=DIR] path to ncurses],[
if test "$withval" != "no"; then
CPPFLAGS="${CPPFLAGS} -I$withval/include -I$withval/include/ncurses"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
])
AC_CHECK_HEADER([ncurses.h],[
AC_SEARCH_LIBS([initscr], [ncurses],[
AC_DEFINE(HAVE_NCURSES_H)
AC_SEARCH_LIBS([tputs], [tinfo])], [
AC_SEARCH_LIBS([initscr], [curses],[
AC_DEFINE(HAVE_CURSES_H)
AC_SEARCH_LIBS([tputs], [tinfo])],[
AC_MSG_ERROR([bvi requires the curses library])])])],[
AC_CHECK_HEADER([curses.h],[
AC_SEARCH_LIBS([initscr], [curses], [
AC_DEFINE(HAVE_CURSES_H)],[
AC_MSG_ERROR([bvi requires the curses library])])],[
AC_MSG_ERROR([bvi requires the curses library])])])
dnl Checks for typedefs, structures, and compiler characteristics.
dnl AC_TYPE_SIZE_T
dnl Checks for library functions.
dnl AC_TYPE_SIGNAL
AC_CHECK_FUNCS(strdup strtol strtoll strerror memmove)
AC_FUNC_FSEEKO
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_PROG_INSTALL
AC_CONFIG_FILES([Makefile])
AC_OUTPUT