summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/ref/api-evaluation.texi6
-rw-r--r--module/scripts/compile.scm5
2 files changed, 11 insertions, 0 deletions
diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi
index 98593ce3f..60f7fece9 100644
--- a/doc/ref/api-evaluation.texi
+++ b/doc/ref/api-evaluation.texi
@@ -658,6 +658,12 @@ Write output bytecode to @var{ofile}. By convention, bytecode file
names end in @code{.go}. When @option{-o} is omitted, the output file
name is as for @code{compile-file} (see below).
+@item -x @var{extension}
+Recognize @var{extension} as a valid source file name extension.
+
+For example, to compile R6RS code, you might want to pass @command{-x
+.sls} so that files ending in @file{.sls} can be found.
+
@item -W @var{warning}
@itemx --warn=@var{warning}
@cindex warnings, compiler
diff --git a/module/scripts/compile.scm b/module/scripts/compile.scm
index 5aa58d3e9..924456ed2 100644
--- a/module/scripts/compile.scm
+++ b/module/scripts/compile.scm
@@ -68,6 +68,10 @@
(if (assoc-ref result 'output-file)
(fail "`-o' option cannot be specified more than once")
(alist-cons 'output-file arg result))))
+ (option '(#\x) #t #f
+ (lambda (opt name arg result)
+ (set! %load-extensions (cons arg %load-extensions))
+ result))
(option '(#\W "warn") #t #f
(lambda (opt name arg result)
@@ -197,6 +201,7 @@ Compile each Guile source file FILE into a Guile object.
-L, --load-path=DIR add DIR to the front of the module load path
-o, --output=OFILE write output to OFILE
+ -x EXTENSION add EXTENSION to the set of source file extensions
-W, --warn=WARNING emit warnings of type WARNING; use `--warn=help'
for a list of available warnings