|
root / base / libxcb / build.sh
build.sh Bash 36 lines 1.4 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
35
#!/bin/sh
# Build script for libxcb (autotools, Template A + custom).
# Needs python3 (xcb-proto's xcbgen module) to generate C sources from XML.
# Verified 2026-07-22: configure hard-requires the pthread-stubs pkg-config
# module unconditionally (`xau >= 0.99.2 pthread-stubs`), even on illumos
# with native pthreads. libpthread-stubs is therefore a required build dep
# (see base/libpthread-stubs).
set -e
cd "$SRCDIR"

# GOTCHA (found 2026-07-22, Task 4a): this release's libtool-generated
# `configure` has no solaris/illumos/hammerhead arm in its dynamic-linker
# detection `case $host_os in ...` block - unmatched OS falls through to
# `*) dynamic_linker=no ;;` which forces can_build_shared=no (static-only
# .a, no .so). Patch the case arm to add hammerhead* alongside the generic
# glibc/ELF branch (same SONAME/.so.N convention applies).
if [ -f configure ]; then
    sed -i -E 's/(kopensolaris\*-gnu)([^)]*\))/\1 | hammerhead*\2/' configure
fi

export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
export CFLAGS="${CFLAGS} -I$PREFIX/include"
export LDFLAGS="${LDFLAGS} -L$PREFIX/lib -R$PREFIX/lib"
export PYTHON=/usr/local/bin/python3

./configure \
    --prefix="$PREFIX" \
    --build="$BUILD_TRIPLE" \
    --host="$BUILD_TRIPLE" \
    --sysconfdir="$SYSCONFDIR" \
    --disable-static \
    --enable-xkb

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