1 dnl Process this file with autoconf to produce a configure script.
3 AM_INIT_AUTOMAKE("bc", "1.06")
4 AM_CONFIG_HEADER(config.h)
6 AC_DEFINE(DC_VERSION,"1.3")
7 AC_DEFINE_UNQUOTED(BC_COPYRIGHT, dnl
8 ["Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc."])
9 AC_DEFINE_UNQUOTED(DC_COPYRIGHT, dnl
10 ["Copyright 1994, 1997, 1998, 2000 Free Software Foundation, Inc."])
22 AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h)
25 AC_CHECK_TYPE(ptrdiff_t, size_t)
28 AC_CHECK_FUNCS(isgraph setvbuf)
30 AC_ARG_WITH(pkg,[ --with-pkg use software installed in /usr/pkg tree], [
31 CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
32 LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
33 echo Using /usr/pkg/include and /usr/pkg/lib
37 AC_ARG_WITH(libedit,[ --with-libedit support fancy BSD command input
39 AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap)
41 LDFLAGS="$LDFLAGS $TERMLIB"
42 AC_CHECK_LIB(edit,el_gets,
43 [AC_CHECK_HEADER(histedit.h,
44 READLINELIB="-ledit $TERMLIB";bcle=y)],
46 if test "$bcle" = "y"; then
47 echo Using the libedit library.
54 AC_ARG_WITH(readline,[ --with-readline support fancy command input editing], [
55 AC_CHECK_LIB(ncurses,tparm,TERMLIB=-lncurses,
56 AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap))
58 LDFLAGS="$LDFLAGS $TERMLIB"
59 AC_CHECK_LIB(readline,readline,
60 [AC_CHECK_HEADER(readline/readline.h,
61 READLINELIB="-lreadline $TERMLIB";bcrl=y)],
63 if test "$bcrl" = "y" ; then
64 echo Using the readline library.
70 if test "$LEX" = "flex" ; then
73 if test "$bcrl" = "y" ; then
74 AC_MSG_WARN(readline works only with flex.)
78 if test "$bcrl" = "y" -a "$bcle" = "y" ; then
79 AC_MSG_ERROR(Can not use both readline and libedit. Aborting.)
82 if test "$LEX" = "lex" -a `uname -s` = "SunOS" ; then
84 echo "SunOS using lex does not have a -ll."
89 AC_OUTPUT(Makefile bc/Makefile dc/Makefile doc/Makefile lib/Makefile)