From 38640e763e8a6b35f2343a88e9561139a3bd7237 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Sun, 25 Feb 2024 18:16:10 -0500 Subject: [PATCH] configure: support `STEXLIB=` For compatibility with older scripts, when not explicitly configured, continue to honor the `STEXLIB` environment variable at build time. --- build.zuo | 13 +++++++++---- configure | 12 ++++++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/build.zuo b/build.zuo index c21d2caa9..c5896396f 100644 --- a/build.zuo +++ b/build.zuo @@ -224,10 +224,15 @@ token)) (define stexlib - (let ((found (assoc "STEXLIB" (hash-ref (runtime-env) 'env)))) - (if found - (cdr found) - (at-source "stex")))) + (let ([configured (hash-ref config 'STEXLIB "")] + [env (assoc "STEXLIB" (hash-ref (runtime-env) 'env))]) + (cond + [(not (equal? "" configured)) + configured] + [env + (cdr env)] + [else + (at-source "stex")]))) (define stex-sources (source-tree stexlib)) diff --git a/configure b/configure index 9c08fa19d..782dd09b7 100755 --- a/configure +++ b/configure @@ -93,6 +93,7 @@ default_warning_flags="-Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough" CFLAGS_ADD= zlibLib= LZ4Lib= +STEXLIB= Kernel=KernelLib buildKernelOnly=no enableFrompb=yes @@ -447,6 +448,9 @@ while [ $# != 0 ] ; do LZ4=*) LZ4Lib=`echo $1 | sed -e 's/^LZ4=//'` ;; + STEXLIB=*) + STEXLIB=`echo $1 | sed -e 's/^STEXLIB=//'` + ;; ZUO=*) zuoExternal=`echo $1 | sed -e 's/^ZUO=//'` ;; @@ -676,6 +680,7 @@ if [ "$help" = "yes" ]; then echo " STRIP= executable stripper" echo " ZLIB= link to instead of own zlib" echo " LZ4= link to instead of own LZ4" + echo " STEXLIB= build docs with instead of own stex" echo " ZUO= build with instead of own Zuo" echo "" echo "Available machine types: $machs" @@ -923,8 +928,10 @@ if [ "${LZ4Lib}" = "" ] ; then fi fi -if [ ! -f "$srcdir"/stex/Mf-stex ] ; then - submod_instructions 'Source in "stex" is missing' +if [ "${STEXLIB}" = "" ] ; then + if [ ! -f "$srcdir"/stex/Mf-stex ] ; then + submod_instructions 'Source in "stex" is missing' + fi fi # more compile and link flags for c/Mf-unix and mats/Mf-unix @@ -1133,6 +1140,7 @@ cursesLib=$cursesLib ncursesLib=$ncursesLib zlibLib=$zlibLib LZ4Lib=$LZ4Lib +STEXLIB=$STEXLIB warningFlags=$warningFlags Kernel=$Kernel installscriptname=$installscriptname