1
1
dnl Process this file with autoconf to produce a configure script.
3
dnl Copyright (C) 2006 Free Software Foundation, Inc.
5
dnl This program is free software; you can redistribute it and/or modify
6
dnl it under the terms of the GNU General Public License as published by
7
dnl the Free Software Foundation; either version 2, or (at your option)
10
dnl This program is distributed in the hope that it will be useful,
11
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
dnl GNU General Public License for more details.
15
dnl You should have received a copy of the GNU General Public License
16
dnl along with this program; if not, write to the Free Software Foundation,
17
dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3
AM_INIT_AUTOMAKE("bc", "1.06")
20
AM_INIT_AUTOMAKE("bc", "1.06.94")
4
21
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."])
23
AC_DEFINE([DC_VERSION], "1.3.94",
24
[Define the dc version number.])
26
AC_DEFINE([BC_COPYRIGHT],
27
["Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc."],
28
[Define the bc copyright line.])
30
AC_DEFINE_UNQUOTED([DC_COPYRIGHT],
31
["Copyright 1994, 1997, 1998, 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc."],
32
[Define the dc copyright line.])
24
AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h)
43
AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h errno.h limits.h unistd.h lib.h)
27
46
AC_CHECK_TYPE(ptrdiff_t, size_t)
30
AC_CHECK_FUNCS(isgraph setvbuf)
49
AC_CHECK_FUNCS(isgraph setvbuf fstat strtol)
32
AC_ARG_WITH(pkg,[ --with-pkg use software installed in /usr/pkg tree], [
33
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
34
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
35
echo Using /usr/pkg/include and /usr/pkg/lib
52
AC_HELP_STRING([--with-pkg],
53
[use software installed in /usr/pkg tree]),
54
[case $withval in no) ;;
55
*) CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
56
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
57
echo Using /usr/pkg/include and /usr/pkg/lib ;;
39
AC_ARG_WITH(libedit,[ --with-libedit support fancy BSD command input
41
AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap)
43
LDFLAGS="$LDFLAGS $TERMLIB"
44
AC_CHECK_LIB(edit,el_gets,
45
[AC_CHECK_HEADER(histedit.h,
46
READLINELIB="-ledit $TERMLIB";bcle=y)],
48
if test "$bcle" = "y"; then
49
echo Using the libedit library.
62
AC_HELP_STRING([--with-libedit],
63
[support fancy BSD command input editing]),
64
[case $withval in no) ;;
66
AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap)
67
LDFLAGS="$LDFLAGS $TERMLIB"
68
AC_CHECK_LIB(edit,el_gets,
69
[AC_CHECK_HEADER(histedit.h,
70
READLINELIB="-ledit $TERMLIB";bcle=y)],
73
y) AC_DEFINE(LIBEDIT,1, [Define if libedit is used])
74
echo Using the libedit library. ;;
56
AC_ARG_WITH(readline,[ --with-readline support fancy command input editing], [
57
AC_CHECK_LIB(ncurses,tparm,TERMLIB=-lncurses,
58
AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap))
60
LDFLAGS="$LDFLAGS $TERMLIB"
61
AC_CHECK_LIB(readline,readline,
62
[AC_CHECK_HEADER(readline/readline.h,
63
READLINELIB="-lreadline $TERMLIB";bcrl=y)],
65
if test "$bcrl" = "y" ; then
66
echo Using the readline library.
72
if test "$LEX" = "flex" ; then
75
if test "$bcrl" = "y" ; then
76
AC_MSG_WARN(readline works only with flex.)
80
if test "$bcrl" = "y" -a "$bcle" = "y" ; then
81
AC_MSG_ERROR(Can not use both readline and libedit. Aborting.)
84
if test "$LEX" = "lex" -a `uname -s` = "SunOS" ; then
86
echo "SunOS using lex does not have a -ll."
82
AC_HELP_STRING([--with-readline],
83
[support fancy command input editing]),
84
[case $withval in no) ;;
86
AC_CHECK_LIB(ncurses,tparm,TERMLIB=-lncurses,
87
AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap))
88
LDFLAGS="$LDFLAGS $TERMLIB"
89
AC_CHECK_LIB(readline,readline,
90
[AC_CHECK_HEADER(readline/readline.h,
91
READLINELIB="-lreadline $TERMLIB";bcrl=y)],
94
y) AC_DEFINE(READLINE,1, [Define if readline is used])
95
echo Using the readline library. ;;
101
case $bcle-$bcrl-$LEX in
103
AC_MSG_ERROR(Can not use both readline and libedit. Aborting.) ;;
107
n) AC_MSG_WARN(readline works only with flex.) ;;
111
case $LEX-`uname -s` in
112
lex-SunOS) LEXLIB=""; echo "SunOS using lex does not have a -ll." ;;
116
yes) CFLAGS="$CFLAGS -Wall -funsigned-char"
117
echo "Adding GCC specific compile flags." ;;
89
120
AC_SUBST(READLINELIB)
90
121
AC_OUTPUT(Makefile bc/Makefile dc/Makefile doc/Makefile lib/Makefile)