|
root / base / xf86-video-illumosfb / build.sh
build.sh Bash 65 lines 2.9 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
# Build script for xf86-video-illumosfb (autotools, Template A variant).
#
# Phase 2 Task 3 (M2). This port ships NO pre-generated `configure` - only
# configure.ac/Makefile.am + its own autogen.sh (confirmed via `tar tf` on the
# git-commit-archive tarball). Must run `NOCONFIGURE=1 ./autogen.sh` (which is
# just `autoreconf -v --install` under the hood) before the usual
# libtool/config.sub fix + configure, same shape as base/x11vnc (Task 7a).
#
# configure.ac requires xorg-macros (XORG_MACROS_VERSION/XORG_DEFAULT_OPTIONS)
# at aclocal time. base/util-macros installs xorg-macros.m4 under
# $PREFIX/share/aclocal (/usr/local/share/aclocal), which is NOT on aclocal's
# default search path (/usr/share/aclocal) - export ACLOCAL_PATH so the
# autoreconf inside autogen.sh finds it.
#
# Module install dir: configure.ac defaults --with-xorg-module-dir to
# "$libdir/xorg/modules", but this XLibre build (base/xlibre-xserver-xorg)
# uses a versioned moduledir, $libdir/xorg/modules/xlibre-25 (see that port's
# xorg-server.pc: moduledir=${exec_prefix}/lib/xorg/modules/xlibre-25). The
# driver's own Makefile.am appends "/drivers" to @moduledir@, so pass
# --with-xorg-module-dir="$PREFIX/lib/xorg/modules/xlibre-25" here to land
# illumosfb_drv.so where Xorg's video_drivers_dir actually points.
#
# ABI: illumosfb_driver.c's XF86ModuleVersionInfo uses the SDK's
# ABI_VIDEODRV_VERSION macro directly (no hardcoded ABI number) - building
# against xorg-server.pc's SDK headers means the ABI always matches the
# server it's paired with. No ABI patch expected/needed.
set -e
cd "$SRCDIR"

export AUTOCONF=/usr/bin/autoconf
export AUTOHEADER=/usr/bin/autoheader
export ACLOCAL=/usr/bin/aclocal
export AUTOM4TE=/usr/bin/autom4te
export ACLOCAL_PATH="$PREFIX/share/aclocal:$ACLOCAL_PATH"

export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
export CFLAGS="${CFLAGS} -I$PREFIX/include -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS"
export LDFLAGS="${LDFLAGS} -L$PREFIX/lib -R$PREFIX/lib"

NOCONFIGURE=1 ./autogen.sh

# GOTCHA (same as x11vnc, Task 7a): autoreconf --install generates its OWN
# fresh config.sub/config.guess which do NOT carry the hammerhead patch.
# Re-copy the patched versions post-autoreconf, before configure runs.
cp -f /usr/share/autoconf/build-aux/config.sub config.sub 2>/dev/null || true
cp -f /usr/share/autoconf/build-aux/config.guess config.guess 2>/dev/null || true

# MANDATORY libtool fix (Template A) - piggyback hammerhead onto the
# kopensolaris arm in the generated configure's dynamic-linker case block.
if [ -f configure ]; then
    sed -i -E 's/(kopensolaris\*-gnu)([^)]*\))/\1 | hammerhead*\2/' configure
fi

./configure \
    --prefix="$PREFIX" \
    --build="$BUILD_TRIPLE" \
    --host="$BUILD_TRIPLE" \
    --sysconfdir="$SYSCONFDIR" \
    --disable-static \
    --with-xorg-module-dir="$PREFIX/lib/xorg/modules/xlibre-25"

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