linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
commit 3a800c586cf8163276cd4fdbc0c63be827eab625 parent 4d7b77e87851c1c70afcfecbdea110533a5f91f0 Author: Jul <jul@9o.is> Date: Thu, 28 Aug 2025 20:34:18 +0800 add awk Diffstat:
| M | .gitmodules | | | 4 | ++++ |
| M | gen.sh | | | 1 | + |
| M | ninja/functions.sh | | | 24 | +++++++++++++++++++++++- |
| M | ninja/rules.ninja | | | 4 | ++++ |
| A | pkg/awk/gen.sh | | | 35 | +++++++++++++++++++++++++++++++++++ |
| A | pkg/awk/repo | | | 1 | + |
| A | pkg/awk/version | | | 3 | +++ |
7 files changed, 71 insertions(+), 1 deletion(-)
diff --git a/.gitmodules b/.gitmodules @@ -58,3 +58,7 @@ path = pkg/zstd/repo url = https://github.com/facebook/zstd ignore = all +[submodule "awk"] + path = pkg/awk/repo + url = https://github.com/onetrueawk/awk + ignore = all diff --git a/gen.sh b/gen.sh @@ -18,6 +18,7 @@ setv ldflags $TARGET_LDFLAGS include $basedir/ninja/rules.ninja subgen pkg/abduco +subgen pkg/awk subgen pkg/b3sum subgen pkg/byacc subgen pkg/fspec-sync diff --git a/ninja/functions.sh b/ninja/functions.sh @@ -35,6 +35,23 @@ ldflags() { setv ldflags '$ldflags' "$*" } +yacc() { + _out=${2-} + + if [ ! $_out ]; then + _out=${1##*/} + _out=${_out%.*} + fi + + _ninja_prefix _src $srcdir $1 + _ninja_prefix _out $yaccdir $_out + _ninja_sync $_src + + setv yaccdir $outdir/_yacc + build yacc "$_out.tab.c $_out.tab.h" $_src '|' $hostdir/yacc + bind yaccflags "-d -b $_out" +} + copy() { _ninja_prefix _src $srcdir $1 _ninja_prefix _out $outdir ${2-$1} @@ -241,6 +258,7 @@ _ninja_setv_init() { srcdir='$srcdir' rootdir='$rootdir' pkgdir='$pkgdir' + yaccdir='$yaccdir' objdir='$outdir/_obj' unset -f host @@ -311,7 +329,11 @@ _ninja_compile() { for _src in $*; do case $_src in *.[cS]) - _obj=$objdir/${_src#\$srcdir/}.o + case $_src in + \$srcdir*) _obj=$objdir/${_src#\$srcdir/}.o;; + \$yaccdir*) _obj=$objdir/${_src#\$yaccdir/}.o;; + *) _obj=$objdir/$_src.o;; + esac if _ninja_has $_obj $_ninja_buffer_objs; then _objs="$_objs $_obj" diff --git a/ninja/rules.ninja b/ninja/rules.ninja @@ -60,3 +60,7 @@ rule fspec rule fspec-tar command = $hostdir/fspec-tar <$in | $hostdir/zstd >$out description = FSPEC-TAR $out + +rule yacc + command = $hostdir/yacc $yaccflags $in + description = YACC $out diff --git a/pkg/awk/gen.sh b/pkg/awk/gen.sh @@ -0,0 +1,35 @@ +cflags " + -std=c11 + -I $srcdir + -D _XOPEN_SOURCE=700 + -Wno-implicit-function-declaration + -Wno-int-conversion + -Wno-unused-parameter +" + +yacc awkgram.y +cflags -I $yaccdir +dep $yaccdir/awkgram.tab.h + +rule maketab '$hostdir/maketab $in >$out' +build maketab $yaccdir/proctab.c $yaccdir/awkgram.tab.h '|' $hostdir/maketab + +host() { + cflags -I $yaccdir + exe maketab maketab.c +} + +exe awk " + b.c + lex.c + lib.c + main.c + parse.c + run.c + tran.c + $yaccdir/awkgram.tab.c + $yaccdir/proctab.c +" + +bin awk +man awk.1 diff --git a/pkg/awk/repo b/pkg/awk/repo @@ -0,0 +1 @@ +Subproject commit d7f37646965ee26214da0e1d97f3c1d54349ae2d diff --git a/pkg/awk/version b/pkg/awk/version @@ -0,0 +1,3 @@ +method=git +ref=d9f3764 +rel=0