~ubuntu-branches/ubuntu/precise/bc/precise

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-05 12:24:03 UTC
  • mfrom: (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20071205122403-rv1a7x90ktu1wl95
Tags: 1.06.94-3ubuntu1
* Merge with Debian; remaining changes:
  - Make bc/dc notice read and write errors on its input and output.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl Process this file with autoconf to produce a configure script.
 
2
 
 
3
dnl Copyright (C) 2006 Free Software Foundation, Inc.
 
4
dnl
 
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)
 
8
dnl any later version.
 
9
dnl
 
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.
 
14
dnl
 
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.
 
18
 
2
19
AC_INIT(doc/bc.1)
3
 
AM_INIT_AUTOMAKE("bc", "1.06")
 
20
AM_INIT_AUTOMAKE("bc", "1.06.94")
4
21
AM_CONFIG_HEADER(config.h)
5
22
 
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."])
11
 
 
12
 
AM_MAINTAINER_MODE
 
23
AC_DEFINE([DC_VERSION], "1.3.94",
 
24
          [Define the dc version number.])
 
25
 
 
26
AC_DEFINE([BC_COPYRIGHT],
 
27
          ["Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc."],
 
28
          [Define the bc copyright line.])
 
29
 
 
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.])
13
33
 
14
34
AC_PROG_CC
15
35
AC_MINIX
16
 
dnl AC_ISC_POSIX
17
36
 
18
37
AM_PROG_LEX
19
38
AC_PROG_YACC
21
40
AC_PROG_RANLIB
22
41
AC_PROG_MAKE_SET
23
42
 
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)
25
44
AC_C_CONST
26
45
AC_TYPE_SIZE_T
27
46
AC_CHECK_TYPE(ptrdiff_t, size_t)
28
47
 
29
48
AC_FUNC_VPRINTF
30
 
AC_CHECK_FUNCS(isgraph setvbuf)
 
49
AC_CHECK_FUNCS(isgraph setvbuf fstat strtol)
31
50
 
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
36
 
])
 
51
AC_ARG_WITH(pkg,
 
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 ;;
 
58
    esac])
37
59
 
38
60
bcle=n
39
 
AC_ARG_WITH(libedit,[  --with-libedit          support fancy BSD command input 
40
 
editing], [
41
 
   AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap)
42
 
   LDSAVE=$LDFLAGS
43
 
   LDFLAGS="$LDFLAGS $TERMLIB"
44
 
   AC_CHECK_LIB(edit,el_gets,
45
 
      [AC_CHECK_HEADER(histedit.h,
46
 
      READLINELIB="-ledit $TERMLIB";bcle=y)],
47
 
      READLINELIB="")
48
 
   if test "$bcle" = "y"; then
49
 
     echo Using the libedit library.
50
 
     AC_DEFINE(LIBEDIT,1)
51
 
   fi
52
 
   LDFLAGS=$LDSAVE
53
 
])
 
61
AC_ARG_WITH(libedit,
 
62
   AC_HELP_STRING([--with-libedit],
 
63
      [support fancy BSD command input editing]),
 
64
   [case $withval in no) ;;
 
65
      *) LDSAVE=$LDFLAGS
 
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)],
 
71
            READLINELIB="")
 
72
         case $bcle in
 
73
           y) AC_DEFINE(LIBEDIT,1, [Define if libedit is used])
 
74
              echo Using the libedit library. ;;
 
75
         esac
 
76
         LDFLAGS=$LDSAVE
 
77
         ;;
 
78
    esac])
54
79
 
55
80
bcrl=n
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))
59
 
   LDSAVE=$LDFLAGS
60
 
   LDFLAGS="$LDFLAGS $TERMLIB"
61
 
   AC_CHECK_LIB(readline,readline,
62
 
      [AC_CHECK_HEADER(readline/readline.h,
63
 
      READLINELIB="-lreadline $TERMLIB";bcrl=y)],
64
 
      READLINELIB="")
65
 
   if test "$bcrl" = "y" ; then
66
 
     echo Using the readline library.
67
 
     AC_DEFINE(READLINE,1)
68
 
   fi
69
 
   LDFLAGS=$LDSAVE
70
 
])
71
 
 
72
 
if test "$LEX" = "flex" ; then
73
 
 LEX="flex -I -8"
74
 
else
75
 
 if test "$bcrl" = "y" ; then
76
 
  AC_MSG_WARN(readline works only with flex.)
77
 
 fi
78
 
fi
79
 
 
80
 
if test "$bcrl" = "y" -a "$bcle" = "y" ; then
81
 
  AC_MSG_ERROR(Can not use both readline and libedit.  Aborting.)
82
 
fi
83
 
 
84
 
if test "$LEX" = "lex" -a `uname -s` = "SunOS" ; then
85
 
  LEXLIB=""
86
 
  echo "SunOS using lex does not have a -ll."
87
 
fi
 
81
AC_ARG_WITH(readline,
 
82
   AC_HELP_STRING([--with-readline],
 
83
      [support fancy command input editing]),
 
84
   [case $withval in no) ;;
 
85
      *) LDSAVE=$LDFLAGS
 
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)],
 
92
            READLINELIB="")
 
93
         case $bcrl in
 
94
           y) AC_DEFINE(READLINE,1, [Define if readline is used])
 
95
              echo Using the readline library. ;;
 
96
         esac
 
97
         LDFLAGS=$LDSAVE
 
98
         ;;
 
99
    esac])
 
100
 
 
101
case $bcle-$bcrl-$LEX in
 
102
   y-y-*)
 
103
        AC_MSG_ERROR(Can not use both readline and libedit.  Aborting.) ;;
 
104
   ?-?-flex)
 
105
        LEX="flex -I -8"
 
106
        case $bcrl in
 
107
          n) AC_MSG_WARN(readline works only with flex.) ;;
 
108
        esac ;;
 
109
esac
 
110
 
 
111
case $LEX-`uname -s` in
 
112
  lex-SunOS) LEXLIB=""; echo "SunOS using lex does not have a -ll." ;;
 
113
esac
 
114
 
 
115
case $GCC in
 
116
  yes) CFLAGS="$CFLAGS -Wall -funsigned-char"
 
117
       echo "Adding GCC specific compile flags." ;;
 
118
esac
88
119
 
89
120
AC_SUBST(READLINELIB)
90
121
AC_OUTPUT(Makefile bc/Makefile dc/Makefile doc/Makefile lib/Makefile)