summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2003-07-17 19:28:31 +0000
committerMike Frysinger <vapier@gentoo.org>2003-07-17 19:28:31 +0000
commit29418910a9e1396bd03379014a99cfe219be059b (patch)
treea43365af8484db0a569b5f864803b81dff4ecc82 /dev-lang/cm3-bin
parentppc config (diff)
downloadgentoo-2-29418910a9e1396bd03379014a99cfe219be059b.tar.gz
gentoo-2-29418910a9e1396bd03379014a99cfe219be059b.tar.bz2
gentoo-2-29418910a9e1396bd03379014a99cfe219be059b.zip
unify .cfg files
Diffstat (limited to 'dev-lang/cm3-bin')
-rw-r--r--dev-lang/cm3-bin/cm3-bin-5.2.6.ebuild19
-rw-r--r--dev-lang/cm3-bin/files/cm3-ppc.cfg351
-rw-r--r--dev-lang/cm3-bin/files/cm3-x86.cfg351
-rw-r--r--dev-lang/cm3-bin/files/cm3.cfg187
4 files changed, 202 insertions, 706 deletions
diff --git a/dev-lang/cm3-bin/cm3-bin-5.2.6.ebuild b/dev-lang/cm3-bin/cm3-bin-5.2.6.ebuild
index 4e968708ddd7..81560051b269 100644
--- a/dev-lang/cm3-bin/cm3-bin-5.2.6.ebuild
+++ b/dev-lang/cm3-bin/cm3-bin-5.2.6.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/cm3-bin/cm3-bin-5.2.6.ebuild,v 1.2 2003/07/17 19:04:36 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/cm3-bin/cm3-bin-5.2.6.ebuild,v 1.3 2003/07/17 19:28:16 vapier Exp $
DESCRIPTION="Critical Mass Modula-3 compiler (binary version)"
HOMEPAGE="http://www.elegosoft.com/cm3/"
@@ -18,15 +18,26 @@ src_unpack() {
unpack ${A}
tar -zxf system.tgz || die "unpacking system.tgz"
+ local TARGET
+ local GNU_PLATFORM
+ case ${ARCH} in
+ x86) TARGET=LINUXLIBC6
+ GNU_PLATFORM=i486--linuxelf
+ ;;
+ ppc) TARGET=PPC_LINUX
+ GNU_PLATFORM=powerpc-apple-linuxelf
+ ;;
+ esac
sed \
+ -e "s:GENTOO_TARGET:${TARGET}:" \
+ -e "s:GENTOO_GNU_PLATFORM:${GNU_PLATFORM}:" \
-e "s:GENTOO_INITIAL_REACTOR_EDITOR:${EDITOR:-/usr/bin/nano}:" \
-e "s:GENTOO_INSTALL_ROOT:/usr/lib/cm3/:" \
-e "s:GENTOO_GNU_CC:${CC:-gcc}:" \
-e "s:GENTOO_GNU_CFLAGS:${CFLAGS:--O}:" \
-e "s:GENTOO_GNU_MAKE:${MAKE:-make}:" \
- ${FILESDIR}/cm3-${ARCH}.cfg > bin/cm3.cfg
- echo "ROOT=\"/usr/lib/cm3/pkg/\"" >> bin/cm3.cfg
- rm -rf doc elisp examples man
+ -e "s:GENTOO_ROOT:/usr/lib/cm3/pkg/:" \
+ ${FILESDIR}/cm3.cfg > bin/cm3.cfg
}
src_install() {
diff --git a/dev-lang/cm3-bin/files/cm3-ppc.cfg b/dev-lang/cm3-bin/files/cm3-ppc.cfg
deleted file mode 100644
index 4477acad60af..000000000000
--- a/dev-lang/cm3-bin/files/cm3-ppc.cfg
+++ /dev/null
@@ -1,351 +0,0 @@
-% Copyright 1996 Critical Mass, Inc. All rights reserved.
-%
-% Standard configuration file for LINUX with ELF object files
-%
-
-%-------------------------------------------------- compilation environment ---
-
-%M3_PROFILING = TRUE % set by cm3 since 5.1.2 (option -profile)
-%M3_PROFILING = FALSE
-
-readonly TARGET = "PPC_LINUX" % 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-linuxelf" % "cpu-vendor-os" string for GNU
-%readonly INSTALL_KEY = BEGIN_CONFIG
-% "What is your installation key?"
-% 14 %-- user specified key
-%END_CONFIG
-
-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 = BEGIN_CONFIG
-% "What should be the default World-Wide Web browser for new Reactor users?"
-% 0 "netscape"
-% 6 "/usr/local/bin" "netscape"
-% 6 "/usr/local/netscape/bin" "netscape"
-% 6 "/usr/local/netscape/bin" "netscape-3"
-% 6 "/usr/local/netscape/bin" "netscape-2"
-% 6 "/usr/local/netscape" "netscape"
-% 6 "/usr/local/mosaic" "mosaic"
-% 6 "/usr/local/moasic" "Xmosaic"
-%END_CONFIG
-% A World-Wide Web browser. Reactor passes it an initial URL
-% its first command-line argument.
-
-INITIAL_REACTOR_EDITOR = "GENTOO_INITIAL_REACTOR_EDITOR"
-% A text editor. Reactor passes it "<file> +<line>" on the
-% command-line when it wants to edit <file> initially positioned
-% at <line>.
-
-%------------------------------------------------------------- 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 = "GENTOO_INSTALL_ROOT"
-
-BIN_INSTALL = INSTALL_ROOT & "/bin" % executables
-if M3_PROFILING
- LIB_INSTALL = INSTALL_ROOT & "/libp" % libraries
-else
- LIB_INSTALL = INSTALL_ROOT & "/lib" % libraries
-end
-PKG_INSTALL = INSTALL_ROOT & "/pkg" % packages
-DOC_INSTALL = INSTALL_ROOT & "/doc" % documents
-EMACS_INSTALL = INSTALL_ROOT & "/elisp" % emacs lisp code
-MAN_INSTALL = INSTALL_ROOT & "/man" % man pages
-HTML_INSTALL = INSTALL_ROOT & "/www" % 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 = INSTALL_ROOT
-BIN_USE = BIN_INSTALL % executables
-LIB_USE = LIB_INSTALL % libraries
-PKG_USE = PKG_INSTALL % 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" ],
-%-- not on most Linux platforms
-% "LEX-YACC" : [ BEGIN_CONFIG
-% "Where are the lex/yacc libraries?"
-% 11 "libl.a"
-% 12 "/usr/lib"
-% 12 "/usr/local/lib"
-% 12 "/usr/local/gnu/lib"
-% 13 "/usr/lib"
-% END_CONFIG, "-ll" ],
- "FLEX-BISON" : [ "-L/usr/lib", "-lfl" ],
-% "POSTGRES95" : [ BEGIN_CONFIG
-% "OPENGL" : [ BEGIN_CONFIG
-% "ODBC" : [ BEGIN_CONFIG
-% "MOTIF" : [ BEGIN_CONFIG
-% "X11" : [ BEGIN_CONFIG
- "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" ]
-
-%---------------------------------------------------------- system programs ---
-
-readonly SYSTEM_CC = "/usr/bin/gcc" % C compiler
-readonly SYSTEM_AR = "/usr/bin/ar" % Archiver
-readonly SYSTEM_ASM = "/usr/bin/as" % Assembler
-
-%--------------------------------------------------------- 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 ]
- 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 ("@" & SYSTEM_CC, 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 ("@" & SYSTEM_ASM, source, "-o", object)
-end
-
-%--------------------------------------------------------- library creation ---
-% "make_lib" is called to combine a collection of object modules into
-% a library.
-
-GCWRAPFLAGS = "-Wl,--wrap,adjtime,--wrap,getdirentries,--wrap,readv,--wrap,utimes,--wrap,wait3"
-
-proc make_lib (lib, options, objects, imported_libs, shared) is
- local ret_code = 0
- local lib_a = format ("lib%s.a", lib)
- local lib_so = format ("lib%s.so", lib)
- local lib_sox = format ("lib%s.so.5", lib)
-
- % first, build the non-shared library
- ret_code = try_exec ("@/usr/bin/ar", "crus", lib_a, objects)
- if not equal (ret_code, 0) return ret_code end
-
- if shared
- % build the shared library
- if M3_PROFILING
- ret_code = try_exec ("@" & SYSTEM_CC, "-pg -shared " & GCWRAPFLAGS &
- "-Wl,-soname," & lib_sox,
- "-o", lib_sox, objects)
- else
- ret_code = try_exec ("@" & SYSTEM_CC, "-shared " & GCWRAPFLAGS &
- "-Wl,-soname," & lib_sox,
- "-o", lib_sox, objects)
- end
- if not equal (ret_code, 0) return ret_code end
-
- % create the version aliases
- link_file(lib_sox, lib_so)
-
- % finally, make sure the shared library stuff gets installed properly
- install_derived (lib_sox)
- install_derived_link (lib_sox, lib_so)
- 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)
- 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 lib_so = format ("lib%s.so", lib)
- local lib_sox = format ("lib%s.so.5", lib)
-
- if shared
- % make sure the shared library stuff gets installed properly
- install_derived (lib_sox)
- install_derived (lib_so)
- 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)
- 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, options, objects, imported_libs ]
- if shared
- return try_exec ("@" & SYSTEM_CC, args, GCWRAPFLAGS)
- else
- return try_exec ("@" & SYSTEM_CC, "-static", args, GCWRAPFLAGS)
- %%% -- see M3_NEED_STANDALONE_LINKS below
- %%%return try_exec ("@" & SYSTEM_CC, args)
- end
-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 = FALSE
-% --- 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_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 = "GENTOO_GNU_CC"
-GNU_CFLAGS = "GENTOO_GNU_CFLAGS"
-GNU_MAKE = "GENTOO_GNU_MAKE"
diff --git a/dev-lang/cm3-bin/files/cm3-x86.cfg b/dev-lang/cm3-bin/files/cm3-x86.cfg
deleted file mode 100644
index bbe323e51431..000000000000
--- a/dev-lang/cm3-bin/files/cm3-x86.cfg
+++ /dev/null
@@ -1,351 +0,0 @@
-% Copyright 1996 Critical Mass, Inc. All rights reserved.
-%
-% Standard configuration file for LINUX with ELF object files
-%
-
-%-------------------------------------------------- compilation environment ---
-
-%M3_PROFILING = TRUE % set by cm3 since 5.1.2 (option -profile)
-%M3_PROFILING = FALSE
-
-readonly TARGET = "LINUXLIBC6" % 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 = "i486--linuxelf" % "cpu-vendor-os" string for GNU
-%readonly INSTALL_KEY = BEGIN_CONFIG
-% "What is your installation key?"
-% 14 %-- user specified key
-%END_CONFIG
-
-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 = BEGIN_CONFIG
-% "What should be the default World-Wide Web browser for new Reactor users?"
-% 0 "netscape"
-% 6 "/usr/local/bin" "netscape"
-% 6 "/usr/local/netscape/bin" "netscape"
-% 6 "/usr/local/netscape/bin" "netscape-3"
-% 6 "/usr/local/netscape/bin" "netscape-2"
-% 6 "/usr/local/netscape" "netscape"
-% 6 "/usr/local/mosaic" "mosaic"
-% 6 "/usr/local/moasic" "Xmosaic"
-%END_CONFIG
-% A World-Wide Web browser. Reactor passes it an initial URL
-% its first command-line argument.
-
-INITIAL_REACTOR_EDITOR = "GENTOO_INITIAL_REACTOR_EDITOR"
-% A text editor. Reactor passes it "<file> +<line>" on the
-% command-line when it wants to edit <file> initially positioned
-% at <line>.
-
-%------------------------------------------------------------- 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 = "GENTOO_INSTALL_ROOT"
-
-BIN_INSTALL = INSTALL_ROOT & "/bin" % executables
-if M3_PROFILING
- LIB_INSTALL = INSTALL_ROOT & "/libp" % libraries
-else
- LIB_INSTALL = INSTALL_ROOT & "/lib" % libraries
-end
-PKG_INSTALL = INSTALL_ROOT & "/pkg" % packages
-DOC_INSTALL = INSTALL_ROOT & "/doc" % documents
-EMACS_INSTALL = INSTALL_ROOT & "/elisp" % emacs lisp code
-MAN_INSTALL = INSTALL_ROOT & "/man" % man pages
-HTML_INSTALL = INSTALL_ROOT & "/www" % 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 = INSTALL_ROOT
-BIN_USE = BIN_INSTALL % executables
-LIB_USE = LIB_INSTALL % libraries
-PKG_USE = PKG_INSTALL % 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" ],
-%-- not on most Linux platforms
-% "LEX-YACC" : [ BEGIN_CONFIG
-% "Where are the lex/yacc libraries?"
-% 11 "libl.a"
-% 12 "/usr/lib"
-% 12 "/usr/local/lib"
-% 12 "/usr/local/gnu/lib"
-% 13 "/usr/lib"
-% END_CONFIG, "-ll" ],
- "FLEX-BISON" : [ "-L/usr/lib", "-lfl" ],
-% "POSTGRES95" : [ BEGIN_CONFIG
-% "OPENGL" : [ BEGIN_CONFIG
-% "ODBC" : [ BEGIN_CONFIG
-% "MOTIF" : [ BEGIN_CONFIG
-% "X11" : [ BEGIN_CONFIG
- "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" ]
-
-%---------------------------------------------------------- system programs ---
-
-readonly SYSTEM_CC = "/usr/bin/gcc" % C compiler
-readonly SYSTEM_AR = "/usr/bin/ar" % Archiver
-readonly SYSTEM_ASM = "/usr/bin/as" % Assembler
-
-%--------------------------------------------------------- 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 ]
- 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 ("@" & SYSTEM_CC, 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 ("@" & SYSTEM_ASM, source, "-o", object)
-end
-
-%--------------------------------------------------------- library creation ---
-% "make_lib" is called to combine a collection of object modules into
-% a library.
-
-GCWRAPFLAGS = "-Wl,--wrap,adjtime,--wrap,getdirentries,--wrap,readv,--wrap,utimes,--wrap,wait3"
-
-proc make_lib (lib, options, objects, imported_libs, shared) is
- local ret_code = 0
- local lib_a = format ("lib%s.a", lib)
- local lib_so = format ("lib%s.so", lib)
- local lib_sox = format ("lib%s.so.5", lib)
-
- % first, build the non-shared library
- ret_code = try_exec ("@/usr/bin/ar", "crus", lib_a, objects)
- if not equal (ret_code, 0) return ret_code end
-
- if shared
- % build the shared library
- if M3_PROFILING
- ret_code = try_exec ("@" & SYSTEM_CC, "-pg -shared " & GCWRAPFLAGS &
- "-Wl,-soname," & lib_sox,
- "-o", lib_sox, objects)
- else
- ret_code = try_exec ("@" & SYSTEM_CC, "-shared " & GCWRAPFLAGS &
- "-Wl,-soname," & lib_sox,
- "-o", lib_sox, objects)
- end
- if not equal (ret_code, 0) return ret_code end
-
- % create the version aliases
- link_file(lib_sox, lib_so)
-
- % finally, make sure the shared library stuff gets installed properly
- install_derived (lib_sox)
- install_derived_link (lib_sox, lib_so)
- 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)
- 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 lib_so = format ("lib%s.so", lib)
- local lib_sox = format ("lib%s.so.5", lib)
-
- if shared
- % make sure the shared library stuff gets installed properly
- install_derived (lib_sox)
- install_derived (lib_so)
- 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)
- 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, options, objects, imported_libs ]
- if shared
- return try_exec ("@" & SYSTEM_CC, args, GCWRAPFLAGS)
- else
- return try_exec ("@" & SYSTEM_CC, "-static", args, GCWRAPFLAGS)
- %%% -- see M3_NEED_STANDALONE_LINKS below
- %%%return try_exec ("@" & SYSTEM_CC, args)
- end
-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 = FALSE
-% --- 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_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 = "GENTOO_GNU_CC"
-GNU_CFLAGS = "GENTOO_GNU_CFLAGS"
-GNU_MAKE = "GENTOO_GNU_MAKE"
diff --git a/dev-lang/cm3-bin/files/cm3.cfg b/dev-lang/cm3-bin/files/cm3.cfg
new file mode 100644
index 000000000000..dcc895ccb091
--- /dev/null
+++ b/dev-lang/cm3-bin/files/cm3.cfg
@@ -0,0 +1,187 @@
+% Copyright 1996 Critical Mass, Inc. All rights reserved.
+% For definitions of variables see cm3.cfg--default
+
+%M3_PROFILING = TRUE
+%M3_PROFILING = FALSE
+
+readonly TARGET = "GENTOO_TARGET"
+if M3_PROFILING
+ readonly BUILD_DIR = TARGET & "p"
+else
+ readonly BUILD_DIR = TARGET
+end
+readonly OS_TYPE = "POSIX"
+readonly WORD_SIZE = "32BITS"
+readonly GNU_PLATFORM = "GENTOO_GNU_PLATFORM"
+
+readonly NAMING_CONVENTIONS = "0"
+
+proc set_config_options () is
+ m3_option ("-why")
+ m3_debug (TRUE)
+ M3_OPTIONS += "-w1"
+end
+
+INITIAL_REACTOR_EDITOR = "GENTOO_INITIAL_REACTOR_EDITOR"
+
+ROOT="GENTOO_ROOT"
+
+INSTALL_ROOT = "GENTOO_INSTALL_ROOT"
+
+BIN_INSTALL = INSTALL_ROOT & "/bin"
+if M3_PROFILING
+ LIB_INSTALL = INSTALL_ROOT & "/libp"
+else
+ LIB_INSTALL = INSTALL_ROOT & "/lib"
+end
+PKG_INSTALL = INSTALL_ROOT & "/pkg"
+DOC_INSTALL = INSTALL_ROOT & "/doc"
+EMACS_INSTALL = INSTALL_ROOT & "/elisp"
+MAN_INSTALL = INSTALL_ROOT & "/man"
+HTML_INSTALL = INSTALL_ROOT & "/www"
+
+USE_ROOT = INSTALL_ROOT
+BIN_USE = BIN_INSTALL
+LIB_USE = LIB_INSTALL
+PKG_USE = PKG_INSTALL
+
+readonly INSTALL_IMPLS = TRUE
+
+SYSTEM_LIBS = {
+ "LIBC" : [ "-lm" ],
+ "FLEX-BISON" : [ "-L/usr/lib", "-lfl" ],
+ "OPENGL" : [ "-L/usr/lib", "-lGLU", "-lGL", "-lXext" ],
+ "MOTIF" : [ "-L/usr/X11R6/lib", "-lXm" ],
+ "X11" : [ "-L/usr/X11R6/lib", "-lXaw", "-lXmu", "-lXext",
+ "-lXt", "-lSM", "-lICE", "-lX11" ],
+% "POSTGRES95" : [ ]
+% "ODBC" : [ ]
+ "TCP" : [ ]
+}
+
+SYSTEM_LIBORDER = [ "OPENGL", "DECPEX", "MOTIF", "X11", "TCP", "ODBC",
+ "POSTGRES95", "FLEX-BISON", "LEX-YACC", "LIBC" ]
+
+readonly SYSTEM_CC = "/usr/bin/gcc"
+readonly SYSTEM_AR = "/usr/bin/ar"
+readonly SYSTEM_ASM = "/usr/bin/as"
+
+readonly m3back = "@" & BIN_USE & "/cm3cg"
+
+proc m3_backend (source, object, optimize, debug) is
+ local args = [ "-quiet", source, "-o", object ]
+ 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"
+
+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 ("@" & SYSTEM_CC, args, "-c", source)
+end
+
+proc assemble (source, object) is
+ return try_exec ("@" & SYSTEM_ASM, source, "-o", object)
+end
+
+GCWRAPFLAGS = "-Wl,--wrap,adjtime,--wrap,getdirentries,--wrap,readv,--wrap,utimes,--wrap,wait3"
+
+proc make_lib (lib, options, objects, imported_libs, shared) is
+ local ret_code = 0
+ local lib_a = format ("lib%s.a", lib)
+ local lib_so = format ("lib%s.so", lib)
+ local lib_sox = format ("lib%s.so.5", lib)
+
+ % first, build the non-shared library
+ ret_code = try_exec ("@/usr/bin/ar", "crus", lib_a, objects)
+ if not equal (ret_code, 0) return ret_code end
+
+ if shared
+ % build the shared library
+ if M3_PROFILING
+ ret_code = try_exec ("@" & SYSTEM_CC, "-pg -shared " & GCWRAPFLAGS &
+ "-Wl,-soname," & lib_sox,
+ "-o", lib_sox, objects)
+ else
+ ret_code = try_exec ("@" & SYSTEM_CC, "-shared " & GCWRAPFLAGS &
+ "-Wl,-soname," & lib_sox,
+ "-o", lib_sox, objects)
+ end
+ if not equal (ret_code, 0) return ret_code end
+
+ % create the version aliases
+ link_file(lib_sox, lib_so)
+
+ % finally, make sure the shared library stuff gets installed properly
+ install_derived (lib_sox)
+ install_derived_link (lib_sox, lib_so)
+ 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)
+ end
+
+ return 0
+end
+
+proc skip_lib (lib, shared) is
+ local lib_so = format ("lib%s.so", lib)
+ local lib_sox = format ("lib%s.so.5", lib)
+
+ if shared
+ % make sure the shared library stuff gets installed properly
+ install_derived (lib_sox)
+ install_derived (lib_so)
+ 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)
+ end
+
+ return 0
+end
+
+proc m3_link (prog, options, objects, imported_libs, shared) is
+ local args = []
+ if M3_PROFILING args += "-pg" end
+ args += [ "-o", prog, options, objects, imported_libs ]
+ if shared
+ return try_exec ("@" & SYSTEM_CC, args, GCWRAPFLAGS)
+ else
+ return try_exec ("@" & SYSTEM_CC, "-static", args, GCWRAPFLAGS)
+ %%% -- see M3_NEED_STANDALONE_LINKS below
+ %%%return try_exec ("@" & SYSTEM_CC, args)
+ end
+end
+
+proc skip_link (prog, shared) is
+ return 0
+end
+
+M3_FRONT_FLAGS = [ ]
+M3_OPTIONS = [ ]
+% M3_KEEP_FILES = TRUE
+M3_WINDOWS_GUI = FALSE
+% M3_COVERAGE = TRUE
+M3_COVERAGE_LIB = LIB_USE & "/report_coverage.o"
+M3_SPLIT_LIBNAMES = TRUE
+M3_SHARED_LIB_ARG = "-Wl,-R"
+% M3_BOOTSTRAP = TRUE
+% M3_COMPILE_ONCE = TRUE
+% SYS_HAS_LOADER = TRUE
+% M3_SKIP_LINK = TRUE
+% M3_MAIN_IN_C = TRUE
+% X11_WITH_SHARED_MEM = TRUE
+%M3_NEED_STANDALONE_LINKS = TRUE
+
+GNU_CC = "GENTOO_GNU_CC"
+GNU_CFLAGS = "GENTOO_GNU_CFLAGS"
+GNU_MAKE = "GENTOO_GNU_MAKE"