From 4511c2f8101abb8fe5f1358a61c1b05eea87df5c Mon Sep 17 00:00:00 2001 From: mainzelm Date: Fri, 2 May 2003 13:41:20 +0000 Subject: [PATCH] Support for configure's --srcdir. --- Makefile.in | 74 +++++++++++++++++++++++++++++++--------------------- configure.in | 35 +++++++++++++------------ 2 files changed, 62 insertions(+), 47 deletions(-) diff --git a/Makefile.in b/Makefile.in index 13b546e..312749f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,7 +29,9 @@ libdir = @libdir@ incdir = @includedir@ manext = 1 mandir = @mandir@/man$(manext) + ### End of `configure' section### +### @machine@ will be substituted below ### htmldir = $(libdir)/scsh/doc/scsh-manual/html @@ -41,8 +43,11 @@ htmldir = $(libdir)/scsh/doc/scsh-manual/html # Ultrix # LDFLAGS = -N +.SUFFIXES: +.SUFFIXES: .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 # out of the CVS repository. @@ -101,7 +106,7 @@ START_LINKER = echo ',batch' && echo ',bench on' # Targets: IMAGE = scheme48.image -INITIAL = build/initial.image +INITIAL = $(srcdir)/build/initial.image VM = scshvm #scsh-lib @@ -117,7 +122,7 @@ SCSHOBJS = \ scsh/fdports1.o \ scsh/flock1.o \ scsh/signals1.o \ - scsh/machine/libansi.o \ + scsh/@machine@/libansi.o \ scsh/network1.o \ scsh/putenv.o \ scsh/rx/regexp1.o \ @@ -226,13 +231,13 @@ scsh/sighandlers1.o: scsh/sighandlers1.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) -#.include "$(srcdir)/scsh/machine/Makefile.inc" +#.include "$(srcdir)/scsh/@machine@/Makefile.inc" $(VM): c/main.o $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS) 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) && \ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/main.o $(OBJS) $(UNIX_OBJS) \ /tmp/s48_external_$$$$.c \ @@ -251,7 +256,7 @@ $(LIBSCSHVM): c/smain.o $(OBJS) $(LIBSCSH): $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS) $(RM) $@ \ 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) && \ $(CC) -c $(CFLAGS) -o /tmp/s48_external_$$$$.o \ /tmp/s48_external_$$$$.c && \ @@ -263,12 +268,12 @@ $(LIBSCSH): $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS) c/main.o: c/main.c $(CC) -c $(CFLAGS) -o $@ \ -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 $(CC) -c $(CFLAGS) -o $@ \ -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/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 \ scheme/link-packages.scm scheme/more-packages.scm \ $(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)' ### Fake targets: all clean install man dist @@ -406,7 +411,7 @@ configure: configure.in autoheader && autoconf clean: clean-scsh - -rm -f $(VM) *.o c/*/*.o c/*.o \ + $(RM) $(VM) *.o c/*/*.o c/*.o \ $(IMAGE) \ build/*.tmp $(MANPAGE) build/linker.image \ scheme/debug/*.image scheme/debug/*.debug \ @@ -414,12 +419,17 @@ clean: clean-scsh go $(distname) distclean: clean - rm -f Makefile config.log config.status c/sysdep.h config.cache \ - scsh/machine \ + $(RM) Makefile config.log config.status c/sysdep.h config.cache \ exportlist.aix $(RM) a.exe $(VM).base $(VM).def $(VM).exp -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 ( \ echo ',batch'; \ @@ -470,7 +480,7 @@ DISTFILES = README COPYING INSTALL RELEASE configure config.sub config.guess \ c/sysdep.h.in \ scsh/*.scm scsh/*/*.scm \ scsh/*.[ch] scsh/*/*.[ch] \ - scsh/*.scm.in scsh/*/Makefile.inc \ + scsh/*.scm.in \ doc/scsh.man \ doc/scsh-manual/*.tex doc/scsh-manual/*.sty \ 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 -distname = $(RUNNABLE)-0.`cat build/minor-version-number` +distname = $(RUNNABLE)-0.`cat $(srcdir)/build/minor-version-number` dist: build/initial.image (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 -SCHEME =scsh/awk.scm \ +SCHEME = \ + scsh/awk.scm \ scsh/command-line.scm \ scsh/continuation.scm \ scsh/crypt.scm \ @@ -735,15 +746,15 @@ SCHEME =scsh/awk.scm \ scsh/import-os-error-syscall.scm \ scsh/libscsh.scm \ scsh/low-interrupt.scm \ - scsh/machine/bufpol.scm \ - scsh/machine/errno.scm \ - scsh/machine/fdflags.scm \ - scsh/machine/netconst.scm \ - scsh/machine/packages.scm \ - scsh/machine/signals.scm \ - scsh/machine/time_dep.scm \ - scsh/machine/tty-consts.scm \ - scsh/machine/waitcodes.scm \ + scsh/@machine@/bufpol.scm \ + scsh/@machine@/errno.scm \ + scsh/@machine@/fdflags.scm \ + scsh/@machine@/netconst.scm \ + scsh/@machine@/packages.scm \ + scsh/@machine@/signals.scm \ + scsh/@machine@/time_dep.scm \ + scsh/@machine@/tty-consts.scm \ + scsh/@machine@/waitcodes.scm \ scsh/md5.scm \ scsh/meta-arg.scm \ scsh/network.scm \ @@ -801,10 +812,10 @@ scsh/scsh: scsh/scsh-tramp.c $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) \ -DVM=\"$(LIB)/$(VM)\" \ -DIMAGE=\"$(LIB)/scsh.image\" \ - scsh/scsh-tramp.c + $< -loads = $(srcdir)/scsh/let-opt.scm $(srcdir)/scsh/scsh-interfaces.scm \ - $(srcdir)/scsh/machine/packages.scm \ +loads = $(srcdir)/scsh/let-opt.scm $(srcdir)/scsh/scsh-interfaces.scm \ + $(srcdir)/scsh/@machine@/packages.scm \ $(srcdir)/scsh/rx/packages.scm \ $(srcdir)/scsh/scsh-package.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 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 ",config ,load $(loads)"; \ echo ",open $(opens)"; \ @@ -859,8 +871,10 @@ install-stripped-scsh-image: $(VM) scsh/stripped-scsh.image ) | ./$(VM) -i scsh/stripped-scsh.image clean-scsh: - $(RM) scsh/*.o scsh/rx/*.o scsh/machine/*.o + $(RM) scsh/*.o scsh/rx/*.o scsh/*/*.o $(RM) scsh/*.image $(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 \ No newline at end of file diff --git a/configure.in b/configure.in index e8b9924..64dfacc 100644 --- a/configure.in +++ b/configure.in @@ -88,7 +88,8 @@ AC_DEFUN(SCSH_ELF, [ dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- AC_DEFUN(SCSH_SIG_NRS, [ 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_2, `./scsh_aux 2`, [scsh interrupt for signal 2]) 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 ## CX/UX m88k-harris-cxux* ) - dir=cxux + machine=cxux CC="cc -Xa" CFLAGS="-O" LDFLAGS="-O -Wl,-Bexport" @@ -205,7 +206,7 @@ AC_INIT(c/scheme48vm.c) ## DEC Ultrix mips-dec-ultrix* ) - dir=ultrix + machine=ultrix if test ${CC} = cc; then LDFLAGS=-N fi @@ -213,7 +214,7 @@ AC_INIT(c/scheme48vm.c) ## HP 9000 series 700 and 800, running HP/UX hppa*-hp-hpux* ) - dir=hpux + machine=hpux LDFLAGS="-Wl,-E" if test ${CC} = cc; then CFLAGS="-Ae -O +Obb1800" @@ -225,7 +226,7 @@ AC_INIT(c/scheme48vm.c) ## IBM AIX rs6000-ibm-aix*|powerpc-ibm-aix* ) - dir=aix + machine=aix LDFLAGS="-O" if test ${CC} = gcc; then LDFLAGS_AIX="-Xlinker -bexport:exportlist.aix" @@ -238,7 +239,7 @@ AC_INIT(c/scheme48vm.c) ## Linux *-*-linux* ) - dir=linux + machine=linux # gross, but needed for some older a.out systems for 0.4.x LIBS=-lc SCSH_ELF @@ -246,52 +247,52 @@ AC_INIT(c/scheme48vm.c) ## NetBSD and FreeBSD ( and maybe 386BSD also) *-*-*bsd*|*-*-darwin* ) - dir=bsd + machine=bsd SCSH_ELF ;; ## NeXT *-next-* ) - dir=next + machine=next CC="$CC -posix" AC_DEFINE(HAVE_SIGACTION) ;; ## SGI IRIX mips-sgi-irix* ) - dir=irix + machine=irix S48_CFLAG_CKR INSTALL='$(srcdir)/install-sh' ;; ## SunOS sparc*-sun-sunos* ) - dir=sunos + machine=sunos ;; ## Solaris - Sparc and i386 *-*-solaris* ) - dir=solaris + machine=solaris AC_DEFINE(HAVE_NLIST) ;; ## NT - cygwin32 *-*-cygwin* ) AC_DEFINE(CYGWIN, 1, [Define to 1 on cygwin]) - dir=cygwin32 + machine=cygwin32 EXEEXT=".exe" ;; ## Generic Configuration * ) - dir=generic + machine=generic echo "WARNING: " echo "WARNING: Using generic configuration." echo "WARNING: See doc/porting.txt for more information." echo "WARNING: " ;; 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(dl, main) @@ -367,14 +368,14 @@ fail AC_SUBST(CFLAGS) AC_SUBST(CFLAGS1) AC_SUBST(EXEEXT) - AC_SUBST(ENDIAN) + AC_SUBST(ENDIAN) #does currently not occur AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS_AIX) AC_SUBST(LIBS) AC_SUBST(TMPDIR) - + AC_SUBST(machine) -AC_CONFIG_FILES(Makefile scsh/endian.scm scsh-config) +AC_CONFIG_FILES(Makefile scsh-config) AC_CONFIG_COMMANDS([scsh-config+x],[chmod +x scsh-config]) AC_OUTPUT