X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=configure.in;h=23b9844f6054acc87487a05425bca7401e9fde01;hp=071de3b1c88be87235e0b69f81e5148e3bf43524;hb=cb007c6145b0dbb3fcbe9826f081650becf9a05c;hpb=af03c4a4f5320b52c7cc5f47bab7c9ad4b3e384d diff --git a/configure.in b/configure.in index 071de3b..23b9844 100644 --- a/configure.in +++ b/configure.in @@ -1,11 +1,13 @@ -dnl Zebra, Index Data Aps, 1995-2002 -dnl $Id: configure.in,v 1.56 2002-11-15 21:26:00 adam Exp $ +dnl Zebra, Index Data Aps, 1995-2004 +dnl $Id: configure.in,v 1.94 2004-08-24 10:37:18 adam Exp $ dnl AC_INIT(include/zebraver.h) -AM_INIT_AUTOMAKE(idzebra,1.3.3) +AM_INIT_AUTOMAKE(idzebra,1.4.0) +AM_PROG_LIBTOOL dnl ------ Substitutions AC_SUBST(TCL_INCLUDE) AC_SUBST(TCL_LIB) +AC_SUBST(READLINE_LIBS) dnl ------ Perl substitutions AC_SUBST(PERL_BINARY) AC_SUBST(PERL_XS_INIT) @@ -75,7 +77,6 @@ else yazflag="" fi YAZ_INIT($yazflag) - dnl ------ Look for Tcl dnl See if user has specified location of tclConfig.sh; otherwise dnl see if tclConfig.sh exists in same prefix lcoation as tclsh; otherwise @@ -111,6 +112,7 @@ if test -r ${tclconfig}/tclConfig.sh; then TCL_INCLUDE=-I${TCL_PREFIX}/include TCL_LIB="$TCL_LIB_SPEC $TCL_LIBS" fi + TCL_LIB=`echo $TCL_LIB|sed 's%-L/usr/lib%%g'` SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS SHLIB_LD=$TCL_SHLIB_LD SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX @@ -128,6 +130,39 @@ dnl dnl ------ mkstemp AC_CHECK_FUNCS(mkstemp) dnl +dnl ------ GNU Readline +READLINE_SHARED_LIBADD="" +AC_CHECK_LIB(ncurses, tgetent, [READLINE_SHARED_LIBADD="-lncurses"], + AC_CHECK_LIB(termcap, tgetent, [READLINE_SHARED_LIBADD="-ltermcap"]) +) +READLINE_LIBS="" +AC_CHECK_LIB(readline, readline, [READLINE_LIBS="$READLINE_LIBS -lreadline $READLINE_SHARED_LIBADD"],,$READLINE_SHARED_LIBADD) +AC_CHECK_LIB(history, add_history, [READLINE_LIBS="$READLINE_LIBS -lhistory"]) +if test "$ac_cv_lib_readline_readline" = "yes"; then + AC_CHECK_HEADERS(readline/readline.h readline/history.h) + xLIBS=$LIBS + LIBS="$LIBS $READLINE_LIBS" + AC_TRY_LINK([ + #include + #include + ],[ + static void f() + { + rl_attempted_completion_over = 0; + } + ],AC_DEFINE(HAVE_READLINE_COMPLETION_OVER)) + AC_TRY_LINK([ + #include + #include + ],[ + static void f() + { + rl_completion_matches (0, 0); + } + ],AC_DEFINE(HAVE_READLINE_RL_COMPLETION_MATCHES)) + LIBS=$xLIBS +fi +dnl dnl ------ iconv AC_ARG_WITH(iconv, [ --with-iconv[=DIR] iconv library in DIR]) if test "$with_iconv" != "no"; then @@ -173,6 +208,9 @@ else fi fi dnl +dnl ------ -lm +AC_CHECK_LIB(m,sqrt) +dnl dnl ------ EXPAT expat=yes AC_ARG_WITH(expat, [ --with-expat[=DIR] EXPAT library in DIR],[expat=$withval]) @@ -195,14 +233,15 @@ if test "$expat" != "no"; then fi dnl dnl ------ PERL -perl=yes +AM_CONDITIONAL(perl,false) +perl=no PERL_XS_INIT="NULL" PERL_XS_INIT_INCLUDE='' PERL_BINARY="" AC_ARG_WITH(perl, [ --with-perl[=FILE] perl binary location],[perl=$withval]) if test "$perl" != "no"; then AC_MSG_CHECKING(for perl binary) - if test "$perl" == "yes"; then + if test "$perl" = "yes"; then perlbin=`which perl` else perlbin="$perl" @@ -212,13 +251,11 @@ if test "$perl" != "no"; then AC_MSG_CHECKING(perl core directory) archdir=`$perlbin -MConfig -e 'print $Config{archlib}'`; perlcore="$archdir/CORE"; - if test "$perlcore"; then + if test -d "$perlcore"; then PERL_BINARY="$perlbin" AC_MSG_RESULT($perlcore) - AC_DEFINE(HAVE_PERL,1) else AC_MSG_RESULT(Failed) - AC_DEFINE(HAVE_PERL,0) fi AC_MSG_CHECKING("for ExtUtils::Embed to determine ccopts") @@ -252,9 +289,28 @@ if test "$perl" != "no"; then AC_MSG_RESULT(XS libraries are not going to be available) fi - ZPERL_LIBS="$LIBS" + xLIBS="$LIBS" + xCFLAGS="$CFLAGS" CFLAGS="$PERL_CFLAGS $CFLAGS" LIBS="$PERL_LIBS $LIBS" + + AC_MSG_CHECKING(for perl library) + AC_TRY_LINK([ + #include + ],[ + static void f() + { + ; + } + ],AM_CONDITIONAL(perl,true) + AC_DEFINE(HAVE_PERL,1) + AC_MSG_RESULT(found) + ZPERL_LIBS="$xLIBS" + , + AC_MSG_RESULT(not found) + AC_DEFINE(HAVE_PERL,0) + LIBS="$xLIBS" + CFLAGS="$xCFLAGS") else AC_DEFINE(HAVE_PERL,0) AC_MSG_RESULT(Not found) @@ -316,7 +372,6 @@ AC_OUTPUT([ isamb/Makefile isams/Makefile isamc/Makefile - isam/Makefile rset/Makefile data1/Makefile recctrl/Makefile @@ -331,11 +386,19 @@ AC_OUTPUT([ doc/zebraphp.dsl doc/tkl.xsl test/Makefile test/gils/Makefile test/usmarc/Makefile test/api/Makefile - perl/Makefile.PL - test/dmoz/Makefile test/xpath/Makefile - examples/Makefile examples/gils/Makefile + test/rusmarc/Makefile test/cddb/Makefile test/malxml/Makefile + test/config/Makefile + perl/Makefile.PL test/xelm/Makefile + test/dmoz/Makefile test/xpath/Makefile test/sort/Makefile test/zsh/Makefile + test/marcxml/Makefile test/charmap/Makefile test/codec/Makefile + examples/Makefile examples/gils/Makefile examples/zthes/Makefile + idzebra.spec ]) - if test -x "$perlbin"; then - res=`cd perl ; $perlbin Makefile.PL ; cd .. ;`; + res=`cd perl ; $perlbin Makefile.PL ; cd .. ;`; fi +if test -z "$YAZLIB"; then + echo "YAZ was not found. Use --with-yazconfig=DIR to specify location." + test -f /etc/debian_version && echo "Debian package libyaz-dev is required." +fi +