More carefully checking for libreadline suitability
This commit is contained in:
parent
8a3b4e2207
commit
dfd0466291
35
acinclude.m4
35
acinclude.m4
@ -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 Important: Must be performed _after_ TARGET_SHIZZLE
|
||||
dnl
|
||||
|
@ -120,10 +120,19 @@ if test x$enable_libreadline = xyes; then
|
||||
dnl Check whether there is readline-devel and readline-runtime.
|
||||
dnl If not, erase this macro which would enable use of readline(),add_history()
|
||||
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
|
||||
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
|
||||
AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= )
|
||||
fi
|
||||
else
|
||||
READLINE_DEF=
|
||||
fi
|
||||
|
@ -145,10 +145,20 @@ if test x$enable_libreadline = xyes; then
|
||||
dnl Check whether there is readline-devel and readline-runtime.
|
||||
dnl If not, erase this macro which would enable use of readline(),add_history()
|
||||
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
|
||||
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
|
||||
AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= )
|
||||
|
||||
fi
|
||||
else
|
||||
READLINE_DEF=
|
||||
fi
|
||||
|
@ -1 +1 @@
|
||||
#define Xorriso_timestamP "2010.04.13.103917"
|
||||
#define Xorriso_timestamP "2010.04.13.154201"
|
||||
|
Loading…
Reference in New Issue
Block a user