| 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 | #bird: this is busted
 | 
|---|
| 37 | #AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))
 | 
|---|
| 38 | 
 | 
|---|
| 39 | # Checks for header files.
 | 
|---|
| 40 | AC_HEADER_STAT
 | 
|---|
| 41 | AC_HEADER_STDC
 | 
|---|
| 42 | AC_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.
 | 
|---|
| 47 | AC_CHECK_HEADERS([sys/ptem.h],,,
 | 
|---|
| 48 | [#if HAVE_SYS_STREAM_H
 | 
|---|
| 49 | #include <sys/stream.h>
 | 
|---|
| 50 | #endif
 | 
|---|
| 51 | ])
 | 
|---|
| 52 | 
 | 
|---|
| 53 | AC_SYS_POSIX_TERMIOS
 | 
|---|
| 54 | AC_HEADER_TIOCGWINSZ
 | 
|---|
| 55 | 
 | 
|---|
| 56 | # Checks for typedefs, structures, and compiler characteristics.
 | 
|---|
| 57 | AC_TYPE_OFF_T
 | 
|---|
| 58 | AC_TYPE_SIGNAL
 | 
|---|
| 59 | AC_C_CONST
 | 
|---|
| 60 | AC_STRUCT_TM
 | 
|---|
| 61 | 
 | 
|---|
| 62 | # Checks for function declarations.
 | 
|---|
| 63 | AC_CHECK_DECLS([memchr, strcoll, strerror])
 | 
|---|
| 64 | 
 | 
|---|
| 65 | # Checks for library functions.
 | 
|---|
| 66 | AC_FUNC_ALLOCA
 | 
|---|
| 67 | AC_FUNC_STRCOLL
 | 
|---|
| 68 | AC_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
 | 
|---|
| 72 | AC_CHECK_FUNCS(bzero getcwd memset setvbuf sigaction sigprocmask \
 | 
|---|
| 73 |                sigsetmask strchr)
 | 
|---|
| 74 | AC_REPLACE_FUNCS(memcpy memmove strdup strerror)
 | 
|---|
| 75 | 
 | 
|---|
| 76 | # strcasecmp and strncasecmp, gnulib-style.
 | 
|---|
| 77 | gl_STRCASE
 | 
|---|
| 78 | 
 | 
|---|
| 79 | # We want to recognize djgpp to avoid the useless warning about no
 | 
|---|
| 80 | # term library.
 | 
|---|
| 81 | AC_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.
 | 
|---|
| 86 | #
 | 
|---|
| 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 | #
 | 
|---|
| 94 | if test "$cross_compiling" = no; then
 | 
|---|
| 95 |   native_tools=
 | 
|---|
| 96 | else
 | 
|---|
| 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}).]])
 | 
|---|
| 115 | fi
 | 
|---|
| 116 | AC_SUBST(native_tools)
 | 
|---|
| 117 | AM_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.
 | 
|---|
| 121 | TERMLIBS=
 | 
|---|
| 122 | # Check for termlib before termcap because Solaris termcap needs libucb.
 | 
|---|
| 123 | TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo"
 | 
|---|
| 124 | for termlib in ${TERMLIB_VARIANTS}; do
 | 
|---|
| 125 |   AC_CHECK_LIB(${termlib}, tgetent,
 | 
|---|
| 126 |      [TERMLIBS="${TERMLIBS} -l${termlib}"; break])
 | 
|---|
| 127 | done
 | 
|---|
| 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.
 | 
|---|
| 130 | if test -z "$TERMLIBS" && echo "$build" | grep -v djgpp >/dev/null; then
 | 
|---|
| 131 |   AC_MSG_WARN([probably need a terminal library, one of: ${TERMLIB_VARIANTS}])
 | 
|---|
| 132 | fi
 | 
|---|
| 133 | 
 | 
|---|
| 134 | # Checks for variables.
 | 
|---|
| 135 | # HP-UX 9 (at least) needs -lncurses which defines termcap variables PC etc.
 | 
|---|
| 136 | AC_MSG_CHECKING(for library with termcap variables)
 | 
|---|
| 137 | AC_CACHE_VAL(ac_cv_var_ospeed,
 | 
|---|
| 138 | oldLIBS=$LIBS
 | 
|---|
| 139 | for 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>
 | 
|---|
| 148 | #else
 | 
|---|
| 149 | #ifdef HAVE_TERMCAP_H
 | 
|---|
| 150 | #include <termcap.h>
 | 
|---|
| 151 | #else
 | 
|---|
| 152 | #undef PC
 | 
|---|
| 153 | char *BC;
 | 
|---|
| 154 | char **UP;
 | 
|---|
| 155 | char PC;
 | 
|---|
| 156 | short ospeed;
 | 
|---|
| 157 | #endif
 | 
|---|
| 158 | #endif
 | 
|---|
| 159 | /* Make sure all variables actually exist.  AIX 4.3 has ospeed but no BC.
 | 
|---|
| 160 |    --Andreas Ley <andy@rz.uni-karlsruhe.de> 24 Aug 2000.  */
 | 
|---|
| 161 | BC++;
 | 
|---|
| 162 | UP++;
 | 
|---|
| 163 | PC++;
 | 
|---|
| 164 | return ospeed != 0;
 | 
|---|
| 165 | ], ac_cv_var_ospeed=$trylib; break)
 | 
