From 4d74f4665fbe2d53f3d2757ac0bd111f78f08c7ade05961f64d6dc994b447710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Sat, 30 Oct 2010 15:55:13 +0000 Subject: [PATCH] Accepting request 51697 from home:elvigia:branches:Base:System OBS-URL: https://build.opensuse.org/request/show/51697 OBS-URL: https://build.opensuse.org/package/show/Base:System/pcre?expand=0&rev=18 --- pcre-visibility.patch | 58 +++++++++++++++++++++++++++++++++++++++++++ pcre.changes | 5 ++++ pcre.spec | 7 ++++-- 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 pcre-visibility.patch diff --git a/pcre-visibility.patch b/pcre-visibility.patch new file mode 100644 index 0000000..fd80c73 --- /dev/null +++ b/pcre-visibility.patch @@ -0,0 +1,58 @@ +--- configure.ac.orig ++++ configure.ac +@@ -672,6 +672,44 @@ if test "$enable_pcretest_libreadline" = + fi + AC_SUBST(LIBREADLINE) + ++ ++ dnl ************************************************************ ++ dnl Enable hiding of internal symbols in library to reduce its size and ++ dnl speed dynamic linking of applications. This currently is only supported ++ dnl on gcc >= 4.0 and SunPro C. ++ dnl ++ AC_MSG_CHECKING([whether to enable hidden symbols in the library]) ++ AC_ARG_ENABLE(hidden-symbols, ++ AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library]) ++ AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]), ++ [ case "$enableval" in ++ no) ++ AC_MSG_RESULT(no) ++ ;; ++ *) ++ AC_MSG_CHECKING([whether $CC supports it]) ++ if test "$GCC" = yes ; then ++ if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then ++ AC_MSG_RESULT(yes) ++ AC_DEFINE(PCRE_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCRE_EXP_DEFN, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCRE_EXP_DATA_DEFN, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCREPOSIX_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCREPOSIX_EXP_DEFN, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCRECPP_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCRECPP_EXP_DEFN, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ CFLAGS="$CFLAGS -fvisibility=hidden" ++ CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden" ++ else ++ AC_MSG_RESULT(no) ++ fi ++ ++ fi ++ ;; ++ esac ], ++ AC_MSG_RESULT(no) ++ ) ++ + # Produce these files, in addition to config.h. + AC_CONFIG_FILES( + Makefile +--- Makefile.am.orig ++++ Makefile.am +@@ -252,7 +252,7 @@ TESTS += RunGrepTest + dist_noinst_SCRIPTS += RunGrepTest + bin_PROGRAMS += pcregrep + pcregrep_SOURCES = pcregrep.c +-pcregrep_LDADD = libpcreposix.la $(LIBZ) $(LIBBZ2) ++pcregrep_LDADD = libpcreposix.la libpcre.la $(LIBZ) $(LIBBZ2) + + EXTRA_DIST += \ + testdata/grepinput \ diff --git a/pcre.changes b/pcre.changes index ed76fa6..4d5256b 100644 --- a/pcre.changes +++ b/pcre.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Oct 30 02:15:06 UTC 2010 - cristian.rodriguez@opensuse.org + +- Support GCC visibility, symbol clashes no more. + ------------------------------------------------------------------- Sun Sep 19 11:03:57 CEST 2010 - vuntz@opensuse.org diff --git a/pcre.spec b/pcre.spec index cd1fe2b..450ba25 100644 --- a/pcre.spec +++ b/pcre.spec @@ -34,6 +34,7 @@ Url: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ Source: %name-%version.tar.bz2 Source2: baselibs.conf BuildRoot: %{_tmppath}/%{name}-%{version}-build +Patch: pcre-visibility.patch %description The PCRE library is a set of functions that implement regular @@ -117,9 +118,11 @@ as Perl 5. %prep %setup -q - +%patch %build -%configure --disable-static \ +mkdir m4 +autoreconf -fiv +%configure --enable-hidden-symbols --disable-static \ --with-link-size=2 \ --with-match-limit=10000000 \ --enable-newline-is-lf \