Commit 363c8a4a authored by Benoit Perrot's avatar Benoit Perrot
Browse files

Index: ChangeLog

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

        * configure.ac, config/readline.m4,
        * src/Makefile.am, src/shell/Makefile.am:
        Improve readline detection and related information use.
parent 1e2603e8
2004-05-01 Benot Perrot <benoit@lrde.epita.fr>
* configure.ac, config/readline.m4,
* src/Makefile.am, src/shell/Makefile.am:
Improve readline detection and related information use.
2004-05-01 Benot Perrot <benoit@lrde.epita.fr>
* src/shell/cmd.hh,
......
......@@ -23,7 +23,9 @@ 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.
dnl otherwise set it to the empty string. Set the variables READLINE_CPPFLAGS,
dnl READLINE_LIBS and READLINE_LDFLAGS to their correct content if
dnl readline is found, to the empty string else.
AC_DEFUN([AC_CHECK_READLINE], [
......@@ -51,72 +53,73 @@ AC_ARG_WITH([readline-library],
## -- Engine
# Save current compilation flags to restore them if something goes wrong
ac_save_CFLAGS=$CFLAGS
ac_save_LIBS=$LIBS
ac_cv_saved_CPPFLAGS=$CPPFLAGS
ac_cv_saved_LDFLAGS=$LDFLAGS
ac_cv_saved_LIBS=$LIBS
READLINE_CFLAGS=""
READLINE_LIBS="-lreadline"
# Reset READLINE strings and prepare their substitution
AC_SUBST([READLINE_CPPFLAGS], [""])
AC_SUBST([READLINE_LDFLAGS], [""])
AC_SUBST([READLINE_LIBS], [""])
if test "x$with_readline" = xno; then
# The user explicitly disabled readline
have_readline=disabled
else
have_readline=no
no_readline="yes"
if test "x$with_readline" != xno; then
if test "x$readline_includes" != xno; then
READLINE_CFLAGS="-I$readline_includes"
CFLAGS="$CFLAGS $READLINE_CFLAGS"
READLINE_CPPFLAGS="-I$readline_includes"
CPPFLAGS="$CPPFLAGS $READLINE_CPPFLAGS"
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"
READLINE_LDFLAGS="-L$readline_library"
LDFLAGS="$LDFLAGS $READLINE_LDFLAGS"
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"
# Search for tgetent function, on which readline may depends
AC_SEARCH_LIBS([tgetent],
[readline termcap curses ncurses],
[TERMCAP_LIBS=$ac_cv_search_tgetent])
READLINE_LIBS="-lreadline"
if test "$TERMCAP_LIBS" != "-lreadline"; then
READLINE_LIBS="$READLINE_LIBS $TERMCAP_LIBS"
# TERMCAP_LIBS was automaticaly added to LIBS by AC_SEARCH_LIBS
fi
LIBS="$LIBS $READLINE_LIBS"
# Check for readline library presence and usability
AC_CHECK_LIB(readline, readline,
[have_readline=yes])
AC_CHECK_LIB([readline], [readline], [no_readline=""])
])
fi
## -- Epilogue
## -- Epilogue
# Display readline check status
AC_MSG_CHECKING([for readline])
# Display readline check status
AC_MSG_CHECKING([for readline])
AC_MSG_RESULT([$have_readline])
if test "$no_readline"; then
# Restore environment variables
READLINE_CPPFLAGS=""
READLINE_LDFLAGS=""
READLINE_LIBS=""
# Set or reset environment variables
no_readline=""
if test "$have_readline" != yes; then
CFLAGS=$ac_save_CFLAGS
LIBS=$ac_save_LIBS
AC_MSG_RESULT([no])
else
AC_DEFINE([HAVE_LIBREADLINE],
[1],
[Define to 1 if you have the readline library.])
AC_DEFINE([HAVE_READLINE_READLINE_H],
[1],
[Define to 1 if you have the <readline/readline.h> header file.])
AC_MSG_RESULT([yes])
fi
no_readline=yes
fi
# Substitute readline flags
AC_SUBST(READLINE_CFLAGS)
AC_SUBST(READLINE_LIBS)
CPPFLAGS=$ac_cv_saved_CPPFLAGS
LDFLAGS=$ac_cv_saved_LDFLAGS
LIBS=$ac_cv_saved_LIBS
])
......@@ -37,8 +37,7 @@ AC_PROG_RANLIB
AC_CHECK_READLINE
## Development environment -------------
CXXFLAGS="${CXXFLAGS} $READLINE_CFLAGS -ansi -Wall -W"
CXXFLAGS="${CXXFLAGS} -ansi -Wall -W"
## Epilogue ----------------------------
# Ask for the Makefile creations.
......
......@@ -2,22 +2,22 @@
(Created-By-Prcs-Version 1 3 2)
(Project-Description "")
(Project-Version mipsy 0 91)
(Parent-Version mipsy 0 90)
(Project-Version mipsy 0 92)
(Parent-Version mipsy 0 91)
(Version-Log
"Index: ChangeLog
from Benot Perrot <benoit@lrde.epita.fr>
* src/shell/cmd.hh,
* src/shell/shell.hh, src/shell/shell.cc:
Use std::string instead of char* or std::string*, avoiding
hazardous memory manipulations.
* configure.ac, config/readline.m4,
* src/Makefile.am, src/shell/Makefile.am:
Improve readline detection and related information use.
")
(New-Version-Log
"")
(Checkin-Time "Sun, 02 May 2004 15:29:43 +0200")
(Checkin-Time "Sun, 02 May 2004 15:33:28 +0200")
(Checkin-Login benoit)
(Files
......@@ -25,19 +25,19 @@ from Beno
;; ./
(AUTHORS (mipsy/0_AUTHORS 1.2 644))
(COPYING (mipsy/1_COPYING 1.1 644))
(ChangeLog (mipsy/2_ChangeLog 1.85 604))
(ChangeLog (mipsy/2_ChangeLog 1.86 604))
(INSTALL (mipsy/b/12_INSTALL 1.1 604))
(Makefile.am (mipsy/3_Makefile.a 1.9 604))
(NEWS (mipsy/b/25_NEWS 1.10 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.9 604))
(configure.ac (mipsy/6_configure. 1.10 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))
(config/readline.m4 (mipsy/c/25_readline.m 1.2 644))
;; ./dev/
(dev/doc-inst-set-gen.py (mipsy/c/21_doc-inst-s 1.4 705))
......@@ -57,7 +57,7 @@ from Beno
(doc/mipsy.texi (mipsy/b/10_mipsy.texi 1.7 604))
;; ./src/
(src/Makefile.am (mipsy/18_Makefile.a 1.4 644))
(src/Makefile.am (mipsy/18_Makefile.a 1.5 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.4 644))
......@@ -99,7 +99,7 @@ from Beno
(src/parse/parse-tasks.hh (mipsy/44_parse-task 1.6 644))
;; ./src/shell/
(src/shell/Makefile.am (mipsy/b/17_Makefile.a 1.1 644))
(src/shell/Makefile.am (mipsy/b/17_Makefile.a 1.2 644))
(src/shell/cmd.hh (mipsy/b/18_cmd.hh 1.3 644))
(src/shell/shell-tasks.cc (mipsy/b/19_shell-task 1.1 644))
(src/shell/shell-tasks.hh (mipsy/c/22_shell-task 1.2 644))
......
......@@ -18,9 +18,11 @@ mipsy_SOURCES = \
mipsy.cc \
mipsy-tasks.hh mipsy-tasks.cc
mipsy_LDFLAGS = $(AM_LDFLAGS) @READLINE_LDFLAGS@
mipsy_LDADD = \
parse/libparse.a \
vm/libvm.a \
inst/libinst.a \
shell/libshell.a \
task/libtask.a
task/libtask.a \
@READLINE_LIBS@
......@@ -6,3 +6,4 @@ libshell_a_SOURCES = \
cmd.hh \
shell.hh shell.cc \
shell-tasks.hh shell-tasks.cc
libshell_a_CPPFLAGS = $(AM_CPPFLAGS) @READLINE_CPPFLAGS@
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