apenwarr-redo/redoconf/link.od
Avery Pennarun 88250334da redoconf: move -Wl,-rpath flags to shlib.rc and add -Wl,-z,origin.
It was kind of ugly to have this kind of special flag directly in
link.od; now we detect whether it's available.  This also gives a
project the ability to override the flag in some other way if they
want.

As a result, rc/shlib.rc needs to be included in all.rc.od if you want
to create or link against shared libraries.

While we're here, also add -Wl,-z,origin on platforms where it works.
This is apparently needed for FreeBSD 8.0 at least, and probably other
platforms.

Reported-by: Wayne Scott <wsc9tt@gmail.com>
2019-03-01 13:55:22 -05:00

21 lines
364 B
Text

. ./redoconf.rc
rc_include _all.rc
# Tricky quoting: see _compile.od for details.
cat >$3 <<-EOF
#!/bin/sh -e
LINK=$(shquote "$LINK")
LDFLAGS=$(shquote "$LDFLAGS")
OPTFLAGS=$(shquote "$OPTFLAGS")
LIBS=$(shquote "$LIBS")
o="\$1"
shift
IFS="$NL"
set -f
\$LINK -o "\$o" \\
\$LDFLAGS \$OPTFLAGS \\
"\$@" \\
\$LIBS
EOF
chmod a+x "$3"
redo-stamp <$3