-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__build_libtool.sh
More file actions
executable file
·34 lines (29 loc) · 1.02 KB
/
__build_libtool.sh
File metadata and controls
executable file
·34 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -xe
_VER="${3:-2.4.7}"
_PKG="libtool-$_VER"
_PREFIX="${1:-/usr/local}"
_SCRATCH_DIR="${2:-..}"
_NO_TESTS="$4"
if [[ ! -x "$_PREFIX/bin/glibtool" ]]
then
cd "$_SCRATCH_DIR"
[[ -s "$_PKG.tar.xz" ]] || curl -OkfSL "https://ftp.gnu.org/gnu/libtool/$_PKG.tar.xz"
rm -rf "$_PKG"
COPYFILE_DISABLE=1 tar -xf "$_PKG.tar.xz"
cd "$_PKG"
./configure --disable-dependency-tracking "--prefix=$_PREFIX" --enable-ltdl-install \
--program-prefix=g "CFLAGS=${CFLAGS:+$CFLAGS }-O2"
make -j2 V=1 install
if [[ "$_NO_TESTS" == 0 ]]; then
# Patch DYLD_LIBRARY_PATH SIP for execution mode
sed -i- 's| if \$LIBTOOL --mode=execute -dlopen m/| cp -af m/. l/ ;&|' tests/testsuite
make check || true
fi
mkdir -p "$_PREFIX/libexec"/{gnubin,gnuman/man1}
for prog in libtool libtoolize; do
ln -s "../../bin/g$prog" "$_PREFIX/libexec/gnubin/$prog"
ln -s "../../../share/man/man1/g$prog.1" "$_PREFIX/libexec/gnuman/man1/$prog.1"
done
[[ -e "$_PREFIX/libexec/man" ]] || ln -s gnuman "$_PREFIX/libexec/man"
fi