diff --git a/BUILDING b/BUILDING index 89b1b40224..1a7b85ddc2 100644 --- a/BUILDING +++ b/BUILDING @@ -40,8 +40,8 @@ Prerequisites: * GNU Make * gcc -* Header files and libraries for ncurses -* Header files and libraries for X windows +* Header files and libraries for ncurses [unless --disable-curses] +* Header files and libraries for X windows [unless --disable-x11] * Header files and libraries for uuid Uninstalling on Unix-like systems is as simple as running: @@ -75,7 +75,7 @@ That's why the boot and header files are packaged with the sources. if successful, creates several files and directories: * The directory nanopass containing the Nanopass Infrastructure, - retrieved from github. + retrieved from GitHub. * A make file, Makefile, in the root (top level) directory. @@ -117,9 +117,18 @@ The make file supports several targets: Set SCHEMEHEAPDIRS to /usr/lib/csv%v/%m:/usr/local/lib/csv%v/%m on Unix-like systems and to %x/../../boot/%m on Windows systems. - To run Chez Scheme without installing, you need to tell the executable - where to find the boot files. This can be done via command-line - arguments, e.g.: + Alternatively, if you have a build before the changes at full path + , use + + make from-orig ORIG= + + To run Chez Scheme without installing, you need to tell the + executable where to find the boot files. The run target of the + makefile will do that + + make run + + or this can be done manually via command-line arguments, e.g.: $W/bin/$M/scheme -b $W/boot/$M/petite.boot -b $W/boot/$M/scheme.boot @@ -194,15 +203,41 @@ The make file supports several targets: 'make distclean' removes nanopass, Makefile, and all workareas. +OTHER UNIX VARIANTS + +To build on Unix variants other than Linux and OS X, you will first +need to build boot files on a Linux or OS X machine. On that machine, +after building Chez Scheme, create boot files for the target machine + with: + + make boot XM= + +Copy the generated boot/ directory to the target machine, +adding to or replacing the boot directory with pre-built boot files +there, and then build as on Linux. + +Remember to use gmake if make is not GNU make. If you run into linker +trouble, try running configure with --libkernel so that the build +avoids running ld directly. + +On OpenBSD, Chez Scheme must be built and installed on a filesystem +that is mounted with wxneeded. + +On NetNSD, note that the makefiles run "paxctl +m" to enable WX pages +(i.e., pages that have both write and execute enabled). + WINDOWS Building Chez Scheme under 64-bit Windows with Bash/WSL, MinGW/MSYS, or Cygwin follows the instructions above, except that 'make install' -and 'make uninstall' are not supported. On Bash/WSL, the build -directory must be in a location with a Windows path such as /mnt/c, -and the 'OS' environment variable must be set to 'Windows_NT' to -indicate a build for Windows, as opposed to a build for Linux on -Windows: +and 'make uninstall' are not supported. Alternatively, the main Chez +Scheme executable can be built from the Windows command line or +cross-compiled using MinGW as described further below. + +On Bash/WSL, the build directory must be in a location with a Windows +path such as /mnt/c, and the 'OS' environment variable must be set to +'Windows_NT' to indicate a build for Windows, as opposed to a build +for Linux on Windows: env OS=Windows_NT ./configure env OS=Windows_NT make @@ -267,3 +302,37 @@ the Cygwin values are incompatible with the Microsoft C Runtime Library. Use 'make test' described above to run the tests. + +WINDOWS EXECUTABLE VIA COMMAND PROMPT + +To build the Chez Scheme executable using Microsoft Visual Studio, +first set up command-line tools. The c\vs.bat script can help if you +supply amd64 for a 64-bit build or x86 for a 32-bit build: + + c\vs.bat amd64 + +Then, run c\build/bat with a machine name, either ta6nt (64-bit +threaded), a6nt (64-bit non-threaded), ti3nt (32-bit threaded), or +i3nt (32-bit non-threaded): + + c\build.bat ta6nt + +The resulting executable in \bin\ relies on +bootfiles in ..\boot\ relative to the executable. + +CROSS-COMPILING THE WINDOWS EXECUTABLE + +To cross-compile the main Chez Scheme executable for Windows using +MinGW, specify suitable build tools to configure, perhaps using +--toolprefix= like this: + + ./configure -m=ta6nt --threads --toolprefix=x86_64-w64-mingw32- + +Then, make with c/Mf- while supplying cross=t and o=o, +possibly like this: + + (cd ta6nt/c && make -f Mf-ta6nt cross=t o=o) + +The executable is written to /bin/, and it should be +installed with bootfiles in ../boot// relative to the +executable. diff --git a/LOG b/LOG index 06c145bd21..6ee67a06d7 100644 --- a/LOG +++ b/LOG @@ -1419,3 +1419,10 @@ BUILDING, c/vs.bat, wininstall/locate-vcredist.bat - fixed open-string-input-port on immutable strings cpnanopass.ss, io.ms, release_notes.stex +- restore {Free,Open,Net}BSD build, support Windows cross-compile + via MinGW, add configuration options, and add helper makefile targets + expenditor.c, thread.c, stats.c, statics.c, scheme.c, main.c, types.h, + externs.h, globals.h, nocurses.h, version.h, system.h, segment.h, + a6ob.def, ta6ob.def, a6nb.def, ta6nb.def, i3nt.def, ti3nt.def, + c/Mf-*, build.bat, makefiles/Makefile.in, makefiles/Mf-install.in, + misc.ms, s/update-revision, BUILDING diff --git a/c/Mf-a6fb b/c/Mf-a6fb index 9285819c52..43bf5900ba 100644 --- a/c/Mf-a6fb +++ b/c/Mf-a6fb @@ -17,7 +17,7 @@ m = a6fb Cpu = X86_64 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) +mdclib = -L/usr/local/lib -liconv -lm ${ncursesLib} -lossp-uuid C = ${CC} ${CPPFLAGS} -Wpointer-arith -Wextra -Werror -O ${CFLAGS} o = o mdsrc = i3le.c @@ -31,14 +31,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-a6le b/c/Mf-a6le index c42ed5f9b2..1564cce947 100644 --- a/c/Mf-a6le +++ b/c/Mf-a6le @@ -16,7 +16,7 @@ m = a6le Cpu = X86_64 -mdclib = -lm -ldl $(LIBNCURSES) -lrt -luuid +mdclib = -lm -ldl ${ncursesLib} -lrt -luuid C = ${CC} ${CPPFLAGS} -m64 -msse2 -Wpointer-arith -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -melf_x86_64 -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -melf_x86_64 -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-a6nb b/c/Mf-a6nb index dce0e58c48..42b5483d60 100644 --- a/c/Mf-a6nb +++ b/c/Mf-a6nb @@ -31,14 +31,15 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} + paxctl +m ${Scheme} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-a6nt b/c/Mf-a6nt index a38cc91f58..3e96e0e64a 100644 --- a/c/Mf-a6nt +++ b/c/Mf-a6nt @@ -21,10 +21,11 @@ o = obj mdobj=windows.$o mdsrc=windows.c Makefile.$m cs.ico scheme.rc make.bat mdclean=vs.bat make.bat scheme.res ../bin/$m/*.exp mtscheme.exe* mdscheme.exe* +cross=f include Mf-base -${Scheme}: make.bat +${Scheme}${cross:f=}: make.bat cmd.exe /c make.bat cp ../bin/$m/scheme.exe ../bin/$m/petite.exe cp ../bin/$m/scheme.pdb ../bin/$m/petite.pdb @@ -34,3 +35,28 @@ make.bat: vs.bat echo 'set MAKEFLAGS=' >> $@ echo 'vs.bat amd64 && nmake /f Makefile.$m /nologo %*' >> $@ chmod +x $@ + +# ------------------------------------------------------- +# For cross-compilation, triggered by setting cross=t o=o + +C = ${CC} ${CPPFLAGS} -O2 ${CFLAGS} + +${Scheme}${cross:t=}: ${Main} ${Kernel} ${KernelLinkDeps} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} -lshell32 -luser32 -lole32 -lrpcrt4 -luuid + +.c.$o: + $C -c -D${Cpu} -I${Include} ${zlibInc} ${LZ4Inc} $*.c + +${KernelLib}: ${kernelobj} + ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} + +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} + +../zlib/configure.log: + echo "all:" >> ../zlib/Makefile + echo '\t$$(MAKE) -f win32/Makefile.gcc CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" RC="$(WINDRES)"' >> ../zlib/Makefile + touch ../zlib/configure.log + +../lz4/lib/liblz4.a: ${LZ4Sources} + (cd ../lz4/lib; CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" ${MAKE} liblz4.a) diff --git a/c/Mf-a6ob b/c/Mf-a6ob index bc1990f2ac..fe117c67f1 100644 --- a/c/Mf-a6ob +++ b/c/Mf-a6ob @@ -17,7 +17,7 @@ m = a6ob Cpu = X86_64 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) +mdclib = -L/usr/local/lib -liconv -lm ${ncursesLib} -lossp-uuid C = ${CC} ${CPPFLAGS} -Wpointer-arith -Werror -O ${CFLAGS} o = o mdsrc = i3le.c @@ -31,14 +31,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -Wl,--export-dynamic -Wl,-zwxneeded -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -Wl,--export-dynamic -Wl,-zwxneeded -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-a6osx b/c/Mf-a6osx index 439d817d89..1977f3cf28 100644 --- a/c/Mf-a6osx +++ b/c/Mf-a6osx @@ -16,7 +16,7 @@ m = a6osx Cpu = X86_64 -mdclib = -liconv -lm $(LIBNCURSES) +mdclib = -liconv -lm ${ncursesLib} C = ${CC} ${CPPFLAGS} -m64 -Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough -Werror -O2 -I/opt/X11/include/ ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-a6s2 b/c/Mf-a6s2 index 5df9a7b7ac..6a8e403656 100644 --- a/c/Mf-a6s2 +++ b/c/Mf-a6s2 @@ -16,7 +16,7 @@ m = a6s2 Cpu = X86_64 -mdclib = -lnsl -ldl -lm $(LIBCURSES) -lrt +mdclib = -lnsl -ldl -lm ${cursesLib} -lrt C = ${CC} ${CPPFLAGS} -m64 -Wpointer-arith -Wextra -Werror -O ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -melf_x86_64 -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -melf_x86_64 -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-arm32le b/c/Mf-arm32le index 17ab2ad77e..699f49a318 100644 --- a/c/Mf-arm32le +++ b/c/Mf-arm32le @@ -16,7 +16,7 @@ m = arm32le Cpu = ARMV6 -mdclib = -lm -ldl $(LIBNCURSES) -lrt -luuid +mdclib = -lm -ldl ${ncursesLib} -lrt -luuid C = ${CC} ${CPPFLAGS} -Wpointer-arith -Wextra -Werror -Wno-implicit-fallthrough -O2 ${CFLAGS} o = o mdsrc = arm32le.c @@ -30,14 +30,14 @@ mdobj = arm32le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; ./configure) diff --git a/c/Mf-base b/c/Mf-base index ef21fc17e0..afe5fde202 100644 --- a/c/Mf-base +++ b/c/Mf-base @@ -18,11 +18,20 @@ include Mf-config Include=../boot/$m PetiteBoot=../boot/$m/petite.boot SchemeBoot=../boot/$m/scheme.boot -Kernel=../boot/$m/kernel.$o -KernelLib=../boot/$m/libkernel.a Main=../boot/$m/main.$o Scheme=../bin/$m/scheme +# One of these sets is referenced in Mf-config to select between +# linking with kernel.o or libkernel.a + +KernelO=../boot/$m/kernel.$o +KernelOLinkDeps= +KernelOLinkLibs= + +KernelLib=../boot/$m/libkernel.a +KernelLibLinkDeps=${zlibDep} ${LZ4Dep} +KernelLibLinkLibs=${zlibLib} ${LZ4Lib} + kernelsrc=statics.c segment.c alloc.c symbol.c intern.c gcwrapper.c gc-ocd.c gc-oce.c\ number.c schsig.c io.c new-io.c print.c fasl.c vfasl.c stats.c foreign.c prim.c prim5.c flushcache.c\ schlib.c thread.c expeditor.c scheme.c compress-io.c @@ -52,7 +61,7 @@ endif 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 nocurses.h compress-io.h +${kernelobj}: system.h types.h version.h externs.h globals.h segment.h thread.h sort.h compress-io.h nocurses.h ${kernelobj}: ${Include}/equates.h ${Include}/scheme.h ${mainobj}: ${Include}/scheme.h ${kernelobj}: ${zlibHeaderDep} ${LZ4HeaderDep} diff --git a/c/Mf-i3fb b/c/Mf-i3fb index 01552735ce..187e03624f 100644 --- a/c/Mf-i3fb +++ b/c/Mf-i3fb @@ -17,7 +17,7 @@ m = i3fb Cpu = I386 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) +mdclib = -L/usr/local/lib -liconv -lm ${ncursesLib} -lossp-uuid C = ${CC} ${CPPFLAGS} -Wpointer-arith -Wextra -Werror -O ${CFLAGS} o = o mdsrc = i3le.c @@ -31,14 +31,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-i3le b/c/Mf-i3le index ce7d6338e8..1cd31eb623 100644 --- a/c/Mf-i3le +++ b/c/Mf-i3le @@ -16,7 +16,7 @@ m = i3le Cpu = I386 -mdclib = -lm -ldl $(LIBNCURSES) -lrt -luuid +mdclib = -lm -ldl ${ncursesLib} -lrt -luuid C = ${CC} ${CPPFLAGS} -m32 -msse2 -Wpointer-arith -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 -fno-stack-protector ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -melf_i386 -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -melf_i386 -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-i3nb b/c/Mf-i3nb index 814da91bd7..05592cf5eb 100644 --- a/c/Mf-i3nb +++ b/c/Mf-i3nb @@ -31,14 +31,15 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} + paxctl +m ${Scheme} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-i3nt b/c/Mf-i3nt index 9b37d41d47..dee0ff05bb 100644 --- a/c/Mf-i3nt +++ b/c/Mf-i3nt @@ -21,10 +21,11 @@ o = obj mdobj=windows.$o mdsrc=windows.c Makefile.$m cs.ico scheme.rc make.bat mdclean=vs.bat make.bat scheme.res ../bin/$m/*.exp mtscheme.exe* mdscheme.exe* +cross=f include Mf-base -${Scheme}: make.bat +${Scheme}${cross:f=}: make.bat cmd.exe /c make.bat cp ../bin/$m/scheme.exe ../bin/$m/petite.exe cp ../bin/$m/scheme.pdb ../bin/$m/petite.pdb @@ -34,3 +35,28 @@ make.bat: vs.bat echo 'set MAKEFLAGS=' >> $@ echo 'vs.bat x86 && nmake /f Makefile.$m /nologo %*' >> $@ chmod +x $@ + +# ------------------------------------------------------- +# For cross-compilation, triggered by setting cross=t o=o + +C = ${CC} ${CPPFLAGS} -O2 ${CFLAGS} + +${Scheme}${cross:t=}: ${Main} ${Kernel} ${KernelLinkDeps} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} -lshell32 -luser32 -lole32 -lrpcrt4 -luuid + +.c.$o: + $C -c -D${Cpu} -I${Include} ${zlibInc} ${LZ4Inc} $*.c + +${KernelLib}: ${kernelobj} + ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} + +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} + +../zlib/configure.log: + echo "all:" >> ../zlib/Makefile + echo '\t$$(MAKE) -f win32/Makefile.gcc CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" RC="$(WINDRES)"' >> ../zlib/Makefile + touch ../zlib/configure.log + +../lz4/lib/liblz4.a: ${LZ4Sources} + (cd ../lz4/lib; CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" ${MAKE} liblz4.a) diff --git a/c/Mf-i3ob b/c/Mf-i3ob index 0b7ae410fa..a1a6d39112 100644 --- a/c/Mf-i3ob +++ b/c/Mf-i3ob @@ -17,7 +17,7 @@ m = i3ob Cpu = I386 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) -lossp-uuid +mdclib = -L/usr/local/lib -liconv -lm ${ncursesLib} -lossp-uuid C = ${CC} ${CPPFLAGS} -Wpointer-arith -Werror -O ${CFLAGS} o = o mdsrc = i3le.c @@ -31,14 +31,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -Wl,--export-dynamic -Wl,-zwxneeded -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -Wl,--export-dynamic -Wl,-zwxneeded -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-i3osx b/c/Mf-i3osx index df0cab0074..1a4b181d04 100644 --- a/c/Mf-i3osx +++ b/c/Mf-i3osx @@ -16,7 +16,7 @@ m = i3osx Cpu = I386 -mdclib = -liconv -lm $(LIBNCURSES) +mdclib = -liconv -lm ${ncursesLib} C = ${CC} ${CPPFLAGS} -m32 -Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough -Werror -O2 -msse2 -I/opt/X11/include/ ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-i3qnx b/c/Mf-i3qnx index c70d947b6e..7d03738866 100644 --- a/c/Mf-i3qnx +++ b/c/Mf-i3qnx @@ -16,7 +16,7 @@ m = i3qnx Cpu = I386 -mdclib = -lm /usr/local/lib/libiconv.so -lsocket $(LIBNCURSES) +mdclib = -lm /usr/local/lib/libiconv.so -lsocket ${ncursesLib} C = qcc ${CPPFLAGS} -m32 -Wpointer-arith -Wextra -Werror -O2 -N2048K ${CFLAGS} o = o mdsrc = i3le.c @@ -31,14 +31,14 @@ LocalInclude = /usr/local/include include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -mi386nto -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -mi386nto -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -Wl,--export-dynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -Wl,--export-dynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-i3s2 b/c/Mf-i3s2 index dce449fa4f..c0dabc3688 100644 --- a/c/Mf-i3s2 +++ b/c/Mf-i3s2 @@ -16,7 +16,7 @@ m = i3s2 Cpu = I386 -mdclib = -lnsl -ldl -lm $(LIBCURSES) -lrt +mdclib = -lnsl -ldl -lm ${cursesLib} -lrt C = ${CC} ${CFLAGS} -m32 -Wpointer-arith -Wextra -Werror -O ${CPPFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -melf_i386 -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -melf_i386 -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-ppc32le b/c/Mf-ppc32le index 5d5225bcc7..66f8753fe6 100644 --- a/c/Mf-ppc32le +++ b/c/Mf-ppc32le @@ -16,7 +16,7 @@ m = ppc32le Cpu = PPC32 -mdclib = -lm -ldl $(LIBNCURSES) -lrt -luuid +mdclib = -lm -ldl ${ncursesLib} -lrt -luuid C = ${CC} ${CPPFLAGS} -m32 -Wpointer-arith -Wextra -Werror -Wno-implicit-fallthrough -O2 ${CFLAGS} o = o mdsrc = ppc32.c @@ -30,14 +30,14 @@ mdobj = ppc32.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-ta6fb b/c/Mf-ta6fb index 45d3d7325d..6b362e9674 100644 --- a/c/Mf-ta6fb +++ b/c/Mf-ta6fb @@ -17,7 +17,7 @@ m = ta6fb Cpu = X86_64 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) -lpthread -lossp-uuid +mdclib = -L/usr/local/lib -liconv -lm ${ncursesLib} -lpthread -lossp-uuid C = ${CC} ${CPPFLAGS} -Wpointer-arith -Wextra -Werror -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c @@ -31,14 +31,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-ta6le b/c/Mf-ta6le index d03159263b..6adb83fb48 100644 --- a/c/Mf-ta6le +++ b/c/Mf-ta6le @@ -16,7 +16,7 @@ m = ta6le Cpu = X86_64 -mdclib = -lm -ldl $(LIBNCURSES) -lpthread -lrt -luuid +mdclib = -lm -ldl ${ncursesLib} -lpthread -lrt -luuid C = ${CC} ${CPPFLAGS} -m64 -msse2 -Wpointer-arith -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -melf_x86_64 -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -melf_x86_64 -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-ta6nb b/c/Mf-ta6nb index a35431a2a5..6133398e03 100644 --- a/c/Mf-ta6nb +++ b/c/Mf-ta6nb @@ -31,14 +31,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} paxctl +m ${Scheme} ../zlib/configure.log: diff --git a/c/Mf-ta6nt b/c/Mf-ta6nt index 5214bb778c..1c9e689884 100644 --- a/c/Mf-ta6nt +++ b/c/Mf-ta6nt @@ -36,13 +36,13 @@ make.bat: vs.bat echo 'vs.bat amd64 && nmake /f Makefile.$m /nologo %*' >> $@ chmod +x $@ -# -------------------------------------------------- -# For cross-compilation, triggered by setting cross=t +# ------------------------------------------------------- +# For cross-compilation, triggered by setting cross=t o=o C = ${CC} ${CPPFLAGS} -O2 ${CFLAGS} -${Scheme}${cross:t=}: ${Main} ${KernelLib} ${zlibDep} ${LZ4Dep} - $C -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} -lshell32 -luser32 -lole32 -lrpcrt4 -luuid +${Scheme}${cross:t=}: ${Main} ${Kernel} ${KernelLinkDeps} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} -lshell32 -luser32 -lole32 -lrpcrt4 -luuid .c.$o: $C -c -D${Cpu} -I${Include} ${zlibInc} ${LZ4Inc} $*.c @@ -50,8 +50,8 @@ ${Scheme}${cross:t=}: ${Main} ${KernelLib} ${zlibDep} ${LZ4Dep} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ../zlib/configure.log: echo "all:" >> ../zlib/Makefile diff --git a/c/Mf-ta6ob b/c/Mf-ta6ob index 6e68be7a16..74857da7f8 100644 --- a/c/Mf-ta6ob +++ b/c/Mf-ta6ob @@ -17,7 +17,7 @@ m = ta6ob Cpu = X86_64 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) -lpthread -lossp-uuid +mdclib = -L/usr/local/lib -liconv -lm ${ncursesLib} -lpthread -lossp-uuid C = ${CC} ${CPPFLAGS} -Wpointer-arith -Werror -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c @@ -31,14 +31,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -Wl,--export-dynamic -Wl,-zwxneeded -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -Wl,--export-dynamic -Wl,-zwxneeded -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-ta6osx b/c/Mf-ta6osx index ecdf2d3b46..10335a8673 100644 --- a/c/Mf-ta6osx +++ b/c/Mf-ta6osx @@ -16,7 +16,7 @@ m = ta6osx Cpu = X86_64 -mdclib = -liconv -lm $(LIBNCURSES) +mdclib = -liconv -lm ${ncursesLib} C = ${CC} ${CPPFLAGS} -m64 -Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough -Werror -O2 -I/opt/X11/include/ ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-ta6s2 b/c/Mf-ta6s2 index b51cfb5cb9..dbe035fe3f 100644 --- a/c/Mf-ta6s2 +++ b/c/Mf-ta6s2 @@ -16,7 +16,7 @@ m = ta6s2 Cpu = X86_64 -mdclib = -lnsl -ldl -lm -lpthread $(LIBCURSES) -lrt +mdclib = -lnsl -ldl -lm -lpthread ${cursesLib} -lrt C = ${CC} ${CPPFLAGS} -m64 -Wpointer-arith -Wextra -Werror -O2 -D_REENTRANT ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -melf_x86_64 -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -melf_x86_64 -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m64" ./configure --64) diff --git a/c/Mf-ti3fb b/c/Mf-ti3fb index 0afefd6c1f..bb4d8125bb 100644 --- a/c/Mf-ti3fb +++ b/c/Mf-ti3fb @@ -17,7 +17,7 @@ m = ti3fb Cpu = I386 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) -lpthread -lossp-uuid +mdclib = -L/usr/local/lib -liconv -lm ${ncursesLib} -lpthread -lossp-uuid C = ${CC} ${CPPFLAGS} -Wpointer-arith -Wextra -Werror -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c @@ -31,14 +31,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-ti3le b/c/Mf-ti3le index 92bda36a01..f923dc25e2 100644 --- a/c/Mf-ti3le +++ b/c/Mf-ti3le @@ -16,7 +16,7 @@ m = ti3le Cpu = I386 -mdclib = -lm -ldl $(LIBNCURSES) -lpthread -lrt -luuid +mdclib = -lm -ldl ${ncursesLib} -lpthread -lrt -luuid C = ${CC} ${CPPFLAGS} -m32 -msse2 -Wpointer-arith -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -melf_i386 -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -melf_i386 -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-ti3nb b/c/Mf-ti3nb index ee6202ef93..db753ac7dc 100644 --- a/c/Mf-ti3nb +++ b/c/Mf-ti3nb @@ -31,14 +31,15 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -m elf_i386 -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -m elf_i386 -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} + paxctl +m ${Scheme} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-ti3nt b/c/Mf-ti3nt index 96bea72efd..030a3d0338 100644 --- a/c/Mf-ti3nt +++ b/c/Mf-ti3nt @@ -36,13 +36,13 @@ make.bat: vs.bat echo 'vs.bat x86 && nmake /f Makefile.$m /nologo %*' >> $@ chmod +x $@ -# -------------------------------------------------- -# For cross-compilation, triggered by setting cross=t +# ------------------------------------------------------- +# For cross-compilation, triggered by setting cross=t o=o -C = ${CC} ${CPPFLAGS} -O2 ${CFLAGS} +C = ${CC} ${CPPFLAGS} -O2 ${CFLAGS} -D__MINGW_USE_VC2005_COMPAT -${Scheme}${cross:t=}: ${Main} ${KernelLib} ${zlibDep} ${LZ4Dep} - $C -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} -lshell32 -luser32 -lole32 -lrpcrt4 -luuid +${Scheme}${cross:t=}: ${Main} ${Kernel} ${KernelLinkDeps} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} -lshell32 -luser32 -lole32 -lrpcrt4 -luuid .c.$o: $C -c -D${Cpu} -I${Include} ${zlibInc} ${LZ4Inc} $*.c @@ -50,8 +50,8 @@ ${Scheme}${cross:t=}: ${Main} ${KernelLib} ${zlibDep} ${LZ4Dep} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ../zlib/configure.log: echo "all:" >> ../zlib/Makefile diff --git a/c/Mf-ti3ob b/c/Mf-ti3ob index 3c7a7e6829..381ebca0cf 100644 --- a/c/Mf-ti3ob +++ b/c/Mf-ti3ob @@ -17,7 +17,7 @@ m = ti3ob Cpu = I386 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) -lpthread -lossp-uuid +mdclib = -L/usr/local/lib -liconv -lm ${ncursesLib} -lpthread -lossp-uuid C = ${CC} ${CPPFLAGS} -Wpointer-arith -Werror -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c @@ -31,14 +31,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -Wl,--export-dynamic -Wl,-zwxneeded -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -Wl,--export-dynamic -Wl,-zwxneeded -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-ti3osx b/c/Mf-ti3osx index 90d41973b3..1421c07f93 100644 --- a/c/Mf-ti3osx +++ b/c/Mf-ti3osx @@ -16,7 +16,7 @@ m = ti3osx Cpu = I386 -mdclib = -liconv -lm $(LIBNCURSES) +mdclib = -liconv -lm ${ncursesLib} C = ${CC} ${CPPFLAGS} -m32 -Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough -Werror -O2 -msse2 -I/opt/X11/include/ ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-ti3s2 b/c/Mf-ti3s2 index d4fc1e1660..a8fd5da99f 100644 --- a/c/Mf-ti3s2 +++ b/c/Mf-ti3s2 @@ -16,7 +16,7 @@ m = ti3s2 Cpu = I386 -mdclib = -lnsl -ldl -lm -lpthread $(LIBCURSES) -lrt +mdclib = -lnsl -ldl -lm -lpthread ${cursesLib} -lrt C = ${CC} ${CPPFLAGS} -m32 -Wpointer-arith -Wextra -Werror -O2 -D_REENTRANT ${CFLAGS} o = o mdsrc = i3le.c @@ -30,14 +30,14 @@ mdobj = i3le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -melf_i386 -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -melf_i386 -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/Mf-tppc32le b/c/Mf-tppc32le index 5526a27073..486b8524f7 100644 --- a/c/Mf-tppc32le +++ b/c/Mf-tppc32le @@ -16,7 +16,7 @@ m = tppc32le Cpu = PPC32 -mdclib = -lm -ldl $(LIBNCURSES) -lpthread -lrt -luuid +mdclib = -lm -ldl ${ncursesLib} -lpthread -lrt -luuid C = ${CC} ${CPPFLAGS} -m32 -Wpointer-arith -Wextra -Werror -Wno-implicit-fallthrough -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = ppc32le.c @@ -30,14 +30,14 @@ mdobj = ppc32le.o include Mf-base -${Kernel}: ${kernelobj} ${zlibDep} ${LZ4Dep} - ${LD} -r -X -o ${Kernel} ${kernelobj} ${zlibLib} ${LZ4Lib} +${KernelO}: ${kernelobj} ${zlibDep} ${LZ4Dep} + ${LD} -r -X -o ${KernelO} ${kernelobj} ${zlibLib} ${LZ4Lib} ${KernelLib}: ${kernelobj} ${AR} ${ARFLAGS} ${KernelLib} ${kernelobj} -${Scheme}: ${KernelLib} ${zlibDep} ${LZ4Dep} ${Main} - $C -rdynamic -o ${Scheme} ${Main} ${KernelLib} ${mdclib} ${zlibLib} ${LZ4Lib} ${LDFLAGS} +${Scheme}: ${Kernel} ${KernelLinkDeps} ${Main} + $C -rdynamic -o ${Scheme} ${Main} ${Kernel} ${mdclib} ${KernelLinkLibs} ${LDFLAGS} ../zlib/configure.log: (cd ../zlib; CFLAGS="${CFLAGS} -m32" ./configure) diff --git a/c/build.bat b/c/build.bat new file mode 100644 index 0000000000..bc4481f69e --- /dev/null +++ b/c/build.bat @@ -0,0 +1,30 @@ +@echo off +setlocal + +set M=%1 +set WORKAREA=%M% + +if "%WORKAREA%"=="" goto needargument + +xcopy /s /i /y c %WORKAREA%\c +xcopy /s /i /y s %WORKAREA%\s +xcopy /s /i /y boot %WORKAREA%\boot +xcopy /s /i /y zlib %WORKAREA%\zlib +xcopy /s /i /y lz4 %WORKAREA%\lz4 + +mkdir %WORKAREA%\bin\%M% + +echo #define SCHEME_SCRIPT "scheme-script" > %WORKAREA%\c\config.h + +cd %WORKAREA%\c +nmake Makefile.%M% +cd ..\.. + +goto donebuilding + +:needargument + +echo Please supply the machine name as an argument +exit /B 1 + +:donebuilding diff --git a/c/externs.h b/c/externs.h index 7955078f7a..bb97ba84eb 100644 --- a/c/externs.h +++ b/c/externs.h @@ -330,13 +330,13 @@ extern void S_handle_overflow PROTO((void)); extern void S_handle_overflood PROTO((void)); extern void S_handle_apply_overflood PROTO((void)); extern void S_overflow PROTO((ptr tc, iptr frame_request)); -extern void S_error_reset PROTO((const char *s)); +extern NORETURN void S_error_reset PROTO((const char *s)); extern NORETURN void S_error_abort PROTO((const char *s)); extern NORETURN void S_abnormal_exit PROTO((void)); -extern void S_error PROTO((const char *who, const char *s)); -extern void S_error1 PROTO((const char *who, const char *s, ptr x)); -extern void S_error2 PROTO((const char *who, const char *s, ptr x, ptr y)); -extern void S_error3 PROTO((const char *who, const char *s, ptr x, ptr y, ptr z)); +extern NORETURN void S_error PROTO((const char *who, const char *s)); +extern NORETURN void S_error1 PROTO((const char *who, const char *s, ptr x)); +extern NORETURN void S_error2 PROTO((const char *who, const char *s, ptr x, ptr y)); +extern NORETURN void S_error3 PROTO((const char *who, const char *s, ptr x, ptr y, ptr z)); extern NORETURN void S_boot_error PROTO((const ptr who, ptr s, ptr args)); extern void S_handle_docall_error PROTO((void)); extern void S_handle_arg_error PROTO((void)); @@ -345,7 +345,7 @@ extern void S_handle_values_error PROTO((void)); extern void S_handle_mvlet_error PROTO((void)); extern void S_register_scheme_signal PROTO((iptr sig)); extern void S_fire_collector PROTO((void)); -extern void S_noncontinuable_interrupt PROTO((void)); +extern NORETURN void S_noncontinuable_interrupt PROTO((void)); extern void S_schsig_init PROTO((void)); #ifdef DEFINE_MATHERR #include diff --git a/c/schsig.c b/c/schsig.c index 5f62953338..01e9dc237d 100644 --- a/c/schsig.c +++ b/c/schsig.c @@ -21,7 +21,7 @@ static void S_promote_to_multishot PROTO((ptr k)); static void split PROTO((ptr k, ptr *s)); static void reset_scheme PROTO((void)); -static void do_error PROTO((iptr type, const char *who, const char *s, ptr args)); +static NORETURN void do_error PROTO((iptr type, const char *who, const char *s, ptr args)); static void handle_call_error PROTO((ptr tc, iptr type, ptr x)); static void init_signal_handlers PROTO((void)); static void keyboard_interrupt PROTO((ptr tc)); diff --git a/c/stats.c b/c/stats.c index 93415ecd9b..e254546e73 100644 --- a/c/stats.c +++ b/c/stats.c @@ -253,7 +253,8 @@ void S_gettime(INT typeno, struct timespec *tp) { #ifdef CLOCK_THREAD_CPUTIME_ID if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, tp) == 0) return; #endif - /* fall through to utc case in case no thread timer */ + /* fall through */ + /* to utc case in case no thread timer */ case time_process: #ifdef CLOCK_PROCESS_CPUTIME_ID if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, tp) == 0) return; @@ -283,7 +284,8 @@ void S_gettime(INT typeno, struct timespec *tp) { #ifdef CLOCK_HIGHRES if (clock_gettime(CLOCK_HIGHRES, tp) == 0) return; #endif - /* fall through to utc case in case no monotonic timer */ + /* fall through */ + /* to utc case in case no monotonic timer */ case time_utc: #ifdef CLOCK_REALTIME_HR if (clock_gettime(CLOCK_REALTIME_HR, tp) == 0) return; diff --git a/c/types.h b/c/types.h index ce8ec0a79d..179fe0937b 100644 --- a/c/types.h +++ b/c/types.h @@ -353,10 +353,9 @@ typedef struct { /* With MinGW on 64-bit Windows, setjmp/longjmp is not reliable. Using __builtin_setjmp/__builtin_longjmp is reliable, but __builtin_longjmp requires 1 as its second argument. So, allocate - room in the buffer for a return value. Using 16 bytes of extra - room should preserves any relavant alignment. */ + room in the buffer for a return value. */ # define JMPBUF_RET(jb) (*(int *)((char *)(jb)+sizeof(jmp_buf))) -# define CREATEJMPBUF() malloc(sizeof(jmp_buf)+16) +# define CREATEJMPBUF() malloc(sizeof(jmp_buf)+sizeof(int)) # define FREEJMPBUF(jb) free(jb) # define SETJMP(jb) (JMPBUF_RET(jb) = 0, __builtin_setjmp(jb), JMPBUF_RET(jb)) # define LONGJMP(jb,n) (JMPBUF_RET(jb) = n, __builtin_longjmp(jb, 1)) diff --git a/c/version.h b/c/version.h index 7c6a9c140b..6bea3100c6 100644 --- a/c/version.h +++ b/c/version.h @@ -170,6 +170,7 @@ typedef int tputsputcchar; #define ARCHYPERBOLIC #define GETPAGESIZE() getpagesize() typedef char *memcpy_t; +struct timespec; #define MAKE_NAN(x) { x = 0.0; x = x / x; } #define GETWD(x) getcwd((x),PATH_MAX) typedef int tputsputcchar; @@ -206,6 +207,7 @@ typedef int tputsputcchar; # define PATH_MAX _MAX_PATH #endif typedef char *memcpy_t; +struct timespec; #ifndef __MINGW32__ # define _setjmp setjmp # define _longjmp longjmp @@ -247,6 +249,7 @@ typedef char *memcpy_t; #define NSECCTIME(sb) 0 #define NSECMTIME(sb) 0 #define ICONV_INBUF_TYPE char ** +struct timespec; #define UNUSED #if defined(__MINGW32__) && (machine_type == machine_type_ti3nt || machine_type == machine_type_i3nt) #define time_t __time64_t @@ -268,6 +271,7 @@ typedef char *memcpy_t; #define ARCHYPERBOLIC #define GETPAGESIZE() getpagesize() typedef char *memcpy_t; +struct timespec; #define MAKE_NAN(x) { x = 0.0; x = x / x; } #define GETWD(x) getcwd((x),PATH_MAX) typedef int tputsputcchar; diff --git a/configure b/configure index ed577e7d9a..623181eb58 100755 --- a/configure +++ b/configure @@ -56,6 +56,10 @@ zlibLib=../zlib/libz.a LZ4Lib=../lz4/lib/liblz4.a zlibHeaderDep="../zlib/zconf.h ../zlib/zlib.h" LZ4HeaderDep="../lz4/lib/lz4.h ../lz4/lib/lz4frame.h" +Kernel=KernelO +installkerneltarget=installkernelobj +installzlibtarget= +installlz4target= # On WSL, set OS to "Windows_NT" to create a Windows # build instead of a Linux (on Windows) build: @@ -200,6 +204,14 @@ while [ $# != 0 ] ; do --installscriptname=*) installscriptname=`echo $1 | sed -e 's/^--installscriptname=//'` ;; + --toolprefix=*) + toolprefix=`echo $1 | sed -e 's/^--toolprefix=//'` + CC="${toolprefix}${CC}" + LD="${toolprefix}${LD}" + AR="${toolprefix}${AR}" + RANLIB="${toolprefix}${RANLIB}" + WINDRES="${toolprefix}${WINDRES}" + ;; --gzip-man-pages) gzipmanpages=yes ;; @@ -221,6 +233,22 @@ while [ $# != 0 ] ; do --disable-curses) disablecurses=yes ;; + --libkernel) + Kernel=KernelLib + installkerneltarget=installkernellib + if [ "$zlibInc" != "" ]; then + installzlibtarget=installzlib + fi + if [ "$LZ4Inc" != "" ]; then + installlz4target=installlz4 + fi + ;; + --kernelobj) + Kernel=KernelO + installkerneltarget=installkernelobj + installzlibtarget= + installlz4target= + ;; CC=*) CC=`echo $1 | sed -e 's/^CC=//'` ;; @@ -253,12 +281,14 @@ while [ $# != 0 ] ; do zlibInc= zlibDep= zlibHeaderDep= + installzlibtarget= ;; LZ4=*) LZ4Lib=`echo $1 | sed -e 's/^LZ4=//'` LZ4Inc= LZ4Dep= LZ4HeaderDep= + installlz4target= ;; *) echo "option '$1' unrecognized or missing an argument; try $0 --help" @@ -322,7 +352,10 @@ if [ "$help" = "yes" ]; then echo " -m= same as --machine ($m)" echo " --threads specify threaded version ($threads)" echo " --32|--64 specify 32/64-bit version ($bits)" - echo " --disable-x11 disabling x11" + echo " --disable-x11 disable X11 support" + echo " --disable-curses disable [n]curses support" + echo " --libkernel build libkernel.a instead of kernel.o" + echo " --kernelobj build kernel.o (the default)" echo " --installprefix= final installation root ($installprefix)" echo " --installbin= bin directory ($installbin)" echo " --installlib= lib directory ($installlib)" @@ -333,6 +366,7 @@ if [ "$help" = "yes" ]; then echo " --installschemename= install with group ($installschemename)" echo " --installpetitename= install with group ($installpetitename)" echo " --installscriptname= install with group ($installscriptname)" + echo " --toolprefix= prefix tool (compiler, linker, ...) names" echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" echo " --workarea= build directory ($w)" echo " CC= C compiler" @@ -344,8 +378,8 @@ if [ "$help" = "yes" ]; then echo " ARFLAGS= archiver flags" echo " RANLIB= archive indexer" echo " WINDRES= resource compiler" - echo " ZLIB= link to static instead of own zlib" - echo " LZ4= link to static instead of own LZ4" + echo " ZLIB= link to instead of own zlib" + echo " LZ4= link to instead of own LZ4" echo "" echo "Available machine types: $machs" echo "" @@ -432,6 +466,9 @@ sed -e "s;^m=none\$;m=$m;"\ -e "s;^InstallSchemeName=.*$;InstallSchemeName=$installschemename;"\ -e "s;^InstallPetiteName=.*$;InstallPetiteName=$installpetitename;"\ -e "s;^InstallScriptName=.*$;InstallScriptName=$installscriptname;"\ + -e "s;^InstallKernelTarget=.*$;InstallKernelTarget=$installkerneltarget;"\ + -e "s;^InstallZlibTarget=.*$;InstallZlibTarget=$installzlibtarget;"\ + -e "s;^InstallLZ4Target=.*$;InstallLZ4Target=$installlz4target;"\ makefiles/Mf-install.in > $w/Mf-install cat > $w/c/config.h << END @@ -445,13 +482,13 @@ if [ "$disablex11" = "yes" ]; then echo '#define DISABLE_X11' >> $w/c/config.h fi -LIBCURSES=-lcurses -LIBNCURSES=-lncurses +cursesLib=-lcurses +ncursesLib=-lncurses if [ "$disablecurses" = "yes" ]; then echo '#define DISABLE_CURSES' >> $w/c/config.h - LIBCURSES= - LIBNCURSES= + cursesLib= + ncursesLib= fi cat > $w/c/Mf-config << END @@ -460,12 +497,12 @@ CPPFLAGS=$CPPFLAGS CFLAGS=$CFLAGS LD=$LD LDFLAGS=$LDFLAGS -LIBCURSES=$LIBCURSES -LIBNCURSES=$LIBNCURSES AR=$AR ARFLAGS=$ARFLAGS RANLIB=$RANLIB WINDRES=$WINDRES +cursesLib=$cursesLib +ncursesLib=$ncursesLib zlibInc=$zlibInc LZ4Inc=$LZ4Inc zlibDep=$zlibDep @@ -474,4 +511,7 @@ zlibLib=$zlibLib LZ4Lib=$LZ4Lib zlibHeaderDep=$zlibHeaderDep LZ4HeaderDep=$LZ4HeaderDep +Kernel=\${${Kernel}} +KernelLinkDeps=\${${Kernel}LinkDeps} +KernelLinkLibs=\${${Kernel}LinkLibs} END diff --git a/makefiles/Makefile.in b/makefiles/Makefile.in index 0308ef0492..882e49fb7f 100644 --- a/makefiles/Makefile.in +++ b/makefiles/Makefile.in @@ -18,6 +18,9 @@ MAKEFLAGS += --no-print-directory build: (cd $(workarea) && $(MAKE) build) +run: + env SCHEMEHEAPDIRS=$(workarea)/boot/$(m) $(workarea)/bin/$(m)/scheme + install: (cd $(workarea) && $(MAKE) install) @@ -30,6 +33,16 @@ test: bootfiles: (cd $(workarea) && $(MAKE) bootfiles) +# Supply XM= to build boot files for +boot: build + mkdir -p boot/$(XM) + (cd $(workarea) && $(MAKE) -f Mf-boot $(XM).boot) + +# Supply ORIG= to build using existing at +from-orig: + (cd $(m)/s && $(MAKE) -f Mf-cross m=$(m) xm=$(m) base=$(ORIG)/$(m)) + $(MAKE) build + docs: build (cd csug && $(MAKE) m=$(m)) (cd release_notes && $(MAKE) m=$(m)) @@ -47,9 +60,9 @@ clean: (cd $(workarea) && $(MAKE) clean) distclean: - (cd csug && if [ -e Makefile ] ; then make reallyreallyclean ; fi) + (cd csug && if [ -e Makefile ] ; then $(MAKE) reallyreallyclean ; fi) rm -f csug/Makefile - (cd release_notes && if [ -e Makefile ] ; then make reallyreallyclean ; fi) + (cd release_notes && if [ -e Makefile ] ; then $(MAKE) reallyreallyclean ; fi) rm -f release_notes/Makefile rm -rf $(workarea) rm -f Makefile diff --git a/makefiles/Mf-install.in b/makefiles/Mf-install.in index a175284da3..4440fc33f4 100644 --- a/makefiles/Mf-install.in +++ b/makefiles/Mf-install.in @@ -51,6 +51,13 @@ InstallSchemeName=scheme InstallPetiteName=petite InstallScriptName=scheme-script +# Whether to install "kernel.o" or "libkernel.a" +InstallKernelTarget=installkernellib + +# Maybe install libz.a and liblz4.a by setting to "installzlib" and "installliz4" +InstallZlibTarget= +InstallLZ4Target= + ############################################################################### # no changes should be needed below this point # ############################################################################### @@ -74,7 +81,7 @@ PetitePath=${Bin}/${InstallPetiteName} SchemePath=${Bin}/${InstallSchemeName} SchemeScriptPath=${Bin}/${InstallScriptName} -install: bininstall libbininstall maninstall liblibinstall +install: bininstall libbininstall maninstall liblibinstall ${InstallKernelTarget} uninstall: rm -rf ${Lib} @@ -116,11 +123,22 @@ libbininstall: ${LibBin} ln -f ${LibBin}/scheme.boot ${LibBin}/${InstallSchemeName}.boot;\ fi ln -f ${LibBin}/scheme.boot ${LibBin}/${InstallScriptName}.boot; - $I -m 444 ${Include}/kernel.o ${LibBin} $I -m 444 ${Include}/main.o ${LibBin} $I -m 444 ${Include}/scheme.h ${LibBin} $I -m 444 ${Revision} ${LibBin}/revision +installkernelobj: ${LibBin} + $I -m 444 ${Include}/kernel.o ${LibBin} + +installkernellib: ${LibBin} ${InstallZlibTarget} ${InstallLZ4Target} + $I -m 444 ${Include}/libkernel.a ${LibBin} + +installzlib: ${LibBin} + $I -m 444 zlib/libz.a ${LibBin} + +installlz4: ${LibBin} + $I -m 444 lz4/lib/liblz4.a ${LibBin} + maninstall: scheme.1 petite.1 ${Man} $I -m 444 scheme.1 ${Man}/${InstallSchemeName}.1 if [ ${GzipManPages} = yes ] ; then gzip -f ${Man}/${InstallSchemeName}.1 ; fi diff --git a/mats/5_3.ms b/mats/5_3.ms index 1f2dd79cc7..50c913aab2 100644 --- a/mats/5_3.ms +++ b/mats/5_3.ms @@ -2401,7 +2401,7 @@ (error? (expt 0 -1)) (error? (expt 0 +1i)) (eqv? (expt 2+2i 4) -64) - (eqv? (expt 10.0 -20) 1e-20) + (fl~= (expt 10.0 -20) 1e-20) (eqv? (expt 2 10) 1024) (eqv? (expt 0 0) 1) (eqv? (expt 1.0 0) 1) diff --git a/mats/misc.ms b/mats/misc.ms index be9dd7d7b6..bd1132a2e1 100644 --- a/mats/misc.ms +++ b/mats/misc.ms @@ -3630,8 +3630,8 @@ ) (mat sci-bug - (equal? (expt 10.0 (- 21)) 1e-21) - (equal? (flexpt 10.0 (- 21.0)) 1e-21) + (fl~= (expt 10.0 (- 21)) 1e-21) + (fl~= (flexpt 10.0 (- 21.0)) 1e-21) ) (mat apropos diff --git a/release_notes/release_notes.stex b/release_notes/release_notes.stex index fb2e793b78..dd80ef4e71 100644 --- a/release_notes/release_notes.stex +++ b/release_notes/release_notes.stex @@ -1749,7 +1749,7 @@ in fasl files does not generally make sense. %----------------------------------------------------------------------------- \section{Bug Fixes}\label{section:bugfixes} -\subsection{String ports form immutable strings (9.5.4)} +\subsection{String ports from immutable strings (9.5.4)} A bug that miscalculated the buffer size for \scheme{open-string-input-port} given an immutable string has been diff --git a/s/a6ob.def b/s/a6ob.def index e207950df5..489085de17 100644 --- a/s/a6ob.def +++ b/s/a6ob.def @@ -24,7 +24,7 @@ (define-constant size_t-bits 64) (define-constant ptrdiff_t-bits 64) (define-constant wchar-bits 32) -(define-constant time-t-bits 32) +(define-constant time-t-bits 64) (define-constant max-float-alignment 8) (define-constant max-integer-alignment 8) (define-constant asm-arg-reg-max 5)