Skip to content

Commit

Permalink
configure: support STEXLIB=<stex>
Browse files Browse the repository at this point in the history
For compatibility with older scripts, when not explicitly configured,
continue to honor the `STEXLIB` environment variable at build time.
  • Loading branch information
LiberalArtist committed Feb 25, 2024
1 parent e3e4098 commit 38640e7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
13 changes: 9 additions & 4 deletions build.zuo
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
12 changes: 10 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=//'`
;;
Expand Down Expand Up @@ -676,6 +680,7 @@ if [ "$help" = "yes" ]; then
echo " STRIP=<strip> executable stripper"
echo " ZLIB=<lib> link to <lib> instead of own zlib"
echo " LZ4=<lib> link to <lib> instead of own LZ4"
echo " STEXLIB=<stex> build docs with <stex> instead of own stex"
echo " ZUO=<zuo> build with <zuo> instead of own Zuo"
echo ""
echo "Available machine types: $machs"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1133,6 +1140,7 @@ cursesLib=$cursesLib
ncursesLib=$ncursesLib
zlibLib=$zlibLib
LZ4Lib=$LZ4Lib
STEXLIB=$STEXLIB
warningFlags=$warningFlags
Kernel=$Kernel
installscriptname=$installscriptname
Expand Down

0 comments on commit 38640e7

Please sign in to comment.