More carefully checking for libreadline suitability

This commit is contained in:
Thomas Schmitt 2010-04-13 15:43:58 +00:00
parent f7ef290ac6
commit fc7cab6706
4 changed files with 62 additions and 8 deletions

View File

@ -131,6 +131,41 @@ iconv_close(cd);
]) ])
dnl LIBBURNIA_ASSERT_READLINE disables xorriso readline if not all needed
dnl functions are present
AC_DEFUN([LIBBURNIA_ASSERT_READLINE],
[
if test x$XORRISO_ASSUME_READLINE = x
then
dnl Check for the essential gestures of libisofs/util.c
AC_MSG_CHECKING([for desired functions in libreadline])
libburnia_save_LIBS="$LIBS"
LIBS="$LIBS -lreadline"
AC_TRY_LINK([
#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <readline/readline.h>
#include <readline/history.h>],
[HIST_ENTRY **hl;
readline("");
add_history("");
hl= history_list();
], [readline_test="yes"], [readline_test="no"]
)
AC_MSG_RESULT([$readline_test])
if test x$readline_test = xno
then
READLINE_DEF=
LIBS="$libburnia_save_LIBS"
fi
fi
])
dnl LIBBURNIA_SET_PKGCONFIG determines the install directory for the *.pc file. dnl LIBBURNIA_SET_PKGCONFIG determines the install directory for the *.pc file.
dnl Important: Must be performed _after_ TARGET_SHIZZLE dnl Important: Must be performed _after_ TARGET_SHIZZLE
dnl dnl

View File

@ -77,16 +77,16 @@ if test x$LIBISOBURN_OLD_ICONV_CONFIGURE = x
then then
dnl ts B00410 : To detect the need for -liconv and const argument of iconv() dnl ts B00410 : To detect the need for -liconv and const argument of iconv()
LIBBURNIA_CHECK_ICONV LIBBURNIA_CHECK_ICONV
else else
dnl Outdated: produces double -liconv and warnings about parameter mismatch dnl Outdated: produces double -liconv and warnings about parameter mismatch
dnl If iconv(3) is in an extra lib, then it gets added to variable LIBS. dnl If iconv(3) is in an extra lib, then it gets added to variable LIBS.
dnl If not, then no -liconv will be added. dnl If not, then no -liconv will be added.
AC_CHECK_LIB(iconv, iconv, , ) AC_CHECK_LIB(iconv, iconv, , )
dnl GNU iconv has no function iconv() but libiconv() and a macro iconv() dnl GNU iconv has no function iconv() but libiconv() and a macro iconv()
AC_CHECK_LIB(iconv, libiconv, , ) AC_CHECK_LIB(iconv, libiconv, , )
fi fi
@ -120,10 +120,19 @@ if test x$enable_libreadline = xyes; then
dnl Check whether there is readline-devel and readline-runtime. dnl Check whether there is readline-devel and readline-runtime.
dnl If not, erase this macro which would enable use of readline(),add_history() dnl If not, erase this macro which would enable use of readline(),add_history()
READLINE_DEF="-DXorriso_with_readlinE" READLINE_DEF="-DXorriso_with_readlinE"
if test x$XORRISO_OLD_READLINE_CONFIGURE = x
then
dnl ts B00411 : To disable readline if not all needed functions are present
LIBBURNIA_ASSERT_READLINE
else
dnl The empty yes case obviously causes -lreadline to be linked dnl The empty yes case obviously causes -lreadline to be linked
AC_CHECK_HEADER(readline/readline.h, AC_CHECK_LIB(readline, readline, , READLINE_DEF= ), READLINE_DEF= ) AC_CHECK_HEADER(readline/readline.h, AC_CHECK_LIB(readline, readline, , READLINE_DEF= ), READLINE_DEF= )
dnl The X= in the yes case prevents that -lreadline gets linked twice dnl The X= in the yes case prevents that -lreadline gets linked twice
AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= ) AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= )
fi
else else
READLINE_DEF= READLINE_DEF=
fi fi

View File

@ -145,10 +145,20 @@ if test x$enable_libreadline = xyes; then
dnl Check whether there is readline-devel and readline-runtime. dnl Check whether there is readline-devel and readline-runtime.
dnl If not, erase this macro which would enable use of readline(),add_history() dnl If not, erase this macro which would enable use of readline(),add_history()
READLINE_DEF="-DXorriso_with_readlinE" READLINE_DEF="-DXorriso_with_readlinE"
if test x$XORRISO_OLD_READLINE_CONFIGURE = x
then
dnl ts B00411 : To disable readline if not all needed functions are present
LIBBURNIA_ASSERT_READLINE
else
dnl The empty yes case obviously causes -lreadline to be linked dnl The empty yes case obviously causes -lreadline to be linked
AC_CHECK_HEADER(readline/readline.h, AC_CHECK_LIB(readline, readline, , READLINE_DEF= ), READLINE_DEF= ) AC_CHECK_HEADER(readline/readline.h, AC_CHECK_LIB(readline, readline, , READLINE_DEF= ), READLINE_DEF= )
dnl The X= in the yes case prevents that -lreadline gets linked twice dnl The X= in the yes case prevents that -lreadline gets linked twice
AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= ) AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= )
fi
else else
READLINE_DEF= READLINE_DEF=
fi fi

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.04.13.103917" #define Xorriso_timestamP "2010.04.13.154201"