summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/texinfo/configure.in
blob: c2e95ca5cf53426463d39835aa76d3bd612beb0e (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
dnl Process this file with autoconf to produce a configure script.
dnl $Id: configure.in,v 1.3 2000/02/09 02:18:36 espie Exp $
dnl
AC_INIT(makeinfo/makeinfo.c)
AC_PREREQ(2.13)dnl Minimum Autoconf version required.
AM_CONFIG_HEADER(config.h:config.in)dnl Keep filename to 8.3 for MS-DOS.

AM_INIT_AUTOMAKE([texinfo], [4.0])

AM_CONDITIONAL(TEXINFO_MAINT, test -n "$TEXINFO_MAINT")

dnl Checks for programs.
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_RANLIB

AC_ISC_POSIX
AC_MINIX

# Needed on sysV68 for sigblock, sigsetmask.  But check for it in libc first.
AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))

# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
# rather ncurses.  So we check for it.
TERMLIBS=
# Check for termlib before termcap because Solaris termcap needs libucb.
for termlib in ncurses curses termlib termcap terminfo; do
   AC_CHECK_LIB(${termlib}, tgetent,
     [TERMLIBS="${TERMLIBS} -l${termlib}"; break])
done

dnl Checks for header files.
dnl Do not use <ncurses/termcap.h> unless we're linking with ncurses.
if test "x$termlib" = xncurses; then
  dnl Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined.
  AC_CHECK_HEADERS(ncurses/termcap.h)
fi
AC_HEADER_STAT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h pwd.h string.h strings.h termcap.h termio.h \
  termios.h unistd.h \
  sys/fcntl.h sys/file.h sys/ptem.h sys/time.h sys/ttold.h sys/wait.h)
AM_SYS_POSIX_TERMIOS
AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL

dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_TYPE_SIGNAL
AC_C_CONST
AC_STRUCT_TM

dnl Checks for function declarations.
txi_CHECK_DECLS

dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_STRCOLL
AC_FUNC_VPRINTF
AC_FUNC_SETVBUF_REVERSED
AC_CHECK_FUNCS(setvbuf getcwd memset bzero strchr sigprocmask sigsetmask)
dnl strerror, xmalloc, xrealloc, probably others should be added.
AC_REPLACE_FUNCS(memcpy memmove strdup strcasecmp strerror strncasecmp)

dnl Checks for variables.
# HP-UX 9 (at least) needs -lncurses which defines termcap variables PC etc.
AC_MSG_CHECKING(for library with termcap variables)
AC_CACHE_VAL(ac_cv_var_ospeed,
oldLIBS=$LIBS 
for trylib in $termlib ncurses curses termlib termcap terminfo; do
   if test "x$trylib" != "x$termlib"; then
     LIBS="$oldLIBS -l$termlib -l$trylib"
   else
     LIBS="$oldLIBS -l$termlib"
   fi
   AC_TRY_LINK(, 
#ifdef HAVE_NCURSES_TERMCAP_H
#include <ncurses/termcap.h>
#else
#ifdef HAVE_TERMCAP_H
#include <termcap.h>
#else
#undef PC
char *BC;
char* *UP;
char PC;      
short ospeed; 
#endif
#endif
return ospeed != 0;
, ac_cv_var_ospeed=$trylib; break)
done
LIBS=$oldLIBS
)
AC_MSG_RESULT($ac_cv_var_ospeed)
if test -n "$ac_cv_var_ospeed" \
   && test "x$termlib" != "x$ac_cv_var_ospeed"; then
  TERMLIBS="${TERMLIBS} -l${ac_cv_var_ospeed}"
fi
AC_SUBST(TERMLIBS)

dnl Set of available languages and i18n macros.
ALL_LINGUAS="cs de de_AT eo fr nl no ru"
AM_GNU_GETTEXT

AC_OUTPUT([Makefile             \
           doc/Makefile         \
           info/Makefile        \
           intl/Makefile        \
           lib/Makefile         \
           makeinfo/Makefile    \
           makeinfo/tests/Makefile \
           po/Makefile.in	\
           util/Makefile        \
           ])