1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Have guile-config' close over pkg-config' and $(pkgconfigdir).

* meta/Makefile.am (guile-config): New target.
  (EXTRA_DIST): Add `guile-config.in'.

* meta/guile-config.in: New, formerly `guile-config'.  Use the right
  installed `guile', with the right $PKG_CONFIG_PATH.  Disable
  auto-compilation.
  (%pkg-config-program): New variable.
  (pkg-config): Use it.
This commit is contained in:
Ludovic Courtès 2009-09-23 22:45:07 +02:00
parent d773ba231c
commit 297273e422
3 changed files with 21 additions and 4 deletions

1
.gitignore vendored
View file

@ -113,3 +113,4 @@ INSTALL
/GSYMS
/GTAGS
/meta/guile-tools
/meta/guile-config

View file

@ -24,7 +24,7 @@ bin_SCRIPTS = guile-config guile-tools
EXTRA_DIST= $(bin_SCRIPTS) \
guile.m4 ChangeLog-2008 \
guile-2.0.pc.in guile-2.0-uninstalled.pc.in \
guile-tools.in
guile-tools.in guile-config.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = guile-2.0.pc
@ -33,3 +33,13 @@ pkgconfig_DATA = guile-2.0.pc
## doing this. When that happens, switch over.
aclocaldir = $(datadir)/aclocal
aclocal_DATA = guile.m4
guile-config: guile-config.in
guile="@bindir@/`echo guile | $(SED) -e '$(program_transform_name)'`" ; \
cat guile-config.in \
| $(SED) -e "s,@pkgconfigdir@,$(pkgconfigdir),g ; \
s,@""PKG_CONFIG@,$(PKG_CONFIG),g ; \
s,@installed_guile@,$$guile,g" \
> guile-config.out
mv guile-config.out guile-config
chmod +x guile-config

View file

@ -1,5 +1,9 @@
#!/bin/sh
exec guile -e main -s $0 "$@"
PKG_CONFIG_PATH="@pkgconfigdir@:$PKG_CONFIG_PATH"
GUILE_AUTO_COMPILE=0
export PKG_CONFIG_PATH GUILE_AUTO_COMPILE
exec "@installed_guile@" -e main -s $0 "$@"
!#
;;;; guile-config --- utility for linking programs with Guile
;;;; Jim Blandy <jim@red-bean.com> --- September 1997
@ -27,6 +31,8 @@ exec guile -e main -s $0 "$@"
(ice-9 rdelim))
(define %pkg-config-program "@PKG_CONFIG@")
;;;; main function, command-line processing
;;; The script's entry point.
@ -74,7 +80,7 @@ exec guile -e main -s $0 "$@"
(define guile-module "guile-2.0")
(define (pkg-config . args)
(let* ((real-args (cons "pkg-config" args))
(let* ((real-args (cons %pkg-config-program args))
(pipe (apply open-pipe* OPEN_READ real-args))
(output (read-delimited "" pipe))
(ret (close-pipe pipe)))
@ -82,7 +88,7 @@ exec guile -e main -s $0 "$@"
((0) (if (eof-object? output) "" output))
(else (display-line-error
(format #f "error: ~s exited with non-zero error code ~A"
(cons "pkg-config" args) (status:exit-val ret)))
(cons %pkg-config-program args) (status:exit-val ret)))
;; assume pkg-config sent diagnostics to stdout
(exit (status:exit-val ret))))))