summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in166
1 files changed, 102 insertions, 64 deletions
diff --git a/configure.in b/configure.in
index 5f982d3..68d23ce 100644
--- a/configure.in
+++ b/configure.in
@@ -1,17 +1,42 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(doc/bc.1)
-AM_INIT_AUTOMAKE("bc", "1.06")
+
+dnl Copyright (C) 2006 Free Software Foundation, Inc.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2, or (at your option)
+dnl any later version.
+dnl
+dnl This program 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. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software Foundation,
+dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+m4_define([bc_version], 1.06.95)
+m4_define([dc_version], 1.3.95)
+
+AC_INIT(bc, bc_version)
+AC_CONFIG_SRCDIR(doc/bc.1)
+AM_INIT_AUTOMAKE([dist-bzip2])
AM_CONFIG_HEADER(config.h)
-AC_DEFINE(DC_VERSION,"1.3")
-AC_DEFINE_UNQUOTED(BC_COPYRIGHT, dnl
- ["Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc."])
-AC_DEFINE_UNQUOTED(DC_COPYRIGHT, dnl
- ["Copyright 1994, 1997, 1998, 2000 Free Software Foundation, Inc."])
+AC_DEFINE([DC_VERSION], "dc_version",
+ [Define the dc version number.])
+
+AC_DEFINE([BC_COPYRIGHT],
+ ["Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc."],
+ [Define the bc copyright line.])
+
+AC_DEFINE([DC_COPYRIGHT],
+ ["Copyright 1994, 1997, 1998, 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc."],
+ [Define the dc copyright line.])
AC_PROG_CC
AC_MINIX
-dnl AC_ISC_POSIX
AM_PROG_LEX
AC_PROG_YACC
@@ -19,71 +44,84 @@ AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_MAKE_SET
-AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h)
+AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h errno.h limits.h unistd.h lib.h)
AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_TYPE(ptrdiff_t, size_t)
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(isgraph setvbuf)
+AC_CHECK_FUNCS(isgraph setvbuf fstat strtol)
-AC_ARG_WITH(pkg,[ --with-pkg use software installed in /usr/pkg tree], [
- CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
- LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
- echo Using /usr/pkg/include and /usr/pkg/lib
-])
+AC_ARG_WITH(pkg,
+ AC_HELP_STRING([--with-pkg],
+ [use software installed in /usr/pkg tree]),
+ [case $withval in no) ;;
+ *) CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
+ LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
+ echo Using /usr/pkg/include and /usr/pkg/lib ;;
+ esac])
bcle=n
-AC_ARG_WITH(libedit,[ --with-libedit support fancy BSD command input
-editing], [
- AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap)
- LDSAVE=$LDFLAGS
- LDFLAGS="$LDFLAGS $TERMLIB"
- AC_CHECK_LIB(edit,el_gets,
- [AC_CHECK_HEADER(histedit.h,
- READLINELIB="-ledit $TERMLIB";bcle=y)],
- READLINELIB="")
- if test "$bcle" = "y"; then
- echo Using the libedit library.
- AC_DEFINE(LIBEDIT,1)
- fi
- LDFLAGS=$LDSAVE
-])
+AC_ARG_WITH(libedit,
+ AC_HELP_STRING([--with-libedit],
+ [support fancy BSD command input editing]),
+ [case $withval in no) ;;
+ *) LDSAVE=$LDFLAGS
+ AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap)
+ LDFLAGS="$LDFLAGS $TERMLIB"
+ AC_CHECK_LIB(edit,el_gets,
+ [AC_CHECK_HEADER(histedit.h,
+ READLINELIB="-ledit $TERMLIB";bcle=y)],
+ READLINELIB="")
+ case $bcle in
+ y) AC_DEFINE(LIBEDIT,1, [Define if libedit is used])
+ echo Using the libedit library. ;;
+ esac
+ LDFLAGS=$LDSAVE
+ ;;
+ esac])
bcrl=n
-AC_ARG_WITH(readline,[ --with-readline support fancy command input editing], [
- AC_CHECK_LIB(ncurses,tparm,TERMLIB=-lncurses,
- AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap))
- LDSAVE=$LDFLAGS
- LDFLAGS="$LDFLAGS $TERMLIB"
- AC_CHECK_LIB(readline,readline,
- [AC_CHECK_HEADER(readline/readline.h,
- READLINELIB="-lreadline $TERMLIB";bcrl=y)],
- READLINELIB="")
- if test "$bcrl" = "y" ; then
- echo Using the readline library.
- AC_DEFINE(READLINE,1)
- fi
- LDFLAGS=$LDSAVE
-])
-
-if test "$LEX" = "flex" ; then
- LEX="flex -I8"
-else
- if test "$bcrl" = "y" ; then
- AC_MSG_WARN(readline works only with flex.)
- fi
-fi
-
-if test "$bcrl" = "y" -a "$bcle" = "y" ; then
- AC_MSG_ERROR(Can not use both readline and libedit. Aborting.)
-fi
-
-if test "$LEX" = "lex" -a `uname -s` = "SunOS" ; then
- LEXLIB=""
- echo "SunOS using lex does not have a -ll."
-fi
+AC_ARG_WITH(readline,
+ AC_HELP_STRING([--with-readline],
+ [support fancy command input editing]),
+ [case $withval in no) ;;
+ *) LDSAVE=$LDFLAGS
+ AC_CHECK_LIB(ncurses,tparm,TERMLIB=-lncurses,
+ AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap))
+ LDFLAGS="$LDFLAGS $TERMLIB"
+ AC_CHECK_LIB(readline,readline,
+ [AC_CHECK_HEADER(readline/readline.h,
+ READLINELIB="-lreadline $TERMLIB";bcrl=y)],
+ READLINELIB="")
+ case $bcrl in
+ y) AC_DEFINE(READLINE,1, [Define if readline is used])
+ echo Using the readline library. ;;
+ esac
+ LDFLAGS=$LDSAVE
+ ;;
+ esac])
+
+case $bcle-$bcrl-$LEX in
+ y-y-*)
+ AC_MSG_ERROR(Can not use both readline and libedit. Aborting.) ;;
+ ?-?-flex)
+ LEX="flex -I -8"
+ case $bcrl in
+ n) AC_MSG_WARN(readline works only with flex.) ;;
+ esac ;;
+esac
+
+case $LEX-`uname -s` in
+ lex-SunOS) LEXLIB=""; echo "SunOS using lex does not have a -ll." ;;
+esac
+
+case $GCC in
+ yes) CFLAGS="$CFLAGS -Wall -funsigned-char"
+ echo "Adding GCC specific compile flags." ;;
+esac
AC_SUBST(READLINELIB)
-AC_ARG_PROGRAM
-AC_OUTPUT(Makefile bc/Makefile dc/Makefile doc/Makefile lib/Makefile)
+AC_SUBST(BC_VERSION, bc_version)
+AC_SUBST(DC_VERSION, dc_version)
+AC_OUTPUT(Makefile bc/Makefile dc/Makefile doc/Makefile doc/texi-ver.incl lib/Makefile)