1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-25 01:05:37 +00:00

Add --without-tre option

elinks-lite in Debian does not depend on any libraries (except
gnutls). Including this option will allow elinks-lite to be built
without libtre dependency.
This commit is contained in:
Hema Seetharamaiah 2009-04-26 16:43:01 +05:30 committed by Kalle Olavi Niemitalo
parent adeac4720a
commit 4c95dd86a7

View File

@ -926,42 +926,56 @@ fi
# Check for TRE library # Check for TRE library
# =================================================================== # ===================================================================
AC_MSG_CHECKING([[for TRE in pkg-config]]) disable_tre=""
if pkg-config tre; then AC_ARG_WITH(tre, [ --without-tre disable TRE regex search support],
TRE_CFLAGS=`pkg-config --cflags tre` [if test "$with_tre" = no; then disable_tre=yes; fi])
TRE_LIBS=`pkg-config --libs tre`
AC_MSG_RESULT([[yes]]) AC_MSG_CHECKING([for TRE])
else
# <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=513055>
# "libtre-dev: /usr/lib/pkgconfig/tre.pc missing"
# so we look for the library even if pkg-config doesn't know about it.
TRE_CFLAGS=
TRE_LIBS=-ltre
AC_MSG_RESULT([[no, but let's try defaults]])
fi
AC_MSG_CHECKING([[for TRE header and library]])
EL_SAVE_FLAGS EL_SAVE_FLAGS
CFLAGS="$TRE_CFLAGS $CFLAGS" cf_result="no"
LIBS="$TRE_LIBS $LIBS"
AC_TRY_LINK([#include <tre/regex.h>], if test "$disable_tre" = yes; then
[regex_t re; cf_result="not used"
regmatch_t match[1]; else
regwcomp(&re, L"zap", REG_ICASE); AC_MSG_CHECKING([[for TRE in pkg-config]])
regwexec(&re, L"ELIZAPROGRAM", 1, match, 0);], if pkg-config tre; then
[AC_MSG_RESULT([[yes]]) TRE_CFLAGS=`pkg-config --cflags tre`
AC_DEFINE([HAVE_TRE_REGEX_H], [1], TRE_LIBS=`pkg-config --libs tre`
[Define to 1 if you have the <tre/regex.h> header file.]) AC_MSG_RESULT([[yes]])
# TRE_CFLAGS will be used only where needed. else
# TRE_LIBS will be kept in LIBS and used everywhere. # <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=513055>
EL_RESTORE_FLAGS # "libtre-dev: /usr/lib/pkgconfig/tre.pc missing"
LIBS="$TRE_LIBS $LIBS"], # so we look for the library even if pkg-config doesn't know about it.
[AC_MSG_RESULT([[no]]) TRE_CFLAGS=
TRE_CFLAGS= TRE_LIBS=-ltre
TRE_LIBS= AC_MSG_RESULT([[no, but let's try defaults]])
EL_RESTORE_FLAGS]) fi
AC_SUBST(TRE_CFLAGS)
AC_SUBST(TRE_LIBS) AC_MSG_CHECKING([[for TRE header and library]])
EL_SAVE_FLAGS
CFLAGS="$TRE_CFLAGS $CFLAGS"
LIBS="$TRE_LIBS $LIBS"
AC_TRY_LINK([#include <tre/regex.h>],
[regex_t re;
regmatch_t match[1];
regwcomp(&re, L"zap", REG_ICASE);
regwexec(&re, L"ELIZAPROGRAM", 1, match, 0);],
[AC_MSG_RESULT([[yes]])
AC_DEFINE([HAVE_TRE_REGEX_H], [1],
[Define to 1 if you have the <tre/regex.h> header file.])
# TRE_CFLAGS will be used only where needed.
# TRE_LIBS will be kept in LIBS and used everywhere.
EL_RESTORE_FLAGS
LIBS="$TRE_LIBS $LIBS"],
[AC_MSG_RESULT([[no]])
TRE_CFLAGS=
TRE_LIBS=
EL_RESTORE_FLAGS])
AC_SUBST(TRE_CFLAGS)
AC_SUBST(TRE_LIBS)
fi
AC_MSG_RESULT($cf_result)
AC_CHECK_SIZEOF([wchar_t], [4], [[#include <wchar.h>]]) AC_CHECK_SIZEOF([wchar_t], [4], [[#include <wchar.h>]])