landry@ noticed that www/squid was picking up execinfo.h in bulk causing

#ifdef'd headers to be used and dpb was junking it thus breaking the build;
fix by improving detection for backtrace_symbol_fd / libexecinfo and
explicitly using it.
This commit is contained in:
sthen 2013-01-22 14:30:46 +00:00
parent 0e4e7602b2
commit af9d1f1acc
5 changed files with 56 additions and 29 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.141 2013/01/09 21:41:48 sthen Exp $
# $OpenBSD: Makefile,v 1.142 2013/01/22 14:30:46 sthen Exp $
MULTI_PACKAGES= -main -ntlm
@ -10,6 +10,7 @@ COMMENT-ldap= LDAP authentication/ACL support for Squid
COMMENT-ntlm= NTLM authentication/ACL support for Squid
V= 3.2.6
REVISION-main= 0
DISTNAME= squid-$V
PKGNAME-main= squid-$V
@ -32,7 +33,9 @@ PERMIT_DISTFILES_FTP= Yes
WANTLIB += c m pthread stdc++
WANTLIB-main= ${WANTLIB} asn1 crypto gssapi krb5 ssl
WANTLIB-main= ${WANTLIB} asn1 crypto execinfo gssapi krb5 ssl
LIB_DEPENDS-main= devel/libexecinfo
SYSCONFDIR= ${BASESYSCONFDIR}/squid
LOCALSTATEDIR= ${BASELOCALSTATEDIR}/squid
@ -48,7 +51,9 @@ STOREIO= aufs ufs diskd #coss rock
SEPARATE_BUILD= Yes
AUTOCONF_VERSION= 2.68
CONFIGURE_STYLE= autoconf
AUTOMAKE_VERSION= 1.11
BUILD_DEPENDS= ${MODGNU_AUTOCONF_DEPENDS} ${MODGNU_AUTOMAKE_DEPENDS}
CONFIGURE_STYLE= gnu
MODGNU_CONFIG_GUESS_DIRS= ${WRKSRC}/cfgaux
USE_GROFF= Yes
@ -82,6 +87,7 @@ CONFIGURE_ARGS+= ${CONFIGURE_SHARED} \
--enable-referer-log \
--enable-removal-policies="lru heap" \
--enable-ssl \
--enable-stacktraces \
--enable-storeio="${STOREIO}" \
--with-default-user="_squid" \
--with-filedescriptors=8192 \
@ -119,6 +125,9 @@ post-extract:
@cp ${FILESDIR}/krb5-config ${WRKDIR}/bin
@chmod a+x ${WRKDIR}/bin/krb5-config
post-patch:
cd ${WRKSRC}; AUTOCONF_VERSION=${AUTOCONF_VERSION} AUTOMAKE_VERSION=${AUTOMAKE_VERSION} LOCALBASE=${LOCALBASE} ./bootstrap.sh
pre-build:
@cd ${WRKSRC}; \
perl -pi -e 's,/usr/local,${LOCALBASE},g' \

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-bootstrap_sh,v 1.1 2013/01/22 14:30:46 sthen Exp $
--- bootstrap.sh.orig Tue Jan 22 12:29:39 2013
+++ bootstrap.sh Tue Jan 22 12:29:42 2013
@@ -129,7 +129,7 @@ do
mkdir -p cfgaux
if test -n "$ltpath"; then
- acincludeflag="-I $ltpath/../share/aclocal"
+ acincludeflag="-I ${LOCALBASE}/share/aclocal"
else
acincludeflag=""
fi

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-configure_ac,v 1.4 2012/12/17 18:56:56 sthen Exp $
--- configure.ac.orig Mon Dec 10 09:54:50 2012
+++ configure.ac Mon Dec 17 18:56:23 2012
$OpenBSD: patch-configure_ac,v 1.5 2013/01/22 14:30:46 sthen Exp $
--- configure.ac.orig Wed Jan 9 01:42:47 2013
+++ configure.ac Tue Jan 22 12:58:39 2013
@@ -566,6 +566,16 @@ for module in $squid_disk_module_candidates none; do
fi
fi
@ -18,3 +18,21 @@ $OpenBSD: patch-configure_ac,v 1.4 2012/12/17 18:56:56 sthen Exp $
solaris)
if test "x$GCC" = "xyes" ; then
SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT -pthreads"
@@ -3112,9 +3122,16 @@ if test "x$squid_host_os" = "xmingw" ; then
ac_cv_func_statfs='yes'
fi
+dnl Some systems (mostly BSDs) require -lexecinfo for backtrace_symbols_fd()
+AC_CHECK_LIB(execinfo,backtrace_symbols_fd,[BACKTRACE_LIB="-lexecinfo"])
+oLIBS=$LIBS
+LIBS="$BACKTRACE_LIB"
+AC_CHECK_FUNCS(backtrace_symbols_fd)
+LIBS=$oLIBS
+AC_SUBST(BACKTRACE_LIB)
+
dnl Check for library functions
AC_CHECK_FUNCS(\
- backtrace_symbols_fd \
bcopy \
bswap_16 \
bswap_32 \

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-src_Makefile_am,v 1.1 2013/01/22 14:30:46 sthen Exp $
--- src/Makefile.am.orig Tue Jan 22 12:19:59 2013
+++ src/Makefile.am Tue Jan 22 12:20:03 2013
@@ -593,6 +593,7 @@ squid_LDADD = \
$(MINGW_LIBS) \
$(KRB5LIBS) \
$(COMPAT_LIB) \
+ $(BACKTRACE_LIB) \
$(XTRA_LIBS)
squid_DEPENDENCIES = \
$(DISK_LIBS) \

View File

@ -1,23 +0,0 @@
$OpenBSD: patch-tools_Makefile_in,v 1.4 2012/11/28 17:45:29 sthen Exp $
## intending to link a static cachemgr.cgi, but this is not enough.
--- tools/Makefile.in.orig Sat Oct 20 13:40:24 2012
+++ tools/Makefile.in Fri Nov 9 22:42:29 2012
@@ -84,6 +84,7 @@ cachemgr__CGIEXT__DEPENDENCIES = $(top_builddir)/src/i
$(am__DEPENDENCIES_3) $(am__DEPENDENCIES_3)
cachemgr__CGIEXT__LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+ -nopie -static \
$(cachemgr__CGIEXT__CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
am_squidclient_OBJECTS = squidclient.$(OBJEXT) stub_debug.$(OBJEXT) \
@@ -438,7 +439,7 @@ cachemgr__CGIEXT__SOURCES = cachemgr.cc \
test_tools.cc \
time.cc
-cachemgr__CGIEXT__CXXFLAGS = -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CXXFLAGS)
+cachemgr__CGIEXT__CXXFLAGS = -fno-pie -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CXXFLAGS)
all: all-recursive
.SUFFIXES: