- Linking shared libraries needs slightly different options. - We were trying to detect mach_time.h but needed to detect mach/mach_time.h instead. While we're here, add a --disable-shared option to ./configure, which is different from --enable-static. --disable-shared does not build *new* share libraries, but doesn't pass -static to the linker (apparently there is no static linking posible on MacOS).
55 lines
1.1 KiB
Text
55 lines
1.1 KiB
Text
. ./redoconf.rc
|
|
rc_include _all.rc rc/shlib.rc
|
|
|
|
# Tricky quoting: see _compile.od for details.
|
|
if [ "$HAVE_SHLIB" = UNIX ]; then
|
|
cat >$3 <<-EOF
|
|
#!/bin/sh -e
|
|
LINK=$(shquote "$LINK")
|
|
LDFLAGS=$(shquote "$LDFLAGS")
|
|
OPTFLAGS=$(shquote "$OPTFLAGS")
|
|
LIBS=$(shquote "$LIBS")
|
|
o="\$1"
|
|
ob="\${o#*/}"
|
|
shift
|
|
IFS="$NL"
|
|
set -f
|
|
\$LINK -shared -o "\$o" \\
|
|
-Wl,-soname,"\$ob" \\
|
|
\$LDFLAGS \$OPTFLAGS \\
|
|
"\$@" \\
|
|
\$LIBS
|
|
EOF
|
|
elif [ "$HAVE_SHLIB" = MACOS ]; then
|
|
cat >$3 <<-EOF
|
|
#!/bin/sh -e
|
|
LINK=$(shquote "$LINK")
|
|
LDFLAGS=$(shquote "$LDFLAGS")
|
|
OPTFLAGS=$(shquote "$OPTFLAGS")
|
|
LIBS=$(shquote "$LIBS")
|
|
LIBDIR=$(shquote "$LIBDIR")
|
|
o="\$1"
|
|
ob="\${o#*/}"
|
|
shift
|
|
IFS="$NL"
|
|
set -f
|
|
\$LINK -dynamiclib -o "\$o" \\
|
|
-install_name "\$ob" \\
|
|
\$LDFLAGS \$OPTFLAGS \\
|
|
"\$@" \\
|
|
\$LIBS
|
|
EOF
|
|
else
|
|
# If no shared library support and we try to build one,
|
|
# compensate by building a static library instead in the
|
|
# same place.
|
|
cat >$3 <<-EOF
|
|
#!/bin/sh -e
|
|
o="\$1"
|
|
shift
|
|
rm -f "\$o"
|
|
ar q "\$o" "\$@"
|
|
EOF
|
|
fi
|
|
chmod a+x "$3"
|
|
redo-stamp <$3
|