mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
regex: Remove --disable-regex option
https://bugzilla.gnome.org/show_bug.cgi?id=622149
This commit is contained in:
parent
3e7f42654f
commit
d70634526d
110
configure.ac
110
configure.ac
@ -2471,76 +2471,60 @@ AC_MSG_RESULT($broken_poll)
|
|||||||
dnl *********************
|
dnl *********************
|
||||||
dnl *** GRegex checks ***
|
dnl *** GRegex checks ***
|
||||||
dnl *********************
|
dnl *********************
|
||||||
|
|
||||||
PCRE_REQUIRED_VERSION=8.11
|
PCRE_REQUIRED_VERSION=8.11
|
||||||
|
|
||||||
# Check if we should compile GRegex
|
# Check if we should use the internal or the system-supplied pcre
|
||||||
AC_ARG_ENABLE(regex, AC_HELP_STRING([--disable-regex],
|
AC_ARG_WITH(pcre,
|
||||||
[disable the compilation of GRegex]),
|
[AC_HELP_STRING([--with-pcre=@<:@internal/system@:>@],
|
||||||
[case "${enableval}" in
|
[whether to use system PCRE [default=internal]])])
|
||||||
yes) enable_regex=true ;;
|
|
||||||
no) enable_regex=false ;;
|
|
||||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-regex) ;;
|
|
||||||
esac],
|
|
||||||
[enable_regex=true])
|
|
||||||
|
|
||||||
AM_CONDITIONAL(ENABLE_REGEX, $enable_regex)
|
AM_CONDITIONAL(USE_SYSTEM_PCRE, [test "x$with_pcre" = xsystem])
|
||||||
|
|
||||||
if test x$enable_regex = xtrue; then
|
if test "x$with_pcre" = xsystem; then
|
||||||
AC_DEFINE(ENABLE_REGEX, [], [include GRegex])
|
PKG_CHECK_MODULES(PCRE,
|
||||||
# Check if we should use the internal or the system-supplied pcre
|
libpcre >= $PCRE_REQUIRED_VERSION)
|
||||||
AC_ARG_WITH(pcre,
|
AC_CACHE_CHECK([for Unicode support in PCRE],glib_cv_pcre_has_unicode,[
|
||||||
[AC_HELP_STRING([--with-pcre=@<:@internal/system@:>@],
|
glib_save_CFLAGS="$CFLAGS"
|
||||||
[whether to use system PCRE [default=internal]])])
|
glib_save_LIBS="$LIBS"
|
||||||
|
CFLAGS="$CFLAGS $PCRE_CFLAGS" LIBS="$PCRE_LIBS"
|
||||||
AM_CONDITIONAL(USE_SYSTEM_PCRE, [test "x$with_pcre" = xsystem])
|
AC_TRY_RUN([#include <pcre.h>
|
||||||
|
int main () {
|
||||||
if test "x$with_pcre" = xsystem; then
|
int support;
|
||||||
PKG_CHECK_MODULES(PCRE,
|
pcre_config (PCRE_CONFIG_UTF8, &support);
|
||||||
libpcre >= $PCRE_REQUIRED_VERSION)
|
if (!support)
|
||||||
AC_CACHE_CHECK([for Unicode support in PCRE],glib_cv_pcre_has_unicode,[
|
return 1;
|
||||||
glib_save_CFLAGS="$CFLAGS"
|
pcre_config (PCRE_CONFIG_UNICODE_PROPERTIES, &support);
|
||||||
glib_save_LIBS="$LIBS"
|
if (!support)
|
||||||
CFLAGS="$CFLAGS $PCRE_CFLAGS" LIBS="$PCRE_LIBS"
|
return 1;
|
||||||
AC_TRY_RUN([#include <pcre.h>
|
return 0;
|
||||||
int main () {
|
}],
|
||||||
int support;
|
glib_cv_pcre_has_unicode=yes,
|
||||||
pcre_config (PCRE_CONFIG_UTF8, &support);
|
glib_cv_pcre_has_unicode=no,
|
||||||
if (!support)
|
glib_cv_pcre_has_unicode=yes)
|
||||||
return 1;
|
CFLAGS="$glib_save_CFLAGS"
|
||||||
pcre_config (PCRE_CONFIG_UNICODE_PROPERTIES, &support);
|
LIBS="$glib_save_LIBS"
|
||||||
if (!support)
|
])
|
||||||
return 1;
|
if test "$glib_cv_pcre_has_unicode" = "no"; then
|
||||||
return 0;
|
AC_MSG_ERROR([*** The system-supplied PCRE does not support Unicode properties or UTF-8.])
|
||||||
}],
|
|
||||||
glib_cv_pcre_has_unicode=yes,
|
|
||||||
glib_cv_pcre_has_unicode=no,
|
|
||||||
glib_cv_pcre_has_unicode=yes)
|
|
||||||
CFLAGS="$glib_save_CFLAGS"
|
|
||||||
LIBS="$glib_save_LIBS"
|
|
||||||
])
|
|
||||||
if test "$glib_cv_pcre_has_unicode" = "no"; then
|
|
||||||
AC_MSG_ERROR([*** The system-supplied PCRE does not support Unicode properties or UTF-8.])
|
|
||||||
fi
|
|
||||||
AC_SUBST(PCRE_CFLAGS)
|
|
||||||
AC_SUBST(PCRE_LIBS)
|
|
||||||
AC_DEFINE(USE_SYSTEM_PCRE, [], [using the system-supplied PCRE library])
|
|
||||||
PCRE_REQUIRES=libpcre
|
|
||||||
AC_SUBST(PCRE_REQUIRES)
|
|
||||||
else
|
|
||||||
# If using gcc 4 pass -Wno-pointer-sign when compiling the internal PCRE
|
|
||||||
if test x"$GCC" = xyes; then
|
|
||||||
AC_MSG_CHECKING([whether compiler understands -Wno-pointer-sign])
|
|
||||||
save_CFLAGS="$CFLAGS"
|
|
||||||
CFLAGS="$CFLAGS -Wno-pointer-sign"
|
|
||||||
AC_TRY_COMPILE([],[],[PCRE_WARN_CFLAGS="$PCRE_WARN_CFLAGS -Wno-pointer-sign"
|
|
||||||
AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
|
|
||||||
CFLAGS="$save_CFLAGS"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
AC_SUBST(PCRE_WARN_CFLAGS)
|
AC_SUBST(PCRE_CFLAGS)
|
||||||
|
AC_SUBST(PCRE_LIBS)
|
||||||
|
AC_DEFINE(USE_SYSTEM_PCRE, [], [using the system-supplied PCRE library])
|
||||||
|
PCRE_REQUIRES=libpcre
|
||||||
|
AC_SUBST(PCRE_REQUIRES)
|
||||||
else
|
else
|
||||||
AM_CONDITIONAL(USE_SYSTEM_PCRE, false])
|
# If using gcc 4 pass -Wno-pointer-sign when compiling the internal PCRE
|
||||||
|
if test x"$GCC" = xyes; then
|
||||||
|
AC_MSG_CHECKING([whether compiler understands -Wno-pointer-sign])
|
||||||
|
save_CFLAGS="$CFLAGS"
|
||||||
|
CFLAGS="$CFLAGS -Wno-pointer-sign"
|
||||||
|
AC_TRY_COMPILE([],[],[PCRE_WARN_CFLAGS="$PCRE_WARN_CFLAGS -Wno-pointer-sign"
|
||||||
|
AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
|
||||||
|
CFLAGS="$save_CFLAGS"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
AC_SUBST(PCRE_WARN_CFLAGS)
|
||||||
|
|
||||||
dnl **********************
|
dnl **********************
|
||||||
dnl *** Win32 API libs ***
|
dnl *** Win32 API libs ***
|
||||||
|
@ -30,17 +30,10 @@ PRINTF_SUBDIR = gnulib
|
|||||||
printf_la = gnulib/libgnulib.la
|
printf_la = gnulib/libgnulib.la
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ENABLE_REGEX
|
|
||||||
if USE_SYSTEM_PCRE
|
if USE_SYSTEM_PCRE
|
||||||
else
|
else
|
||||||
MAYBE_PCRE = pcre
|
MAYBE_PCRE = pcre
|
||||||
endif
|
endif
|
||||||
gregex_c = gregex.c
|
|
||||||
gregex_h = gregex.h
|
|
||||||
else
|
|
||||||
gregex_c =
|
|
||||||
gregex_h =
|
|
||||||
endif
|
|
||||||
|
|
||||||
SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
|
SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
|
||||||
|
|
||||||
@ -173,7 +166,7 @@ libglib_2_0_la_SOURCES = \
|
|||||||
gqsort.c \
|
gqsort.c \
|
||||||
gqueue.c \
|
gqueue.c \
|
||||||
grand.c \
|
grand.c \
|
||||||
$(gregex_c) \
|
gregex.c \
|
||||||
gscanner.c \
|
gscanner.c \
|
||||||
gscripttable.h \
|
gscripttable.h \
|
||||||
gsequence.c \
|
gsequence.c \
|
||||||
@ -299,7 +292,7 @@ glibsubinclude_HEADERS = \
|
|||||||
gquark.h \
|
gquark.h \
|
||||||
gqueue.h \
|
gqueue.h \
|
||||||
grand.h \
|
grand.h \
|
||||||
$(gregex_h) \
|
gregex.h \
|
||||||
gscanner.h \
|
gscanner.h \
|
||||||
gsequence.h \
|
gsequence.h \
|
||||||
gshell.h \
|
gshell.h \
|
||||||
@ -368,7 +361,6 @@ uninstall-def-file:
|
|||||||
export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
|
export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ENABLE_REGEX
|
|
||||||
if USE_SYSTEM_PCRE
|
if USE_SYSTEM_PCRE
|
||||||
pcre_lib = $(PCRE_LIBS)
|
pcre_lib = $(PCRE_LIBS)
|
||||||
pcre_inc = $(PCRE_CFLAGS)
|
pcre_inc = $(PCRE_CFLAGS)
|
||||||
@ -376,10 +368,6 @@ else
|
|||||||
pcre_lib = pcre/libpcre.la
|
pcre_lib = pcre/libpcre.la
|
||||||
pcre_inc =
|
pcre_inc =
|
||||||
endif
|
endif
|
||||||
else
|
|
||||||
pcre_lib =
|
|
||||||
pcre_inc =
|
|
||||||
endif
|
|
||||||
|
|
||||||
libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD)
|
libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD)
|
||||||
libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
|
libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
|
||||||
|
@ -27,8 +27,6 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include "glib.h"
|
#include "glib.h"
|
||||||
|
|
||||||
#ifdef ENABLE_REGEX
|
|
||||||
|
|
||||||
/* U+20AC EURO SIGN (symbol, currency) */
|
/* U+20AC EURO SIGN (symbol, currency) */
|
||||||
#define EURO "\xe2\x82\xac"
|
#define EURO "\xe2\x82\xac"
|
||||||
/* U+00E0 LATIN SMALL LETTER A WITH GRAVE (letter, lowercase) */
|
/* U+00E0 LATIN SMALL LETTER A WITH GRAVE (letter, lowercase) */
|
||||||
@ -2659,14 +2657,3 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
return g_test_run ();
|
return g_test_run ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* ENABLE_REGEX false */
|
|
||||||
|
|
||||||
int
|
|
||||||
main (int argc, char *argv[])
|
|
||||||
{
|
|
||||||
g_print ("GRegex is disabled.\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ENABLE_REGEX */
|
|
||||||
|
@ -132,13 +132,8 @@ G_DEFINE_BOXED_TYPE (GPtrArray, g_ptr_array,g_ptr_array_ref, g_ptr_array_unref)
|
|||||||
G_DEFINE_BOXED_TYPE (GByteArray, g_byte_array, g_byte_array_ref, g_byte_array_unref)
|
G_DEFINE_BOXED_TYPE (GByteArray, g_byte_array, g_byte_array_ref, g_byte_array_unref)
|
||||||
G_DEFINE_BOXED_TYPE (GBytes, g_bytes, g_bytes_ref, g_bytes_unref);
|
G_DEFINE_BOXED_TYPE (GBytes, g_bytes, g_bytes_ref, g_bytes_unref);
|
||||||
|
|
||||||
#ifdef ENABLE_REGEX
|
|
||||||
G_DEFINE_BOXED_TYPE (GRegex, g_regex, g_regex_ref, g_regex_unref)
|
G_DEFINE_BOXED_TYPE (GRegex, g_regex, g_regex_ref, g_regex_unref)
|
||||||
G_DEFINE_BOXED_TYPE (GMatchInfo, g_match_info, g_match_info_ref, g_match_info_unref)
|
G_DEFINE_BOXED_TYPE (GMatchInfo, g_match_info, g_match_info_ref, g_match_info_unref)
|
||||||
#else
|
|
||||||
GType g_regex_get_type (void) { return G_TYPE_INVALID; }
|
|
||||||
GType g_match_info_get_type (void) { return G_TYPE_INVALID; }
|
|
||||||
#endif /* ENABLE_REGEX */
|
|
||||||
|
|
||||||
#define g_variant_type_get_type g_variant_type_get_gtype
|
#define g_variant_type_get_type g_variant_type_get_gtype
|
||||||
G_DEFINE_BOXED_TYPE (GVariantType, g_variant_type, g_variant_type_copy, g_variant_type_free)
|
G_DEFINE_BOXED_TYPE (GVariantType, g_variant_type, g_variant_type_copy, g_variant_type_free)
|
||||||
|
Loading…
Reference in New Issue
Block a user