allow building against uninstalled guile; move some things to meta/
authorAndy Wingo <wingo@pobox.com>
Fri, 27 Mar 2009 21:03:03 +0000 (14:03 -0700)
committerAndy Wingo <wingo@pobox.com>
Fri, 27 Mar 2009 21:03:03 +0000 (14:03 -0700)
* 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.

21 files changed:
Makefile.am
README
am/guilec
am/pre-inst-guile
check-guile.in
configure.in
doc/ref/Makefile.am
gc-benchmarks/run-benchmark.scm
meta/ChangeLog-2008 [moved from guile-config/ChangeLog-2008 with 100% similarity]
meta/Makefile.am [moved from guile-config/Makefile.am with 59% similarity]
meta/gdb-uninstalled-guile.in [moved from gdb-pre-inst-guile.in with 79% similarity]
meta/guile-1.8-uninstalled.pc.in [new file with mode: 0644]
meta/guile-1.8.pc.in [moved from guile-1.8.pc.in with 100% similarity]
meta/guile-config.in [moved from guile-config/guile-config.in with 99% similarity]
meta/guile-tools.in [moved from guile-tools.in with 100% similarity]
meta/guile.in [moved from pre-inst-guile.in with 93% similarity]
meta/guile.m4 [moved from guile-config/guile.m4 with 100% similarity]
meta/uninstalled-env.in [moved from pre-inst-guile-env.in with 87% similarity]
test-suite/standalone/Makefile.am
test-suite/standalone/README
testsuite/Makefile.am

index 556b321..0e61f53 100644 (file)
 #
 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
diff --git a/README b/README
index 3af511b..4e295f8 100644 (file)
--- a/README
+++ b/README
@@ -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 ===========================================================
index aaa1747..fc2bdd0 100644 (file)
--- a/am/guilec
+++ b/am/guilec
@@ -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 "$@" "$<"
index c1a7407..353908d 100644 (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
index 9ee2ea3..1c01012 100644 (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
index 60166d8..68d0d6a 100644 (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],
index 9799a5e..d534351 100644 (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
index 509f978..a50fb48 100755 (executable)
@@ -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
similarity index 59%
rename from guile-config/Makefile.am
rename to meta/Makefile.am
index cedcba9..76544b3 100644 (file)
 ##   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
similarity index 79%
rename from gdb-pre-inst-guile.in
rename to meta/gdb-uninstalled-guile.in
index d1f4e38..457ab2b 100644 (file)
 
 # 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 "$@"
diff --git a/meta/guile-1.8-uninstalled.pc.in b/meta/guile-1.8-uninstalled.pc.in
new file mode 100644 (file)
index 0000000..50d337f
--- /dev/null
@@ -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@
similarity index 100%
rename from guile-1.8.pc.in
rename to meta/guile-1.8.pc.in
similarity index 99%
rename from guile-config/guile-config.in
rename to meta/guile-config.in
index b782292..23c72e2 100644 (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
similarity index 100%
rename from guile-tools.in
rename to meta/guile-tools.in
similarity index 93%
rename from pre-inst-guile.in
rename to meta/guile.in
index 5adbabe..d7bc893 100644 (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
similarity index 100%
rename from guile-config/guile.m4
rename to meta/guile.m4
similarity index 87%
rename from pre-inst-guile-env.in
rename to meta/uninstalled-env.in
index bb0a81c..fa8285d 100644 (file)
 # 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 "$@"
index 854a4a0..b8d6e81 100644 (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                \
index 4e0bd65..164c6ab 100644 (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
index c523eff..2bc7814 100644 (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 =                                                \