Correctly substitute directory names in 'python' executable. master
authorLudovic Courtès <ludo@gnu.org>
Tue, 25 Jun 2019 14:44:39 +0000 (16:44 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Tue, 25 Jun 2019 19:40:02 +0000 (21:40 +0200)
Previously "@libdir@" would typically expand to "${exec_prefix}/…",
which wouldn't have the intended effect.

* modules/Makefile.am (python): New target.
(CLEANFILES): New variable.
* modules/configure.ac: Remove 'AC_CONFIG_FILES' for 'python'.
* modules/python.in: Use @datadir@ instead of @prefix@/share.

Signed-off-by: Ricardo Wurmus <rekado@elephly.net>
modules/Makefile.am
modules/configure.ac
modules/python.in

index 9d7ab54..f621dff 100644 (file)
@@ -130,4 +130,15 @@ EXTRA_DIST += \
   env.in \
   COPYING
 
+python: python.in
+       $(SED) -e 's|[@]GUILE[@]|$(GUILE)|g'            \
+              -e 's|[@]GUILE_EFFECTIVE_VERSION[@]|$(GUILE_EFFECTIVE_VERSION)|g' \
+              -e 's|[@]VERSION[@]|$(VERSION)|g'        \
+              -e 's|[@]libdir[@]|$(libdir)|g'          \
+              -e 's|[@]datadir[@]|$(datadir)|g'        \
+          < "$^" > "$@.tmp"
+       mv "$@.tmp" "$@"
+
+CLEANFILES = python
+
 nodist_bin_SCRIPTS = python
index 9d483d0..5245123 100644 (file)
@@ -13,7 +13,6 @@ GUILE_PKG([3.0 2.2 2.1 2.0])
 GUILE_PROGS
  
 AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([python], [chmod +x python])
 AC_CONFIG_FILES([env], [chmod +x env])
 AC_OUTPUT
 
index 6b57242..5d7849f 100755 (executable)
@@ -4,7 +4,7 @@
 
 (eval-when (expand load eval)
   (set! %load-path
-    (cons "@prefix@/share/guile/site/@GUILE_EFFECTIVE_VERSION@" %load-path))
+    (cons "@datadir@/guile/site/@GUILE_EFFECTIVE_VERSION@" %load-path))
   (set! %load-compiled-path
     (cons "@libdir@/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache"
           %load-compiled-path)))