pre-inst-env.el.in 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ;;; pre-inst-env.el --- Pre-installation environment for Guile-XOSD
  2. ;; Copyright (C) 2016 Alex Kost <alezost@gmail.com>
  3. ;; This file is part of Guile-XOSD.
  4. ;; Guile-XOSD is free software; you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;;
  9. ;; Guile-XOSD is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;;
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with Guile-XOSD. If not, see <http://www.gnu.org/licenses/>.
  16. ;;; Commentary:
  17. ;; This file can be used to set up environment variables for Guile-XOSD
  18. ;; inside Emacs. Shell "pre-inst-env" script may be useful, but I
  19. ;; prefer to work with Guile using Geiser. So I just evaluate the
  20. ;; contents of this file (M-x eval-buffer) and that's it!: when I do
  21. ;; "M-x run-guile", I can ",use(xosd)" there and work with it.
  22. ;;; Code:
  23. (let ((src-modules (expand-file-name "modules" "@abs_top_srcdir@"))
  24. (build-modules (expand-file-name "modules" "@abs_top_builddir@"))
  25. (guile-path (getenv "GUILE_LOAD_PATH"))
  26. (guile-cpath (getenv "GUILE_LOAD_COMPILED_PATH")))
  27. (setenv "GUILE_LOAD_PATH"
  28. (let ((base (if guile-path
  29. (concat build-modules ":" guile-path)
  30. build-modules)))
  31. (if (string= src-modules build-modules)
  32. base
  33. (concat src-modules ":" base))))
  34. (setenv "GUILE_LOAD_COMPILED_PATH"
  35. (if guile-cpath
  36. (concat build-modules ":" guile-cpath)
  37. build-modules))
  38. (setenv "GUILE_XOSD_LIBDIR" (expand-file-name "src/.libs"
  39. "@abs_top_builddir@"))
  40. (setenv "GUILE_XOSD_DOCDIR" src-modules))
  41. ;;; pre-inst-env.el ends here