From d8558056f8b0925a854721015f9f0e0d89db851a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Wed, 22 Jun 2016 08:57:16 +0200 Subject: [PATCH] ppp: fix PIE build --- srcpkgs/ppp/template | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/srcpkgs/ppp/template b/srcpkgs/ppp/template index 60fdbe975c..bed5c6c1df 100644 --- a/srcpkgs/ppp/template +++ b/srcpkgs/ppp/template @@ -1,7 +1,7 @@ # Template file for 'ppp' pkgname=ppp version=2.4.7 -revision=6 +revision=7 short_desc="PPP (Point-to-Point Protocol) daemon" homepage="https://ppp.samba.org/" license="BSD, LGPLv2+, GPLv2+, Public Domain" @@ -23,11 +23,15 @@ CFLAGS="-D_GNU_SOURCE" do_configure() { # Custom CFLAGS. - sed -i "s:-O2 -pipe -Wall -g:${CFLAGS}:" pppd/Makefile.linux - sed -i "s:-g -O2:${CFLAGS}:" pppd/plugins/Makefile.linux - sed -i "s:-O2:${CFLAGS}:" pppstats/Makefile.linux - sed -i "s:-O2 -g -pipe:${CFLAGS}:" chat/Makefile.linux - sed -i "s:-O:${CFLAGS}:" pppdump/Makefile.linux + find -name "Makefile.linux" -exec sed -i "{}" \ + -e "s;CFLAGS\\s*=\(.*\);CFLAGS = ${CFLAGS} \1;" \; + # Custom LDFLAGS for chat, pppoe-discovery and pppdump + sed -i chat/Makefile.linux \ + -e "s;-o chat ;${LDFLAGS} -o chat ;" + sed -i pppd/plugins/rp-pppoe/Makefile.linux \ + -e "s;-o pppoe-discovery ;${LDFLAGS} -o pppoe-discovery ;" + sed -i pppdump/Makefile.linux \ + -e "s;-o pppdump ;${LDFLAGS} -o pppdump ;" # Enable active filter sed -i "s:^#FILTER=y:FILTER=y:" pppd/Makefile.linux # Enable ipv6 support @@ -38,7 +42,7 @@ do_configure() { ./configure ${configure_args} } do_build() { - make COPTS="${CFLAGS}" ${makejobs} + make COPTS="${CFLAGS} ${LDFLAGS}" ${makejobs} } do_install() { make DESTDIR=${DESTDIR}/usr install