source: trunk/essentials/sys-apps/texinfo/configure.ac@ 3166

Last change on this file since 3166 was 3043, checked in by bird, 19 years ago

-> essentials

File size: 6.9 KB
RevLine 
[2617]1# Process this file with autoconf to produce a configure script.
2# $Id: configure.ac,v 1.50 2004/12/22 13:29:44 karl Exp $
3#
4# This file is free software; as a special exception the author gives
5# unlimited permission to copy and/or distribute it, with or without
6# modifications, as long as this notice is preserved.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11#
12AC_PREREQ(2.59)# Minimum Autoconf version required.
13#
14AC_INIT([GNU Texinfo], [4.8])
15AC_CONFIG_HEADERS(config.h:config.in)# Keep filename to 8.3 for MS-DOS.
16AC_CONFIG_SRCDIR([makeinfo/makeinfo.c])
17AM_INIT_AUTOMAKE([dist-bzip2])
18
19# When the Texinfo source is imported into other repositories
20# (NetBSD and TeX Live), timestamps are generally not preserved. This
21# causes lots of annoyance, so --enable-maintainer-mode. Sorry.
22AM_MAINTAINER_MODE
23
24# Checks for programs.
25AC_PROG_CC
26AC_PROG_GCC_TRADITIONAL
27AC_PROG_INSTALL
28AC_PROG_MAKE_SET
29AC_PROG_RANLIB
30AM_MISSING_PROG(HELP2MAN, help2man)
31
32AC_ISC_POSIX
33AC_MINIX
34
35# Needed on sysV68 for sigblock, sigsetmask. But check for it in libc first.
[2659]36#bird: this is busted
37#AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))
[2617]38
39# Checks for header files.
40AC_HEADER_STAT
41AC_HEADER_STDC
42AC_CHECK_HEADERS(fcntl.h io.h limits.h pwd.h string.h strings.h \
43 termcap.h termio.h termios.h unistd.h \
44 sys/fcntl.h sys/file.h sys/stream.h sys/time.h sys/ttold.h sys/wait.h)
45
46# sys/ptem.h requires sys/stream.h for mblk_t on Solaris.
47AC_CHECK_HEADERS([sys/ptem.h],,,
48[#if HAVE_SYS_STREAM_H
49#include <sys/stream.h>
50#endif
51])
52
53AC_SYS_POSIX_TERMIOS
54AC_HEADER_TIOCGWINSZ
55
56# Checks for typedefs, structures, and compiler characteristics.
57AC_TYPE_OFF_T
58AC_TYPE_SIGNAL
59AC_C_CONST
60AC_STRUCT_TM
61
62# Checks for function declarations.
63AC_CHECK_DECLS([memchr, strcoll, strerror])
64
65# Checks for library functions.
66AC_FUNC_ALLOCA
67AC_FUNC_STRCOLL
68AC_FUNC_VPRINTF
69# in theory only pre-sysvr3 systems needed this and it's not likely
70# that anyone compiling new texinfo still has such a thing? we'll see.
71# AC_FUNC_SETVBUF_REVERSED
72AC_CHECK_FUNCS(bzero getcwd memset setvbuf sigaction sigprocmask \
73 sigsetmask strchr)
74AC_REPLACE_FUNCS(memcpy memmove strdup strerror)
75
76# strcasecmp and strncasecmp, gnulib-style.
77gl_STRCASE
78
79# We want to recognize djgpp to avoid the useless warning about no
80# term library.
81AC_CANONICAL_BUILD
82
83# We need to run some of our own binaries, most notably makedoc, but as
84# long as we have this process, we also use our own makeinfo and
85# install-info.
[2659]86#
[2617]87# This means that if we are cross compiling, we have to configure the
88# package twice: once with the native compiler (this is done in a
89# subdirectory $native_tools), and once with the cross compiler.
90# The former is invoked automatically here, with --host=$build.
91# $native_tools is also added to SUBDIRS in the main Makefile.am,
92# so that make compiles the native tools first.
93#
94if test "$cross_compiling" = no; then
95 native_tools=
96else
97 native_tools=tools
98 test -d "$native_tools" || mkdir "$native_tools"
99 confdir=`(cd "$srcdir";pwd)`
100 # Make sure the secondary configure won't fail with
101 # "error: source directory already configured".
102 rm -f config.status
103 AC_MSG_NOTICE([[Doing configure of native tools (${build}).]])
104 cd "$native_tools" || exit 1
105 # Run secondary configure in alternate environment or
106 # it gets the wrong CC etc. env -i gives this build host configure
107 # a clean environment.
108 env -i CC="${BUILD_CC}" AR="${BUILD_AR}" RANLIB="${BUILD_RANLIB}" \
109 PATH="${PATH}" \
110 tools_only=1 \
111 ${confdir}/configure --build=${build} --host=${build} \
112 --disable-rpath --disable-nls
113 cd .. || exit 1
114 AC_MSG_NOTICE([[Continuing with main configure (${host}).]])
115fi
116AC_SUBST(native_tools)
117AM_CONDITIONAL(TOOLS_ONLY, [[test "x$tools_only" = x1]])
118
119# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
120# rather ncurses. So we check for it.
121TERMLIBS=
122# Check for termlib before termcap because Solaris termcap needs libucb.
123TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo"
124for termlib in ${TERMLIB_VARIANTS}; do
125 AC_CHECK_LIB(${termlib}, tgetent,
126 [TERMLIBS="${TERMLIBS} -l${termlib}"; break])
127done
128# don't bother warning on djgpp, it doesn't have a term library, it
129# ports each termcap-needing program separately according to its needs.
130if test -z "$TERMLIBS" && echo "$build" | grep -v djgpp >/dev/null; then
131 AC_MSG_WARN([probably need a terminal library, one of: ${TERMLIB_VARIANTS}])
132fi
133
134# Checks for variables.
135# HP-UX 9 (at least) needs -lncurses which defines termcap variables PC etc.
136AC_MSG_CHECKING(for library with termcap variables)
137AC_CACHE_VAL(ac_cv_var_ospeed,
138oldLIBS=$LIBS
139for trylib in $termlib ${TERMLIB_VARIANTS}; do
140 if test "x$trylib" != "x$termlib"; then
141 LIBS="$oldLIBS -l$termlib -l$trylib"
142 else
143 LIBS="$oldLIBS -l$termlib"
144 fi
145 AC_TRY_LINK(,
146[#ifdef HAVE_NCURSES_TERMCAP_H
147#include <ncurses/termcap.h>