pre-inst-env.in 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. # pre-inst-env --- Pre-installation environment for Guile-XOSD
  3. # Copyright (C) 2016 Alex Kost <alezost@gmail.com>
  4. # This file is part of Guile-XOSD.
  5. # Guile-XOSD is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # Guile-XOSD is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with Guile-XOSD. If not, see <http://www.gnu.org/licenses/>.
  17. usage () {
  18. echo 'Usage: '"$0"' COMMAND ARG...
  19. Run COMMAND in a pre-installation environment.
  20. Particularly, this script allows you to use (xosd) module in a Guile
  21. REPL, if Guile is started like this: "./pre-inst-env guile".'
  22. }
  23. set_env () {
  24. src_modules="@abs_top_srcdir@/modules"
  25. build_modules="@abs_top_builddir@/modules"
  26. GUILE_LOAD_COMPILED_PATH="${build_modules}${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
  27. GUILE_LOAD_PATH="${src_modules}:${build_modules}${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
  28. export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH
  29. GUILE_XOSD_LIBDIR="@abs_top_builddir@/src/.libs"
  30. export GUILE_XOSD_LIBDIR
  31. GUILE_XOSD_DOCDIR="$src_modules"
  32. export GUILE_XOSD_DOCDIR
  33. }
  34. case "$1" in
  35. -h | --help)
  36. usage
  37. exit 0 ;;
  38. *)
  39. set_env
  40. exec "$@" ;;
  41. esac
  42. # pre-inst-env ends here