|
Lines 56-69
Link Here
|
| 56 |
append-flags -Wa,--noexecstack |
56 |
append-flags -Wa,--noexecstack |
| 57 |
|
57 |
|
| 58 |
# replace CFLAGS |
58 |
# replace CFLAGS |
|
|
59 |
[[ $(tc-arch) == "ppc64" ]] && replace-flags -Os -O |
| 60 |
[[ $(tc-arch) == "ppc64" ]] && replace-flags -O2 -O |
| 61 |
[[ $(tc-arch) == "ppc64" ]] && replace-flags -O3 -O |
| 59 |
OLDIFS=$IFS |
62 |
OLDIFS=$IFS |
| 60 |
IFS=$'\n' |
63 |
IFS=$'\n' |
| 61 |
for a in $( grep -n -e "^\"linux-" Configure ); do |
64 |
for a in $( grep -n -e "^\"linux-" Configure ); do |
| 62 |
LINE=$( echo $a | awk -F: '{print $1}' ) |
65 |
LINE=$( echo $a | awk -F: '{print $1}' ) |
| 63 |
CUR_CFLAGS=$( echo $a | awk -F: '{print $3}' ) |
66 |
CUR_CFLAGS=$( echo $a | awk -F: '{print $3}' ) |
| 64 |
NEW_CFLAGS=$(echo $CUR_CFLAGS | LC_ALL=C sed -r -e "s|-O[23]||" -e "s:-fomit-frame-pointer::" -e "s:-mcpu=[-a-z0-9]+::" -e "s:-m486::") |
67 |
NEW_CFLAGS=$(echo $CUR_CFLAGS | LC_ALL=C sed -r -e "s|-O[23]||" -e "s:-fomit-frame-pointer::" -e "s:-mcpu=[-a-z0-9]+::" -e "s:-m486::") |
| 65 |
# ppc64's current toolchain sucks at optimization and will break this package |
68 |
NEW_CFLAGS="${NEW_CFLAGS} ${CFLAGS}" |
| 66 |
[[ $(tc-arch) != "ppc64" ]] && NEW_CFLAGS="${NEW_CFLAGS} ${CFLAGS}" |
|
|
| 67 |
|
69 |
|
| 68 |
sed -i "${LINE}s:$CUR_CFLAGS:$NEW_CFLAGS:" Configure || die "sed failed" |
70 |
sed -i "${LINE}s:$CUR_CFLAGS:$NEW_CFLAGS:" Configure || die "sed failed" |
| 69 |
done |
71 |
done |