Commit 6f851c4e authored by Benoit Perrot's avatar Benoit Perrot
Browse files

Index: ChangeLog

from  Benoît Perrot  <benoit@lrde.epita.fr>
        Enhance readline detection.

        * config/readline.m4:
        Provide AC_CHECK_READLINE.
        * configure.ac, src/Makefile.am:
        Use AC_CHECK_READLINE to check readline library presence and
        usability.
parent 7b3c59df
2004-04-24 Benot Perrot <benoit@lrde.epita.fr>
Enhance readline detection.
* config/readline.m4:
Provide AC_CHECK_READLINE.
* configure.ac, src/Makefile.am:
Use AC_CHECK_READLINE to check readline library presence and
usability.
2004-04-24 Benot Perrot <benoit@lrde.epita.fr>
Restore distcheck with automake1.8
......
# Check readline presence and usability. -*-Autoconf-*-
#
# Copyright (C) 2004 Benoit Perrot
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA
dnl AC_CHECK_READLINE
dnl Check readline libraries and includes usability. If the user gave
dnl the command line options `--with-readline-includes=dir' and
dnl `--with-readline-library=dir', use those directories. If readline is not
dnl found or cannot be used, or the user gave the command line option
dnl `--without-readline', set the shell variable no_readline to `yes';
dnl otherwise set it to the empty string.
AC_DEFUN([AC_CHECK_READLINE], [
## -- Prologue
# Allow the user to disable readline
AC_ARG_WITH([readline],
[AC_HELP_STRING([--without-readline],
[do not use readline (default is YES)])])
# Let the user precise includes and library paths
AC_ARG_WITH([readline-includes],
[AC_HELP_STRING([--with-readline-includes=DIR],
[use DIR to look for readline includes])],
[readline_includes=$withval],
[readline_includes=no]
)
AC_ARG_WITH([readline-library],
[AC_HELP_STRING([--with-readline-library=DIR],
[use DIR to look for readline library])],
[readline_library=$withval],
[readline_library=no]
)
## -- Engine
# Save current compilation flags to restore them if something goes wrong
ac_save_CFLAGS=$CFLAGS
ac_save_LIBS=$LIBS
READLINE_CFLAGS=""
READLINE_LIBS="-lreadline"
if test "x$with_readline" = xno; then
# The user explicitly disabled readline
have_readline=disabled
else
have_readline=no
if test "x$readline_includes" != xno; then
READLINE_CFLAGS="-I$readline_includes"
CFLAGS="$CFLAGS $READLINE_CFLAGS"
fi
# Check for readline headers
AC_CHECK_HEADER([readline/readline.h],
[
if test "x$readline_library" != xno; then
READLINE_LIBS="-L$readline_library $READLINE_LIBS"
fi
# Search for libraries on which readline may depends
# FIXME: might become AC_CHECK_TERMCAP
AC_CHECK_LIB(termcap, tgetent,
termcap_library=termcap,
[
AC_CHECK_LIB(curses, tgetent,
termcap_library=curses,
[
AC_CHECK_LIB(ncurses, tgetent,
termcap_library=ncurses,
termcap_library=no)
])
])
if test temcap_library != no; then
READLINE_LIBS="$READLINE_LIBS -l$termcap_library"
fi
LIBS="$LIBS $READLINE_LIBS"
# Check for readline library presence and usability
AC_CHECK_LIB(readline, readline,
[have_readline=yes])
])
fi
## -- Epilogue
# Display readline check status
AC_MSG_CHECKING([for readline])
AC_MSG_RESULT([$have_readline])
# Set or reset environment variables
no_readline=""
if test "$have_readline" != yes; then
CFLAGS=$ac_save_CFLAGS
LIBS=$ac_save_LIBS
no_readline=yes
fi
# Substitute readline flags
AC_SUBST(READLINE_CFLAGS)
AC_SUBST(READLINE_LIBS)
])
......@@ -30,20 +30,14 @@ AC_PROG_YACC
# Look for a C++ compiler.
AC_PROG_CXX
# Look for ran lib
# Look for ran lib.
AC_PROG_RANLIB
# Look for readline header and lib
AC_CHECK_HEADER(readline/readline.h)
AC_CHECK_LIB(readline, readline)
AC_CHECK_LIB(curses, tputs)
# Look for readline library.
AC_CHECK_READLINE
## Development environment -------------
CXXFLAGS="${CXXFLAGS} -ansi -Wall -W"
READLINE_LIBS="-lreadline"
AC_SUBST(READLINE_LIBS)
CXXFLAGS="${CXXFLAGS} $READLINE_CFLAGS -ansi -Wall -W"
## Epilogue ----------------------------
......
......@@ -2,27 +2,25 @@
(Created-By-Prcs-Version 1 3 2)
(Project-Description "")
(Project-Version mipsy 0 86)
(Parent-Version mipsy 0 85)
(Project-Version mipsy 0 87)
(Parent-Version mipsy 0 86)
(Version-Log
"Index: ChangeLog
from Benot Perrot <benoit@lrde.epita.fr>
Restore distcheck with automake1.8
Enhance readline detection.
* Makefile.am: Distribute inst-solver-gen.py.
* dev/doc-inst-set-gen.py,
* doc/mipsy.texi:
Suggested by Akim Demaille: do not use commands in @node.
The file texinfo.tex from automake1.8 does not handle it, leading to
make dvi failure, leading to make distcheck failure.
* doc/Makefile.am: Do not distribute deprecated files anymore.
* config/readline.m4:
Provide AC_CHECK_READLINE.
* configure.ac, src/Makefile.am:
Use AC_CHECK_READLINE to check readline library presence and
usability.
")
(New-Version-Log
"")
(Checkin-Time "Sat, 24 Apr 2004 17:53:00 +0200")
(Checkin-Time "Sat, 24 Apr 2004 23:54:54 +0200")
(Checkin-Login benoit)
(Files
......@@ -30,18 +28,19 @@ from Beno
;; ./
(AUTHORS (mipsy/0_AUTHORS 1.2 644))
(COPYING (mipsy/1_COPYING 1.1 644))
(ChangeLog (mipsy/2_ChangeLog 1.80 604))
(ChangeLog (mipsy/2_ChangeLog 1.81 604))
(INSTALL (mipsy/b/12_INSTALL 1.1 604))
(Makefile.am (mipsy/3_Makefile.a 1.9 604))
(NEWS (mipsy/b/25_NEWS 1.9 604))
(README (mipsy/4_README 1.3 604))
(TODO (mipsy/5_TODO 1.3 604))
(bootstrap (mipsy/b/14_bootstrap 1.3 705))
(configure.ac (mipsy/6_configure. 1.8 604))
(configure.ac (mipsy/6_configure. 1.9 604))
(prj (mipsy.prj) :symlink)
;; ./config/
(config/Makefile.am (mipsy/7_Makefile.a 1.1 644))
(config/readline.m4 (mipsy/c/25_readline.m 1.1 644))
;; ./dev/
(dev/doc-inst-set-gen.py (mipsy/c/21_doc-inst-s 1.4 705))
......@@ -61,7 +60,7 @@ from Beno
(doc/mipsy.texi (mipsy/b/10_mipsy.texi 1.6 604))
;; ./src/
(src/Makefile.am (mipsy/18_Makefile.a 1.3 644))
(src/Makefile.am (mipsy/18_Makefile.a 1.4 644))
(src/common.hh (mipsy/19_common.hh 1.5 644))
(src/mipsy-tasks.cc (mipsy/20_mipsy-task 1.3 644))
(src/mipsy-tasks.hh (mipsy/21_mipsy-task 1.3 644))
......
......@@ -23,5 +23,4 @@ mipsy_LDADD = \
vm/libvm.a \
inst/libinst.a \
shell/libshell.a \
task/libtask.a \
$(READLINE_LIBS)
task/libtask.a
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment