mescc: Support -dumpmachine.
* scripts/mescc.in (parse-opts): Support -dumpmachine.
This commit is contained in:
parent
3d528b0257
commit
21887b9a8e
|
@ -78,6 +78,7 @@ fi
|
||||||
(compile (single-char #\S))
|
(compile (single-char #\S))
|
||||||
(define (single-char #\D) (value #t))
|
(define (single-char #\D) (value #t))
|
||||||
(debug-info (single-char #\g))
|
(debug-info (single-char #\g))
|
||||||
|
(dumpmachine (single-char #\d))
|
||||||
(help (single-char #\h))
|
(help (single-char #\h))
|
||||||
(include (single-char #\I) (value #t))
|
(include (single-char #\I) (value #t))
|
||||||
(library-dir (single-char #\L) (value #t))
|
(library-dir (single-char #\L) (value #t))
|
||||||
|
@ -88,19 +89,27 @@ fi
|
||||||
(version (single-char #\V))
|
(version (single-char #\V))
|
||||||
(verbose (single-char #\v))
|
(verbose (single-char #\v))
|
||||||
(write (single-char #\w) (value #t))))
|
(write (single-char #\w) (value #t))))
|
||||||
|
(single-dash-options '("-dumpmachine"))
|
||||||
|
(args (map (lambda (o)
|
||||||
|
(if (member o single-dash-options) (string-append "-" o)
|
||||||
|
o))
|
||||||
|
args))
|
||||||
(options (getopt-long args option-spec))
|
(options (getopt-long args option-spec))
|
||||||
(help? (option-ref options 'help #f))
|
(help? (option-ref options 'help #f))
|
||||||
(files (option-ref options '() '()))
|
(files (option-ref options '() '()))
|
||||||
(usage? (and (not help?) (null? files)))
|
(usage? (and (not help?) (null? files)))
|
||||||
(version? (option-ref options 'version #f)))
|
(version? (option-ref options 'version #f)))
|
||||||
(or
|
(cond ((option-ref options 'dumpmachine #f)
|
||||||
(and version?
|
(display "x86-mes")
|
||||||
(format (current-output-port) "mescc (GNU Mes) ~a\n" %version))
|
(exit 0))
|
||||||
(and (or help? usage?)
|
(version? (format #t "mescc (GNU Mes) ~a\n" %version) (exit 0))
|
||||||
(format (or (and usage? (current-error-port)) (current-output-port)) "\
|
(else
|
||||||
|
(and (or help? usage?)
|
||||||
|
(format (or (and usage? (current-error-port)) (current-output-port)) "\
|
||||||
Usage: mescc [OPTION]... FILE...
|
Usage: mescc [OPTION]... FILE...
|
||||||
--align align globals
|
--align align globals
|
||||||
-c preprocess, compile and assemble only; do not link
|
-c preprocess, compile and assemble only; do not link
|
||||||
|
-dumpmachine display the compiler's target processor
|
||||||
--base-address=ADRRESS
|
--base-address=ADRRESS
|
||||||
use BaseAddress ADDRESS [0x1000000]
|
use BaseAddress ADDRESS [0x1000000]
|
||||||
-D DEFINE[=VALUE] define DEFINE [VALUE=1]
|
-D DEFINE[=VALUE] define DEFINE [VALUE=1]
|
||||||
|
@ -122,8 +131,8 @@ Environment variables:
|
||||||
MES_DEBUG=LEVEL show debug output with verbosity LEVEL {0..5}
|
MES_DEBUG=LEVEL show debug output with verbosity LEVEL {0..5}
|
||||||
NYACC_TRACE=1 show Nyacc progress
|
NYACC_TRACE=1 show Nyacc progress
|
||||||
")
|
")
|
||||||
(exit (or (and usage? 2) 0)))
|
(exit (or (and usage? 2) 0)))
|
||||||
options)))
|
options))))
|
||||||
|
|
||||||
(define (main args)
|
(define (main args)
|
||||||
(let* ((options (parse-opts args))
|
(let* ((options (parse-opts args))
|
||||||
|
|
Loading…
Reference in a new issue