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 | #
|
---|
12 | AC_PREREQ(2.59)# Minimum Autoconf version required.
|
---|
13 | #
|
---|
14 | AC_INIT([GNU Texinfo], [4.8])
|
---|
15 | AC_CONFIG_HEADERS(config.h:config.in)# Keep filename to 8.3 for MS-DOS.
|
---|
16 | AC_CONFIG_SRCDIR([makeinfo/makeinfo.c])
|
---|
17 | AM_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.
|
---|
22 | AM_MAINTAINER_MODE
|
---|
23 |
|
---|
24 | # Checks for programs.
|
---|
25 | AC_PROG_CC
|
---|
26 | AC_PROG_GCC_TRADITIONAL
|
---|
27 | AC_PROG_INSTALL
|
---|
28 | AC_PROG_MAKE_SET
|
---|
29 | AC_PROG_RANLIB
|
---|
30 | AM_MISSING_PROG(HELP2MAN, help2man)
|
---|
31 |
|
---|
32 | AC_ISC_POSIX
|
---|
33 | AC_MINIX
|
---|
34 |
|
---|
35 | # Needed on sysV68 for sigblock, sigsetmask. But check for it in libc first.
|
---|
36 | AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))
|
---|
37 |
|
---|
38 | # Checks for header files.
|
---|
39 | AC_HEADER_STAT
|
---|
40 | AC_HEADER_STDC
|
---|
41 | AC_CHECK_HEADERS(fcntl.h io.h limits.h pwd.h string.h strings.h \
|
---|
42 | termcap.h termio.h termios.h unistd.h \
|
---|
43 | sys/fcntl.h sys/file.h sys/stream.h sys/time.h sys/ttold.h sys/wait.h)
|
---|
44 |
|
---|
45 | # sys/ptem.h requires sys/stream.h for mblk_t on Solaris.
|
---|
46 | AC_CHECK_HEADERS([sys/ptem.h],,,
|
---|
47 | [#if HAVE_SYS_STREAM_H
|
---|
48 | #include <sys/stream.h>
|
---|
49 | #endif
|
---|
50 | ])
|
---|
51 |
|
---|
52 | AC_SYS_POSIX_TERMIOS
|
---|
53 | AC_HEADER_TIOCGWINSZ
|
---|
54 |
|
---|
55 | # Checks for typedefs, structures, and compiler characteristics.
|
---|
56 | AC_TYPE_OFF_T
|
---|
57 | AC_TYPE_SIGNAL
|
---|
58 | AC_C_CONST
|
---|
59 | AC_STRUCT_TM
|
---|
60 |
|
---|
61 | # Checks for function declarations.
|
---|
62 | AC_CHECK_DECLS([memchr, strcoll, strerror])
|
---|
63 |
|
---|
64 | # Checks for library functions.
|
---|
65 | AC_FUNC_ALLOCA
|
---|
66 | AC_FUNC_STRCOLL
|
---|
67 | AC_FUNC_VPRINTF
|
---|
68 | # in theory only pre-sysvr3 systems needed this and it's not likely
|
---|
69 | # that anyone compiling new texinfo still has such a thing? we'll see.
|
---|
70 | # AC_FUNC_SETVBUF_REVERSED
|
---|
71 | AC_CHECK_FUNCS(bzero getcwd memset setvbuf sigaction sigprocmask \
|
---|
72 | sigsetmask strchr)
|
---|
73 | AC_REPLACE_FUNCS(memcpy memmove strdup strerror)
|
---|
74 |
|
---|
75 | # strcasecmp and strncasecmp, gnulib-style.
|
---|
76 | gl_STRCASE
|
---|
77 |
|
---|
78 | # We want to recognize djgpp to avoid the useless warning about no
|
---|
79 | # term library.
|
---|
80 | AC_CANONICAL_BUILD
|
---|
81 |
|
---|
82 | # We need to run some of our own binaries, most notably makedoc, but as
|
---|
83 | # long as we have this process, we also use our own makeinfo and
|
---|
84 | # install-info.
|
---|
85 | #
|
---|
86 | # This means that if we are cross compiling, we have to configure the
|
---|
87 | # package twice: once with the native compiler (this is done in a
|
---|
88 | # subdirectory $native_tools), and once with the cross compiler.
|
---|
89 | # The former is invoked automatically here, with --host=$build.
|
---|
90 | # $native_tools is also added to SUBDIRS in the main Makefile.am,
|
---|
91 | # so that make compiles the native tools first.
|
---|
92 | #
|
---|
93 | if test "$cross_compiling" = no; then
|
---|
94 | native_tools=
|
---|
95 | else
|
---|
96 | native_tools=tools
|
---|
97 | test -d "$native_tools" || mkdir "$native_tools"
|
---|
98 | confdir=`(cd "$srcdir";pwd)`
|
---|
99 | # Make sure the secondary configure won't fail with
|
---|
100 | # "error: source directory already configured".
|
---|
101 | rm -f config.status
|
---|
102 | AC_MSG_NOTICE([[Doing configure of native tools (${build}).]])
|
---|
103 | cd "$native_tools" || exit 1
|
---|
104 | # Run secondary configure in alternate environment or
|
---|
105 | # it gets the wrong CC etc. env -i gives this build host configure
|
---|
106 | # a clean environment.
|
---|
107 | env -i CC="${BUILD_CC}" AR="${BUILD_AR}" RANLIB="${BUILD_RANLIB}" \
|
---|
108 | PATH="${PATH}" \
|
---|
109 | tools_only=1 \
|
---|
110 | ${confdir}/configure --build=${build} --host=${build} \
|
---|
111 | --disable-rpath --disable-nls
|
---|
112 | cd .. || exit 1
|
---|
113 | AC_MSG_NOTICE([[Continuing with main configure (${host}).]])
|
---|
114 | fi
|
---|
115 | AC_SUBST(native_tools)
|
---|
116 | AM_CONDITIONAL(TOOLS_ONLY, [[test "x$tools_only" = x1]])
|
---|
117 |
|
---|
118 | # Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
|
---|
119 | # rather ncurses. So we check for it.
|
---|
120 | TERMLIBS=
|
---|
121 | # Check for termlib before termcap because Solaris termcap needs libucb.
|
---|
122 | TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo"
|
---|
123 | for termlib in ${TERMLIB_VARIANTS}; do
|
---|
124 | AC_CHECK_LIB(${termlib}, tgetent,
|
---|
125 | [TERMLIBS="${TERMLIBS} -l${termlib}"; break])
|
---|
126 | done
|
---|
127 | # don't bother warning on djgpp, it doesn't have a term library, it
|
---|
128 | # ports each termcap-needing program separately according to its needs.
|
---|
129 | if test -z "$TERMLIBS" && echo "$build" | grep -v djgpp >/dev/null; then
|
---|
130 | AC_MSG_WARN([probably need a terminal library, one of: ${TERMLIB_VARIANTS}])
|
---|
131 | fi
|
---|
132 |
|
---|
133 | # Checks for variables.
|
---|
134 | # HP-UX 9 (at least) needs -lncurses which defines termcap variables PC etc.
|
---|
135 | AC_MSG_CHECKING(for library with termcap variables)
|
---|
136 | AC_CACHE_VAL(ac_cv_var_ospeed,
|
---|
137 | oldLIBS=$LIBS
|
---|
138 | for trylib in $termlib ${TERMLIB_VARIANTS}; do
|
---|
139 | if test "x$trylib" != "x$termlib"; then
|
---|
140 | LIBS="$oldLIBS -l$termlib -l$trylib"
|
---|
141 | else
|
---|
142 | LIBS="$oldLIBS -l$termlib"
|
---|
143 | fi
|
---|
144 | AC_TRY_LINK(,
|
---|
145 | [#ifdef HAVE_NCURSES_TERMCAP_H
|
---|
146 | #include <ncurses/termcap.h>
|
---|
147 | #else
|
---|
148 | #ifdef HAVE_TERMCAP_H
|
---|
149 | #include <termcap.h>
|
---|
150 | #else
|
---|
151 | #undef PC
|
---|
152 | char *BC;
|
---|
153 | char **UP;
|
---|
154 | char PC;
|
---|
155 | short ospeed;
|
---|
156 | #endif
|
---|
157 | #endif
|
---|
158 | /* Make sure all variables actually exist. AIX 4.3 has ospeed but no BC.
|
---|
159 | --Andreas Ley <andy@rz.uni-karlsruhe.de> 24 Aug 2000. */
|
---|
160 | BC++;
|
---|
161 | UP++;
|
---|
162 | PC++;
|
---|
163 | return ospeed != 0;
|
---|
164 | ], ac_cv_var_ospeed=$trylib; break)
|
---|
165 | done
|
---|
166 | LIBS=$oldLIBS
|
---|
167 | )
|
---|
168 | AC_MSG_RESULT($ac_cv_var_ospeed)
|
---|
169 | if test -n "$ac_cv_var_ospeed" \
|
---|
170 | && test "x$termlib" != "x$ac_cv_var_ospeed"; then
|
---|
171 | TERMLIBS="${TERMLIBS} -l${ac_cv_var_ospeed}"
|
---|
172 | fi
|
---|
173 | AC_SUBST(TERMLIBS)#
|
---|
174 |
|
---|
175 | # Do not use <ncurses/termcap.h> unless we're linking with ncurses.
|
---|
176 | # Must come after the termlib tests.
|
---|
177 | if test "x$termlib" = xncurses; then
|
---|
178 | # Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined.
|
---|
179 | AC_CHECK_HEADERS(ncurses/termcap.h)
|
---|
180 | fi
|
---|
181 |
|
---|
182 | # gnulib.
|
---|
183 | gl_FUNC_MKSTEMP
|
---|
184 |
|
---|
185 | # For teTeX and TeX Live.
|
---|
186 | AC_CANONICAL_HOST
|
---|
187 | AC_ARG_ENABLE(multiplatform,
|
---|
188 | [ --enable-multiplatform put executables in bin/PLATFORM])
|
---|
189 | # if enable_multiplatform is set in the environment, use that.
|
---|
190 | test "x$enable_multiplatform" = xyes \
|
---|
191 | && test "x$bindir" = 'x${exec_prefix}/bin' \
|
---|
192 | && bindir="$bindir/$host"
|
---|
193 |
|
---|
194 | # Taken from the example in
|
---|
195 | # http://www.gnu.org/software/automake/manual/html_node/Conditionals.html.
|
---|
196 | AC_ARG_ENABLE(install-warnings,
|
---|
197 | [ --disable-install-warnings omit make install warnings about TeX files],
|
---|
198 | [case "${enableval}" in
|
---|
199 | yes) install_warnings=true ;;
|
---|
200 | no) install_warnings=false ;;
|
---|
201 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-install-warnings) ;;
|
---|
202 | esac],
|
---|
203 | [install_warnings=true])
|
---|
204 | AM_CONDITIONAL(INSTALL_WARNINGS,
|
---|
205 | test x"$install_warnings" = xtrue || test x"$install_warnings" = xyes)
|
---|
206 |
|
---|
207 | # i18n support. To update to a new version of gettext, run:
|
---|
208 | # gettextize -f -c --intl
|
---|
209 | AM_GNU_GETTEXT_VERSION(0.14.1)
|
---|
210 | AM_GNU_GETTEXT()
|
---|
211 |
|
---|
212 | AC_CONFIG_FILES([
|
---|
213 | Makefile
|
---|
214 | doc/Makefile
|
---|
215 | info/Makefile
|
---|
216 | intl/Makefile
|
---|
217 | lib/Makefile
|
---|
218 | m4/Makefile
|
---|
219 | makeinfo/Makefile
|
---|
220 | makeinfo/tests/Makefile
|
---|
221 | po/Makefile.in
|
---|
222 | util/Makefile
|
---|
223 | ])
|
---|
224 | AC_OUTPUT
|
---|