mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 20:30:28 +02:00
* New directory --- the build-guile command, intended to help
people build Guile-based applications. * Makefile.am, Makefile.in, build-guile.in: New files.
This commit is contained in:
parent
8a01e7548c
commit
b8b1f32221
3 changed files with 344 additions and 0 deletions
0
build/Makefile.am
Normal file
0
build/Makefile.am
Normal file
217
build/Makefile.in
Normal file
217
build/Makefile.in
Normal file
|
@ -0,0 +1,217 @@
|
|||
# Makefile.in generated automatically by automake 1.2a from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
#### Makefile.in template for guile-core/build.
|
||||
#### Jim Blandy <jimb@red-bean.com> --- September 1997
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = true
|
||||
PRE_INSTALL = true
|
||||
POST_INSTALL = true
|
||||
NORMAL_UNINSTALL = true
|
||||
PRE_UNINSTALL = true
|
||||
POST_UNINSTALL = true
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
GUILE_MAJOR_VERSION = @GUILE_MAJOR_VERSION@
|
||||
GUILE_MINOR_VERSION = @GUILE_MINOR_VERSION@
|
||||
GUILE_STAMP = @GUILE_STAMP@
|
||||
GUILE_VERSION = @GUILE_VERSION@
|
||||
LD = @LD@
|
||||
LIBLOBJS = @LIBLOBJS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
NM = @NM@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
THREAD_LIBS = @THREAD_LIBS@
|
||||
VERSION = @VERSION@
|
||||
qtmd_h = @qtmd_h@
|
||||
qtmdb_s = @qtmdb_s@
|
||||
qtmdc_c = @qtmdc_c@
|
||||
qtmdc_o = @qtmdc_o@
|
||||
qtmds_o = @qtmds_o@
|
||||
qtmds_s = @qtmds_s@
|
||||
target_libs = @target_libs@
|
||||
|
||||
bin_SCRIPTS=build-guile
|
||||
CLEANFILES=build-guile
|
||||
EXTRA_DIST=build-guile.in
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../libguile/scmconfig.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SCRIPTS = $(bin_SCRIPTS)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
default: all
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu build/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
install-binSCRIPTS: $(bin_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(bindir)
|
||||
@list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
else if test -f $(srcdir)/$$p; then \
|
||||
echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
else :; fi; fi; \
|
||||
done
|
||||
|
||||
uninstall-binSCRIPTS:
|
||||
$(NORMAL_UNINSTALL)
|
||||
list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||
rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = build
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu build/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
info:
|
||||
dvi:
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-exec: install-binSCRIPTS
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-data:
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall: uninstall-binSCRIPTS
|
||||
|
||||
all: Makefile $(SCRIPTS)
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(bindir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
rm -f Makefile $(DISTCLEANFILES)
|
||||
rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-generic
|
||||
|
||||
clean: clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-generic clean
|
||||
rm -f config.status
|
||||
rm -f libtool
|
||||
|
||||
maintainer-clean: maintainer-clean-generic distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default uninstall-binSCRIPTS install-binSCRIPTS tags distdir \
|
||||
info dvi installcheck install-exec install-data install uninstall all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
build-guile: build-guile.in
|
||||
rm -f build-guile.tmp
|
||||
sed < ${srcdir}/build-guile.in > build-guile.tmp \
|
||||
-e s:@-bindir-@:${bindir}: \
|
||||
-e s:@-GUILE_VERSION-@:${GUILE_VERSION}:
|
||||
chmod +x build-guile.tmp
|
||||
mv build-guile.tmp build-guile
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
127
build/build-guile.in
Normal file
127
build/build-guile.in
Normal file
|
@ -0,0 +1,127 @@
|
|||
#!@-bindir-@/guile \
|
||||
-e main -s
|
||||
!#
|
||||
;;;; build-guile --- utility for linking programs with Guile
|
||||
;;;; Jim Blandy <jim@red-bean.com> --- September 1997
|
||||
|
||||
(use-modules (ice-9 regex)
|
||||
(ice-9 string-fun))
|
||||
|
||||
|
||||
;;;; main function, command-line processing
|
||||
|
||||
;;; The script's entry point.
|
||||
(define (main args)
|
||||
(set-program-name! (car args))
|
||||
(let ((args (cdr args)))
|
||||
(cond
|
||||
((zero? (length args)) (show-usage))
|
||||
((string=? (car args) "--help") (show-usage))
|
||||
((string=? (car args) "--version") (show-version))
|
||||
((string=? (car args) "link") (build-link (cdr args)))
|
||||
((string=? (car args) "main") (build-main (cdr args)))
|
||||
(else (show-usage)))))
|
||||
|
||||
(define program-name #f)
|
||||
(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
|
||||
;;; directory names stripped).
|
||||
(define (set-program-name! path)
|
||||
(set! program-name
|
||||
(cond
|
||||
((string-match "/([^/]+)$" path)
|
||||
=> (lambda (match) (match:substring match 1)))
|
||||
(else path))))
|
||||
|
||||
(define (show-usage)
|
||||
(let ((dl display-line))
|
||||
(dl "Usage: ")
|
||||
(dl " " program-name " link - print libraries to link with")
|
||||
(dl " " program-name " main - generate initialization code")
|
||||
(dl " " program-name " --help - show usage info (this message)")
|
||||
(dl " " program-name " --version - show running version")))
|
||||
|
||||
(define (show-version)
|
||||
(display-line program-name " - Guile version " program-version))
|
||||
|
||||
|
||||
;;;; the "link" subcommand
|
||||
|
||||
;;; Write a set of linker flags to standard output to include the
|
||||
;;; libraries that libguile needs to link against.
|
||||
;;;
|
||||
;;; In the long run, we want to derive these flags from Guile module
|
||||
;;; declarations files that are installed along the load path. For
|
||||
;;; now, we're just going to reach into Guile's configuration info and
|
||||
;;; hack it out.
|
||||
(define (build-link args)
|
||||
(if (> (length args) 0)
|
||||
(error
|
||||
(string-append program-name
|
||||
" link: arguments to subcommand not yet implemented")))
|
||||
|
||||
(let* ((flags
|
||||
(let loop ((libs
|
||||
;; Get the string of linker flags we used to build
|
||||
;; Guile, and break it up into a list.
|
||||
(separate-fields-discarding-char #\space
|
||||
(get-build-info 'LIBS)
|
||||
list)))
|
||||
(cond
|
||||
((null? libs) '())
|
||||
|
||||
;; Turn any "FOO/libBAR.a" elements into "-lBAR".
|
||||
((string-match "^.*/lib([^./]+).a$" (car libs))
|
||||
=> (lambda (match)
|
||||
(cons (string-append "-l" (match:substring match 1))
|
||||
(loop (cdr libs)))))
|
||||
|
||||
;; Remove any empty strings that may have seeped in there.
|
||||
((string=? (car libs) "") (loop (cdr libs)))
|
||||
|
||||
(else (cons (car libs) (loop (cdr libs)))))))
|
||||
|
||||
;; Don't omit -lguile itself from the list of flags.
|
||||
(flags (cons "-lguile" flags)))
|
||||
|
||||
;; Display the flags, separated by spaces.
|
||||
(display-separated flags)
|
||||
(newline)))
|
||||
|
||||
(define (get-build-info name)
|
||||
(let ((val (assq name %guile-build-info)))
|
||||
(or val (error "get-build-info: no such build info: " name))
|
||||
(cdr val)))
|
||||
|
||||
|
||||
;;;; The "main" subcommand
|
||||
|
||||
(define (build-main args)
|
||||
(display-line-port (current-error-port)
|
||||
program-name ": `main' subcommand not yet implemented"))
|
||||
|
||||
|
||||
;;;; trivial utilities
|
||||
|
||||
(define (display-line . args)
|
||||
(apply display-line-port (current-output-port) args))
|
||||
|
||||
(define (display-line-port port . args)
|
||||
(for-each (lambda (arg) (display arg port))
|
||||
args)
|
||||
(newline))
|
||||
|
||||
(define (display-separated args)
|
||||
(let loop ((args args))
|
||||
(cond ((null? args))
|
||||
((null? (cdr args)) (display (car args)))
|
||||
(else (display (car args))
|
||||
(display " ")
|
||||
(loop (cdr args))))))
|
||||
|
||||
|
||||
;;; Local Variables:
|
||||
;;; mode: scheme
|
||||
;;; End:
|
Loading…
Add table
Add a link
Reference in a new issue