Skip to content

Commit

Permalink
- added custom install options. workarea creates an empty config.h,
Browse files Browse the repository at this point in the history
  and configure creates a config.h that sets the default scheme heap
  path and scheme-script name based on the actual configuration.
    configure, newrelease, workarea, checkin,
    c/Mf-base, scheme.c, main.c,
    Mf-install.in
- renamed the installed example directory from lib to examples.
    Mf-install.in,
    scheme.1.in
- added force option to gzip during man page install to prevent gzip from
  asking for permission to overwrite existing man page files.
    Mf-install.in
- removed ~/lib/csv%v/%m from the default scheme heap path on unix-like
  systems.  documented inclusion of %x\..\..\boot\%m in the Windows
  default scheme heap path.
    main.c,
    use.stex
- added new configuration options: --installbin, --installlib,
  --installschemename, --installpetitename, and --installscriptname.
    configure
- updated the example library link to the nanopass framework.
    CONTRIBUTING.md
- now cleaning up petite.1 and scheme.1 left behind by make install
    Makefile-workarea.in, checkin
- now removing workarea after cleaning csug and release_notes so
  Mf-stex (included from csug/Makefile and release_notes/Makefile)
  doesn't complain trying to determine the machine type.
    Makefile.in
- added installsh support for --ifdiff so the csug make file can use it
  for the install target.
    installsh,
    csug/Makefile
- added instructions for building (cross-compiling) a boot file for
  a supported machine type for which a boot file is not built by default.
    BUILDING
  • Loading branch information
Andy Keep committed May 6, 2016
1 parent 40c1541 commit df4194c
Show file tree
Hide file tree
Showing 18 changed files with 194 additions and 141 deletions.
9 changes: 9 additions & 0 deletions BUILDING
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ The make file supports several targets:
boot and header files can be committed as well. 'make bootfiles'
can take 5 minutes or more.

'make bootfiles' builds boot files for each machine type for which
a subdirectory exists in the top-level boot directory. to build
for a supported machine type that isn't built by default, simply
add the appropriate subdirectory, i.e., 'mkdir boot/$M', where M
is the machine type, before running 'make bootfiles'. You can
also run '(cd $W ; make -f Mf-boot $M.boot)', where W is the name
of a built work area for the host machine type, to build just the
boot files for machine-type M.

