1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Bug 1060: Try TRE_LIBS=-ltre if pkg-config tre fails.

This works around Debian bug 513055 in libtre-dev.
This commit is contained in:
Kalle Olavi Niemitalo 2009-02-08 17:21:03 +02:00 committed by Kalle Olavi Niemitalo
parent 664048098a
commit 63a362ee53

View File

@ -903,22 +903,45 @@ fi
# ===================================================================
# Check for TRE library
# ===================================================================
AC_MSG_CHECKING([for TRE])
cf_result=no
AC_MSG_CHECKING([[for TRE in pkg-config]])
if pkg-config tre; then
TRE_CFLAGS=`pkg-config --cflags tre`
TRE_LIBS=`pkg-config --libs tre`
AC_SUBST(TRE_CFLAGS)
AC_SUBST(TRE_LIBS)
AC_MSG_RESULT([[yes]])
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
CFLAGS="$TRE_CFLAGS $CFLAGS"
LIBS="$TRE_LIBS $LIBS"
cf_result=yes
fi
AC_MSG_RESULT($cf_result)
if test "$cf_result" = yes; then
AC_CHECK_HEADERS(tre/regex.h)
AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
fi
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)
AC_CHECK_SIZEOF([wchar_t], [4], [[#include <wchar.h>]])
# ===================================================================
# Check for Ruby, optional even if installed.