dnl $Id: configure.in,v 1.18 1998/07/13 08:09:25 zeller Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl Copyright (C) 1996-1998 Technische Universitaet Braunschweig, Germany.
dnl Written by Andreas Zeller <zeller@ips.cs.tu-bs.de>.
dnl 
dnl This file is part of DDD.
dnl 
dnl DDD is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU General Public
dnl License as published by the Free Software Foundation; either
dnl version 2 of the License, or (at your option) any later version.
dnl 
dnl DDD is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dnl See the GNU General Public License for more details.
dnl 
dnl You should have received a copy of the GNU General Public
dnl License along with DDD -- see the file COPYING.
dnl If not, write to the Free Software Foundation, Inc.,
dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dnl 
dnl DDD is the data display debugger.
dnl For details, see the DDD World-Wide-Web page, 
dnl `http://www.cs.tu-bs.de/softech/ddd/',
dnl or send a mail to the DDD developers <ddd@ips.cs.tu-bs.de>.
dnl
dnl
dnl
dnl
dnl
dnl Revision Control.
dnl
AC_PREREQ(2.6)
AC_REVISION([$Id: configure.in,v 1.18 1998/07/13 08:09:25 zeller Exp $])
dnl
dnl Zdenek Sekera <zs@cray.com> says that if CDPATH is set, it may break
dnl this script.
unset CDPATH
dnl
dnl
dnl Initialization.
dnl
AC_INIT(NEWS)
AC_CONFIG_AUX_DIR(libiberty)
dnl
dnl Some simple checks.
dnl 
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(package, version, do-not-define)
AC_PROG_MAKE_SET
dnl
dnl
dnl Do not run these tests, but be sure to include their --with options.  
if false; then
ICE_FIND_MOTIF
ICE_FIND_ATHENA
fi
dnl
dnl
dnl
dnl Not much to do here.  Configure the sub-directories.
dnl
dnl Use the C++ compiler for all checks.
ICE_PROG_CXX
AC_LANG_CPLUSPLUS
dnl
# Avoid calling config.guess again.  In libiberty, this destroys dummy.c.
case "$ac_configure_args" in
*--host*) ;;
*) ac_configure_args="$ac_configure_args --host=$host";;
esac
dnl
dnl If we already have -liberty, -ltermcap, etc., 
dnl there is no need to build them.
ddd_have_termcap=false
ddd_have_libiberty=false
ddd_have_rx=false
dnl
dnl By default, DDD needs no RX library.
ddd_have_rx=true
dnl
dnl Check for -liberty.
AC_CHECK_LIB(iberty, xstrerror, ddd_have_libiberty=true)
dnl
dnl Look for the tgetent() function - either in libtermcap, libcurses,
dnl or use the GNU termcap library as shipped with DDD.
dnl
dnl On FreeBSD systems, `-lmytinfo' is preferred to `-lncurses'.
dnl Reported by Vincenzo Capuano <vcapuano@esoc.esa.de>
dnl
dnl On Linux ELF systems, `-lncurses' is preferred to `-ltermcap'.
dnl Reported by jdassen@wi.leidenuniv.nl (J.H.M. Dassen)
ddd_have_termcap=false
for termlib in mytinfo ncurses curses termcap terminfo termlib; do
   AC_CHECK_LIB(${termlib}, tgetent, [ddd_have_termcap=true; break])
done
dnl
dnl
AC_MSG_CHECKING([for packages to be configured and built])
ddd_subdirs="ddd"
test "$ddd_have_termcap"   != true && ddd_subdirs="termcap $ddd_subdirs"
test "$ddd_have_libiberty" != true && ddd_subdirs="libiberty $ddd_subdirs"
test "$ddd_have_rx"        != true && ddd_subdirs="librx $ddd_subdirs"
AC_MSG_RESULT($ddd_subdirs)
AC_CONFIG_SUBDIRS($ddd_subdirs)
dnl
dnl
dnl Create the top-level Makefile.
dnl
AC_OUTPUT(Makefile)