'make clean'
removes binaries from the workarea.

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ Please keep in mind the following guidance when preparing contributions:
of their own. If you are contributing a significant extension built
using Chez Scheme, consider whether your contribution is such an
independent project. An example of such a project is the [Nanopass
Framework](http://github.com/akeep/nanopass-framework) which is
both used by Chez Scheme and was initially written using Chez Scheme,
but evolves separately.
Framework](http://github.com/nanopass/nanopass-framework-scheme)
which is both used by Chez Scheme and was initially written using
Chez Scheme, but evolves separately.

Before investing significant effort preparing a contribution,
consider running the idea by one of the committers for additional
Expand Down
37 changes: 35 additions & 2 deletions LOG
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,38 @@
configure, makefiles/Makefile.in,
csug/Makefile, copyright.stex, csug.stex,
release_notes/Makefile
- added custom install options.
configure newrelease scheme.c heappath.h.in
- added custom install options. workarea creates an empty config.h,
and configure creates a config.h that sets the default scheme heap
path and scheme-script name based on the actual configuration.
configure, newrelease, workarea, checkin,
c/Mf-base, scheme.c, main.c,
Mf-install.in
- renamed the installed example directory from lib to examples.
Mf-install.in,
scheme.1.in
- added force option to gzip during man page install to prevent gzip from
asking for permission to overwrite existing man page files.
Mf-install.in
- removed ~/lib/csv%v/%m from the default scheme heap path on unix-like
systems. documented inclusion of %x\..\..\boot\%m in the Windows
default scheme heap path.
main.c,
use.stex
- added new configuration options: --installbin, --installlib,
--installschemename, --installpetitename, and --installscriptname.
configure
- updated the example library link to the nanopass framework.
CONTRIBUTING.md
- now cleaning up petite.1 and scheme.1 left behind by make install
Makefile-workarea.in, checkin
- now removing workarea after cleaning csug and release_notes so
Mf-stex (included from csug/Makefile and release_notes/Makefile)
doesn't complain trying to determine the machine type.
Makefile.in
- added installsh support for --ifdiff so the csug make file can use it
for the install target.
installsh,
csug/Makefile
- added instructions for building (cross-compiling) a boot file for
a supported machine type for which a boot file is not built by default.
BUILDING
3 changes: 2 additions & 1 deletion c/Mf-base
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ kernelsrc=statics.c segment.c alloc.c symbol.c intern.c gcwrapper.c gc-ocd.c gc-

kernelobj=${kernelsrc:%.c=%.$o} ${mdobj}

kernelhdr=system.h types.h version.h globals.h externs.h segment.h gc.c sort.h thread.h itest.c
kernelhdr=system.h types.h version.h globals.h externs.h segment.h gc.c sort.h thread.h config.h itest.c

mainsrc=main.c

Expand All @@ -44,6 +44,7 @@ rootsrc=$(shell cd ../../c; echo *)
${rootsrc}: ; ln -s ../../c/$@ $@

scheme.o: itest.c
scheme.o main.o: config.h
${kernelobj}: system.h types.h version.h externs.h globals.h segment.h thread.h sort.h
${kernelobj}: ${Include}/equates.h ${Include}/scheme.h
${mainobj}: ${Include}/scheme.h
Expand Down
32 changes: 0 additions & 32 deletions c/heappath.h.in

This file was deleted.

7 changes: 6 additions & 1 deletion c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <string.h>
#include <stdio.h>
#include "scheme.h"
#include "config.h"

/****
CUSTOM_INIT may be defined as a function with the signature shown to
Expand All @@ -45,6 +46,10 @@
#define ABNORMAL_EXIT ((void (*)(void))0)
#endif /* ABNORMAL_EXIT */

#ifndef SCHEME_SCRIPT
#define SCHEME_SCRIPT "scheme-script"
#endif

static const char *path_last(const char *p) {
const char *s;
#ifdef WIN32
Expand Down Expand Up @@ -92,7 +97,7 @@ int main(int argc, const char *argv[]) {

Sscheme_init(ABNORMAL_EXIT);

if (strcmp(path_last(execpath), "scheme-script") == 0) {
if (strcmp(path_last(execpath), SCHEME_SCRIPT) == 0) {
if (argc < 2) {
(void) fprintf(stderr,"%s requires program-path argument\n", execpath);
exit(1);
Expand Down
25 changes: 14 additions & 11 deletions c/scheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include "system.h"
#include "config.h"
#include <setjmp.h>
#include <limits.h>
#ifdef WIN32
Expand Down Expand Up @@ -403,29 +404,31 @@ static const char *path_last(p) const char *p; {
return p;
}

#include "heappath.h"
#define SEARCHPATHMAXSIZE 8192
#ifdef WIN32
#ifndef DEFAULT_HEAP_PATH
/* by default, look in executable directory or in parallel boot directory */
#define DEFAULT_HEAP_PATH "%x;%x\\..\\..\\boot\\%m"
#endif
#define SEARCHPATHSEP ';'

static char *get_defaultheapdirs() {
char *result;
static char defaultheapdirs[SEARCHPATHMAXSIZE];
char key[PATH_MAX];
snprintf(key, PATH_MAX, "HKEY_LOCAL_MACHINE\\Software\\Chez Scheme\\csv%s\\HeapSearchPath", VERSION);
result = S_GetRegistry(defaultheapdirs, SEARCHPATHMAXSIZE, key);
if (result == NULL) result = defaultsystemheappath;
if (result == NULL) result = DEFAULT_HEAP_PATH;
return result;
}
#else /* not WIN32: */
#define SEARCHPATHSEP ':'
#ifndef DEFAULT_HEAP_PATH
#define DEFAULT_HEAP_PATH "/usr/lib/csv%v/%m:/usr/local/lib/csv%v/%m"
#endif

static char *get_defaultheapdirs() {
static char defaultheapdirs[SEARCHPATHMAXSIZE];
const char *home;

if ((home = S_homedir()) != NULL &&
(snprintf(defaultheapdirs, SEARCHPATHMAXSIZE, "%s/lib/csv%%v/%%m:%s",
home, defaultsystemheappath) < SEARCHPATHMAXSIZE))
return defaultheapdirs;
else
return defaultsystemheappath;
return DEFAULT_HEAP_PATH;
}
#endif /* WIN32 */

Expand Down
5 changes: 3 additions & 2 deletions checkin
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ echo '*** running "make clean" in source directories ***'
foreach x ($sdirs)
switch ($x)
case .:
(cd $W; /bin/rm -f petite.1 scheme.1)
(cd $W; /bin/rm -f Make.out)
case unicode:
case unicode/UNIDATA:
Expand Down Expand Up @@ -121,7 +122,7 @@ end

set sfiles = ()
foreach x ($tmpsfiles)
if ("$x" == "./Makefile" || "$x" == "./Mf-install" || "$x" == "./Mf-boot") then
if ("$x" == "./Makefile" || "$x" == "./Mf-install" || "$x" == "./Mf-boot" || "$x" == "c/config.h") then
set ignorefiles = ($ignorefiles $x)
else
cmp $W/$x $x >& /dev/null
Expand Down Expand Up @@ -190,7 +191,7 @@ set RESPONSE = ""
while ("$RESPONSE" != "y")
echo -n "proceed with check in? (y/n): "
set RESPONSE = $<
if ("$RESPONSE" == "n") goto error
if ("$RESPONSE" == "n") exit 0
end

set oldsfiles = ()
Expand Down
Loading

0 comments on commit df4194c

Please sign in to comment.