Support for configure's --srcdir.

This commit is contained in:
mainzelm 2003-05-02 13:41:20 +00:00
parent 6261942760
commit 4511c2f810
2 changed files with 62 additions and 47 deletions

View File

@ -29,7 +29,9 @@ libdir = @libdir@
incdir = @includedir@ incdir = @includedir@
manext = 1 manext = 1
mandir = @mandir@/man$(manext) mandir = @mandir@/man$(manext)
### End of `configure' section### ### End of `configure' section###
### @machine@ will be substituted below ###
htmldir = $(libdir)/scsh/doc/scsh-manual/html htmldir = $(libdir)/scsh/doc/scsh-manual/html
@ -41,8 +43,11 @@ htmldir = $(libdir)/scsh/doc/scsh-manual/html
# Ultrix # Ultrix
# LDFLAGS = -N # LDFLAGS = -N
.SUFFIXES:
.SUFFIXES: .c .o
.c.o: .c.o:
$(CC) -g -c $(DEFS) -I$(srcdir)/c $(CPPFLAGS) $(CFLAGS) -o $@ $< $(CC) -g -c $(DEFS) -I ./c -I$(srcdir)/c $(CPPFLAGS) $(CFLAGS) -o $@ $<
# BUILD_RUNNABLE has to be Scheme 48 0.53. This is used for builds directly # BUILD_RUNNABLE has to be Scheme 48 0.53. This is used for builds directly
# out of the CVS repository. # out of the CVS repository.
@ -101,7 +106,7 @@ START_LINKER = echo ',batch' && echo ',bench on'
# Targets: # Targets:
IMAGE = scheme48.image IMAGE = scheme48.image
INITIAL = build/initial.image INITIAL = $(srcdir)/build/initial.image
VM = scshvm VM = scshvm
#scsh-lib #scsh-lib
@ -117,7 +122,7 @@ SCSHOBJS = \
scsh/fdports1.o \ scsh/fdports1.o \
scsh/flock1.o \ scsh/flock1.o \
scsh/signals1.o \ scsh/signals1.o \
scsh/machine/libansi.o \ scsh/@machine@/libansi.o \
scsh/network1.o \ scsh/network1.o \
scsh/putenv.o \ scsh/putenv.o \
scsh/rx/regexp1.o \ scsh/rx/regexp1.o \
@ -226,13 +231,13 @@ scsh/sighandlers1.o: scsh/sighandlers1.h
scsh/syslog1.o: c/scheme48.h scsh/syslog1.o: c/scheme48.h
include $(srcdir)/scsh/machine/Makefile.inc include $(srcdir)/scsh/@machine@/Makefile.inc
# Berkeley make wants to see this instead: (or use GNU make on BSD. -bri) # Berkeley make wants to see this instead: (or use GNU make on BSD. -bri)
#.include "$(srcdir)/scsh/machine/Makefile.inc" #.include "$(srcdir)/scsh/@machine@/Makefile.inc"
$(VM): c/main.o $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS) $(VM): c/main.o $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS)
rm -f /tmp/s48_external_$$$$.c && \ rm -f /tmp/s48_external_$$$$.c && \
build/build-external-modules /tmp/s48_external_$$$$.c \ $(srcdir)/build/build-external-modules /tmp/s48_external_$$$$.c \
$(EXTERNAL_INITIALIZERS) && \ $(EXTERNAL_INITIALIZERS) && \
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/main.o $(OBJS) $(UNIX_OBJS) \ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/main.o $(OBJS) $(UNIX_OBJS) \
/tmp/s48_external_$$$$.c \ /tmp/s48_external_$$$$.c \
@ -251,7 +256,7 @@ $(LIBSCSHVM): c/smain.o $(OBJS)
$(LIBSCSH): $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS) $(LIBSCSH): $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS)
$(RM) $@ \ $(RM) $@ \
rm -f /tmp/s48_external_$$$$.c && \ rm -f /tmp/s48_external_$$$$.c && \
build/build-external-modules /tmp/s48_external_$$$$.c \ $(srcdir)/build/build-external-modules /tmp/s48_external_$$$$.c \
$(EXTERNAL_INITIALIZERS) && \ $(EXTERNAL_INITIALIZERS) && \
$(CC) -c $(CFLAGS) -o /tmp/s48_external_$$$$.o \ $(CC) -c $(CFLAGS) -o /tmp/s48_external_$$$$.o \
/tmp/s48_external_$$$$.c && \ /tmp/s48_external_$$$$.c && \
@ -263,12 +268,12 @@ $(LIBSCSH): $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS)
c/main.o: c/main.c c/main.o: c/main.c
$(CC) -c $(CFLAGS) -o $@ \ $(CC) -c $(CFLAGS) -o $@ \
-DDEFAULT_IMAGE_NAME=\"$(LIB)/$(IMAGE)\" \ -DDEFAULT_IMAGE_NAME=\"$(LIB)/$(IMAGE)\" \
$(CPPFLAGS) $(DEFS) c/main.c $(CPPFLAGS) $(DEFS) $(srcdir)/c/main.c
c/init.o: c/init.c c/scheme48vm.h c/scheme48heap.h c/init.o: c/init.c c/scheme48vm.h c/scheme48heap.h
$(CC) -c $(CFLAGS) -o $@ \ $(CC) -c $(CFLAGS) -o $@ \
-DDEFAULT_IMAGE_NAME=\"$(LIB)/$(IMAGE)\" \ -DDEFAULT_IMAGE_NAME=\"$(LIB)/$(IMAGE)\" \
$(CPPFLAGS) $(DEFS) c/init.c $(CPPFLAGS) $(DEFS) $(srcdir)/c/init.c
c/scheme48vm.o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h c/event.h \ c/scheme48vm.o: c/prescheme.h c/scheme48vm.h c/scheme48heap.h c/event.h \
c/io.h c/fd-io.h c/scheme48vm-prelude.h c/io.h c/fd-io.h c/scheme48vm-prelude.h
@ -295,7 +300,7 @@ c/fake/strerror.o: c/fake/strerror.h
$(IMAGE): $(VM) scheme/env/init-defpackage.scm scheme/more-interfaces.scm \ $(IMAGE): $(VM) scheme/env/init-defpackage.scm scheme/more-interfaces.scm \
scheme/link-packages.scm scheme/more-packages.scm \ scheme/link-packages.scm scheme/more-packages.scm \
$(usual-files) build/initial.debug build/build-usual-image $(usual-files) build/initial.debug build/build-usual-image
build/build-usual-image . "`pwd`/scheme" '$(IMAGE)' './$(VM)' \ $(srcdir)/build/build-usual-image $(srcdir) "$(srcdir)/scheme" '$(IMAGE)' './$(VM)' \
'$(INITIAL)' '$(INITIAL)'
### Fake targets: all clean install man dist ### Fake targets: all clean install man dist
@ -406,7 +411,7 @@ configure: configure.in
autoheader && autoconf autoheader && autoconf
clean: clean-scsh clean: clean-scsh
-rm -f $(VM) *.o c/*/*.o c/*.o \ $(RM) $(VM) *.o c/*/*.o c/*.o \
$(IMAGE) \ $(IMAGE) \
build/*.tmp $(MANPAGE) build/linker.image \ build/*.tmp $(MANPAGE) build/linker.image \
scheme/debug/*.image scheme/debug/*.debug \ scheme/debug/*.image scheme/debug/*.debug \
@ -414,12 +419,17 @@ clean: clean-scsh
go $(distname) go $(distname)
distclean: clean distclean: clean
rm -f Makefile config.log config.status c/sysdep.h config.cache \ $(RM) Makefile config.log config.status c/sysdep.h config.cache \
scsh/machine \
exportlist.aix exportlist.aix
$(RM) a.exe $(VM).base $(VM).def $(VM).exp $(RM) a.exe $(VM).base $(VM).def $(VM).exp
-find . -name '*~' -o -name '#*' -o -name core -exec rm {} \; -find . -name '*~' -o -name '#*' -o -name core -exec rm {} \;
maintainer-clean: distclean
@echo 'This command is intended for maintainers to use; it'
@echo 'deletes files that may need special tools to rebuild.'
$(RM) $(srcdir)/c/{scheme48vm.c,scheme48heap.c,scheme48.h}
$(RM) $(srcdir)/build/{linker.image,initial.image}
check: $(VM) $(IMAGE) scheme/debug/check.scm check: $(VM) $(IMAGE) scheme/debug/check.scm
( \ ( \
echo ',batch'; \ echo ',batch'; \
@ -470,7 +480,7 @@ DISTFILES = README COPYING INSTALL RELEASE configure config.sub config.guess \
c/sysdep.h.in \ c/sysdep.h.in \
scsh/*.scm scsh/*/*.scm \ scsh/*.scm scsh/*/*.scm \
scsh/*.[ch] scsh/*/*.[ch] \ scsh/*.[ch] scsh/*/*.[ch] \
scsh/*.scm.in scsh/*/Makefile.inc \ scsh/*.scm.in \
doc/scsh.man \ doc/scsh.man \
doc/scsh-manual/*.tex doc/scsh-manual/*.sty \ doc/scsh-manual/*.tex doc/scsh-manual/*.sty \
doc/scsh-manual/man.ps doc/scsh-manual/man.pdf \ doc/scsh-manual/man.ps doc/scsh-manual/man.pdf \
@ -484,7 +494,7 @@ DISTFILES = README COPYING INSTALL RELEASE configure config.sub config.guess \
doc/scsh-paper/html/*.html doc/scsh-paper/html/*.css doc/scsh-paper/html/*.html doc/scsh-paper/html/*.css
distname = $(RUNNABLE)-0.`cat build/minor-version-number` distname = $(RUNNABLE)-0.`cat $(srcdir)/build/minor-version-number`
dist: build/initial.image dist: build/initial.image
(cd doc/src && latex manual.tex && latex manual.tex && \ (cd doc/src && latex manual.tex && latex manual.tex && \
@ -709,7 +719,8 @@ i-know-what-i-am-doing:
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
scsh: scsh/scsh scsh/scsh.image scsh: scsh/scsh scsh/scsh.image
SCHEME =scsh/awk.scm \ SCHEME = \
scsh/awk.scm \
scsh/command-line.scm \ scsh/command-line.scm \
scsh/continuation.scm \ scsh/continuation.scm \
scsh/crypt.scm \ scsh/crypt.scm \
@ -735,15 +746,15 @@ SCHEME =scsh/awk.scm \
scsh/import-os-error-syscall.scm \ scsh/import-os-error-syscall.scm \
scsh/libscsh.scm \ scsh/libscsh.scm \
scsh/low-interrupt.scm \ scsh/low-interrupt.scm \
scsh/machine/bufpol.scm \ scsh/@machine@/bufpol.scm \
scsh/machine/errno.scm \ scsh/@machine@/errno.scm \
scsh/machine/fdflags.scm \ scsh/@machine@/fdflags.scm \
scsh/machine/netconst.scm \ scsh/@machine@/netconst.scm \
scsh/machine/packages.scm \ scsh/@machine@/packages.scm \
scsh/machine/signals.scm \ scsh/@machine@/signals.scm \
scsh/machine/time_dep.scm \ scsh/@machine@/time_dep.scm \
scsh/machine/tty-consts.scm \ scsh/@machine@/tty-consts.scm \
scsh/machine/waitcodes.scm \ scsh/@machine@/waitcodes.scm \
scsh/md5.scm \ scsh/md5.scm \
scsh/meta-arg.scm \ scsh/meta-arg.scm \
scsh/network.scm \ scsh/network.scm \
@ -801,10 +812,10 @@ scsh/scsh: scsh/scsh-tramp.c
$(CC) -o $@ $(CPPFLAGS) $(CFLAGS) \ $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) \
-DVM=\"$(LIB)/$(VM)\" \ -DVM=\"$(LIB)/$(VM)\" \
-DIMAGE=\"$(LIB)/scsh.image\" \ -DIMAGE=\"$(LIB)/scsh.image\" \
scsh/scsh-tramp.c $<
loads = $(srcdir)/scsh/let-opt.scm $(srcdir)/scsh/scsh-interfaces.scm \ loads = $(srcdir)/scsh/let-opt.scm $(srcdir)/scsh/scsh-interfaces.scm \
$(srcdir)/scsh/machine/packages.scm \ $(srcdir)/scsh/@machine@/packages.scm \
$(srcdir)/scsh/rx/packages.scm \ $(srcdir)/scsh/rx/packages.scm \
$(srcdir)/scsh/scsh-package.scm \ $(srcdir)/scsh/scsh-package.scm \
$(srcdir)/scsh/lib/ccp-pack.scm \ $(srcdir)/scsh/lib/ccp-pack.scm \
@ -814,7 +825,8 @@ opens = floatnums scsh ccp-lib scsh-top-package scsh-here-string-hax \
srfi-1 srfi-13 srfi-14 # srfi-14 is also exported by scsh srfi-1 srfi-13 srfi-14 # srfi-14 is also exported by scsh
scsh/scsh.image: $(VM) $(SCHEME) $(IMAGE) scsh/scsh.image: $(VM) $(SCHEME) $(IMAGE)
(echo ",translate =scheme48/ `pwd`/scheme/"; \ (echo ",translate =scheme48/ $(srcdir)/scheme/"; \
echo ",translate $(srcdir)/scsh/machine/ $(srcdir)/scsh/@machine@/"; \
echo ",batch on"; \ echo ",batch on"; \
echo ",config ,load $(loads)"; \ echo ",config ,load $(loads)"; \
echo ",open $(opens)"; \ echo ",open $(opens)"; \
@ -859,8 +871,10 @@ install-stripped-scsh-image: $(VM) scsh/stripped-scsh.image
) | ./$(VM) -i scsh/stripped-scsh.image ) | ./$(VM) -i scsh/stripped-scsh.image
clean-scsh: clean-scsh:
$(RM) scsh/*.o scsh/rx/*.o scsh/machine/*.o $(RM) scsh/*.o scsh/rx/*.o scsh/*/*.o
$(RM) scsh/*.image $(RM) scsh/*.image
$(RM) $(LIBSCSHVM) $(LIBSCSH) scsh/scsh$(EXEEXT) $(RM) $(LIBSCSHVM) $(LIBSCSH) scsh/scsh$(EXEEXT)
$(RM) scsh-config
# rm -rf * && mkdir -p scsh/rx c/unix c/srfi && ~/sw/scsh-HEAD/configure --srcdir=/afs/wsi//home/gasbichl/sw/scsh-HEAD/ && make

View File

@ -88,7 +88,8 @@ AC_DEFUN(SCSH_ELF, [
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(SCSH_SIG_NRS, [ AC_DEFUN(SCSH_SIG_NRS, [
AC_MSG_RESULT([defining signal constants]) AC_MSG_RESULT([defining signal constants])
${CC} -o scsh_aux scsh/scsh_aux.c mkdir -p scsh
${CC} -o scsh_aux $srcdir/scsh/scsh_aux.c
AC_DEFINE_UNQUOTED(SIGNR_1, `./scsh_aux 1`, [scsh interrupt for signal 1]) AC_DEFINE_UNQUOTED(SIGNR_1, `./scsh_aux 1`, [scsh interrupt for signal 1])
AC_DEFINE_UNQUOTED(SIGNR_2, `./scsh_aux 2`, [scsh interrupt for signal 2]) AC_DEFINE_UNQUOTED(SIGNR_2, `./scsh_aux 2`, [scsh interrupt for signal 2])
AC_DEFINE_UNQUOTED(SIGNR_3, `./scsh_aux 3`, [scsh interrupt for signal 3]) AC_DEFINE_UNQUOTED(SIGNR_3, `./scsh_aux 3`, [scsh interrupt for signal 3])
@ -196,7 +197,7 @@ AC_INIT(c/scheme48vm.c)
case "$host" in case "$host" in
## CX/UX ## CX/UX
m88k-harris-cxux* ) m88k-harris-cxux* )
dir=cxux machine=cxux
CC="cc -Xa" CC="cc -Xa"
CFLAGS="-O" CFLAGS="-O"
LDFLAGS="-O -Wl,-Bexport" LDFLAGS="-O -Wl,-Bexport"
@ -205,7 +206,7 @@ AC_INIT(c/scheme48vm.c)
## DEC Ultrix ## DEC Ultrix
mips-dec-ultrix* ) mips-dec-ultrix* )
dir=ultrix machine=ultrix
if test ${CC} = cc; then if test ${CC} = cc; then
LDFLAGS=-N LDFLAGS=-N
fi fi
@ -213,7 +214,7 @@ AC_INIT(c/scheme48vm.c)
## HP 9000 series 700 and 800, running HP/UX ## HP 9000 series 700 and 800, running HP/UX
hppa*-hp-hpux* ) hppa*-hp-hpux* )
dir=hpux machine=hpux
LDFLAGS="-Wl,-E" LDFLAGS="-Wl,-E"
if test ${CC} = cc; then if test ${CC} = cc; then
CFLAGS="-Ae -O +Obb1800" CFLAGS="-Ae -O +Obb1800"
@ -225,7 +226,7 @@ AC_INIT(c/scheme48vm.c)
## IBM AIX ## IBM AIX
rs6000-ibm-aix*|powerpc-ibm-aix* ) rs6000-ibm-aix*|powerpc-ibm-aix* )
dir=aix machine=aix
LDFLAGS="-O" LDFLAGS="-O"
if test ${CC} = gcc; then if test ${CC} = gcc; then
LDFLAGS_AIX="-Xlinker -bexport:exportlist.aix" LDFLAGS_AIX="-Xlinker -bexport:exportlist.aix"
@ -238,7 +239,7 @@ AC_INIT(c/scheme48vm.c)
## Linux ## Linux
*-*-linux* ) *-*-linux* )
dir=linux machine=linux
# gross, but needed for some older a.out systems for 0.4.x # gross, but needed for some older a.out systems for 0.4.x
LIBS=-lc LIBS=-lc
SCSH_ELF SCSH_ELF
@ -246,52 +247,52 @@ AC_INIT(c/scheme48vm.c)
## NetBSD and FreeBSD ( and maybe 386BSD also) ## NetBSD and FreeBSD ( and maybe 386BSD also)
*-*-*bsd*|*-*-darwin* ) *-*-*bsd*|*-*-darwin* )
dir=bsd machine=bsd
SCSH_ELF SCSH_ELF
;; ;;
## NeXT ## NeXT
*-next-* ) *-next-* )
dir=next machine=next
CC="$CC -posix" CC="$CC -posix"
AC_DEFINE(HAVE_SIGACTION) AC_DEFINE(HAVE_SIGACTION)
;; ;;
## SGI IRIX ## SGI IRIX
mips-sgi-irix* ) mips-sgi-irix* )
dir=irix machine=irix
S48_CFLAG_CKR S48_CFLAG_CKR
INSTALL='$(srcdir)/install-sh' INSTALL='$(srcdir)/install-sh'
;; ;;
## SunOS ## SunOS
sparc*-sun-sunos* ) sparc*-sun-sunos* )
dir=sunos machine=sunos
;; ;;
## Solaris - Sparc and i386 ## Solaris - Sparc and i386
*-*-solaris* ) *-*-solaris* )
dir=solaris machine=solaris
AC_DEFINE(HAVE_NLIST) AC_DEFINE(HAVE_NLIST)
;; ;;
## NT - cygwin32 ## NT - cygwin32
*-*-cygwin* ) *-*-cygwin* )
AC_DEFINE(CYGWIN, 1, [Define to 1 on cygwin]) AC_DEFINE(CYGWIN, 1, [Define to 1 on cygwin])
dir=cygwin32 machine=cygwin32
EXEEXT=".exe" EXEEXT=".exe"
;; ;;
## Generic Configuration ## Generic Configuration
* ) * )
dir=generic machine=generic
echo "WARNING: " echo "WARNING: "
echo "WARNING: Using generic configuration." echo "WARNING: Using generic configuration."
echo "WARNING: See doc/porting.txt for more information." echo "WARNING: See doc/porting.txt for more information."
echo "WARNING: " echo "WARNING: "
;; ;;
esac esac
(cd $srcdir/scsh && rm -rf machine && ln -s $dir machine) (mkdir -p ./scsh/$machine scsh/rx c/unix c/srfi)
AC_CHECK_LIB(m, main) AC_CHECK_LIB(m, main)
AC_CHECK_LIB(dl, main) AC_CHECK_LIB(dl, main)
@ -367,14 +368,14 @@ fail
AC_SUBST(CFLAGS) AC_SUBST(CFLAGS)
AC_SUBST(CFLAGS1) AC_SUBST(CFLAGS1)
AC_SUBST(EXEEXT) AC_SUBST(EXEEXT)
AC_SUBST(ENDIAN) AC_SUBST(ENDIAN) #does currently not occur
AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS)
AC_SUBST(LDFLAGS_AIX) AC_SUBST(LDFLAGS_AIX)
AC_SUBST(LIBS) AC_SUBST(LIBS)
AC_SUBST(TMPDIR) AC_SUBST(TMPDIR)
AC_SUBST(machine)
AC_CONFIG_FILES(Makefile scsh-config)
AC_CONFIG_FILES(Makefile scsh/endian.scm scsh-config)
AC_CONFIG_COMMANDS([scsh-config+x],[chmod +x scsh-config]) AC_CONFIG_COMMANDS([scsh-config+x],[chmod +x scsh-config])
AC_OUTPUT AC_OUTPUT