177
177
# ############################################################################
178
178
# Log output of a command to a file
179
179
# ############################################################################
180
+ pipelog () {
181
+ $TEE -a $LOGFILE 2>&1
182
+ }
183
+
180
184
logcmd () {
181
185
typeset preserve_stdout=0
182
186
[ " $1 " = " -p" ] && shift && preserve_stdout=1
@@ -190,18 +194,14 @@ logcmd() {
190
194
else
191
195
if [ " $preserve_stdout " = 0 ]; then
192
196
echo Running: " $@ "
193
- " $@ " | $TEE -a $LOGFILE 2>&1
197
+ " $@ " | pipelog
194
198
return ${PIPESTATUS[0]}
195
199
else
196
200
" $@ "
197
201
fi
198
202
fi
199
203
}
200
204
201
- pipelog () {
202
- $TEE -a $LOGFILE 2>&1
203
- }
204
-
205
205
c_highlight=" ` $TPUT setaf 2` "
206
206
c_error=" ` $TPUT setaf 1` "
207
207
c_note=" ` $TPUT setaf 6` "
@@ -2755,6 +2755,30 @@ make_install() {
2755
2755
$MAKE_INSTALL_TARGET || logerr " --- Make install failed"
2756
2756
fi
2757
2757
hook post_install $arch
2758
+
2759
+ typeset tf=$TMPDIR /pkgconfig.fix
2760
+ : > $tf
2761
+ logmsg " --- fixing runtime path linker option in pkg-config files"
2762
+ while read f; do
2763
+ logcmd $RM -f $f .orig
2764
+ $SED -Ei.orig -e '
2765
+ # If the line already contains -Wl,-R, next!
2766
+ /-Wl,-R/n
2767
+ /^Libs:/ {
2768
+ # Replace any -R with the more widely accepted -Wl,-R
2769
+ s/[:space:]-R/ -Wl,-R/
2770
+ # If the above replacement succeeded, next!
2771
+ t
2772
+ # Augment any remaining -L with a matching -Wl,-R
2773
+ s/-L[:space:]*([^[:space:]]+)/& -Wl,-R\1/
2774
+ }
2775
+ ' $f || echo " Failed to fix $f " >> $tf
2776
+ logcmd $DIFF -u $f {.orig,}
2777
+ done < <( $FD -t f -e pc -p " ${LIBDIRS[$arch]} /pkgconfig/[^/]+\\ .pc\$ " $DESTDIR )
2778
+ if [ -s " $tf " ]; then
2779
+ $CAT $tf | pipelog
2780
+ logerr " Problem fixing pkg-config files"
2781
+ fi
2758
2782
}
2759
2783
2760
2784
make_install_i386 () {
@@ -3691,7 +3715,7 @@ check_rtime() {
3691
3715
-f $TMPDIR /rtime.files
3692
3716
3693
3717
if [ -s " $TMPDIR /rtime.err" ]; then
3694
- $CAT $TMPDIR /rtime.err | $TEE -a $LOGFILE
3718
+ $CAT $TMPDIR /rtime.err | pipelog
3695
3719
logerr " ELF runtime problems detected"
3696
3720
fi
3697
3721
}
@@ -3709,7 +3733,7 @@ check_ssp() {
3709
3733
done < <( rtime_objects)
3710
3734
wait
3711
3735
if [ -s " $TMPDIR /rtime.ssp" ]; then
3712
- $CAT $TMPDIR /rtime.ssp | $TEE -a $LOGFILE
3736
+ $CAT $TMPDIR /rtime.ssp | pipelog
3713
3737
logerr " Found object(s) without SSP"
3714
3738
fi
3715
3739
}
@@ -3748,7 +3772,7 @@ check_soname() {
3748
3772
done < <( rtime_objects -f)
3749
3773
wait
3750
3774
if [ -s " $TMPDIR /rtime.soname" ]; then
3751
- $CAT $TMPDIR /rtime.soname | $TEE -a $LOGFILE
3775
+ $CAT $TMPDIR /rtime.soname | pipelog
3752
3776
logerr " Found SONAME problems"
3753
3777
fi
3754
3778
}
@@ -3773,7 +3797,7 @@ check_bmi() {
3773
3797
done < <( rtime_objects)
3774
3798
wait
3775
3799
if [ -s " $TMPDIR /rtime.bmi" ]; then
3776
- $CAT $TMPDIR /rtime.bmi | $TEE -a $LOGFILE
3800
+ $CAT $TMPDIR /rtime.bmi | pipelog
3777
3801
logerr " BMI instruction set found"
3778
3802
fi
3779
3803
}
0 commit comments