diff options
Diffstat (limited to 'pre-inst-env.in')
-rw-r--r-- | pre-inst-env.in | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/pre-inst-env.in b/pre-inst-env.in new file mode 100644 index 0000000..20e77c5 --- /dev/null +++ b/pre-inst-env.in | |||
@@ -0,0 +1,39 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # GNUnet-Guile --- Guile bindings for GNUnet. | ||
4 | # Copyright © 2015 Ludovic Courtès <ludo@gnu.org> | ||
5 | # | ||
6 | # This file is part of GNUnet-Guile. | ||
7 | # | ||
8 | # GNUnet-Guile is free software; you can redistribute it and/or modify it | ||
9 | # under the terms of the GNU General Public License as published by | ||
10 | # the Free Software Foundation; either version 3 of the License, or (at | ||
11 | # your option) any later version. | ||
12 | # | ||
13 | # GNUnet-Guile is distributed in the hope that it will be useful, but | ||
14 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | # GNU General Public License for more details. | ||
17 | # | ||
18 | # You should have received a copy of the GNU General Public License | ||
19 | # along with GNUnet-Guile. If not, see <http://www.gnu.org/licenses/>. | ||
20 | |||
21 | # Usage: ./pre-inst-env COMMAND ARG... | ||
22 | # | ||
23 | # Run COMMAND in a pre-installation environment. Typical use is | ||
24 | # "./pre-inst-env guile". | ||
25 | |||
26 | # By default we may end up with absolute directory names that contain '..', | ||
27 | # which get into $GUILE_LOAD_PATH, leading to '..' in the module file names | ||
28 | # recorded by Guile. To avoid that, make sure we get a real absolute | ||
29 | # directory name. Additionally, use '-P' to get the canonical directory name | ||
30 | # so that Guile's 'relative' %file-port-name-canonicalization can actually | ||
31 | # work (see <http://bugs.gnu.org/17935>.) | ||
32 | abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd -P`" | ||
33 | abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd -P`" | ||
34 | |||
35 | GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" | ||
36 | GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" | ||
37 | export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH | ||
38 | |||
39 | exec "$@" | ||