#!/bin/sh
# Build script for libxkbfile (Meson, Template B).# NOTE (Task 4b, 2026-07-22): the 1.2.0 release tarball ships ONLY# meson.build - no configure script (autotools support was dropped# upstream by this release, despite the phase1a manifest listing# "autotools/meson" for it). Confirmed via `tar tf` on the fetched# tarball: no configure.ac/configure anywhere in the tree. Using# Template B; no libtool fix needed (Meson doesn't hit the libtool# dynamic-linker case-arm bug at all).## GOTCHA (Task 4b, 2026-07-22): meson's cc.has_function() probe reported# flockfile/getc_unlocked/funlockfile as present (they exist in libc), so# config.h's HAVE_UNLOCKED_STDIO got set - but src/maprules.c then fails# with "implicit declaration" because illumos's stdio.h only exposes those# POSIX.1c prototypes when __EXTENSIONS__ (PLURAL - not the single-S# __EXTENSION__ used by some other illumos headers) or _REENTRANT or# _POSIX_C_SOURCE>=199506L is defined (confirmed by reading# /usr/include/stdio.h's guard directly on alpha9). Define __EXTENSIONS__.set -e
cd "$SRCDIR"export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH"export CFLAGS="${CFLAGS} -D__EXTENSIONS__"meson setup build \
--prefix="$PREFIX"\
--libdir=lib \
--buildtype=release \
-Ddefault_library=shared
ninja -C build -j${JOBS:-1}DESTDIR="$PKGDIR" ninja -C build install