1 dnl Process this file with autoconf to produce a configure script.
3 AM_INIT_AUTOMAKE(bc, 1.05)
4 AM_CONFIG_HEADER(config.h)
17 AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h)
20 AC_CHECK_TYPE(ptrdiff_t, size_t)
23 AC_CHECK_FUNCS(isgraph setvbuf)
26 CFLAGS="-g -O -I. -I$srcdir"
27 AC_MSG_CHECKING(if long strings are accepted by the C compiler)
30 #include "bc/libmath.h"
32 ],[],AC_MSG_RESULT(yes),
34 AC_MSG_WARN(libmath.b will not be preloaded into the executable)
35 if test "${prefix}" = "NONE" ; then
36 AC_DEFINE_UNQUOTED(BC_MATH_FILE,"/usr/local/lib/libmath.b")
38 AC_DEFINE_UNQUOTED(BC_MATH_FILE,"${prefix}/lib/libmath.b")
44 AC_ARG_WITH(readline,[ --with-readline support fancy command input editing], [
45 AC_CHECK_LIB(ncurses,tparm,TERMLIB=-lncurses,
46 AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap))
49 AC_CHECK_LIB(readline,readline,
50 [AC_CHECK_HEADER(readline/readline.h,
51 LIBS="$saved_LIBS -lreadline $TERMLIB";bcrl=y)],
53 if test "$bcrl" = "y" ; then
54 echo Using the readline library.
60 dnl AC_ARG_WITH(readline,[ --with-readline support fancy command input editing], [
61 dnl if test "$with_readline" = "yes" ; then
62 dnl echo Using the readline library.
63 dnl AC_DEFINE(READLINE,1)
64 dnl LIBS="$LIBS -lreadline -ltermcap"
73 if test "$LEX" = "flex" ; then
76 if test "$bcrl" = "y" ; then
77 AC_MSG_WARN(readline works only with flex.)
81 if test "$LEX" = "lex" -a `uname -s` = "SunOS" ; then
83 echo "SunOS using lex does not have a -ll."
87 AC_OUTPUT(Makefile bc/Makefile dc/Makefile doc/Makefile lib/Makefile)