|---|
| 166 | done
 | 
|---|
| 167 | LIBS=$oldLIBS
 | 
|---|
| 168 | )
 | 
|---|
| 169 | AC_MSG_RESULT($ac_cv_var_ospeed)
 | 
|---|
| 170 | if test -n "$ac_cv_var_ospeed" \
 | 
|---|
| 171 |    && test "x$termlib" != "x$ac_cv_var_ospeed"; then
 | 
|---|
| 172 |   TERMLIBS="${TERMLIBS} -l${ac_cv_var_ospeed}"
 | 
|---|
| 173 | fi
 | 
|---|
| 174 | AC_SUBST(TERMLIBS)#
 | 
|---|
| 175 | 
 | 
|---|
| 176 | # Do not use <ncurses/termcap.h> unless we're linking with ncurses.
 | 
|---|
| 177 | # Must come after the termlib tests.
 | 
|---|
| 178 | if test "x$termlib" = xncurses; then
 | 
|---|
| 179 |   # Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined.
 | 
|---|
| 180 |   AC_CHECK_HEADERS(ncurses/termcap.h)
 | 
|---|
| 181 | fi
 | 
|---|
| 182 | 
 | 
|---|
| 183 | # gnulib.
 | 
|---|
| 184 | gl_FUNC_MKSTEMP
 | 
|---|
| 185 | 
 | 
|---|
| 186 | # For teTeX and TeX Live.
 | 
|---|
| 187 | AC_CANONICAL_HOST
 | 
|---|
| 188 | AC_ARG_ENABLE(multiplatform,
 | 
|---|
| 189 |   [  --enable-multiplatform      put executables in bin/PLATFORM])
 | 
|---|
| 190 | # if enable_multiplatform is set in the environment, use that.
 | 
|---|
| 191 | test "x$enable_multiplatform" = xyes \
 | 
|---|
| 192 | && test "x$bindir" = 'x${exec_prefix}/bin' \
 | 
|---|
| 193 | && bindir="$bindir/$host"
 | 
|---|
| 194 | 
 | 
|---|
| 195 | # Taken from the example in
 | 
|---|
| 196 | # http://www.gnu.org/software/automake/manual/html_node/Conditionals.html.
 | 
|---|
| 197 | AC_ARG_ENABLE(install-warnings,
 | 
|---|
| 198 |   [  --disable-install-warnings  omit make install warnings about TeX files],
 | 
|---|
| 199 |   [case "${enableval}" in
 | 
|---|
| 200 |      yes) install_warnings=true ;;
 | 
|---|
| 201 |       no) install_warnings=false ;;
 | 
|---|
| 202 |        *) AC_MSG_ERROR(bad value ${enableval} for --enable-install-warnings) ;;
 | 
|---|
| 203 |    esac],
 | 
|---|
| 204 |    [install_warnings=true])
 | 
|---|
| 205 | AM_CONDITIONAL(INSTALL_WARNINGS,
 | 
|---|
| 206 |    test x"$install_warnings" = xtrue || test x"$install_warnings" = xyes)
 | 
|---|
| 207 | 
 | 
|---|
| 208 | # i18n support.  To update to a new version of gettext, run:
 | 
|---|
| 209 | # gettextize -f -c --intl
 | 
|---|
| 210 | AM_GNU_GETTEXT_VERSION(0.14.1)
 | 
|---|
| 211 | AM_GNU_GETTEXT()
 | 
|---|
| 212 | 
 | 
|---|
| 213 | AC_CONFIG_FILES([
 | 
|---|
| 214 |   Makefile
 | 
|---|
| 215 |   doc/Makefile
 | 
|---|
| 216 |   info/Makefile
 | 
|---|
| 217 |   intl/Makefile
 | 
|---|
| 218 |   lib/Makefile
 | 
|---|
| 219 |   m4/Makefile
 | 
|---|
| 220 |   makeinfo/Makefile
 | 
|---|
| 221 |   makeinfo/tests/Makefile
 | 
|---|
| 222 |   po/Makefile.in
 | 
|---|
| 223 |   util/Makefile
 | 
|---|
| 224 | ])
 | 
|---|
| 225 | AC_OUTPUT
 | 
|---|