From 66070ecc0e0e1cbc8f7e8a84a69ec48299fcf910 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 16 Jan 2008 23:36:17 +0000 Subject: [PATCH] Added a test for readline.h and eventually enabled use of libreadline --- libisoburn/trunk/test/configure_ac.txt | 13 ++++++++++++- libisoburn/trunk/test/xorriso_makefile_am.txt | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libisoburn/trunk/test/configure_ac.txt b/libisoburn/trunk/test/configure_ac.txt index c1598505..3bfa0fd9 100644 --- a/libisoburn/trunk/test/configure_ac.txt +++ b/libisoburn/trunk/test/configure_ac.txt @@ -7,7 +7,7 @@ AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([subdir-objects]) -# A dummy demanded by libburn sources, but unused by xorriso +dnl A dummy demanded by libburn sources, but unused by xorriso BURN_MAJOR_VERSION=0 BURN_MINOR_VERSION=0 BURN_MICRO_VERSION=0 @@ -68,6 +68,17 @@ else CFLAGS="$CFLAGS -DDEBUG" fi + +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" +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= ) +AC_SUBST(READLINE_DEF) + + AC_CONFIG_FILES([ Makefile version.h diff --git a/libisoburn/trunk/test/xorriso_makefile_am.txt b/libisoburn/trunk/test/xorriso_makefile_am.txt index d574f334..b2fba74e 100644 --- a/libisoburn/trunk/test/xorriso_makefile_am.txt +++ b/libisoburn/trunk/test/xorriso_makefile_am.txt @@ -18,7 +18,7 @@ xorriso_xorriso_CPPFLAGS = -I./libburn -I./libisofs -I./libisoburn -I./xorriso # No readline in the vanilla version because the necessary headers # are in a separate readline-development package. -xorriso_xorriso_CFLAGS = -DXorriso_standalonE -DXorriso_with_maiN -DXorriso_with_regeX +xorriso_xorriso_CFLAGS = -DXorriso_standalonE -DXorriso_with_maiN -DXorriso_with_regeX $(READLINE_DEF) xorriso_xorriso_LDADD = $(THREAD_LIBS)