|
root / base / readline / build.sh
build.sh Bash 34 lines 1.2 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
#!/bin/bash
# Build script for readline
# GNU readline library for command line editing

set -e

cd "$SRCDIR"

# Set library path for ncurses (installed under $PREFIX, not /usr)
# Note: no tputs cast needed — readline depends on ncurses (build dep), which
# uses `int(*)(int)`, matching _rl_output_character_function's signature.
export LDFLAGS="-L$PREFIX/lib -R$PREFIX/lib -lncurses"
export CPPFLAGS="-I$PREFIX/include -I$PREFIX/include/ncurses"
export SHLIB_LIBS="-L$PREFIX/lib -lncursesw"

# Configure readline with shared library support
./configure \
    --build=$BUILD_TRIPLE \
    --host=$BUILD_TRIPLE \
    --prefix=$PREFIX \
    --libdir=$PREFIX/lib \
    --with-curses \
    --enable-shared

gmake -j${JOBS:-1}
gmake install DESTDIR="$PKGDIR"

# readline's shobj-conf for illumos installs only libreadline.so.8 with no
# libreadline.so symlink, so `-lreadline` falls through to the static archive
# (which then needs explicit -lncurses/-ltermcap to resolve tputs/tgetent).
# Add the canonical .so → .so.8 symlinks so consumers link dynamically.
ln -sf libreadline.so.8 "$PKGDIR$PREFIX/lib/libreadline.so"
ln -sf libhistory.so.8  "$PKGDIR$PREFIX/lib/libhistory.so"