Skip to content

Commit b75842b

Browse files
authored
Merge pull request #1583 from hadfl/pkgconfig
add runtime linker option to pkg-config files
2 parents 175fa63 + e2d6ebf commit b75842b

File tree

5 files changed

+52
-16
lines changed

5 files changed

+52
-16
lines changed

build/alpine/patches/autoreconf.patch

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -wpruN --no-dereference '--exclude=*.orig' a~/configure.ac a/configure.ac
2+
--- a~/configure.ac 1970-01-01 00:00:00
3+
+++ a/configure.ac 1970-01-01 00:00:00
4+
@@ -58,7 +58,7 @@ AC_PATH_PROG(MAKE, make)
5+
6+
dnl COMPILE-TIME OPTIONS
7+
8+
-AM_GNU_GETTEXT_VERSION([0.16.1])
9+
+AM_GNU_GETTEXT_REQUIRE_VERSION([0.21])
10+
AM_GNU_GETTEXT([external])
11+
12+
dnl enable dmalloc per http://dmalloc.com

build/alpine/patches/lib.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
diff -wpruN '--exclude=*.orig' a~/configure.ac a/configure.ac
1+
diff -wpruN --no-dereference '--exclude=*.orig' a~/configure.ac a/configure.ac
22
--- a~/configure.ac 1970-01-01 00:00:00
33
+++ a/configure.ac 1970-01-01 00:00:00
4-
@@ -1076,10 +1076,10 @@ else
4+
@@ -1035,10 +1035,10 @@ else
55
])
66

77
if test -n "$alpine_LDAPINCLUDE" ; then

build/alpine/patches/series

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
lib.patch
22
uuid.patch
3+
autoreconf.patch

build/alpine/patches/uuid.patch

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ of calls to random(), which is seeded.
66

77
Duplicate message IDs have been seen in the wild, use libuuid instead.
88

9-
diff --git a/imap/src/c-client/oauth2_aux.c b/imap/src/c-client/oauth2_aux.c
10-
index d2ad6ce..ca0fadb 100644
11-
--- a/imap/src/c-client/oauth2_aux.c
12-
+++ b/imap/src/c-client/oauth2_aux.c
9+
diff -wpruN --no-dereference '--exclude=*.orig' a~/imap/src/c-client/oauth2_aux.c a/imap/src/c-client/oauth2_aux.c
10+
--- a~/imap/src/c-client/oauth2_aux.c 1970-01-01 00:00:00
11+
+++ a/imap/src/c-client/oauth2_aux.c 1970-01-01 00:00:00
1312
@@ -24,6 +24,8 @@
1413
#include "json.h"
1514
#include "oauth2_aux.h"
@@ -19,7 +18,7 @@ index d2ad6ce..ca0fadb 100644
1918
OA2_type oauth2_find_extra_parameter(OAUTH2_S *, char *);
2019
JSON_S *oauth2_json_reply(OAUTH2_SERVER_METHOD_S, OAUTH2_S *, int *);
2120
char *xoauth2_server(char *, char *);
22-
@@ -148,25 +150,13 @@
21+
@@ -148,25 +150,13 @@ void oauth2_login_hint(OAUTH2_S *oauth2,
2322
*/
2423
char *oauth2_generate_state(void)
2524
{

lib/functions.sh

+33-9
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ EOM
177177
#############################################################################
178178
# Log output of a command to a file
179179
#############################################################################
180+
pipelog() {
181+
$TEE -a $LOGFILE 2>&1
182+
}
183+
180184
logcmd() {
181185
typeset preserve_stdout=0
182186
[ "$1" = "-p" ] && shift && preserve_stdout=1
@@ -190,18 +194,14 @@ logcmd() {
190194
else
191195
if [ "$preserve_stdout" = 0 ]; then
192196
echo Running: "$@"
193-
"$@" | $TEE -a $LOGFILE 2>&1
197+
"$@" | pipelog
194198
return ${PIPESTATUS[0]}
195199
else
196200
"$@"
197201
fi
198202
fi
199203
}
200204

201-
pipelog() {
202-
$TEE -a $LOGFILE 2>&1
203-
}
204-
205205
c_highlight="`$TPUT setaf 2`"
206206
c_error="`$TPUT setaf 1`"
207207
c_note="`$TPUT setaf 6`"
@@ -2755,6 +2755,30 @@ make_install() {
27552755
$MAKE_INSTALL_TARGET || logerr "--- Make install failed"
27562756
fi
27572757
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
27582782
}
27592783

27602784
make_install_i386() {
@@ -3691,7 +3715,7 @@ check_rtime() {
36913715
-f $TMPDIR/rtime.files
36923716

36933717
if [ -s "$TMPDIR/rtime.err" ]; then
3694-
$CAT $TMPDIR/rtime.err | $TEE -a $LOGFILE
3718+
$CAT $TMPDIR/rtime.err | pipelog
36953719
logerr "ELF runtime problems detected"
36963720
fi
36973721
}
@@ -3709,7 +3733,7 @@ check_ssp() {
37093733
done < <(rtime_objects)
37103734
wait
37113735
if [ -s "$TMPDIR/rtime.ssp" ]; then
3712-
$CAT $TMPDIR/rtime.ssp | $TEE -a $LOGFILE
3736+
$CAT $TMPDIR/rtime.ssp | pipelog
37133737
logerr "Found object(s) without SSP"
37143738
fi
37153739
}
@@ -3748,7 +3772,7 @@ check_soname() {
37483772
done < <(rtime_objects -f)
37493773
wait
37503774
if [ -s "$TMPDIR/rtime.soname" ]; then
3751-
$CAT $TMPDIR/rtime.soname | $TEE -a $LOGFILE
3775+
$CAT $TMPDIR/rtime.soname | pipelog
37523776
logerr "Found SONAME problems"
37533777
fi
37543778
}
@@ -3773,7 +3797,7 @@ check_bmi() {
37733797
done < <(rtime_objects)
37743798
wait
37753799
if [ -s "$TMPDIR/rtime.bmi" ]; then
3776-
$CAT $TMPDIR/rtime.bmi | $TEE -a $LOGFILE
3800+
$CAT $TMPDIR/rtime.bmi | pipelog
37773801
logerr "BMI instruction set found"
37783802
fi
37793803
}

0 commit comments

Comments
 (0)