diff options
Diffstat (limited to 'kjs/configure.in.in')
-rw-r--r-- | kjs/configure.in.in | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/kjs/configure.in.in b/kjs/configure.in.in index 1c4d3ac52..4e6bd9742 100644 --- a/kjs/configure.in.in +++ b/kjs/configure.in.in @@ -2,52 +2,55 @@ dnl KDE JavaScript specific configure tests AC_CHECK_HEADERS(ieeefp.h float.h) -AC_DEFUN([AC_CHECK_PCREPOSIX], +AC_DEFUN(AC_CHECK_PCRE2POSIX], [ - dnl define the configure option that disables pcre - AC_ARG_ENABLE(pcre,AC_HELP_STRING([--disable-pcre],[don't require libpcre (poor RegExp support in Javascript)]), - with_pcre=$enableval, with_pcre=yes) + dnl define the configure option that disables pcre2 + AC_ARG_ENABLE(pcre2,AC_HELP_STRING([--disable-pcre],[don't require libpcre (poor RegExp support in Javascript)]), + with_pcre2=$enableval, with_pcre2=yes) - if test "$with_pcre" = "yes"; then + if test "$with_pcre2" = "yes"; then - KDE_FIND_PATH(pcre-config, PCRE_CONFIG, [${exec_prefix}/bin ${prefix}/bin], [PCRE_CONFIG="" ]) - if test -n "$PCRE_CONFIG" && $PCRE_CONFIG --libs >/dev/null 2>&1; then - LIBPCRE=`$PCRE_CONFIG --libs-posix | sed -e "s,-L/usr/lib ,," -e "s,[\b-].\+pcreposix[^[:space:]]*\b,,"` - PCRECFLAGS=`$PCRE_CONFIG --cflags` + KDE_FIND_PATH(pcre2-config, PCRE2_CONFIG, [${exec_prefix}/bin ${prefix}/bin], [PCRE2_CONFIG="" ]) + if test -n "$PCRE2_CONFIG" && $PCRE2_CONFIG --libs8 >/dev/null 2>&1; then + LIBPCRE2=`$PCRE2_CONFIG --libs-posix | sed -e "s,-L/usr/lib ,," -e "s,[\b-].\+pcreposix[^[:space:]]*\b,,"` + PCRE2CFLAGS=`$PCRE2_CONFIG --cflags` else - LIBPCRE="-lpcre" - PCRECFLAGS= + LIBPCRE2="-lpcre2-8" + PCRE2CFLAGS= fi - AC_CACHE_VAL(ac_cv_have_pcreposix, [ + AC_CACHE_VAL(ac_cv_have_pcre2posix, [ ac_save_libs="$LIBS" - LIBS="$LIBPCRE" + LIBS="$LIBPCRE2" ac_CPPFLAGS_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $PCRECFLAGS $all_includes" + CPPFLAGS="$CPPFLAGS $PCRE2CFLAGS $all_includes" ac_LDFLAGS_save="$LDFLAGS" LDFLAGS="$LDFLAGS $all_libraries" AC_TRY_LINK( - [#include <pcre.h>], - [regfree(0);], - [ac_cv_have_pcreposix="yes"], - [ac_cv_have_pcreposix="no"] + [ + #define PCRE2_CODE_UNIT_WIDTH 8 + #include <pcre2.h> + ], + [pcre2_regfree(0);], + [ac_cv_have_pcre2posix="yes"], + [ac_cv_have_pcre2posix="no"] ) LIBS="$ac_save_libs" LDFLAGS="$ac_LDFLAGS_save" CPPFLAGS="$ac_CPPFLAGS_save" ]) - if test "$ac_cv_have_pcreposix" = "yes"; then - AC_DEFINE(HAVE_PCREPOSIX, 1, [Define if you have pcreposix libraries and header files.]) + if test "$ac_cv_have_pcre2posix" = "yes"; then + AC_DEFINE(HAVE_PCRE2POSIX, 1, [Define if you have pcre2posix libraries and header files.]) else AC_MSG_ERROR([You're missing libpcre. -Download libpcre from http://www.pcre.org or find a binary package for your platform. +Download libpcre2 from http://www.pcre.org or find a binary package for your platform. Alternatively, you can specify --disable-pcre, but some web pages - using regular expressions in Javascript code - will not work correctly, the regexp support being quite limited if libpcre isn't present.]) fi fi ]) -AC_CHECK_PCREPOSIX -AC_SUBST(LIBPCRE) -AC_SUBST(PCRECFLAGS) +AC_CHECK_PCRE2POSIX +AC_SUBST(LIBPCRE2) +AC_SUBST(PCRE2CFLAGS) AM_CONFIG_HEADER([kjs/global.h]) |