allow building against uninstalled guile; move some things to meta/

* README: Add more info about building against an uninstalled Guile.

* meta/: New directory. The proximate cause of its creation is that I
  want to be able to build external packages against uninstalled Guile,
  and to do that I need guile-tools in the PATH, but I don't want
  $top_builddir/libtool in the path. But it seems like a good
  reorganization, for things that are /about/ Guile: pkg-config files, m4
  files, guile-config... then we also include uninstalled info: the
  environment, the pre-inst-guile script, etc.

* meta/guile-1.8-uninstalled.pc.in: New pkg-config template. pkg-config
  prefers -uninstalled pkg-config files, if they are in its path.

* meta/Makefile.am:
* meta/ChangeLog-2008:
* meta/gdb-uninstalled-guile.in:
* meta/guile-1.8.pc.in:
* meta/guile-config.in:
* meta/guile.m4:
* meta/guile-tools.in: Moved to meta/.

* meta/guile.in: This is the new name of pre-inst-guile.in.

* meta/uninstalled-env.in: And this, pre-inst-guile-env.in.

* Makefile.am:
* am/guilec:
* am/pre-inst-guile:
* check-guile.in:
* configure.in:
* doc/ref/Makefile.am:
* gc-benchmarks/run-benchmark.scm:
* test-suite/standalone/Makefile.am:
* test-suite/standalone/README:
* testsuite/Makefile.am: Adapt to meta/ change.
This commit is contained in:
Andy Wingo 2009-03-27 14:03:03 -07:00
commit 0b6d8fdc28
21 changed files with 74 additions and 59 deletions

View file

@ -24,16 +24,14 @@
#
AUTOMAKE_OPTIONS = 1.10
SUBDIRS = lib libguile guile-config guile-readline emacs \
SUBDIRS = lib meta libguile guile-readline emacs \
scripts srfi doc examples test-suite benchmark-suite lang am \
module testsuite
bin_SCRIPTS = guile-tools
include_HEADERS = libguile.h
EXTRA_DIST = LICENSE HACKING GUILE-VERSION \
m4/ChangeLog-2008 FAQ guile-1.8.pc.in \
m4/ChangeLog-2008 FAQ \
m4/autobuild.m4 ChangeLog-2008
TESTS = check-guile
@ -42,7 +40,4 @@ ACLOCAL_AMFLAGS = -I m4
DISTCLEANFILES = check-guile.log
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = guile-1.8.pc
# Makefile.am ends here

20
README
View file

@ -223,9 +223,23 @@ GUILE_FOR_BUILD variable, it defaults to just "guile".
Using Guile Without Installing It =========================================
The top directory of the Guile sources contains a script called
"pre-inst-guile" that can be used to run the Guile that has just been
built.
The "meta/" subdirectory of the Guile sources contains a script called
"guile" that can be used to run the Guile that has just been built. Note
that this is not the same "guile" as the one that is installed; this
"guile" is a wrapper script that sets up the environment appropriately,
then invokes the Guile binary.
You may also build against an uninstalled Guile build tree. The
"uninstalled-env" script in the "meta/" subdirectory will set up an
environment with a path including "meta/", a modified dynamic linker
path, a modified PKG_CONFIG_PATH, etc.
For example, you can enter this environment via invoking
meta/uninstalled-env bash
Within that shell, other packages should be able to build against
uninstalled Guile.
Installing SLIB ===========================================================

View file

@ -10,6 +10,6 @@ CLEANFILES = $(GOBJECTS)
SUFFIXES = .scm .go
.scm.go:
$(MKDIR_P) `dirname $@`
$(top_builddir)/pre-inst-guile \
$(top_builddir)/meta/guile \
-l $(top_builddir)/libguile/stack-limit-calibration.scm \
$(top_srcdir)/scripts/compile -o "$@" "$<"

View file

@ -28,7 +28,7 @@
## Code:
preinstguile = $(top_builddir_absolute)/pre-inst-guile
preinstguile = $(top_builddir_absolute)/meta/guile
preinstguiletool = GUILE="$(preinstguile)" $(top_srcdir)/scripts
## am/pre-inst-guile ends here

View file

@ -1,6 +1,6 @@
#! /bin/sh
# Usage: check-guile [-i GUILE-INTERPRETER] [GUILE-TEST-ARGS]
# If `-i GUILE-INTERPRETER' is omitted, use ${top_builddir}/pre-inst-guile.
# If `-i GUILE-INTERPRETER' is omitted, use ${top_builddir}/meta/guile.
# See ${top_srcdir}/test-suite/guile-test for documentation on GUILE-TEST-ARGS.
#
# Example invocations:
@ -21,7 +21,7 @@ if [ x"$1" = x-i ] ; then
shift
shift
else
guile=${top_builddir}/pre-inst-guile
guile=${top_builddir}/meta/guile
fi
GUILE_LOAD_PATH=$TEST_SUITE_DIR

