Expose all bournish commands as external command.

* bin/builtin.in: New file.
* bin/tar.in: Remove.
* configure: Generate bin/<builtin> for all bournish-commands.
* build-aux/build-guile.sh: Compile them.
* .gitignore: Ignore them.
This commit is contained in:
Jan Nieuwenhuizen 2018-10-26 16:22:58 +02:00
parent 70d28ea480
commit 904eecbb2c
5 changed files with 37 additions and 14 deletions

8
.gitignore vendored
View File

@ -1,7 +1,15 @@
*.go
*~
/bin/cat
/bin/cp
/bin/find
/bin/gash
/bin/grep
/bin/ls
/bin/reboot
/bin/tar
/bin/wc
/bin/which
/.config.make
/doc/version.texi
/gash/config.scm

View File

@ -20,4 +20,4 @@
;;; along with Gash. If not, see <http://www.gnu.org/licenses/>.
(define (main args)
((@ (gash gash) main) (cons* (car (command-line)) "--" "tar" (cdr (command-line)))))
((@ (gash gash) main) (cons* (car (command-line)) "--" "@builtin@" (cdr (command-line)))))

View File

@ -1,6 +0,0 @@
#! /home/janneke/.guix-profile/bin/guile \
--no-auto-compile -e main -L "/usr/local/share/guile/site/" -C "/usr/local/lib/guile//site-ccache" -L . -C . -s
!#
(define (main args)
(setenv "SHELL" ((compose canonicalize-path car command-line)))
((@ (gash gash) main) (command-line)))

View File

@ -51,7 +51,6 @@ gash/job.scm
gash/peg.scm
gash/pipe.scm
gash/script.scm
gash/tar.scm
gash/ustar.scm
gash/util.scm
"
@ -68,8 +67,16 @@ for i in $SCM_FILES; do
done
SCRIPTS="
bin/cat
bin/cp
bin/find
bin/gash
bin/grep
bin/ls
bin/reboot
bin/tar
bin/wc
bin/which
"
for i in $SCRIPTS; do

26
configure vendored
View File

@ -34,12 +34,26 @@ sed \
-e s,@GUILE_SITE_CCACHE_DIR@,$GUILE_SITE_CCACHE_DIR,\
bin/gash.in > bin/gash
chmod +x bin/gash
sed \
-e s,@GUILE@,$GUILE,\
-e s,@GUILE_SITE_DIR@,$GUILE_SITE_DIR,\
-e s,@GUILE_SITE_CCACHE_DIR@,$GUILE_SITE_CCACHE_DIR,\
bin/tar.in > bin/tar
chmod +x bin/tar
BUILTINS="
cat
cp
find
grep
ls
reboot
tar
wc
which
"
for builtin in $BUILTINS; do
sed \
-e s,@GUILE@,$GUILE,\
-e s,@GUILE_SITE_DIR@,$GUILE_SITE_DIR,\
-e s,@GUILE_SITE_CCACHE_DIR@,$GUILE_SITE_CCACHE_DIR,\
-e s,@builtin@,$builtin,\
bin/builtin.in > bin/$builtin
chmod +x bin/$builtin
done
cat > .config.make <<EOF
BASH=$BASH
GUILE=$GUILE