racket/src/mzscheme/make-configure
2007-11-22 01:27:48 +00:00

45 lines
945 B
Bash
Executable File

#!/bin/sh
#|
cd "`dirname \"$0\"`"
src="configure.ac"
tgt="../configure"
if [ ! -e "$src" ]; then echo "abort: did not find $src"; exit 1; fi
echo "Creating $tgt from $src"
if [ -e "$tgt" ]; then
/bin/echo -n "overwriting $tgt, Ctrl-C to abort, enter to continue "; read R;
fi
autoconf "$src" | mzscheme -qr "$0" > "$tgt"
chmod +x "$tgt"
exit 0
|#
;; When autoconf produces `configure', it includes many
;; options that do not apply to PLT software. We want to
;; get rid of them, so that `configure --help' produces
;; valid information.
(define skip-rxs
(map (lambda (s)
(regexp (format "^ --~a=DIR" s)))
'(sbindir
libexecdir
sysconfdir
sharedstatedir
localstatedir
oldincludedir
infodir)))
(let loop ()
(let ([l (read-line)])
(unless (eof-object? l)
(if (ormap (lambda (rx)
(regexp-match rx l))
skip-rxs)
;; Skip
(loop)
;; Copy
(begin
(printf "~a~n" l)
(loop))))))