the Fink project is an effort to port
popular Unix programs to Mac OS X
Package: cm3-dev
Version: 5.2.4
Revision: 4
Architecture: powerpc
DescPackaging: Doesn't compile on intel
Maintainer: Matthias Neeracher
Depends: cm3-shlibs (= %v-%r)
Replaces: cm3-shlibs-src
Source: http://www.elegosoft.com/cm3/cm3-src-all-%v.tgz
Source-MD5: d7ce529bc6bffc87ade367c7c0d79256
Source2: http://www.elegosoft.com/cm3/cm3-min-POSIX-PPC_DARWIN-5.2.4.tgz
Source2-MD5: b12f68341a97f2af1eac0c77929af77a
NoSourceDirectory: true
PatchScript: <<
patch -p1 <%a/%n.patch
mkdir bootstrap
tar -C bootstrap -zxvf system.tgz
cp bootstrap.cm3.cfg bootstrap/bin/cm3.cfg
perl -i -pe 's|\@USE_ROOT\@|%b/bootstrap/|; s|\@INSTALL_ROOT\@|%i/|' bootstrap/bin/cm3.cfg
<<
SetCFLAGS: -isystem %p/include
CompileScript: <<
echo "We build and install at once, so all the work is in InstallScript"
<<
InstallScript: <<
cd scripts; PATH=%b/bootstrap/bin:$PATH M3GC_SIMPLE=yes ./do-cm3-core.sh buildship
cd scripts; PATH=%b/bootstrap/bin:$PATH M3GC_SIMPLE=yes ./do-pkg.sh buildship tcp
ln -s %p/lib/cm3/pkg/cm3/PPC_DARWIN/cm3 %i/bin/cm3
cp run.cm3.cfg %i/bin/cm3.cfg
perl -i -pe 's|\@USE_ROOT\@|%p/|; s|\@INSTALL_ROOT\@|%p/|' %i/bin/cm3.cfg
echo Fixing .M3EXPORT files...
find %i -name .M3EXPORTS -print -exec perl -i -pe 's|%d||' '{}' ';'
echo Fixing dynamic libraries...
find %i -name '*.[0-9].[0-9].dylib'|perl -pe '($i=$_)=~s|%d||;chomp($i);`install_name_tool -id $i $_`'
<<
SplitOff: <<
Package: cm3-shlibs
Files: <<
lib/cm3/pkg/bitvector/PPC_DARWIN/libBitVector.*.dylib
lib/cm3/pkg/digraph/PPC_DARWIN/libDiGraph.*.dylib
lib/cm3/pkg/libm3/PPC_DARWIN/libm3.*.dylib
lib/cm3/pkg/m3core/PPC_DARWIN/libm3core.*.dylib
lib/cm3/pkg/m3gc-simple/PPC_DARWIN/libm3gcdefs.*.dylib
lib/cm3/pkg/parseparams/PPC_DARWIN/libm3parseparams.*.dylib
lib/cm3/pkg/realgeometry/PPC_DARWIN/libGeometry.*.dylib
lib/cm3/pkg/set/PPC_DARWIN/libset.*.dylib
lib/cm3/pkg/slisp/PPC_DARWIN/libm3slisp.*.dylib
lib/cm3/pkg/sortedtableextras/PPC_DARWIN/libSortedTableExtras.*.dylib
lib/cm3/pkg/table-list/PPC_DARWIN/libtable-list.*.dylib
lib/cm3/pkg/tcp/PPC_DARWIN/libm3tcp.*.dylib
lib/cm3/pkg/tempfiles/PPC_DARWIN/libTempFiles.*.dylib
<<
Shlibs: <<
%p/lib/cm3/pkg/bitvector/PPC_DARWIN/libBitVector.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/digraph/PPC_DARWIN/libDiGraph.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/libm3/PPC_DARWIN/libm3.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/m3core/PPC_DARWIN/libm3core.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/m3gc-simple/PPC_DARWIN/libm3gcdefs.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/parseparams/PPC_DARWIN/libm3parseparams.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/realgeometry/PPC_DARWIN/libGeometry.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/set/PPC_DARWIN/libset.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/slisp/PPC_DARWIN/libm3slisp.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/sortedtableextras/PPC_DARWIN/libSortedTableExtras.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/table-list/PPC_DARWIN/libtable-list.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/tcp/PPC_DARWIN/libm3tcp.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/tempfiles/PPC_DARWIN/libTempFiles.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
<<
Description: Critical Mass Modula-3 Shared Libraries
DescDetail: <<
Shared libraries needed for programs built with Critical Mass Modula-3.
<<
DocFiles: COPYRIGHT-CMASS COPYRIGHT-DEC
<<
DocFiles: COPYRIGHT-CMASS COPYRIGHT-DEC
Description: Critical Mass Modula-3 Compiler
DescDetail: <<
Critical Mass Modula-3 5.1 (CM3) is the latest release of the Modula-3
compiler produced by Critical Mass
This package currently does not build if autogen-dev is installed (once built,
it no longer conflicts with autogen-dev).
<<
DescPort: <<
This port was mainly accomplished by reverse engineering the darwinports
version by Landon Fuller.
<<
License: Restrictive/Distributable
Homepage: http://www.m3.org
diff -ru cm3-orig/bootstrap.cm3.cfg cm3/bootstrap.cm3.cfg
--- cm3-orig/bootstrap.cm3.cfg Sat Mar 29 00:29:54 2003
+++ cm3/bootstrap.cm3.cfg Sun Mar 30 20:39:29 2003
@@ -0,0 +1,342 @@
+% Copyright 1996-2000 Critical Mass, Inc. All rights reserved.
+% See file COPYRIGHT-CMASS for details.
+%
+% Standard configuration file for FreeBSD with ELF object files
+%
+
+%-------------------------------------------------- compilation environment ---
+
+%M3_PROFILING = TRUE % set by cm3 since 5.1.2
+%M3_PROFILING = FALSE
+
+readonly TARGET = "PPC_DARWIN" % code generation target
+if M3_PROFILING
+ readonly BUILD_DIR = TARGET & "p" % code generation target
+else
+ readonly BUILD_DIR = TARGET % directory for results
+end
+readonly OS_TYPE = "POSIX" % { "WIN32" or "POSIX" }
+readonly WORD_SIZE = "32BITS" % { "32BITS" or "64BITS" }
+readonly GNU_PLATFORM = "powerpc-apple-darwin6.3" % "cpu-vendor-os" string for GNU
+readonly INSTALL_KEY = "9R52-K7A2-2K32"
+
+readonly NAMING_CONVENTIONS = "0"
+% object files libraries
+% 0=Unix => .o .io .mo libXX.a
+% 1=Unix with a grumpy C compiler => .o _i.o _m.o libXX.a
+% 2=Windows NT or Windows 95 => .obj .io .mo XX.lib
+%
+
+%-------------------------------------------------- default compile options ---
+% "set_config_options" is called before starting the compilation. It should
+% be used to provide system-wide default options.
+
+proc set_config_options () is
+ m3_option ("-why") %-- produce a listing that explains what's happening and why
+ m3_debug (TRUE) %-- produce object code with debugging symbols
+ M3_OPTIONS += "-w1" %-- produce "level 1" warnings
+end
+
+%--------------------------------------------------------- Reactor defaults ---
+% The first time a user runs Reactor, it will configure itself to use
+% the executables defined below.
+
+INITIAL_REACTOR_BROWSER = "netscape"
+% A World-Wide Web browser. Reactor passes it an initial URL
+% its first command-line argument.
+
+INITIAL_REACTOR_EDITOR = "emacsclient"
+% A text editor. Reactor passes it "
+% command-line when it wants to edit
+% at
+
+%------------------------------------------------------------- export paths ---
+% During the installation, destination directories that do not exists
+% will be created. You need the necessary permissions to do so; otherwise,
+% the installation will fail, but can be restarted after you have
+% fixed the permissions.
+
+INSTALL_ROOT = "@INSTALL_ROOT@"
+
+BIN_INSTALL = INSTALL_ROOT & "bin" % executables
+if M3_PROFILING
+ LIB_INSTALL = INSTALL_ROOT & "libp" % libraries
+else
+ LIB_INSTALL = INSTALL_ROOT & "lib/cm3" % libraries
+end
+PKG_INSTALL = INSTALL_ROOT & "lib/cm3/pkg" % packages
+DOC_INSTALL = INSTALL_ROOT & "share/doc/cm3" % documents
+EMACS_INSTALL = INSTALL_ROOT & "elisp" % emacs lisp code
+MAN_INSTALL = INSTALL_ROOT & "share/man" % man pages
+HTML_INSTALL = INSTALL_ROOT & "share/doc/cm3/html" % public hypertext
+
+% On some systems (e.g. AFS) you must install public files in a different
+% place from where you use them. If that is the case for your system,
+% specify the "use" location here, otherwise leave them alone.
+%
+USE_ROOT = "@USE_ROOT@"
+BIN_USE = USE_ROOT & "bin" % executables
+LIB_USE = USE_ROOT & "lib" % libraries
+PKG_USE = INSTALL_ROOT & "lib/cm3/pkg" % packages
+
+readonly INSTALL_IMPLS = TRUE
+% TRUE
+% => save all source files during the install
+% => makes debugging easier and browsing more fruitful
+% FALSE
+% => save only the exported interfaces and templates
+% => makes the installed system slightly smaller.
+
+%------------------------------------------------ external system libraries ---
+% SYSTEM_LIBS provides a mapping from Modula-3 names for the common
+% external libraries to site-dependent information about how they
+% are accessed. If SYSTEM_LIBS{x} is defined it should be a list
+% of linker arguments that are used when linking against that library.
+% If SYSTEM_LIBS{x} is not defined, the Modula-3 system will assume
+% that the library is not available.
+
+SYSTEM_LIBS = {
+ "LIBC" : [ "-lm" ],
+ "LEX-YACC" : [ "-L/usr/lib", "-ll" ],
+% "FLEX-BISON" : [ "-L/usr/lib", "-lfl" ],
+ "POSTGRES95" : [ "-L/usr/local/pgsql/lib", "-lpq" ],
+ "OPENGL" : [ "-L/usr/X11R6/lib", "-lGLU", "-lGL", "-lXext" ],
+ "MOTIF" : [ "-L/usr/X11R6/lib", "-lXm" ],
+ "X11" : [ "-L/usr/X11R6/lib", "-lXaw", "-lXmu", "-lXext",
+ "-lXt", "-lSM", "-lICE", "-lX11" ],
+ "TCP" : [ ]
+}
+
+% SYSTEM_LIBORDER defines the order in which SYSTEM_LIBS should be
+% scanned by the linker.
+
+SYSTEM_LIBORDER = [ "OPENGL", "DECPEX", "MOTIF", "X11", "TCP", "ODBC",
+ "POSTGRES95", "FLEX-BISON", "LEX-YACC", "LIBC" ]
+
+%--------------------------------------------------------- Modula-3 backend ---
+% For platforms without an integrated backend, "m3_backend" is called to
+% translate Modula-3 intermediate code to object code.
+
+readonly m3back = "@" & BIN_USE & "/cm3cg"
+
+proc m3_backend (source, object, optimize, debug) is
+ local args = [ "-quiet", source, "-o", object, "-fPIC", "-gstabs" ]
+ if optimize args += "-O" end
+ if debug args += "-g" end
+ if M3_PROFILING args += "-p" end
+ return try_exec (m3back, args)
+end
+
+M3_BACKEND_MODE = "3"
+% -- defines how the frontend, backend, and assembler interact
+% "0" -- don't call m3_backend, M3CG produces object code
+% "1" -- don't call m3_backend, M3CG produces assembly code
+% "2" -- call m3_backend, it produces object code
+% "3" -- call m3_backend, it produces assembly code
+
+%--------------------------------------------------------------- C compiler ---
+% "compile_c" is called to compile C source files. Note that this function
+% is only called if your program or library explicitly includes C source
+% code, the system distributed by Critical Mass does not.
+
+proc compile_c (source, object, options, optimize, debug) is
+ local args = [ "-fPIC", options ]
+ if optimize args += "-O" end
+ if debug args += "-g" end
+ if M3_PROFILING args += "-pg" end
+ return try_exec ("@gcc", args, "-c", source)
+end
+
+%---------------------------------------------------------------- assembler ---
+% "assemble" is called to assemble .s or .asm files. Note that this function
+% is only called if your program or library explicitly includes assembly source
+% code, the system distributed by Critical Mass does not.
+
+proc assemble (source, object) is
+ return try_exec ("@/usr/bin/as", source, "-o", object)
+end
+
+%--------------------------------------------------------- library creation ---
+% "make_lib" is called to combine a collection of object modules into
+% a library.
+
+proc make_lib (lib, options, objects, imported_libs, shared) is
+ local vmaj = "5"
+ local vmin = "2"
+ local version = vmaj & "." & vmin
+ local ret_code = 0
+ local lib_a = format ("lib%s.a", lib)
+ local lib_so = format ("lib%s.dylib", lib)
+ local lib_sox = format ("lib%s.%s.dylib", lib, vmaj)
+ local lib_soxx = format ("lib%s.%s.dylib", lib, version)
+ local lib_pn = LIB_INSTALL & "/" & lib_soxx
+
+ % first, build the non-shared library
+ ret_code = try_exec ("@/usr/bin/ar", "cru", lib_a, objects)
+ if not equal (ret_code, 0) return ret_code end
+ ret_code = try_exec ("@/usr/bin/ranlib", lib_a)
+ if not equal (ret_code, 0) return ret_code end
+
+ %shared = FALSE
+ if shared
+ % build the shared library
+ ret_code = try_exec ("@libtool -dynamic -flat_namespace",
+ "-undefined suppress -compatibility_version", vmaj,
+ "-current_version", version, "-install_name", lib_pn,
+ "-o", lib_soxx, objects)
+ if not equal (ret_code, 0)
+ delete_file (lib_a)
+ return ret_code
+ end
+
+ % create the version aliases
+ link_file(lib_soxx, lib_sox)
+ link_file(lib_sox, lib_so)
+
+ % finally, make sure the shared library stuff gets installed properly
+ install_derived (lib_soxx)
+ install_derived_link (lib_soxx, lib_sox)
+ install_derived_link (lib_sox, lib_so)
+ install_link_to_derived (lib_soxx, LIB_INSTALL)
+ install_link_to_derived (lib_sox, LIB_INSTALL)
+ install_link_to_derived (lib_so, LIB_INSTALL)
+ else
+ delete_file (lib_so)
+ delete_file (lib_sox)
+ delete_file (lib_soxx)
+ end
+
+ return 0
+end
+
+%-------------------------------------------------------------------
+% "skip_lib" is called when the compiler decides it doesn't need to
+% call "make_lib", but it wants to discover the names of the derived
+% files that should be deleted or shipped.
+
+proc skip_lib (lib, shared) is
+ local vmaj = "5"
+ local vmin = "2"
+ local version = vmaj & "." & vmin
+ local ret_code = 0
+ local lib_a = format ("lib%s.a", lib)
+ local lib_so = format ("lib%s.dylib", lib)
+ local lib_sox = format ("lib%s.%s.dylib", lib, vmaj)
+ local lib_soxx = format ("lib%s.%s.dylib", lib, version)
+
+ if shared
+ % make sure the shared library stuff gets installed properly
+ install_derived (lib_soxx)
+ install_derived (lib_sox)
+ install_derived (lib_so)
+ install_link_to_derived (lib_soxx, LIB_INSTALL)
+ install_link_to_derived (lib_sox, LIB_INSTALL)
+ install_link_to_derived (lib_so, LIB_INSTALL)
+ else
+ delete_file (lib_so)
+ delete_file (lib_sox)
+ delete_file (lib_soxx)
+ end
+
+ return 0
+end
+
+%------------------------------------------------------------------- linker ---
+% "m3_link" is called to produce a final executable.
+%--- "-pdb:none" enables the use of windbg with the resulting executable.
+
+proc m3_link (prog, options, objects, imported_libs, shared) is
+ local args = []
+ if M3_PROFILING args += "-pg" end
+ args += [ "-o", prog, "-fPIC", options, objects, imported_libs ]
+ args += [ "-shared-libgcc" ]
+ return try_exec ("@cc", args)
+end
+
+%-------------------------------------------------------------------
+% "skip_link" is called when the compiler decides it doesn't need to
+% call "m3_link", but it wants to discover the names of the derived
+% files that should be deleted or shipped.
+
+proc skip_link (prog, shared) is
+ return 0
+end
+
+%------------------------------------------------------------ misc. options ---
+% Note, most of these options can be set from the command line. Otherwise,
+% they can be set "permanently" here in the config file or in as needed
+% in user's m3makefiles.
+
+M3_FRONT_FLAGS = [ ]
+% --- internal configuration options passed directly to the Modula-3 front-end
+
+M3_OPTIONS = [ ]
+% --- user options passed directly to the Modula-3 front-end
+
+% M3_KEEP_FILES = TRUE
+% --- keep intermediate and temporary files
+
+% M3_WINDOWS_GUI = TRUE
+% --- generate a Windows GUI subsystem program instead of a console one.
+
+% M3_COVERAGE = TRUE
+% --- compile & link with coverage options
+
+M3_COVERAGE_LIB = LIB_USE & "/report_coverage.o"
+% --- library linked in programs compiled with "-Z" coverage option
+
+%M3_SPLIT_LIBNAMES = TRUE
+% --- split library names and pass -L/-l arguments to the linker
+
+M3_SPLIT_LIBNAMES_IF_SHARED = TRUE
+% --- split library names and pass -L/-l arguments to the linker if linking
+% dynamically, pass full library names else
+% (assumes M3_SPLIT_LIBNAMES = FALSE)
+
+%M3_SHARED_LIB_ARG = "-Wl,-R"
+% --- pass "-R" flags to the linker too...
+
+% M3_BOOTSTRAP = TRUE
+% --- generate bootstrap code (assembly) instead of finaly object code
+
+% M3_COMPILE_ONCE = TRUE
+% --- don't recompile code to improve opaque object references
+
+% SYS_HAS_LOADER = TRUE
+% --- generate a loader info file with objects, libraries and timestamps
+
+% M3_SKIP_LINK = TRUE
+% --- skip the final link for programs, presumably to use the loader instead
+
+% M3_MAIN_IN_C = TRUE
+% --- generate the Modula-3 main program as C code
+
+X11_WITH_SHARED_MEM = TRUE
+% --- X11 libraries include the shared memory extensions (XShm...)
+
+%M3_NEED_STANDALONE_LINKS = TRUE
+% --- linker is broken and we need to build a directory of symbolic
+% links pointing to the non-shared libraries.
+
+%-------------------------------------------------------------------- emacs ---
+% If you have emacs and want to compile ".el" files to ".elc" files,
+% fill in the function below. Otherwise, comment out or delete the
+% entire function. Note, the distributed code assumes gnuemacs version 19
+% or later.
+
+readonly proc emacs_compile (el) is
+ exec ("emacs -batch -f batch-byte-compile", el)
+end
+
+%------------------------------------------------------------- GNU variants ---
+% The two large pieces of GNU software used by the Modula-3 system
+% gcc(=m3cc) and gdb(=m3gdb) often require slightly different C compilers
+% or flags. They are specified here. Note that they may be overridden
+% from the m3build command line.
+%
+% To use the GNU defaults for CC and CFLAGS, specify "*".
+%
+
+GNU_CC = "gcc"
+GNU_CFLAGS = "-g"
+GNU_MAKE = "make"
Only in cm3: bootstrap.cm3.cfg~
diff -ru cm3-orig/m3-sys/m3cc/gcc/gcc/stmt.c cm3/m3-sys/m3cc/gcc/gcc/stmt.c
--- cm3-orig/m3-sys/m3cc/gcc/gcc/stmt.c Sat Mar 29 00:25:02 2003
+++ cm3/m3-sys/m3cc/gcc/gcc/stmt.c Sat Mar 29 00:30:32 2003
@@ -5166,12 +5166,15 @@
/* We deliberately use calloc here, not cmalloc, so that we can suppress
this optimization if we don't have enough memory rather than
aborting, as xmalloc would do. */
- && (cases_seen =
- (unsigned char *) really_call_calloc (bytes_needed, 1)) != NULL)
+ && (cases_seen = (unsigned char *)alloca(bytes_needed) ) != NULL )
+/* && (cases_seen = */
+/* (unsigned char *) really_call_calloc (bytes_needed, 1)) != NULL) */
{
HOST_WIDE_INT i;
tree v = TYPE_VALUES (type);
+ unsigned char *x;
+ for( x = cases_seen; x < cases_seen + bytes_needed; x++){ *x = 0; }
/* The time complexity of this code is normally O(N), where
N being the number of members in the enumerated type.
However, if type is a ENUMERAL_TYPE whose values do not
diff -ru cm3-orig/run.cm3.cfg cm3/run.cm3.cfg
--- cm3-orig/run.cm3.cfg Sun Mar 30 17:08:22 2003
+++ cm3/run.cm3.cfg Sun Mar 30 17:21:54 2003
@@ -0,0 +1,342 @@
+% Copyright 1996-2000 Critical Mass, Inc. All rights reserved.
+% See file COPYRIGHT-CMASS for details.
+%
+% Standard configuration file for FreeBSD with ELF object files
+%
+
+%-------------------------------------------------- compilation environment ---
+
+%M3_PROFILING = TRUE % set by cm3 since 5.1.2
+%M3_PROFILING = FALSE
+
+readonly TARGET = "PPC_DARWIN" % code generation target
+if M3_PROFILING
+ readonly BUILD_DIR = TARGET & "p" % code generation target
+else
+ readonly BUILD_DIR = TARGET % directory for results
+end
+readonly OS_TYPE = "POSIX" % { "WIN32" or "POSIX" }
+readonly WORD_SIZE = "32BITS" % { "32BITS" or "64BITS" }
+readonly GNU_PLATFORM = "powerpc-apple-darwin6.3" % "cpu-vendor-os" string for GNU
+readonly INSTALL_KEY = "9R52-K7A2-2K32"
+
+readonly NAMING_CONVENTIONS = "0"
+% object files libraries
+% 0=Unix => .o .io .mo libXX.a
+% 1=Unix with a grumpy C compiler => .o _i.o _m.o libXX.a
+% 2=Windows NT or Windows 95 => .obj .io .mo XX.lib
+%
+
+%-------------------------------------------------- default compile options ---
+% "set_config_options" is called before starting the compilation. It should
+% be used to provide system-wide default options.
+
+proc set_config_options () is
+ m3_option ("-why") %-- produce a listing that explains what's happening and why
+ m3_debug (TRUE) %-- produce object code with debugging symbols
+ M3_OPTIONS += "-w1" %-- produce "level 1" warnings
+end
+
+%--------------------------------------------------------- Reactor defaults ---
+% The first time a user runs Reactor, it will configure itself to use
+% the executables defined below.
+
+INITIAL_REACTOR_BROWSER = "netscape"
+% A World-Wide Web browser. Reactor passes it an initial URL
+% its first command-line argument.
+
+INITIAL_REACTOR_EDITOR = "emacsclient"
+% A text editor. Reactor passes it "
+% command-line when it wants to edit
+% at
+
+%------------------------------------------------------------- export paths ---
+% During the installation, destination directories that do not exists
+% will be created. You need the necessary permissions to do so; otherwise,
+% the installation will fail, but can be restarted after you have
+% fixed the permissions.
+
+INSTALL_ROOT = "@INSTALL_ROOT@"
+
+BIN_INSTALL = INSTALL_ROOT & "bin" % executables
+if M3_PROFILING
+ LIB_INSTALL = INSTALL_ROOT & "libp" % libraries
+else
+ LIB_INSTALL = INSTALL_ROOT & "lib/cm3" % libraries
+end
+PKG_INSTALL = INSTALL_ROOT & "lib/cm3/pkg" % packages
+DOC_INSTALL = INSTALL_ROOT & "share/doc/cm3" % documents
+EMACS_INSTALL = INSTALL_ROOT & "elisp" % emacs lisp code
+MAN_INSTALL = INSTALL_ROOT & "share/man" % man pages
+HTML_INSTALL = INSTALL_ROOT & "share/doc/cm3/html" % public hypertext
+
+% On some systems (e.g. AFS) you must install public files in a different
+% place from where you use them. If that is the case for your system,
+% specify the "use" location here, otherwise leave them alone.
+%
+USE_ROOT = "@USE_ROOT@"
+BIN_USE = USE_ROOT & "bin" % executables
+LIB_USE = USE_ROOT & "lib/cm3" % libraries
+PKG_USE = USE_ROOT & "lib/cm3/pkg" % packages
+
+readonly INSTALL_IMPLS = TRUE
+% TRUE
+% => save all source files during the install
+% => makes debugging easier and browsing more fruitful
+% FALSE
+% => save only the exported interfaces and templates
+% => makes the installed system slightly smaller.
+
+%------------------------------------------------ external system libraries ---
+% SYSTEM_LIBS provides a mapping from Modula-3 names for the common
+% external libraries to site-dependent information about how they
+% are accessed. If SYSTEM_LIBS{x} is defined it should be a list
+% of linker arguments that are used when linking against that library.
+% If SYSTEM_LIBS{x} is not defined, the Modula-3 system will assume
+% that the library is not available.
+
+SYSTEM_LIBS = {
+ "LIBC" : [ "-lm" ],
+ "LEX-YACC" : [ "-L/usr/lib", "-ll" ],
+% "FLEX-BISON" : [ "-L/usr/lib", "-lfl" ],
+ "POSTGRES95" : [ "-L/usr/local/pgsql/lib", "-lpq" ],
+ "OPENGL" : [ "-L/usr/X11R6/lib", "-lGLU", "-lGL", "-lXext" ],
+ "MOTIF" : [ "-L/usr/X11R6/lib", "-lXm" ],
+ "X11" : [ "-L/usr/X11R6/lib", "-lXaw", "-lXmu", "-lXext",
+ "-lXt", "-lSM", "-lICE", "-lX11" ],
+ "TCP" : [ ]
+}
+
+% SYSTEM_LIBORDER defines the order in which SYSTEM_LIBS should be
+% scanned by the linker.
+
+SYSTEM_LIBORDER = [ "OPENGL", "DECPEX", "MOTIF", "X11", "TCP", "ODBC",
+ "POSTGRES95", "FLEX-BISON", "LEX-YACC", "LIBC" ]
+
+%--------------------------------------------------------- Modula-3 backend ---
+% For platforms without an integrated backend, "m3_backend" is called to
+% translate Modula-3 intermediate code to object code.
+
+readonly m3back = "@" & BIN_USE & "/cm3cg"
+
+proc m3_backend (source, object, optimize, debug) is
+ local args = [ "-quiet", source, "-o", object, "-fPIC", "-gstabs" ]
+ if optimize args += "-O" end
+ if debug args += "-g" end
+ if M3_PROFILING args += "-p" end
+ return try_exec (m3back, args)
+end
+
+M3_BACKEND_MODE = "3"
+% -- defines how the frontend, backend, and assembler interact
+% "0" -- don't call m3_backend, M3CG produces object code
+% "1" -- don't call m3_backend, M3CG produces assembly code
+% "2" -- call m3_backend, it produces object code
+% "3" -- call m3_backend, it produces assembly code
+
+%--------------------------------------------------------------- C compiler ---
+% "compile_c" is called to compile C source files. Note that this function
+% is only called if your program or library explicitly includes C source
+% code, the system distributed by Critical Mass does not.
+
+proc compile_c (source, object, options, optimize, debug) is
+ local args = [ "-fPIC", options ]
+ if optimize args += "-O" end
+ if debug args += "-g" end
+ if M3_PROFILING args += "-pg" end
+ return try_exec ("@gcc", args, "-c", source)
+end
+
+%---------------------------------------------------------------- assembler ---
+% "assemble" is called to assemble .s or .asm files. Note that this function
+% is only called if your program or library explicitly includes assembly source
+% code, the system distributed by Critical Mass does not.
+
+proc assemble (source, object) is
+ return try_exec ("@/usr/bin/as", source, "-o", object)
+end
+
+%--------------------------------------------------------- library creation ---
+% "make_lib" is called to combine a collection of object modules into
+% a library.
+
+proc make_lib (lib, options, objects, imported_libs, shared) is
+ local vmaj = "5"
+ local vmin = "2"
+ local version = vmaj & "." & vmin
+ local ret_code = 0
+ local lib_a = format ("lib%s.a", lib)
+ local lib_so = format ("lib%s.dylib", lib)
+ local lib_sox = format ("lib%s.%s.dylib", lib, vmaj)
+ local lib_soxx = format ("lib%s.%s.dylib", lib, version)
+ local lib_pn = LIB_INSTALL & "/" & lib_soxx
+
+ % first, build the non-shared library
+ ret_code = try_exec ("@/usr/bin/ar", "cru", lib_a, objects)
+ if not equal (ret_code, 0) return ret_code end
+ ret_code = try_exec ("@/usr/bin/ranlib", lib_a)
+ if not equal (ret_code, 0) return ret_code end
+
+ %shared = FALSE
+ if shared
+ % build the shared library
+ ret_code = try_exec ("@libtool -dynamic -flat_namespace",
+ "-undefined suppress -compatibility_version", vmaj,
+ "-current_version", version, "-install_name", lib_pn,
+ "-o", lib_soxx, objects)
+ if not equal (ret_code, 0)
+ delete_file (lib_a)
+ return ret_code
+ end
+
+ % create the version aliases
+ link_file(lib_soxx, lib_sox)
+ link_file(lib_sox, lib_so)
+
+ % finally, make sure the shared library stuff gets installed properly
+ install_derived (lib_soxx)
+ install_derived_link (lib_soxx, lib_sox)
+ install_derived_link (lib_sox, lib_so)
+ install_link_to_derived (lib_soxx, LIB_INSTALL)
+ install_link_to_derived (lib_sox, LIB_INSTALL)
+ install_link_to_derived (lib_so, LIB_INSTALL)
+ else
+ delete_file (lib_so)
+ delete_file (lib_sox)
+ delete_file (lib_soxx)
+ end
+
+ return 0
+end
+
+%-------------------------------------------------------------------
+% "skip_lib" is called when the compiler decides it doesn't need to
+% call "make_lib", but it wants to discover the names of the derived
+% files that should be deleted or shipped.
+
+proc skip_lib (lib, shared) is
+ local vmaj = "5"
+ local vmin = "2"
+ local version = vmaj & "." & vmin
+ local ret_code = 0
+ local lib_a = format ("lib%s.a", lib)
+ local lib_so = format ("lib%s.dylib", lib)
+ local lib_sox = format ("lib%s.%s.dylib", lib, vmaj)
+ local lib_soxx = format ("lib%s.%s.dylib", lib, version)
+
+ if shared
+ % make sure the shared library stuff gets installed properly
+ install_derived (lib_soxx)
+ install_derived (lib_sox)
+ install_derived (lib_so)
+ install_link_to_derived (lib_soxx, LIB_INSTALL)
+ install_link_to_derived (lib_sox, LIB_INSTALL)
+ install_link_to_derived (lib_so, LIB_INSTALL)
+ else
+ delete_file (lib_so)
+ delete_file (lib_sox)
+ delete_file (lib_soxx)
+ end
+
+ return 0
+end
+
+%------------------------------------------------------------------- linker ---
+% "m3_link" is called to produce a final executable.
+%--- "-pdb:none" enables the use of windbg with the resulting executable.
+
+proc m3_link (prog, options, objects, imported_libs, shared) is
+ local args = []
+ if M3_PROFILING args += "-pg" end
+ args += [ "-o", prog, "-fPIC", options, objects, imported_libs ]
+ args += [ "-shared-libgcc" ]
+ return try_exec ("@cc", args)
+end
+
+%-------------------------------------------------------------------
+% "skip_link" is called when the compiler decides it doesn't need to
+% call "m3_link", but it wants to discover the names of the derived
+% files that should be deleted or shipped.
+
+proc skip_link (prog, shared) is
+ return 0
+end
+
+%------------------------------------------------------------ misc. options ---
+% Note, most of these options can be set from the command line. Otherwise,
+% they can be set "permanently" here in the config file or in as needed
+% in user's m3makefiles.
+
+M3_FRONT_FLAGS = [ ]
+% --- internal configuration options passed directly to the Modula-3 front-end
+
+M3_OPTIONS = [ ]
+% --- user options passed directly to the Modula-3 front-end
+
+% M3_KEEP_FILES = TRUE
+% --- keep intermediate and temporary files
+
+% M3_WINDOWS_GUI = TRUE
+% --- generate a Windows GUI subsystem program instead of a console one.
+
+% M3_COVERAGE = TRUE
+% --- compile & link with coverage options
+
+M3_COVERAGE_LIB = LIB_USE & "/report_coverage.o"
+% --- library linked in programs compiled with "-Z" coverage option
+
+%M3_SPLIT_LIBNAMES = TRUE
+% --- split library names and pass -L/-l arguments to the linker
+
+M3_SPLIT_LIBNAMES_IF_SHARED = TRUE
+% --- split library names and pass -L/-l arguments to the linker if linking
+% dynamically, pass full library names else
+% (assumes M3_SPLIT_LIBNAMES = FALSE)
+
+%M3_SHARED_LIB_ARG = "-Wl,-R"
+% --- pass "-R" flags to the linker too...
+
+% M3_BOOTSTRAP = TRUE
+% --- generate bootstrap code (assembly) instead of finaly object code
+
+% M3_COMPILE_ONCE = TRUE
+% --- don't recompile code to improve opaque object references
+
+% SYS_HAS_LOADER = TRUE
+% --- generate a loader info file with objects, libraries and timestamps
+
+% M3_SKIP_LINK = TRUE
+% --- skip the final link for programs, presumably to use the loader instead
+
+% M3_MAIN_IN_C = TRUE
+% --- generate the Modula-3 main program as C code
+
+X11_WITH_SHARED_MEM = TRUE
+% --- X11 libraries include the shared memory extensions (XShm...)
+
+%M3_NEED_STANDALONE_LINKS = TRUE
+% --- linker is broken and we need to build a directory of symbolic
+% links pointing to the non-shared libraries.
+
+%-------------------------------------------------------------------- emacs ---
+% If you have emacs and want to compile ".el" files to ".elc" files,
+% fill in the function below. Otherwise, comment out or delete the
+% entire function. Note, the distributed code assumes gnuemacs version 19
+% or later.
+
+readonly proc emacs_compile (el) is
+ exec ("emacs -batch -f batch-byte-compile", el)
+end
+
+%------------------------------------------------------------- GNU variants ---
+% The two large pieces of GNU software used by the Modula-3 system
+% gcc(=m3cc) and gdb(=m3gdb) often require slightly different C compilers
+% or flags. They are specified here. Note that they may be overridden
+% from the m3build command line.
+%
+% To use the GNU defaults for CC and CFLAGS, specify "*".
+%
+
+GNU_CC = "gcc"
+GNU_CFLAGS = "-g"
+GNU_MAKE = "make"
Only in cm3: run.cm3.cfg~
--- cm3-orig/m3-sys/m3cc/src/m3makefile Mon Apr 14 19:03:28 2003
+++ cm3/m3-sys/m3cc/src/m3makefile Mon Apr 14 19:04:28 2003
@@ -51,16 +51,6 @@
end
end
-if equal(TARGET, "PPC_DARWIN")
- write(EOL)
- write(" Please note that you need a bootstrapped gcc 3.2.1 in order to" &
- EOL)
- write(" compile this package. All attempts to build cm3cg with Apple's" &
- EOL)
- write(" native version of gcc 3.1 have failed so far." & EOL)
- write(EOL)
-end
-
readonly proc GNU_platform (x) is
if Platform_info contains x
return Platform_info{x}
Package: cm3-dev
Version: 5.2.4
Revision: 4
Architecture: powerpc
DescPackaging: Doesn't compile on intel
Maintainer: Matthias Neeracher
Depends: cm3-shlibs (= %v-%r)
Replaces: cm3-shlibs-src
Source: http://www.elegosoft.com/cm3/cm3-src-all-%v.tgz
Source-MD5: d7ce529bc6bffc87ade367c7c0d79256
Source2: http://www.elegosoft.com/cm3/cm3-min-POSIX-PPC_DARWIN-5.2.4.tgz
Source2-MD5: b12f68341a97f2af1eac0c77929af77a
NoSourceDirectory: true
PatchScript: <<
patch -p1 <%a/%n.patch
mkdir bootstrap
tar -C bootstrap -zxvf system.tgz
cp bootstrap.cm3.cfg bootstrap/bin/cm3.cfg
perl -i -pe 's|\@USE_ROOT\@|%b/bootstrap/|; s|\@INSTALL_ROOT\@|%i/|' bootstrap/bin/cm3.cfg
<<
SetCFLAGS: -isystem %p/include
CompileScript: <<
echo "We build and install at once, so all the work is in InstallScript"
<<
InstallScript: <<
cd scripts; PATH=%b/bootstrap/bin:$PATH M3GC_SIMPLE=yes ./do-cm3-core.sh buildship
cd scripts; PATH=%b/bootstrap/bin:$PATH M3GC_SIMPLE=yes ./do-pkg.sh buildship tcp
ln -s %p/lib/cm3/pkg/cm3/PPC_DARWIN/cm3 %i/bin/cm3
cp run.cm3.cfg %i/bin/cm3.cfg
perl -i -pe 's|\@USE_ROOT\@|%p/|; s|\@INSTALL_ROOT\@|%p/|' %i/bin/cm3.cfg
echo Fixing .M3EXPORT files...
find %i -name .M3EXPORTS -print -exec perl -i -pe 's|%d||' '{}' ';'
echo Fixing dynamic libraries...
find %i -name '*.[0-9].[0-9].dylib'|perl -pe '($i=$_)=~s|%d||;chomp($i);`install_name_tool -id $i $_`'
<<
SplitOff: <<
Package: cm3-shlibs
Files: <<
lib/cm3/pkg/bitvector/PPC_DARWIN/libBitVector.*.dylib
lib/cm3/pkg/digraph/PPC_DARWIN/libDiGraph.*.dylib
lib/cm3/pkg/libm3/PPC_DARWIN/libm3.*.dylib
lib/cm3/pkg/m3core/PPC_DARWIN/libm3core.*.dylib
lib/cm3/pkg/m3gc-simple/PPC_DARWIN/libm3gcdefs.*.dylib
lib/cm3/pkg/parseparams/PPC_DARWIN/libm3parseparams.*.dylib
lib/cm3/pkg/realgeometry/PPC_DARWIN/libGeometry.*.dylib
lib/cm3/pkg/set/PPC_DARWIN/libset.*.dylib
lib/cm3/pkg/slisp/PPC_DARWIN/libm3slisp.*.dylib
lib/cm3/pkg/sortedtableextras/PPC_DARWIN/libSortedTableExtras.*.dylib
lib/cm3/pkg/table-list/PPC_DARWIN/libtable-list.*.dylib
lib/cm3/pkg/tcp/PPC_DARWIN/libm3tcp.*.dylib
lib/cm3/pkg/tempfiles/PPC_DARWIN/libTempFiles.*.dylib
<<
Shlibs: <<
%p/lib/cm3/pkg/bitvector/PPC_DARWIN/libBitVector.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/digraph/PPC_DARWIN/libDiGraph.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/libm3/PPC_DARWIN/libm3.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/m3core/PPC_DARWIN/libm3core.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/m3gc-simple/PPC_DARWIN/libm3gcdefs.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/parseparams/PPC_DARWIN/libm3parseparams.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/realgeometry/PPC_DARWIN/libGeometry.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/set/PPC_DARWIN/libset.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/slisp/PPC_DARWIN/libm3slisp.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/sortedtableextras/PPC_DARWIN/libSortedTableExtras.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/table-list/PPC_DARWIN/libtable-list.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/tcp/PPC_DARWIN/libm3tcp.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
%p/lib/cm3/pkg/tempfiles/PPC_DARWIN/libTempFiles.5.2.dylib 5.2.0 %n (>= 5.2.4-1)
<<
Description: Critical Mass Modula-3 Shared Libraries
DescDetail: <<
Shared libraries needed for programs built with Critical Mass Modula-3.
<<
DocFiles: COPYRIGHT-CMASS COPYRIGHT-DEC
<<
DocFiles: COPYRIGHT-CMASS COPYRIGHT-DEC
Description: Critical Mass Modula-3 Compiler
DescDetail: <<
Critical Mass Modula-3 5.1 (CM3) is the latest release of the Modula-3
compiler produced by Critical Mass
This package currently does not build if autogen-dev is installed (once built,
it no longer conflicts with autogen-dev).
<<
DescPort: <<
This port was mainly accomplished by reverse engineering the darwinports
version by Landon Fuller.
<<
License: Restrictive/Distributable
Homepage: http://www.m3.org
diff -ru cm3-orig/bootstrap.cm3.cfg cm3/bootstrap.cm3.cfg
--- cm3-orig/bootstrap.cm3.cfg Sat Mar 29 00:29:54 2003
+++ cm3/bootstrap.cm3.cfg Sun Mar 30 20:39:29 2003
@@ -0,0 +1,342 @@
+% Copyright 1996-2000 Critical Mass, Inc. All rights reserved.
+% See file COPYRIGHT-CMASS for details.
+%
+% Standard configuration file for FreeBSD with ELF object files
+%
+
+%-------------------------------------------------- compilation environment ---
+
+%M3_PROFILING = TRUE % set by cm3 since 5.1.2
+%M3_PROFILING = FALSE
+
+readonly TARGET = "PPC_DARWIN" % code generation target
+if M3_PROFILING
+ readonly BUILD_DIR = TARGET & "p" % code generation target
+else
+ readonly BUILD_DIR = TARGET % directory for results
+end
+readonly OS_TYPE = "POSIX" % { "WIN32" or "POSIX" }
+readonly WORD_SIZE = "32BITS" % { "32BITS" or "64BITS" }
+readonly GNU_PLATFORM = "powerpc-apple-darwin6.3" % "cpu-vendor-os" string for GNU
+readonly INSTALL_KEY = "9R52-K7A2-2K32"
+
+readonly NAMING_CONVENTIONS = "0"
+% object files libraries
+% 0=Unix => .o .io .mo libXX.a
+% 1=Unix with a grumpy C compiler => .o _i.o _m.o libXX.a
+% 2=Windows NT or Windows 95 => .obj .io .mo XX.lib
+%
+
+%-------------------------------------------------- default compile options ---
+% "set_config_options" is called before starting the compilation. It should
+% be used to provide system-wide default options.
+
+proc set_config_options () is
+ m3_option ("-why") %-- produce a listing that explains what's happening and why
+ m3_debug (TRUE) %-- produce object code with debugging symbols
+ M3_OPTIONS += "-w1" %-- produce "level 1" warnings
+end
+
+%--------------------------------------------------------- Reactor defaults ---
+% The first time a user runs Reactor, it will configure itself to use
+% the executables defined below.
+
+INITIAL_REACTOR_BROWSER = "netscape"
+% A World-Wide Web browser. Reactor passes it an initial URL
+% its first command-line argument.
+
+INITIAL_REACTOR_EDITOR = "emacsclient"
+% A text editor. Reactor passes it "
+% command-line when it wants to edit
+% at
+
+%------------------------------------------------------------- export paths ---
+% During the installation, destination directories that do not exists
+% will be created. You need the necessary permissions to do so; otherwise,
+% the installation will fail, but can be restarted after you have
+% fixed the permissions.
+
+INSTALL_ROOT = "@INSTALL_ROOT@"
+
+BIN_INSTALL = INSTALL_ROOT & "bin" % executables
+if M3_PROFILING
+ LIB_INSTALL = INSTALL_ROOT & "libp" % libraries
+else
+ LIB_INSTALL = INSTALL_ROOT & "lib/cm3" % libraries
+end
+PKG_INSTALL = INSTALL_ROOT & "lib/cm3/pkg" % packages
+DOC_INSTALL = INSTALL_ROOT & "share/doc/cm3" % documents
+EMACS_INSTALL = INSTALL_ROOT & "elisp" % emacs lisp code
+MAN_INSTALL = INSTALL_ROOT & "share/man" % man pages
+HTML_INSTALL = INSTALL_ROOT & "share/doc/cm3/html" % public hypertext
+
+% On some systems (e.g. AFS) you must install public files in a different
+% place from where you use them. If that is the case for your system,
+% specify the "use" location here, otherwise leave them alone.
+%
+USE_ROOT = "@USE_ROOT@"
+BIN_USE = USE_ROOT & "bin" % executables
+LIB_USE = USE_ROOT & "lib" % libraries
+PKG_USE = INSTALL_ROOT & "lib/cm3/pkg" % packages
+
+readonly INSTALL_IMPLS = TRUE
+% TRUE
+% => save all source files during the install
+% => makes debugging easier and browsing more fruitful
+% FALSE
+% => save only the exported interfaces and templates
+% => makes the installed system slightly smaller.
+
+%------------------------------------------------ external system libraries ---
+% SYSTEM_LIBS provides a mapping from Modula-3 names for the common
+% external libraries to site-dependent information about how they
+% are accessed. If SYSTEM_LIBS{x} is defined it should be a list
+% of linker arguments that are used when linking against that library.
+% If SYSTEM_LIBS{x} is not defined, the Modula-3 system will assume
+% that the library is not available.
+
+SYSTEM_LIBS = {
+ "LIBC" : [ "-lm" ],
+ "LEX-YACC" : [ "-L/usr/lib", "-ll" ],
+% "FLEX-BISON" : [ "-L/usr/lib", "-lfl" ],
+ "POSTGRES95" : [ "-L/usr/local/pgsql/lib", "-lpq" ],
+ "OPENGL" : [ "-L/usr/X11R6/lib", "-lGLU", "-lGL", "-lXext" ],
+ "MOTIF" : [ "-L/usr/X11R6/lib", "-lXm" ],
+ "X11" : [ "-L/usr/X11R6/lib", "-lXaw", "-lXmu", "-lXext",
+ "-lXt", "-lSM", "-lICE", "-lX11" ],
+ "TCP" : [ ]
+}
+
+% SYSTEM_LIBORDER defines the order in which SYSTEM_LIBS should be
+% scanned by the linker.
+
+SYSTEM_LIBORDER = [ "OPENGL", "DECPEX", "MOTIF", "X11", "TCP", "ODBC",
+ "POSTGRES95", "FLEX-BISON", "LEX-YACC", "LIBC" ]
+
+%--------------------------------------------------------- Modula-3 backend ---
+% For platforms without an integrated backend, "m3_backend" is called to
+% translate Modula-3 intermediate code to object code.
+
+readonly m3back = "@" & BIN_USE & "/cm3cg"
+
+proc m3_backend (source, object, optimize, debug) is
+ local args = [ "-quiet", source, "-o", object, "-fPIC", "-gstabs" ]
+ if optimize args += "-O" end
+ if debug args += "-g" end
+ if M3_PROFILING args += "-p" end
+ return try_exec (m3back, args)
+end
+
+M3_BACKEND_MODE = "3"
+% -- defines how the frontend, backend, and assembler interact
+% "0" -- don't call m3_backend, M3CG produces object code
+% "1" -- don't call m3_backend, M3CG produces assembly code
+% "2" -- call m3_backend, it produces object code
+% "3" -- call m3_backend, it produces assembly code
+
+%--------------------------------------------------------------- C compiler ---
+% "compile_c" is called to compile C source files. Note that this function
+% is only called if your program or library explicitly includes C source
+% code, the system distributed by Critical Mass does not.
+
+proc compile_c (source, object, options, optimize, debug) is
+ local args = [ "-fPIC", options ]
+ if optimize args += "-O" end
+ if debug args += "-g" end
+ if M3_PROFILING args += "-pg" end
+ return try_exec ("@gcc", args, "-c", source)
+end
+
+%---------------------------------------------------------------- assembler ---
+% "assemble" is called to assemble .s or .asm files. Note that this function
+% is only called if your program or library explicitly includes assembly source
+% code, the system distributed by Critical Mass does not.
+
+proc assemble (source, object) is
+ return try_exec ("@/usr/bin/as", source, "-o", object)
+end
+
+%--------------------------------------------------------- library creation ---
+% "make_lib" is called to combine a collection of object modules into
+% a library.
+
+proc make_lib (lib, options, objects, imported_libs, shared) is
+ local vmaj = "5"
+ local vmin = "2"
+ local version = vmaj & "." & vmin
+ local ret_code = 0
+ local lib_a = format ("lib%s.a", lib)
+ local lib_so = format ("lib%s.dylib", lib)
+ local lib_sox = format ("lib%s.%s.dylib", lib, vmaj)
+ local lib_soxx = format ("lib%s.%s.dylib", lib, version)
+ local lib_pn = LIB_INSTALL & "/" & lib_soxx
+
+ % first, build the non-shared library
+ ret_code = try_exec ("@/usr/bin/ar", "cru", lib_a, objects)
+ if not equal (ret_code, 0) return ret_code end
+ ret_code = try_exec ("@/usr/bin/ranlib", lib_a)
+ if not equal (ret_code, 0) return ret_code end
+
+ %shared = FALSE
+ if shared
+ % build the shared library
+ ret_code = try_exec ("@libtool -dynamic -flat_namespace",
+ "-undefined suppress -compatibility_version", vmaj,
+ "-current_version", version, "-install_name", lib_pn,
+ "-o", lib_soxx, objects)
+ if not equal (ret_code, 0)
+ delete_file (lib_a)
+ return ret_code
+ end
+
+ % create the version aliases
+ link_file(lib_soxx, lib_sox)
+ link_file(lib_sox, lib_so)
+
+ % finally, make sure the shared library stuff gets installed properly
+ install_derived (lib_soxx)
+ install_derived_link (lib_soxx, lib_sox)
+ install_derived_link (lib_sox, lib_so)
+ install_link_to_derived (lib_soxx, LIB_INSTALL)
+ install_link_to_derived (lib_sox, LIB_INSTALL)
+ install_link_to_derived (lib_so, LIB_INSTALL)
+ else
+ delete_file (lib_so)
+ delete_file (lib_sox)
+ delete_file (lib_soxx)
+ end
+
+ return 0
+end
+
+%-------------------------------------------------------------------
+% "skip_lib" is called when the compiler decides it doesn't need to
+% call "make_lib", but it wants to discover the names of the derived
+% files that should be deleted or shipped.
+
+proc skip_lib (lib, shared) is
+ local vmaj = "5"
+ local vmin = "2"
+ local version = vmaj & "." & vmin
+ local ret_code = 0
+ local lib_a = format ("lib%s.a", lib)
+ local lib_so = format ("lib%s.dylib", lib)
+ local lib_sox = format ("lib%s.%s.dylib", lib, vmaj)
+ local lib_soxx = format ("lib%s.%s.dylib", lib, version)
+
+ if shared
+ % make sure the shared library stuff gets installed properly
+ install_derived (lib_soxx)
+ install_derived (lib_sox)
+ install_derived (lib_so)
+ install_link_to_derived (lib_soxx, LIB_INSTALL)
+ install_link_to_derived (lib_sox, LIB_INSTALL)
+ install_link_to_derived (lib_so, LIB_INSTALL)
+ else
+ delete_file (lib_so)
+ delete_file (lib_sox)
+ delete_file (lib_soxx)
+ end
+
+ return 0
+end
+
+%------------------------------------------------------------------- linker ---
+% "m3_link" is called to produce a final executable.
+%--- "-pdb:none" enables the use of windbg with the resulting executable.
+
+proc m3_link (prog, options, objects, imported_libs, shared) is
+ local args = []
+ if M3_PROFILING args += "-pg" end
+ args += [ "-o", prog, "-fPIC", options, objects, imported_libs ]
+ args += [ "-shared-libgcc" ]
+ return try_exec ("@cc", args)
+end
+
+%-------------------------------------------------------------------
+% "skip_link" is called when the compiler decides it doesn't need to
+% call "m3_link", but it wants to discover the names of the derived
+% files that should be deleted or shipped.
+
+proc skip_link (prog, shared) is
+ return 0
+end
+
+%------------------------------------------------------------ misc. options ---
+% Note, most of these options can be set from the command line. Otherwise,
+% they can be set "permanently" here in the config file or in as needed
+% in user's m3makefiles.
+
+M3_FRONT_FLAGS = [ ]
+% --- internal configuration options passed directly to the Modula-3 front-end
+
+M3_OPTIONS = [ ]
+% --- user options passed directly to the Modula-3 front-end
+
+% M3_KEEP_FILES = TRUE
+% --- keep intermediate and temporary files
+
+% M3_WINDOWS_GUI = TRUE
+% --- generate a Windows GUI subsystem program instead of a console one.
+
+% M3_COVERAGE = TRUE
+% --- compile & link with coverage options
+
+M3_COVERAGE_LIB = LIB_USE & "/report_coverage.o"
+% --- library linked in programs compiled with "-Z" coverage option
+
+%M3_SPLIT_LIBNAMES = TRUE
+% --- split library names and pass -L/-l arguments to the linker
+
+M3_SPLIT_LIBNAMES_IF_SHARED = TRUE
+% --- split library names and pass -L/-l arguments to the linker if linking
+% dynamically, pass full library names else
+% (assumes M3_SPLIT_LIBNAMES = FALSE)
+
+%M3_SHARED_LIB_ARG = "-Wl,-R"
+% --- pass "-R" flags to the linker too...
+
+% M3_BOOTSTRAP = TRUE
+% --- generate bootstrap code (assembly) instead of finaly object code
+
+% M3_COMPILE_ONCE = TRUE
+% --- don't recompile code to improve opaque object references
+
+% SYS_HAS_LOADER = TRUE
+% --- generate a loader info file with objects, libraries and timestamps
+
+% M3_SKIP_LINK = TRUE
+% --- skip the final link for programs, presumably to use the loader instead
+
+% M3_MAIN_IN_C = TRUE
+% --- generate the Modula-3 main program as C code
+
+X11_WITH_SHARED_MEM = TRUE
+% --- X11 libraries include the shared memory extensions (XShm...)
+
+%M3_NEED_STANDALONE_LINKS = TRUE
+% --- linker is broken and we need to build a directory of symbolic
+% links pointing to the non-shared libraries.
+
+%-------------------------------------------------------------------- emacs ---
+% If you have emacs and want to compile ".el" files to ".elc" files,
+% fill in the function below. Otherwise, comment out or delete the
+% entire function. Note, the distributed code assumes gnuemacs version 19
+% or later.
+
+readonly proc emacs_compile (el) is
+ exec ("emacs -batch -f batch-byte-compile", el)
+end
+
+%------------------------------------------------------------- GNU variants ---
+% The two large pieces of GNU software used by the Modula-3 system
+% gcc(=m3cc) and gdb(=m3gdb) often require slightly different C compilers
+% or flags. They are specified here. Note that they may be overridden
+% from the m3build command line.
+%
+% To use the GNU defaults for CC and CFLAGS, specify "*".
+%
+
+GNU_CC = "gcc"
+GNU_CFLAGS = "-g"
+GNU_MAKE = "make"
Only in cm3: bootstrap.cm3.cfg~
diff -ru cm3-orig/m3-sys/m3cc/gcc/gcc/stmt.c cm3/m3-sys/m3cc/gcc/gcc/stmt.c
--- cm3-orig/m3-sys/m3cc/gcc/gcc/stmt.c Sat Mar 29 00:25:02 2003
+++ cm3/m3-sys/m3cc/gcc/gcc/stmt.c Sat Mar 29 00:30:32 2003
@@ -5166,12 +5166,15 @@
/* We deliberately use calloc here, not cmalloc, so that we can suppress
this optimization if we don't have enough memory rather than
aborting, as xmalloc would do. */
- && (cases_seen =
- (unsigned char *) really_call_calloc (bytes_needed, 1)) != NULL)
+ && (cases_seen = (unsigned char *)alloca(bytes_needed) ) != NULL )
+/* && (cases_seen = */
+/* (unsigned char *) really_call_calloc (bytes_needed, 1)) != NULL) */
{
HOST_WIDE_INT i;
tree v = TYPE_VALUES (type);
+ unsigned char *x;
+ for( x = cases_seen; x < cases_seen + bytes_needed; x++){ *x = 0; }
/* The time complexity of this code is normally O(N), where
N being the number of members in the enumerated type.
However, if type is a ENUMERAL_TYPE whose values do not
diff -ru cm3-orig/run.cm3.cfg cm3/run.cm3.cfg
--- cm3-orig/run.cm3.cfg Sun Mar 30 17:08:22 2003
+++ cm3/run.cm3.cfg Sun Mar 30 17:21:54 2003
@@ -0,0 +1,342 @@
+% Copyright 1996-2000 Critical Mass, Inc. All rights reserved.
+% See file COPYRIGHT-CMASS for details.
+%
+% Standard configuration file for FreeBSD with ELF object files
+%
+
+%-------------------------------------------------- compilation environment ---
+
+%M3_PROFILING = TRUE % set by cm3 since 5.1.2
+%M3_PROFILING = FALSE
+
+readonly TARGET = "PPC_DARWIN" % code generation target
+if M3_PROFILING
+ readonly BUILD_DIR = TARGET & "p" % code generation target
+else
+ readonly BUILD_DIR = TARGET % directory for results
+end
+readonly OS_TYPE = "POSIX" % { "WIN32" or "POSIX" }
+readonly WORD_SIZE = "32BITS" % { "32BITS" or "64BITS" }
+readonly GNU_PLATFORM = "powerpc-apple-darwin6.3" % "cpu-vendor-os" string for GNU
+readonly INSTALL_KEY = "9R52-K7A2-2K32"
+
+readonly NAMING_CONVENTIONS = "0"
+% object files libraries
+% 0=Unix => .o .io .mo libXX.a
+% 1=Unix with a grumpy C compiler => .o _i.o _m.o libXX.a
+% 2=Windows NT or Windows 95 => .obj .io .mo XX.lib
+%
+
+%-------------------------------------------------- default compile options ---
+% "set_config_options" is called before starting the compilation. It should
+% be used to provide system-wide default options.
+
+proc set_config_options () is
+ m3_option ("-why") %-- produce a listing that explains what's happening and why
+ m3_debug (TRUE) %-- produce object code with debugging symbols
+ M3_OPTIONS += "-w1" %-- produce "level 1" warnings
+end
+
+%--------------------------------------------------------- Reactor defaults ---
+% The first time a user runs Reactor, it will configure itself to use
+% the executables defined below.
+
+INITIAL_REACTOR_BROWSER = "netscape"
+% A World-Wide Web browser. Reactor passes it an initial URL
+% its first command-line argument.
+
+INITIAL_REACTOR_EDITOR = "emacsclient"
+% A text editor. Reactor passes it "
+% command-line when it wants to edit
+% at
+
+%------------------------------------------------------------- export paths ---
+% During the installation, destination directories that do not exists
+% will be created. You need the necessary permissions to do so; otherwise,
+% the installation will fail, but can be restarted after you have
+% fixed the permissions.
+
+INSTALL_ROOT = "@INSTALL_ROOT@"
+
+BIN_INSTALL = INSTALL_ROOT & "bin" % executables
+if M3_PROFILING
+ LIB_INSTALL = INSTALL_ROOT & "libp" % libraries
+else
+ LIB_INSTALL = INSTALL_ROOT & "lib/cm3" % libraries
+end
+PKG_INSTALL = INSTALL_ROOT & "lib/cm3/pkg" % packages
+DOC_INSTALL = INSTALL_ROOT & "share/doc/cm3" % documents
+EMACS_INSTALL = INSTALL_ROOT & "elisp" % emacs lisp code
+MAN_INSTALL = INSTALL_ROOT & "share/man" % man pages
+HTML_INSTALL = INSTALL_ROOT & "share/doc/cm3/html" % public hypertext
+
+% On some systems (e.g. AFS) you must install public files in a different
+% place from where you use them. If that is the case for your system,
+% specify the "use" location here, otherwise leave them alone.
+%
+USE_ROOT = "@USE_ROOT@"
+BIN_USE = USE_ROOT & "bin" % executables
+LIB_USE = USE_ROOT & "lib/cm3" % libraries
+PKG_USE = USE_ROOT & "lib/cm3/pkg" % packages
+
+readonly INSTALL_IMPLS = TRUE
+% TRUE
+% => save all source files during the install
+% => makes debugging easier and browsing more fruitful
+% FALSE
+% => save only the exported interfaces and templates
+% => makes the installed system slightly smaller.
+
+%------------------------------------------------ external system libraries ---
+% SYSTEM_LIBS provides a mapping from Modula-3 names for the common
+% external libraries to site-dependent information about how they
+% are accessed. If SYSTEM_LIBS{x} is defined it should be a list
+% of linker arguments that are used when linking against that library.
+% If SYSTEM_LIBS{x} is not defined, the Modula-3 system will assume
+% that the library is not available.
+
+SYSTEM_LIBS = {
+ "LIBC" : [ "-lm" ],
+ "LEX-YACC" : [ "-L/usr/lib", "-ll" ],
+% "FLEX-BISON" : [ "-L/usr/lib", "-lfl" ],
+ "POSTGRES95" : [ "-L/usr/local/pgsql/lib", "-lpq" ],
+ "OPENGL" : [ "-L/usr/X11R6/lib", "-lGLU", "-lGL", "-lXext" ],
+ "MOTIF" : [ "-L/usr/X11R6/lib", "-lXm" ],
+ "X11" : [ "-L/usr/X11R6/lib", "-lXaw", "-lXmu", "-lXext",
+ "-lXt", "-lSM", "-lICE", "-lX11" ],
+ "TCP" : [ ]
+}
+
+% SYSTEM_LIBORDER defines the order in which SYSTEM_LIBS should be
+% scanned by the linker.
+
+SYSTEM_LIBORDER = [ "OPENGL", "DECPEX", "MOTIF", "X11", "TCP", "ODBC",
+ "POSTGRES95", "FLEX-BISON", "LEX-YACC", "LIBC" ]
+
+%--------------------------------------------------------- Modula-3 backend ---
+% For platforms without an integrated backend, "m3_backend" is called to
+% translate Modula-3 intermediate code to object code.
+
+readonly m3back = "@" & BIN_USE & "/cm3cg"
+
+proc m3_backend (source, object, optimize, debug) is
+ local args = [ "-quiet", source, "-o", object, "-fPIC", "-gstabs" ]
+ if optimize args += "-O" end
+ if debug args += "-g" end
+ if M3_PROFILING args += "-p" end
+ return try_exec (m3back, args)
+end
+
+M3_BACKEND_MODE = "3"
+% -- defines how the frontend, backend, and assembler interact
+% "0" -- don't call m3_backend, M3CG produces object code
+% "1" -- don't call m3_backend, M3CG produces assembly code
+% "2" -- call m3_backend, it produces object code
+% "3" -- call m3_backend, it produces assembly code
+
+%--------------------------------------------------------------- C compiler ---
+% "compile_c" is called to compile C source files. Note that this function
+% is only called if your program or library explicitly includes C source
+% code, the system distributed by Critical Mass does not.
+
+proc compile_c (source, object, options, optimize, debug) is
+ local args = [ "-fPIC", options ]
+ if optimize args += "-O" end
+ if debug args += "-g" end
+ if M3_PROFILING args += "-pg" end
+ return try_exec ("@gcc", args, "-c", source)
+end
+
+%---------------------------------------------------------------- assembler ---
+% "assemble" is called to assemble .s or .asm files. Note that this function
+% is only called if your program or library explicitly includes assembly source
+% code, the system distributed by Critical Mass does not.
+
+proc assemble (source, object) is
+ return try_exec ("@/usr/bin/as", source, "-o", object)
+end
+
+%--------------------------------------------------------- library creation ---
+% "make_lib" is called to combine a collection of object modules into
+% a library.
+
+proc make_lib (lib, options, objects, imported_libs, shared) is
+ local vmaj = "5"
+ local vmin = "2"
+ local version = vmaj & "." & vmin
+ local ret_code = 0
+ local lib_a = format ("lib%s.a", lib)
+ local lib_so = format ("lib%s.dylib", lib)
+ local lib_sox = format ("lib%s.%s.dylib", lib, vmaj)
+ local lib_soxx = format ("lib%s.%s.dylib", lib, version)
+ local lib_pn = LIB_INSTALL & "/" & lib_soxx
+
+ % first, build the non-shared library
+ ret_code = try_exec ("@/usr/bin/ar", "cru", lib_a, objects)
+ if not equal (ret_code, 0) return ret_code end
+ ret_code = try_exec ("@/usr/bin/ranlib", lib_a)
+ if not equal (ret_code, 0) return ret_code end
+
+ %shared = FALSE
+ if shared
+ % build the shared library
+ ret_code = try_exec ("@libtool -dynamic -flat_namespace",
+ "-undefined suppress -compatibility_version", vmaj,
+ "-current_version", version, "-install_name", lib_pn,
+ "-o", lib_soxx, objects)
+ if not equal (ret_code, 0)
+ delete_file (lib_a)
+ return ret_code
+ end
+
+ % create the version aliases
+ link_file(lib_soxx, lib_sox)
+ link_file(lib_sox, lib_so)
+
+ % finally, make sure the shared library stuff gets installed properly
+ install_derived (lib_soxx)
+ install_derived_link (lib_soxx, lib_sox)
+ install_derived_link (lib_sox, lib_so)
+ install_link_to_derived (lib_soxx, LIB_INSTALL)
+ install_link_to_derived (lib_sox, LIB_INSTALL)
+ install_link_to_derived (lib_so, LIB_INSTALL)
+ else
+ delete_file (lib_so)
+ delete_file (lib_sox)
+ delete_file (lib_soxx)
+ end
+
+ return 0
+end
+
+%-------------------------------------------------------------------
+% "skip_lib" is called when the compiler decides it doesn't need to
+% call "make_lib", but it wants to discover the names of the derived
+% files that should be deleted or shipped.
+
+proc skip_lib (lib, shared) is
+ local vmaj = "5"
+ local vmin = "2"
+ local version = vmaj & "." & vmin
+ local ret_code = 0
+ local lib_a = format ("lib%s.a", lib)
+ local lib_so = format ("lib%s.dylib", lib)
+ local lib_sox = format ("lib%s.%s.dylib", lib, vmaj)
+ local lib_soxx = format ("lib%s.%s.dylib", lib, version)
+
+ if shared
+ % make sure the shared library stuff gets installed properly
+ install_derived (lib_soxx)
+ install_derived (lib_sox)
+ install_derived (lib_so)
+ install_link_to_derived (lib_soxx, LIB_INSTALL)
+ install_link_to_derived (lib_sox, LIB_INSTALL)
+ install_link_to_derived (lib_so, LIB_INSTALL)
+ else
+ delete_file (lib_so)
+ delete_file (lib_sox)
+ delete_file (lib_soxx)
+ end
+
+ return 0
+end
+
+%------------------------------------------------------------------- linker ---
+% "m3_link" is called to produce a final executable.
+%--- "-pdb:none" enables the use of windbg with the resulting executable.
+
+proc m3_link (prog, options, objects, imported_libs, shared) is
+ local args = []
+ if M3_PROFILING args += "-pg" end
+ args += [ "-o", prog, "-fPIC", options, objects, imported_libs ]
+ args += [ "-shared-libgcc" ]
+ return try_exec ("@cc", args)
+end
+
+%-------------------------------------------------------------------
+% "skip_link" is called when the compiler decides it doesn't need to
+% call "m3_link", but it wants to discover the names of the derived
+% files that should be deleted or shipped.
+
+proc skip_link (prog, shared) is
+ return 0
+end
+
+%------------------------------------------------------------ misc. options ---
+% Note, most of these options can be set from the command line. Otherwise,
+% they can be set "permanently" here in the config file or in as needed
+% in user's m3makefiles.
+
+M3_FRONT_FLAGS = [ ]
+% --- internal configuration options passed directly to the Modula-3 front-end
+
+M3_OPTIONS = [ ]
+% --- user options passed directly to the Modula-3 front-end
+
+% M3_KEEP_FILES = TRUE
+% --- keep intermediate and temporary files
+
+% M3_WINDOWS_GUI = TRUE
+% --- generate a Windows GUI subsystem program instead of a console one.
+
+% M3_COVERAGE = TRUE
+% --- compile & link with coverage options
+
+M3_COVERAGE_LIB = LIB_USE & "/report_coverage.o"
+% --- library linked in programs compiled with "-Z" coverage option
+
+%M3_SPLIT_LIBNAMES = TRUE
+% --- split library names and pass -L/-l arguments to the linker
+
+M3_SPLIT_LIBNAMES_IF_SHARED = TRUE
+% --- split library names and pass -L/-l arguments to the linker if linking
+% dynamically, pass full library names else
+% (assumes M3_SPLIT_LIBNAMES = FALSE)
+
+%M3_SHARED_LIB_ARG = "-Wl,-R"
+% --- pass "-R" flags to the linker too...
+
+% M3_BOOTSTRAP = TRUE
+% --- generate bootstrap code (assembly) instead of finaly object code
+
+% M3_COMPILE_ONCE = TRUE
+% --- don't recompile code to improve opaque object references
+
+% SYS_HAS_LOADER = TRUE
+% --- generate a loader info file with objects, libraries and timestamps
+
+% M3_SKIP_LINK = TRUE
+% --- skip the final link for programs, presumably to use the loader instead
+
+% M3_MAIN_IN_C = TRUE
+% --- generate the Modula-3 main program as C code
+
+X11_WITH_SHARED_MEM = TRUE
+% --- X11 libraries include the shared memory extensions (XShm...)
+
+%M3_NEED_STANDALONE_LINKS = TRUE
+% --- linker is broken and we need to build a directory of symbolic
+% links pointing to the non-shared libraries.
+
+%-------------------------------------------------------------------- emacs ---
+% If you have emacs and want to compile ".el" files to ".elc" files,
+% fill in the function below. Otherwise, comment out or delete the
+% entire function. Note, the distributed code assumes gnuemacs version 19
+% or later.
+
+readonly proc emacs_compile (el) is
+ exec ("emacs -batch -f batch-byte-compile", el)
+end
+
+%------------------------------------------------------------- GNU variants ---
+% The two large pieces of GNU software used by the Modula-3 system
+% gcc(=m3cc) and gdb(=m3gdb) often require slightly different C compilers
+% or flags. They are specified here. Note that they may be overridden
+% from the m3build command line.
+%
+% To use the GNU defaults for CC and CFLAGS, specify "*".
+%
+
+GNU_CC = "gcc"
+GNU_CFLAGS = "-g"
+GNU_MAKE = "make"
Only in cm3: run.cm3.cfg~
--- cm3-orig/m3-sys/m3cc/src/m3makefile Mon Apr 14 19:03:28 2003
+++ cm3/m3-sys/m3cc/src/m3makefile Mon Apr 14 19:04:28 2003
@@ -51,16 +51,6 @@
end
end
-if equal(TARGET, "PPC_DARWIN")
- write(EOL)
- write(" Please note that you need a bootstrapped gcc 3.2.1 in order to" &
- EOL)
- write(" compile this package. All attempts to build cm3cg with Apple's" &
- EOL)
- write(" native version of gcc 3.1 have failed so far." & EOL)
- write(EOL)
-end
-
readonly proc GNU_platform (x) is
if Platform_info contains x
return Platform_info{x}