-dnl ---------------------------------------------------------------------------
-dnl Look for the curses libraries. Older curses implementations may require
-dnl termcap/termlib to be linked as well.
-AC_DEFUN([CF_CURSES_LIBS],[
-AC_CHECK_FUNC(initscr,,[
-case $host_os in #(vi
-freebsd*) #(vi
- AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
- ;;
-hpux10.*|hpux11.*)
- AC_CHECK_LIB(cur_colr,initscr,[
- LIBS="-lcur_colr $LIBS"
- CFLAGS="-I/usr/include/curses_colr $CFLAGS"
- ac_cv_func_initscr=yes
- ],[
- AC_CHECK_LIB(Hcurses,initscr,[
- # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
- LIBS="-lHcurses $LIBS"
- CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
- ac_cv_func_initscr=yes
- ])])
- ;;
-linux*) # Suse Linux does not follow /usr/lib convention
- LIBS="$LIBS -L/lib"
- ;;
-esac
-
-if test ".$With5lib" != ".no" ; then
-if test -d /usr/5lib ; then
- # SunOS 3.x or 4.x
- CPPFLAGS="$CPPFLAGS -I/usr/5include"
- LIBS="$LIBS -L/usr/5lib"
-fi
-fi
-
-if test ".$ac_cv_func_initscr" != .yes ; then
- cf_save_LIBS="$LIBS"
- cf_term_lib=""
- cf_curs_lib=""
-
- # Check for library containing tgoto. Do this before curses library
- # because it may be needed to link the test-case for initscr.
- AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
- for cf_term_lib in termcap termlib unknown
- do
- AC_CHECK_LIB($cf_term_lib,tgoto,[break])
- done
- ])
-
- # Check for library containing initscr
- test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
- for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
- do
- AC_CHECK_LIB($cf_curs_lib,initscr,[break])
- done
- test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
-
- LIBS="-l$cf_curs_lib $cf_save_LIBS"
- if test "$cf_term_lib" = unknown ; then
- AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
- AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
- [initscr()],
- [cf_result=yes],
- [cf_result=no])
- AC_MSG_RESULT($cf_result)
- test $cf_result = no && AC_ERROR(Cannot link curses library)
- elif test "$cf_term_lib" != predefined ; then
- AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
- AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
- [initscr(); tgoto((char *)0, 0, 0);],
- [cf_result=no],
- [
- LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
- AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
- [initscr()],
- [cf_result=yes],
- [cf_result=error])
- ])
- AC_MSG_RESULT($cf_result)
- fi
-fi
-
-])])
-
-
-
-dnl @synopsis AC_LIB_READLINE
-dnl
-dnl Searches for a readline compatible library. If found, defines
-dnl `HAVE_LIBREADLINE'. If the found library has the `add_history'
-dnl function, sets also `HAVE_READLINE_HISTORY'. Also checks for the
-dnl locations of the necessary include files and sets `HAVE_READLINE_H'
-dnl or `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
-dnl 'HAVE_HISTORY_H' if the corresponding include files exists.
-dnl
-dnl The libraries that may be readline compatible are `libedit',
-dnl `libeditline' and `libreadline'. Sometimes we need to link a termcap
-dnl library for readline to work, this macro tests these cases too by
-dnl trying to link with `libtermcap', `libcurses' or `libncurses' before
-dnl giving up.
-dnl
-dnl Here is an example of how to use the information provided by this
-dnl macro to perform the necessary includes or declarations in a C file:
-dnl
-dnl #include <config.h>
-dnl
-dnl #ifdef HAVE_LIBREADLINE
-dnl #if defined(HAVE_READLINE_READLINE_H)
-dnl #include <readline/readline.h>
-dnl #elif defined(HAVE_READLINE_H)
-dnl #include <readline.h>
-dnl #else /* !defined(HAVE_READLINE_H) */
-dnl extern char *readline ();
-dnl #endif /* !defined(HAVE_READLINE_H) */
-dnl char *cmdline = NULL;
-dnl #else /* !defined(HAVE_READLINE_READLINE_H) */
-dnl /* no readline */
-dnl #endif /* HAVE_LIBREADLINE */
-dnl
-dnl #ifdef HAVE_READLINE_HISTORY
-dnl #if defined(HAVE_READLINE_HISTORY_H)
-dnl #include <readline/history.h>
-dnl #elif defined(HAVE_HISTORY_H)
-dnl #include <history.h>
-dnl #else /* !defined(HAVE_HISTORY_H) */
-dnl extern void add_history ();
-dnl extern int write_history ();
-dnl extern int read_history ();
-dnl #endif /* defined(HAVE_READLINE_HISTORY_H) */
-dnl /* no history */
-dnl #endif /* HAVE_READLINE_HISTORY */
-dnl
-dnl
-dnl @version $Id$
-dnl @author Ville Laurikari <vl@iki.fi>
-dnl
-AC_DEFUN([AC_LIB_READLINE], [
- AC_CACHE_CHECK([for a readline compatible library],
- ac_cv_lib_readline, [
- ORIG_LIBS="$LIBS"
- for readline_lib in readline edit editline; do
- for termcap_lib in "" termcap curses ncurses; do
- if test -z "$termcap_lib"; then
- TRY_LIB="-l$readline_lib"
- else
- TRY_LIB="-l$readline_lib -l$termcap_lib"
- fi
- LIBS="$ORIG_LIBS $TRY_LIB"
- AC_TRY_LINK_FUNC(readline, ac_cv_lib_readline="$TRY_LIB")
- if test -n "$ac_cv_lib_readline"; then
- break
- fi
- done
- if test -n "$ac_cv_lib_readline"; then
- break
- fi
- done
- if test -z "$ac_cv_lib_readline"; then
- ac_cv_lib_readline="no"
- fi
- LIBS="$ORIG_LIBS"
- ])
-
- if test "$ac_cv_lib_readline" != "no"; then
- LIBS="$LIBS $ac_cv_lib_readline"
- AC_DEFINE(HAVE_LIBREADLINE, 1,
- [Define if you have a readline compatible library])
- AC_CHECK_HEADERS(readline.h readline/readline.h)
- AC_CACHE_CHECK([whether readline supports history],
- ac_cv_lib_readline_history, [
- ac_cv_lib_readline_history="no"
- AC_TRY_LINK_FUNC(add_history, ac_cv_lib_readline_history="yes")
- ])
- if test "$ac_cv_lib_readline_history" = "yes"; then
- AC_DEFINE(HAVE_READLINE_HISTORY, 1,
- [Define if your readline library has \`add_history'])
- AC_CHECK_HEADERS(history.h readline/history.h)
- fi
- fi
-
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# This macro actually does too much some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 8
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-AC_PREREQ([2.52])
-
-# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
-# the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
- AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
- AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_MISSING_PROG(AMTAR, tar)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_][CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_][CC],
- defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_][CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_][CXX],
- defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
-])
-
-# Copyright 2002 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.