From 00a51a23247f1edc4ae8eda72b30df5cd7d0015f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 25 Jun 2019 16:44:39 +0200 Subject: Correctly substitute directory names in 'python' executable. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- modules/Makefile.am | 11 +++++++++++ modules/configure.ac | 1 - modules/python.in | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/Makefile.am b/modules/Makefile.am index 9d7ab54..f621dff 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -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 diff --git a/modules/configure.ac b/modules/configure.ac index 9d483d0..5245123 100644 --- a/modules/configure.ac +++ b/modules/configure.ac @@ -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 diff --git a/modules/python.in b/modules/python.in index 6b57242..5d7849f 100755 --- a/modules/python.in +++ b/modules/python.in @@ -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))) -- cgit v1.2.3