Skip to content

Commit

Permalink
Replace gsc-boot.c by shell scripts to avoid problems when cross-comp…
Browse files Browse the repository at this point in the history
…iling.
  • Loading branch information
feeley committed May 8, 2012
1 parent a32b3ab commit fbb1e78
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 30 deletions.
17 changes: 17 additions & 0 deletions gsc-boot.bat.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off

rem Copyright (c) 2012 by Marc Feeley, All Rights Reserved.

rem Due to the meta-circular nature of the system, an executable
rem version of the Gambit compiler (gsc-boot) is necessary to compile
rem the .scm source files that are part of the Gambit runtime library
rem into .c files. The Gambit git repository contains precompiled
rem versions of these files. When Gambit is initially built, it is
rem necessary to avoid generating these .c files (since an executable
rem Gambit compiler is not yet available to generate them). This
rem circular dependence is resolved by using a dummy gsc-boot script
rem which does not touch the .c files obtained from the repository.

rem echo "***DUMMY*** compilation (this is normal when bootstrapping)"

exit 0
24 changes: 0 additions & 24 deletions gsc-boot.c

This file was deleted.

17 changes: 17 additions & 0 deletions gsc-boot.unix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /bin/sh

# Copyright (c) 2012 by Marc Feeley, All Rights Reserved.

# Due to the meta-circular nature of the system, an executable
# version of the Gambit compiler (gsc-boot) is necessary to compile
# the .scm source files that are part of the Gambit runtime library
# into .c files. The Gambit git repository contains precompiled
# versions of these files. When Gambit is initially built, it is
# necessary to avoid generating these .c files (since an executable
# Gambit compiler is not yet available to generate them). This
# circular dependence is resolved by using a dummy gsc-boot script
# which does not touch the .c files obtained from the repository.

# echo "***DUMMY*** compilation (this is normal when bootstrapping)"

exit 0
3 changes: 2 additions & 1 deletion gsc/makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ $(MODULES_O): $(srcdirpfx)$(rootfromhere)/include/gambit.h
bootstrap-pre:

bootstrap-post:
cp $(LIBRARY) $(rootfromhere)/$(LIBRARY)
rm -f $(rootfromhere)/gsc-boot@bat@
cp $(EXECUTABLE) $(rootfromhere)/gsc-boot@exe@
cp $(LIBRARY) $(rootfromhere)/$(LIBRARY)

install-pre:

Expand Down
4 changes: 2 additions & 2 deletions include/stamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
* Time stamp of last source code repository commit.
*/

#define ___STAMP_YMD 20120429
#define ___STAMP_HMS 14027
#define ___STAMP_YMD 20120508
#define ___STAMP_HMS 130234
12 changes: 9 additions & 3 deletions makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ SUBDIRS = include lib gsi gsc bin misc doc tests examples contrib prebuilt

RCFILES = README INSTALL.txt LICENSE-2.0.txt LGPL.txt \
makefile.in configure configure.ac config.guess config.sub install-sh mkidirs \
relpath gsc-boot.c
relpath gsc-boot.unix gsc-boot.bat.windows

GITRCFILES = .gitignore .gitattributes
HGRCFILES = .hgignore .hgtags
Expand All @@ -99,8 +99,14 @@ all-pre: gsc-boot@exe@

all-post:

gsc-boot@exe@: gsc-boot.c
@C_COMPILER@ -o gsc-boot@exe@ gsc-boot.c
gsc-boot@exe@:
rm -f gsc-boot@bat@
if test "@bat@" = ""; then \
cp gsc-boot.unix gsc-boot@bat@; \
chmod +x gsc-boot@bat@; \
else \
cp gsc-boot.bat.windows gsc-boot@bat@; \
fi

fake_target:

Expand Down

0 comments on commit fbb1e78

Please sign in to comment.