Skip to content

Commit

Permalink
Add a 'pre-inst-env' wrapper script to test library before installing.
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Apteryks committed Dec 19, 2023
1 parent 455a3e3 commit e6fd699
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ config.log
config.status
configure
libtool
pre-inst-env
TAGS
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
12 changes: 12 additions & 0 deletions doc/guile-udev.texi
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
14 changes: 14 additions & 0 deletions pre-inst-env.in
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit e6fd699

Please sign in to comment.