| git.druid.rocks | index | druid520 | ports | ports/ | build-tools/ | gnu-libtool/ | add.sh |
ports/build-tools/gnu-libtool/add.sh
set -e
# release tarball - same reasoning as gnu-autoconf/gnu-automake: no point
# reintroducing a git+bootstrap dependency on autotools output for the
# one port in this trio that still had it.
curl -LO https://ftp.gnu.org/gnu/libtool/libtool-2.6.2.tar.gz
tar xf libtool-2.6.2.tar.gz
mv libtool-2.6.2 libtool
cd libtool
# strip any static/PIE-forcing flags from a global build-flags policy
# (-static-pie, -static, -fno-pie, -no-pie) before building: libltdl
# (this port's own portable-dlopen library) builds a real shared/
# loadable object (libltdl.so) as part of its normal build, which a
# static-pie crt startup object can't link against ("undefined
# reference to `main'" out of rcrt1.o -- it's meant for a static-pie
# EXECUTABLE, not a shared library). nothing needs libtool's own
# binaries to be static-pie -- it's a build-time tool, same reasoning
# as languages/perl5's own identical strip.
lt_cflags="$(printf '%s' "$CFLAGS" | sed -E 's/-static-pie|-static\b|-fno-pie|-no-pie//g')"
lt_ldflags="$(printf '%s' "$LDFLAGS" | sed -E 's/-static-pie|-static\b|-fno-pie|-no-pie//g')"
./configure --prefix=$MP_PREFIX
make CFLAGS="$lt_cflags" LDFLAGS="$lt_ldflags" -j$MP_JOBS
make install
make clean || true
cd ..
rm -rf libtool libtool-2.6.2.tar.gz