From e6fd699c4347e3709cf572b3d9a91583d6e5b0be Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 19 Dec 2023 17:16:00 -0500 Subject: [PATCH] Add a 'pre-inst-env' wrapper script to test library before installing. * pre-inst-env.in: New input file. * .gitignore: Register its finalized version. * configure.ac: Register it in AC_CONFIG_FILES. * doc/guile-udev.texi (Using this library before it is installed): Document it. --- .gitignore | 1 + configure.ac | 1 + doc/guile-udev.texi | 12 ++++++++++++ pre-inst-env.in | 14 ++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 pre-inst-env.in diff --git a/.gitignore b/.gitignore index 9255e08..1b1dd2e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ config.log config.status configure libtool +pre-inst-env TAGS diff --git a/configure.ac b/configure.ac index 6b87ae8..c41b8ba 100644 --- a/configure.ac +++ b/configure.ac @@ -109,6 +109,7 @@ AC_SUBST([guilesitedir]) GUILE_EFFECTIVE_VERSION=`$GUILE -c '(display (effective-version))'` AC_SUBST(GUILE_EFFECTIVE_VERSION) +AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) AC_CONFIG_FILES([Makefile libguile-udev/Makefile build-aux/Makefile]) AC_CONFIG_FILES([build-aux/m4/Makefile build-aux/am/Makefile doc/Makefile]) AC_CONFIG_FILES([modules/Makefile modules/udev/Makefile]) diff --git a/doc/guile-udev.texi b/doc/guile-udev.texi index a9fdbed..e435dbf 100644 --- a/doc/guile-udev.texi +++ b/doc/guile-udev.texi @@ -57,6 +57,7 @@ Documentation License.'' * Introduction:: * Installing as a system package:: * Installing from sources:: +* Using this library before it is installed:: * API Reference:: Appendices * Examples:: * GNU Free Documentation License:: The license of this manual. @@ -138,6 +139,17 @@ installed in Guile's default path. But, if you don't know where your Guile site directory is, run @command{configure} without the option, and it will give you a suggestion. +@node Using this library before it is installed +@chapter Using this library before it is installed + +If you would like to test this Guile extension as you work on it, without +having to install it, you can use the @file{pre-inst-env} wrapper after having +configured and built the project, e.g.@: + +@example +./pre-inst-env examples/device-listener.scm +@end example + @node API Reference @chapter API Reference diff --git a/pre-inst-env.in b/pre-inst-env.in new file mode 100644 index 0000000..8a4cb79 --- /dev/null +++ b/pre-inst-env.in @@ -0,0 +1,14 @@ +#!/bin/sh + +abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd`" +abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd`" + +GUILE_EXTENSIONS_PATH="$abs_top_builddir/libguile-udev/.libs${GUILE_EXTENSIONS_PATH=:+:}$GUILE_EXTENSIONS_PATH" +GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" +GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH" +export GUILE_EXTENSIONS_PATH GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH + +PATH="$abs_top_builddir/scripts:$PATH" +export PATH + +exec "$@"