config.scm.in 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ;;; WebAssembly compiler
  2. ;;; Copyright (C) 2023 David Thompson <dave@spritely.institute>
  3. ;;; Copyright (C) 2024 Andy Wingo <wingo@igalia.com>
  4. ;;;
  5. ;;; Licensed under the Apache License, Version 2.0 (the "License");
  6. ;;; you may not use this file except in compliance with the License.
  7. ;;; You may obtain a copy of the License at
  8. ;;;
  9. ;;; http://www.apache.org/licenses/LICENSE-2.0
  10. ;;;
  11. ;;; Unless required by applicable law or agreed to in writing, software
  12. ;;; distributed under the License is distributed on an "AS IS" BASIS,
  13. ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ;;; See the License for the specific language governing permissions and
  15. ;;; limitations under the License.
  16. ;;; Commentary:
  17. ;;;
  18. ;;; Build time configuration.
  19. ;;;
  20. ;;; Code:
  21. (define-module (hoot config)
  22. #:export (%version
  23. %js-runner-dir
  24. %reflect-js-dir
  25. %reflect-wasm-dir
  26. %stdlib-path
  27. %node
  28. %d8))
  29. (define %version "@PACKAGE_VERSION@")
  30. (define %datadir "@hoot_datadir@/@PACKAGE@/@PACKAGE_VERSION@")
  31. (define %js-runner-dir
  32. (or (getenv "HOOT_JS_RUNNER_DIR")
  33. (in-vicinity %datadir "js-runner")))
  34. (define %reflect-js-dir
  35. (or (getenv "HOOT_REFLECT_JS_DIR")
  36. (in-vicinity %datadir "reflect-js")))
  37. (define %reflect-wasm-dir
  38. (or (getenv "HOOT_REFLECT_WASM_DIR")
  39. (in-vicinity %datadir "reflect-wasm")))
  40. (define %stdlib-path
  41. (cond
  42. ((getenv "HOOT_STDLIB_PATH") => parse-path)
  43. (else (list (in-vicinity %datadir "lib")))))
  44. (define (false-if-empty str) (if (string-null? str) #f str))
  45. (define %node (false-if-empty "@NODE@"))
  46. (define %d8 (false-if-empty "@D8@"))