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
This commit is contained in:
Cristian Rodríguez 2010-10-30 15:55:13 +00:00 committed by Git OBS Bridge
parent 5b695b1dba
commit 4d74f4665f
3 changed files with 68 additions and 2 deletions

58
pcre-visibility.patch Normal file
View File

@ -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 \

View File

@ -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

View File

@ -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 \