View file

@ -1532,13 +1532,13 @@ AC_CONFIG_FILES([
doc/tutorial/Makefile
emacs/Makefile
examples/Makefile
guile-config/Makefile
lang/Makefile
libguile/Makefile
scripts/Makefile
srfi/Makefile
test-suite/Makefile
test-suite/standalone/Makefile
meta/Makefile
module/Makefile
module/ice-9/Makefile
module/ice-9/debugger/Makefile
@ -1549,13 +1549,15 @@ AC_CONFIG_FILES([
testsuite/Makefile
])
AC_CONFIG_FILES([guile-1.8.pc])
AC_CONFIG_FILES([meta/guile-1.8.pc])
AC_CONFIG_FILES([meta/guile-1.8-uninstalled.pc])
AC_CONFIG_FILES([check-guile], [chmod +x check-guile])
AC_CONFIG_FILES([benchmark-guile], [chmod +x benchmark-guile])
AC_CONFIG_FILES([guile-tools], [chmod +x guile-tools])
AC_CONFIG_FILES([pre-inst-guile], [chmod +x pre-inst-guile])
AC_CONFIG_FILES([pre-inst-guile-env], [chmod +x pre-inst-guile-env])
AC_CONFIG_FILES([gdb-pre-inst-guile], [chmod +x gdb-pre-inst-guile])
AC_CONFIG_FILES([meta/guile-config], [chmod +x meta/guile-config])
AC_CONFIG_FILES([meta/guile-tools], [chmod +x meta/guile-tools])
AC_CONFIG_FILES([meta/guile], [chmod +x meta/guile])
AC_CONFIG_FILES([meta/uninstalled-env], [chmod +x meta/uninstalled-env])
AC_CONFIG_FILES([meta/gdb-uninstalled-guile], [chmod +x meta/gdb-uninstalled-guile])
AC_CONFIG_FILES([libguile/guile-snarf],
[chmod +x libguile/guile-snarf])
AC_CONFIG_FILES([libguile/guile-doc-snarf],

View file

@ -89,8 +89,8 @@ include $(top_srcdir)/am/pre-inst-guile
# Automated snarfing
autoconf.texi: autoconf-macros.texi
autoconf-macros.texi: $(top_srcdir)/guile-config/guile.m4
$(preinstguiletool)/snarf-guile-m4-docs $(top_srcdir)/guile-config/guile.m4 \
autoconf-macros.texi: $(top_srcdir)/meta/guile.m4
$(preinstguiletool)/snarf-guile-m4-docs $(top_srcdir)/meta/guile.m4 \
> $(srcdir)/$@
lib-version.texi: $(top_srcdir)/GUILE-VERSION

View file

@ -233,7 +233,7 @@ Report bugs to <bug-guile@gnu.org>.~%"))
(ref-env (assoc-ref args 'reference-environment))
(bdwgc-env (or (assoc-ref args 'bdwgc-environment)
(string-append "GUILE=" bench-dir
"/../pre-inst-guile")))
"/../meta/guile")))
(prof-opts (assoc-ref args 'profile-options)))
(for-each (lambda (benchmark)
(let ((ref (parse-result (run-reference-guile ref-env

View file

@ -20,27 +20,14 @@
## to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
## Floor, Boston, MA 02110-1301 USA
bin_SCRIPTS=guile-config
CLEANFILES=guile-config
EXTRA_DIST=guile-config.in guile.m4 ChangeLog-2008
bin_SCRIPTS=guile-config guile-tools
EXTRA_DIST=guile-config.in guile-tools.in guile.m4 ChangeLog-2008 \
guile-1.8.pc.in guile-1.8-uninstalled.pc.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = guile-1.8.pc
## FIXME: in the future there will be direct automake support for
## doing this. When that happens, switch over.
aclocaldir = $(datadir)/aclocal
aclocal_DATA = guile.m4
## We use @-...-@ as the substitution brackets here, instead of the
## usual @...@, so autoconf doesn't go and substitute the values
## directly into the left-hand sides of the sed substitutions. *sigh*
guile-config: guile-config.in ${top_builddir}/libguile/libpath.h
rm -f guile-config.tmp
sed < ${srcdir}/guile-config.in > guile-config.tmp \
-e 's|@-bindir-@|${bindir}|' \
-e s:@-GUILE_VERSION-@:${GUILE_VERSION}:
chmod +x guile-config.tmp
mv guile-config.tmp guile-config
## Get rid of any copies of the configuration script under the old
## name, so people don't end up running ancient copies of it.
install-exec-local:
rm -f ${bindir}/build-guile

View file

@ -21,18 +21,18 @@
# Commentary:
# Usage: gdb-pre-inst-guile [ARGS]
# Usage: gdb-uninstalled-guile [ARGS]
#
# This script runs Guile from the build tree under GDB. See
# ./pre-inst-guile for more information.
# ./guile for more information.
#
# In addition to running ./gdb-pre-inst-guile, sometimes it's useful to
# run e.g. ./check-guile -i ./gdb-pre-inst-guile foo.test.
# In addition to running ./gdb-uninstalled-guile, sometimes it's useful to
# run e.g. ./check-guile -i meta/gdb-uninstalled-guile foo.test.
# Code:
set -e
# env (set by configure)
top_builddir="@top_builddir_absolute@"
exec ${top_builddir}/pre-inst-guile-env libtool --mode=execute \
exec ${top_builddir}/uninstalled-env libtool --mode=execute \
gdb --args ${top_builddir}/libguile/guile "$@"

View file

@ -0,0 +1,8 @@
builddir=@abs_top_builddir@
srcdir=@abs_top_srcdir@
Name: GNU Guile (uninstalled)
Description: GNU's Ubiquitous Intelligent Language for Extension (uninstalled)
Version: @GUILE_VERSION@
Libs: -L${builddir}/libguile -lguile @GUILE_LIBS@
Cflags: -I${srcdir} -I${builddir} @GUILE_CFLAGS@

View file

@ -1,4 +1,4 @@
#!@-bindir-@/guile \
#!@bindir@/guile \
-e main -s
!#
;;;; guile-config --- utility for linking programs with Guile
@ -47,7 +47,7 @@
(define program-name #f)
(define subcommand-name #f)
(define program-version "@-GUILE_VERSION-@")
(define program-version "@GUILE_VERSION@")
;;; Given an executable path PATH, set program-name to something
;;; appropriate f or use in error messages (i.e., with leading

View file

@ -21,7 +21,7 @@
# Commentary:
# Usage: pre-inst-guile [ARGS]
# Usage: guile [ARGS]
#
# This script arranges for the environment to support, and eventaully execs,
# the uninstalled binary guile executable located somewhere under libguile/,
@ -43,9 +43,9 @@ GUILE=${top_builddir}/libguile/guile
export GUILE
# do it
exec ${top_builddir}/pre-inst-guile-env $GUILE "$@"
exec ${top_builddir}/meta/uninstalled-env $GUILE "$@"
# never reached
exit 1
# pre-inst-guile ends here
# guile ends here

View file

@ -18,17 +18,17 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# NOTE: If you update this file, please update pre-inst-guile.in as
# NOTE: If you update this file, please update uninstalled.in as
# well, if appropriate.
# Usage: pre-inst-guile-env [ARGS]
# Usage: uninstalled-env [ARGS]
# This script arranges for the environment to support running Guile
# from the build tree. The following env vars are modified (but not
# clobbered): GUILE_LOAD_PATH, LTDL_LIBRARY_PATH, and PATH.
# Example: pre-inst-guile-env guile -c '(display "hello\n")'
# Example: ../../pre-inst-guile-env ./guile-test-foo
# Example: uninstalled-env guile -c '(display "hello\n")'
# Example: ../../uninstalled-env ./guile-test-foo
# config
subdirs_with_ltlibs="srfi guile-readline libguile" # maintain me
@ -83,9 +83,18 @@ export LTDL_LIBRARY_PATH
DYLD_LIBRARY_PATH="${dyld_prefix}${top_builddir}/libguile/.libs:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH
if [ x"$PKG_CONFIG_PATH" = x ]
then
PKG_CONFIG_PATH="${top_builddir}"
else
PKG_CONFIG_PATH="${top_builddir}:$PKG_CONFIG_PATH"
fi
export PKG_CONFIG_PATH
# handle PATH (no clobber)
PATH="${top_builddir}/guile-config:${PATH}"
PATH="${top_builddir}/libguile:${PATH}"
PATH="${top_builddir}/meta:${PATH}"
export PATH
exec "$@"

View file

@ -28,7 +28,7 @@ check_SCRIPTS =
BUILT_SOURCES =
EXTRA_DIST =
TESTS_ENVIRONMENT = "${top_builddir}/pre-inst-guile-env"
TESTS_ENVIRONMENT = "${top_builddir}/meta/uninstalled-env"
test_cflags = \
-I$(top_srcdir)/test-suite/standalone \

View file

@ -12,7 +12,7 @@ If you want to use a scheme script, prefix it as follows:
!#
Makefile.am will arrange for all tests (scripts or executables) to be
run under pre-inst-guile-env so that the PATH, LD_LIBRARY_PATH, and
run under uninstalled-env so that the PATH, LD_LIBRARY_PATH, and
GUILE_LOAD_PATH will be augmented appropriately.
The Makefile.am has an example of creating a shared library to be used

View file

@ -1,5 +1,5 @@
TESTS_ENVIRONMENT = \
$(top_builddir)/pre-inst-guile \
$(top_builddir)/meta/guile \
-l $(srcdir)/run-vm-tests.scm -e run-vm-tests
TESTS = \