You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
805 B
Scheme
36 lines
805 B
Scheme
27 years ago
|
|
||
|
(require-library "link.ss" "mzscheme" "dynext")
|
||
|
|
||
|
; Parse arguments:
|
||
|
(define a (vector->list argv))
|
||
|
|
||
|
(define quiet? #f)
|
||
|
|
||
|
(when (and (pair? a) (string=? (car a) "-q"))
|
||
|
(set! quiet? #t)
|
||
|
(set! a (cdr a)))
|
||
|
|
||
|
(define inputs null)
|
||
|
(define output #f)
|
||
|
|
||
|
(let loop ([a a])
|
||
|
(unless (null? a)
|
||
|
(if (string=? (car a) "-o")
|
||
|
(if (null? (cdr a))
|
||
|
(error 'dynlink "expected a filename after -o")
|
||
|
(if output
|
||
|
(error 'dynlink "multiple output files provided")
|
||
|
(begin
|
||
|
(set! output (cadr a))
|
||
|
(loop (cddr a)))))
|
||
|
(begin
|
||
|
(set! inputs (append inputs (list (car a))))
|
||
|
(loop (cdr a))))))
|
||
|
|
||
|
(when (not output)
|
||
|
(error 'dynlink "no output file specified"))
|
||
|
(when (null? inputs)
|
||
|
(error 'dynlink "no input files specified"))
|
||
|
|
||
|
(link-extension quiet? inputs output)
|