ppp: fix PIE build

This commit is contained in:
Jürgen Buchmüller 2016-06-22 08:57:16 +02:00
parent b847cee9e1
commit d8558056f8

View file

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