#!/bin/sh # Build XIElib and xieperf from the vendored X11R6.1 sources. # # The original imake build assumes a complete X11R6 tree. This script uses the # host X11 headers/libraries instead (needs libX11 and libXmu development # packages). Output: build/xieperf/xieperf set -eu cd "$(dirname "$0")" ROOT=$(pwd) BUILD="$ROOT/build" CC=${CC:-gcc} CFLAGS=${CFLAGS:--O2 -std=gnu89 -fcommon -w} rm -rf "$BUILD" mkdir -p "$BUILD/include/X11/extensions" "$BUILD/xieperf" # XIElib.h installs as ; stage the headers in the # layout the sources include them with. cp xc/include/extensions/XIE.h \ xc/include/extensions/XIEproto.h \ xc/include/extensions/XIEprotost.h \ xc/lib/XIE/XIElib.h \ "$BUILD/include/X11/extensions/" echo "== XIElib" for f in xc/lib/XIE/*.c; do $CC $CFLAGS -I"$BUILD/include" -c "$f" -o "$BUILD/$(basename "${f%.c}").o" done ar rcs "$BUILD/libXIE.a" "$BUILD"/*.o echo "== xieperf" for f in xc/programs/xieperf/*.c; do $CC $CFLAGS -I"$BUILD/include" -Ixc/programs/xieperf \ -c "$f" -o "$BUILD/xieperf/$(basename "${f%.c}").o" done $CC -o "$BUILD/xieperf/xieperf" "$BUILD"/xieperf/*.o "$BUILD/libXIE.a" \ -lXmu -lX11 -lm echo "built: $BUILD/xieperf/xieperf"