summaryrefslogtreecommitdiff
path: root/lang/modula-3-lib
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1998-09-18 01:02:04 +0000
committerJohn Polstra <jdp@FreeBSD.org>1998-09-18 01:02:04 +0000
commit736d3c5ca34012873b99c6102c91e62cdc73ab7a (patch)
tree1d97bd4fea568c356125f3d94d48eaf415e510ae /lang/modula-3-lib
parentActivate mergemaster. (diff)
Make these ports work on ELF systems.
Notes
Notes: svn path=/head/; revision=13211
Diffstat (limited to 'lang/modula-3-lib')
-rw-r--r--lang/modula-3-lib/Makefile31
-rw-r--r--lang/modula-3-lib/distinfo1
-rw-r--r--lang/modula-3-lib/files/FreeBSD2.aout337
-rw-r--r--lang/modula-3-lib/files/FreeBSD2.elf334
-rw-r--r--lang/modula-3-lib/files/patch-ah208
-rw-r--r--lang/modula-3-lib/files/patch-bt22
-rw-r--r--lang/modula-3-lib/files/patch-bu29
-rw-r--r--lang/modula-3-lib/pkg-plist84
-rw-r--r--lang/modula-3-lib/pkg-plist.noX1152
-rw-r--r--lang/modula-3-lib/scripts/configure55
10 files changed, 844 insertions, 309 deletions
diff --git a/lang/modula-3-lib/Makefile b/lang/modula-3-lib/Makefile
index 90feb6cd7888..22ae0b02d206 100644
--- a/lang/modula-3-lib/Makefile
+++ b/lang/modula-3-lib/Makefile
@@ -3,19 +3,22 @@
# Date created: 28 Oct 1996
# Whom: John Polstra <jdp@polstra.com>
#
-# $Id: Makefile,v 1.9 1997/07/17 15:12:48 max Exp $
+# $Id: Makefile,v 1.10 1998/06/06 20:32:03 jdp Exp $
#
DISTNAME= modula-3-lib-3.6
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_LOCAL}
-DISTFILES= m3-fbsd-src-3.6.tar.gz m3-fbsd-m3cc-3.6.tar.gz
+DISTFILES= m3-fbsd-src-3.6.tar.gz \
+ m3-fbsd-m3cc-3.6.tar.gz \
+ m3-fbsd-m3ccelf-3.6.tar.gz
# Note: Depending on what is already installed on the system, the code
# below may add some more DISTFILES.
MAINTAINER= jdp@polstra.com
NO_WRKSUBDIR= yes
+SCRIPTS_ENV+= MAJOR=${major} PKGDIR=${PKGDIR} PLIST=${PLIST}
# There are two distfiles that may or may not be needed, depending on
# what is already installed on the system. First, we need an executable
@@ -52,8 +55,10 @@ DISTFILES+= m3-fbsd-gcc-3.6.tar.gz
# only supports X11R6 in the standard location, so we don't bother using
# the X11BASE macro. It's not defined yet at this point in the Makefile
# anyway.
-.if !exists(/usr/X11R6/lib/libX11.a)
-PLIST= ${PKGDIR}/PLIST.noX11
+.if exists(/usr/X11R6/lib/libX11.a)
+PLIST= ${WRKDIR}/PLIST
+.else
+PLIST= ${WRKDIR}/PLIST.noX11
.endif
# Startup script, run at boot time
@@ -66,6 +71,12 @@ startup_script= ${startup_dir}/50.m3.sh
# be "installed" into the following directory, which we own.
temp_prefix= ${WRKSRC}/installed
+# Where shared libraries are installed, relative to the PREFIX.
+libdir= lib/m3/FreeBSD2
+
+# Shared library major version number
+major= 6
+
post-extract:
.if !empty(have_boot)
@echo "Copying bootstrap modula-3 compiler from ${have_boot}"
@@ -97,7 +108,7 @@ do-build:
PATH=${temp_prefix}/bin:$$PATH ./build FreeBSD2; \
${CP} -p FreeBSD2/m3build FreeBSD2/m3ship FreeBSD2/m3where \
${temp_prefix}/bin; \
- ${CP} -p FreeBSD2/m3mkdir ${temp_prefix}/lib/m3/FreeBSD2; \
+ ${CP} -p FreeBSD2/m3mkdir ${temp_prefix}/${libdir}; \
${CP} -p templates/CLEANUP templates/COMMON templates/COMMON.BOOT \
templates/FreeBSD2 templates/PLATFORMS templates/POSIX \
${temp_prefix}/lib/m3/pkg/m3build/templates; \
@@ -108,10 +119,10 @@ do-build:
@cd ${WRKSRC}/m3cc/FreeBSD2; \
../gcc/configure i486-unknown-freebsd; \
make m3cgc1 CC="${CC}" CFLAGS="${CFLAGS}"; \
- ${CP} -p m3cgc1 ${temp_prefix}/lib/m3/FreeBSD2
+ ${CP} -p m3cgc1 ${temp_prefix}/${libdir}
@echo "++++++++++ everything else ++++++++++"
@cd ${WRKSRC}/m3; \
- LD_LIBRARY_PATH=${temp_prefix}/lib/m3/FreeBSD2:$$LD_LIBRARY_PATH; \
+ LD_LIBRARY_PATH=${temp_prefix}/${libdir}:$$LD_LIBRARY_PATH; \
PATH=${temp_prefix}/bin:$$PATH; \
export LD_LIBRARY_PATH PATH; \
m3build
@@ -124,10 +135,10 @@ do-install:
@echo "Installing shared libraries"
@cd ${temp_prefix}; \
umask 022; \
- grep '^lib/m3/' ${PLIST} | \
+ grep '^lib/m3/' ${PLIST}.real | \
cpio -dump -R ${BINOWN}.${BINGRP} ${PREFIX}
@cd ${PREFIX}; \
- grep '^lib/m3/' ${PLIST} | xargs chmod go=u-w; \
+ grep '^lib/m3/' ${PLIST}.real | xargs chmod go=u-w; \
find -X lib/m3 -type d | xargs chown ${BINOWN}.${BINGRP}; \
find -X lib/m3 -type d | xargs chmod 755
@echo "Installing copyright notice"
@@ -147,6 +158,6 @@ do-install:
chmod 755 ${startup_script}; \
fi
@echo "Running ldconfig"
- @${LDCONFIG} -m ${PREFIX}/lib/m3/FreeBSD2
+ @${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/lib/m3/FreeBSD2
.include <bsd.port.mk>
diff --git a/lang/modula-3-lib/distinfo b/lang/modula-3-lib/distinfo
index 9655118b1ed7..1a0d0329f8b1 100644
--- a/lang/modula-3-lib/distinfo
+++ b/lang/modula-3-lib/distinfo
@@ -1,4 +1,5 @@
MD5 (m3-fbsd-boot-3.6.tar.gz) = e65eb3d2466957d64989c6aeac1c7264
MD5 (m3-fbsd-gcc-3.6.tar.gz) = d65a3316d4e3e5d7e901bbd3ef2b53a0
MD5 (m3-fbsd-m3cc-3.6.tar.gz) = 2b65a26c1199b2871299dba4c4bfac71
+MD5 (m3-fbsd-m3ccelf-3.6.tar.gz) = 6d3923c634b6d71a2bf14627ef7d564a
MD5 (m3-fbsd-src-3.6.tar.gz) = 7e8e83ee8444b6d045566a7a90f33ffa
diff --git a/lang/modula-3-lib/files/FreeBSD2.aout b/lang/modula-3-lib/files/FreeBSD2.aout
new file mode 100644
index 000000000000..09090b71e63d
--- /dev/null
+++ b/lang/modula-3-lib/files/FreeBSD2.aout
@@ -0,0 +1,337 @@
+% Copyright (C) 1989, 1992 Digital Equipment Corporation
+% All rights reserved.
+% See the file COPYRIGHT for a full description.
+%
+% Last Modified On Thu Jun 20 12:17:07 PDT 1996 By heydon
+% Modified On Wed Oct 11 13:31:43 PDT 1995 By najork
+% Modified On Wed Jun 14 13:34:49 PDT 1995 By kalsow
+% Modified On Thu Apr 8 13:45:49 PDT 1993 by muller
+%
+% Sun Nov 27 20:19:31 MET 1994 by ow
+% Fri Feb 2 15:04:50 PST 1996 by jdp@polstra.com
+%
+% FreeBSD 2.1 and 2.2 configuration, with shared library support
+%
+
+%-------------------------------------------------- compilation environment ---
+
+readonly TARGET = "FreeBSD2"
+readonly DEFAULT_BUILD_DIR = TARGET
+
+include ("PLATFORMS") % get the target-dependent mappings
+include (OS_TYPE) % get the OS-dependent functions
+
+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 => .obj .io .mo XX.lib
+%
+
+%------------------------------------------------------------- export paths ---
+% During the installation, destination directories that do not exist
+% 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 = "/usr/local/"
+%-- handy for installations that keep all M3 stuff together
+
+BIN_INSTALL = INSTALL_ROOT & "bin" % executables
+LIB_INSTALL = INSTALL_ROOT & "lib/m3/" & TARGET % libraries
+DOC_INSTALL = INSTALL_ROOT & "lib/m3/doc" % documents
+PKG_INSTALL = INSTALL_ROOT & "lib/m3/pkg" % packages
+EMACS_INSTALL = INSTALL_ROOT & "lib/elisp" % emacs lisp code
+MAN_INSTALL = INSTALL_ROOT & "man" % man pages
+HTML_INSTALL = INSTALL_ROOT & "lib/m3/www" % public hypertext
+
+WDROOT = $HOME & "/m3/pkg" % handy default for overrides
+
+% The manual pages normally go in subdirectories man{1,...8} of
+% the MAN_INSTALL directory. If you prefer to have them all in
+% a single section, define MAN_SECTION to be that section's name.
+% MAN_SECTION = "l"
+
+% 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.
+BIN_USE = BIN_INSTALL
+LIB_USE = LIB_INSTALL
+PKG_USE = PKG_INSTALL
+
+% This is a relative path from LIB_USE to PKG_USE, so that we can avoid
+% installing absolute symbolic links. If you cannot support such relative
+% links, then make it the same as PKG_USE.
+LIB_TO_PKG = "../pkg"
+
+readonly INSTALL_IMPLS = ""
+% "TRUE"
+% => save all source files during the install
+% => makes debugging easier and browsing more fruitful
+% "" (i.e. FALSE)
+% => save only the exported interfaces and templates
+% => makes the installed system slightly smaller.
+
+readonly NEED_OBJECTS = "TRUE"
+% "TRUE"
+% => accumulate a list of derived objects in COMPILE_OBJECTS
+% => for building shared libraries in the library_hooks function below
+% ""
+% => don't bother
+
+%---------------------------------------------------------------------- X11 ---
+% If you have X11R4 installed and would like the X11R4 binding interfaces
+% to be built, define the procedure "import_X11R4" to import the libraries
+% that are needed. Otherwise, define "import_X11R4" to be an empty procedure.
+%
+% If you use the MIT server with DECnet support, you need X11 and dnet,
+% otherwise X11 should be enough.
+%
+% Since X11R5 is an extension of X11R4, you can use the X11R5 libraries
+% instead of X11R4. However, the Modula-3 binding interfaces have not
+% yet been upgraded to X11R5.
+%
+% "import_X11R4" is called from the X11R4 package.
+% "import_Motif" is called from the motif package.
+% "import_DECPEX" is called from the PEX package.
+% "import_OpenGL" is called from the opengl package.
+% "import_TCP" is called from the tcp package.
+
+readonly proc import_X11R4() is
+ import_lib("Xaw", "/usr/X11R6/lib")
+ import_lib("Xmu", "/usr/X11R6/lib")
+ import_lib("Xt", "/usr/X11R6/lib")
+ import_lib("SM", "/usr/X11R6/lib")
+ import_lib("ICE", "/usr/X11R6/lib")
+ import_lib("Xext", "/usr/X11R6/lib")
+ import_lib("X11", "/usr/X11R6/lib")
+end
+
+readonly proc import_Motif() is
+ import_lib("Xm", "/usr/X11R6/lib")
+end
+
+readonly proc import_DECPEX() is
+ % DEC PEX differs from MIT PEX, and is only supported on Digital machines.
+end
+
+readonly proc import_OpenGL() is
+ % import_lib (GLU, "/usr/lib")
+ % import_lib (GL, "/usr/lib")
+ % import_lib (Xext, "/usr/lib")
+end
+
+readonly proc import_TCP() is
+end
+
+readonly PLATFORM_SUPPORTS_X = (not stale ("/usr/X11R6/lib/libX11.a",
+ "/usr/X11R6/lib/libX11.a"))
+readonly PLATFORM_SUPPORTS_MOTIF = (not stale ("/usr/X11R6/lib/libXm.a",
+ "/usr/X11R6/lib/libXm.a"))
+readonly PLATFORM_SUPPORTS_DECPEX = ""
+readonly PLATFORM_SUPPORTS_OPENGL = ""
+
+% Does your X11 server have the shared memory extension?
+readonly X11_WITH_SHARED_MEM = "TRUE"
+
+%-------------------------------------------------------------------- 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
+
+%---------------------------------------------------- C compiler and linker ---
+% The following definitions are used to compile and link C modules.
+% Note that these definitions can be overridden on the m3build command
+% line with "-D". (e.g. m3build -DCC=gcc)
+%
+% _ifdef(a,b,c) == if defined(a) return b else return c
+%
+% The actual definitions must be kept on one line due to finicky details
+% of the bootstrap process.
+
+CC = _ifdef ("CC", CC, [ "cc", "-fpic" ])
+%--- C compiler with flags for compiling a single ".c" file
+
+LINK = _ifdef ("LINK", LINK, [ "ld", "-e", "start", "-dc", "-dp", "-L/usr/lib/aout", "-R!PREFIX!/lib/m3/" & TARGET & ":!PREFIX!/lib:/usr/X11R6/lib", "/usr/lib/crt0.o" ])
+%--- C compiler with flags for linking
+
+MAKELIB = _ifdef ("MAKELIB", MAKELIB, [ "ar", "cru" ])
+%--- program to build library archives
+
+RANLIB = _ifdef ("RANLIB", RANLIB, [ "ranlib" ])
+%--- program to index libraries
+
+ASM = _ifdef ("ASM", ASM, [ "as", "-k" ])
+%--- assembler
+
+BOOT_LINK = _ifdef ("BOOT_LINK", BOOT_LINK, [ "cc" ])
+%--- C compiler with flags for linking, used during the bootstrap process.
+% We have to use "cc" for the bootstrap, because the "-z2" option
+% ("libraries systematically linked with all programs") doesn't get used
+% during the bootstrap process. If we use "ld", then the C library isn't
+% linked in.
+
+%------------------------------------------------------------- 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 = _ifdef ("GNU_CC", GNU_CC, "cc")
+GNU_CFLAGS = _ifdef ("GNU_CFLAGS", GNU_CFLAGS, "-O")
+GNU_MAKE = _ifdef ("GNU_MAKE", GNU_MAKE, "make")
+
+%-------------------------------------------------------- Modula-3 compiler ---
+% The syntax for the values passed to most of the M3_CONFIG options is
+% "@pgm@arg1@...@argn@" where "@" is an arbitrary character. The
+% separator character must begin and end the value.
+
+% Where is the driver?
+M3 = LIB_USE & "/m3"
+
+% What are the standard flags?
+M3OPTIONS = [ "-w1", "-why", "-O" ]
+% ------ FOR DEBUGGING INFO, add "-g"
+
+M3_CONFIG = [
+ "-Y1" & _pack_args (CC),
+ "-Y2" & _pack_args (LINK),
+ "-Y3" & _pack_args (MAKELIB),
+ "-Y4" & _pack_args (RANLIB),
+ "-Y7" & _pack_args (ASM),
+
+ "-Y6@" & LIB_USE & "/m3cgc1@-maout@-munderscores@-quiet@-fpic@",
+ % --- the Modula-3 IL to assembly language pass
+
+ "-z2@-lm@/usr/lib/libgcc.a@-lc@/usr/lib/libgcc.a@",
+ % --- libraries systematically linked with all programs
+
+ "-z3" & LIB_USE & SL & "report_coverage.o",
+ % --- library linked in programs compiled with "-Z" coverage option
+
+ "-z5" & NAMING_CONVENTIONS,
+ % Set the host naming conventions.
+
+ "-z60",
+ % Values of "-z6":
+ % "0" => the m3 driver will split library names and pass -L/-l
+ % arguments to the linker
+ % "1" => the m3 driver will pass libraries with full path names
+ % "2" => like "0" except that for shared libraries, the driver
+ % passes -Rdir as well as -Ldir to the linker
+
+ "-zA0",
+ % The "-zA" option specifies the maximum size (in megabytes) that Pass0
+ % is allowed to reach as a persistent server before the driver kills it.
+ % Setting it to zero disables server mode.
+ % NOTE: the current compiler is buggy, leave "-zA" alone!
+
+ "-zB@-O@", % --- pass 1 options implied by "-O"
+ "-zC@-O@", % --- pass 6 options implied by "-O"
+ "-zD@@", % --- pass 7 options implied by "-O"
+
+ "-zE@-g@", % --- pass 1 options implied by "-g"
+ "-zF@-g@", % --- pass 6 options implied by "-g"
+ "-zG@@", % --- pass 7 options implied by "-g"
+
+ "-zH" & NAMING_CONVENTIONS,
+ % --- the target's naming conventions
+
+ "-zI" & TARGET,
+ % --- the target architecture
+
+ % "-zJ10",
+ % The option "-zJx1" specifies that pass "x" is "noisy", "-zJx0"
+ % specifices that it's not. The default is to assume that passes
+ % are not noisy. The driver collects the standard output of noisy
+ % passes in a file and then deletes the file, unless "-keep" or
+ % "-verbose" is specified.
+
+ "-zK1",
+ % --- Set the value of "-zK" to "1" if you want the m3 driver to
+ % supply -Bdynamic/-Bstatic options to the linker, "0" otherwise.
+
+ "-Bdynamic",
+ % --- libraries are shared by default. If you give -zK1 you should
+ % also provide an initial -Bdynamic or -Bstatic.
+
+ "-zL0"
+ % --- Set the value of "-zL" to "1" if you want .M3LINK files produced
+ % for a dynamic loader
+]
+
+proc build_standalone() is
+ % --- reset the linker to avoid shared libraries.
+ M3_CONFIG += "-Y6@" & LIB_USE & "/m3cgc1@-maout@-munderscores@-quiet@"
+ M3_CONFIG += "-Y7@as@"
+ M3_CONFIG += "-Bstatic"
+end
+
+proc build_shared() is
+ % --- reset the linker to use shared libraries.
+end
+
+%-------------------------------------------------------------------- hooks ---
+% These are the "last chance" hooks that are called each time a library
+% or program is built. They might build shared libraries or strip
+% executables...
+
+proc before_library_hooks(x) is
+end
+
+proc after_library_hooks(x) is
+ local lib_a = format ("lib%s.a", x)
+ local lib_so = format ("lib%s.so", x)
+ local lib_sox = format ("lib%s.so.6.0", x)
+ local link_so = format ("%s%s%s%s%s%s%s", PKG_INSTALL, SL, BUILD_PACKAGE,
+ SL, BUILD_DIR, SL, lib_so)
+
+ if defined ("_all")
+ if stale (lib_a, lib_a)
+ write ("missing ", lib_a, ": not building ", lib_sox, CR)
+ else
+ if stale (lib_sox, lib_a)
+ exec ("ld -Bshareable -assert pure-text -o",
+ lib_sox, COMPILE_OBJECTS)
+ end
+ install_derived (lib_sox)
+ >> M3SHIP_FILE in
+ write ("link_file(\"", escape(lib_sox), "\", \"", escape(link_so),
+ "\")", CR)
+ end
+ install_link_to_derived (lib_sox, LIB_INSTALL)
+ install_link_to_derived (lib_so, LIB_INSTALL)
+ end
+ end
+ deriveds (lib_sox, no_extension)
+ deriveds (lib_so, no_extension)
+end
+
+proc before_program_hooks(x) is
+end
+
+proc after_program_hooks(x) is
+end
+
+%------------------------------------------------------------- installation ---
+% "install_file" is called during an "m3build install" for
+% each file that neededs to be externally exported.
+
+readonly proc install_file (src, dest, mode) is
+ Note_install (src, dest)
+ % exec ("@cp -p -f", src, dest)
+ exec ("@install -c -m", mode, src, dest)
+end
+
+%---------------------------------------------- the rest of the environment ---
+
+if defined("_bootstrap") include("COMMON.BOOT") end
+include ("COMMON")
diff --git a/lang/modula-3-lib/files/FreeBSD2.elf b/lang/modula-3-lib/files/FreeBSD2.elf
new file mode 100644
index 000000000000..a2f797c97d45
--- /dev/null
+++ b/lang/modula-3-lib/files/FreeBSD2.elf
@@ -0,0 +1,334 @@
+% Copyright (C) 1989, 1992 Digital Equipment Corporation
+% All rights reserved.
+% See the file COPYRIGHT for a full description.
+%
+% Last Modified On Thu Jun 20 12:17:07 PDT 1996 By heydon
+% Modified On Wed Oct 11 13:31:43 PDT 1995 By najork
+% Modified On Wed Jun 14 13:34:49 PDT 1995 By kalsow
+% Modified On Thu Apr 8 13:45:49 PDT 1993 by muller
+%
+% Sun Nov 27 20:19:31 MET 1994 by ow
+% Fri Feb 2 15:04:50 PST 1996 by jdp@polstra.com
+%
+% FreeBSD 2.1 and 2.2 configuration, with shared library support
+%
+
+%-------------------------------------------------- compilation environment ---
+
+readonly TARGET = "FreeBSD2"
+readonly DEFAULT_BUILD_DIR = TARGET
+
+include ("PLATFORMS") % get the target-dependent mappings
+include (OS_TYPE) % get the OS-dependent functions
+
+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 => .obj .io .mo XX.lib
+%
+
+%------------------------------------------------------------- export paths ---
+% During the installation, destination directories that do not exist
+% 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 = "/usr/local/"
+%-- handy for installations that keep all M3 stuff together
+
+BIN_INSTALL = INSTALL_ROOT & "bin" % executables
+LIB_INSTALL = INSTALL_ROOT & "lib/m3/" & TARGET % libraries
+DOC_INSTALL = INSTALL_ROOT & "lib/m3/doc" % documents
+PKG_INSTALL = INSTALL_ROOT & "lib/m3/pkg" % packages
+EMACS_INSTALL = INSTALL_ROOT & "lib/elisp" % emacs lisp code
+MAN_INSTALL = INSTALL_ROOT & "man" % man pages
+HTML_INSTALL = INSTALL_ROOT & "lib/m3/www" % public hypertext
+
+WDROOT = $HOME & "/m3/pkg" % handy default for overrides
+
+% The manual pages normally go in subdirectories man{1,...8} of
+% the MAN_INSTALL directory. If you prefer to have them all in
+% a single section, define MAN_SECTION to be that section's name.
+% MAN_SECTION = "l"
+
+% 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.
+BIN_USE = BIN_INSTALL
+LIB_USE = LIB_INSTALL
+PKG_USE = PKG_INSTALL
+
+% This is a relative path from LIB_USE to PKG_USE, so that we can avoid
+% installing absolute symbolic links. If you cannot support such relative
+% links, then make it the same as PKG_USE.
+LIB_TO_PKG = "../pkg"
+
+readonly INSTALL_IMPLS = ""
+% "TRUE"
+% => save all source files during the install
+% => makes debugging easier and browsing more fruitful
+% "" (i.e. FALSE)
+% => save only the exported interfaces and templates
+% => makes the installed system slightly smaller.
+
+readonly NEED_OBJECTS = "TRUE"
+% "TRUE"
+% => accumulate a list of derived objects in COMPILE_OBJECTS
+% => for building shared libraries in the library_hooks function below
+% ""
+% => don't bother
+
+%---------------------------------------------------------------------- X11 ---
+% If you have X11R4 installed and would like the X11R4 binding interfaces
+% to be built, define the procedure "import_X11R4" to import the libraries
+% that are needed. Otherwise, define "import_X11R4" to be an empty procedure.
+%
+% If you use the MIT server with DECnet support, you need X11 and dnet,
+% otherwise X11 should be enough.
+%
+% Since X11R5 is an extension of X11R4, you can use the X11R5 libraries
+% instead of X11R4. However, the Modula-3 binding interfaces have not
+% yet been upgraded to X11R5.
+%
+% "import_X11R4" is called from the X11R4 package.
+% "import_Motif" is called from the motif package.
+% "import_DECPEX" is called from the PEX package.
+% "import_OpenGL" is called from the opengl package.
+% "import_TCP" is called from the tcp package.
+
+readonly proc import_X11R4() is
+ import_lib("Xaw", "/usr/X11R6/lib")
+ import_lib("Xmu", "/usr/X11R6/lib")
+ import_lib("Xt", "/usr/X11R6/lib")
+ import_lib("SM", "/usr/X11R6/lib")
+ import_lib("ICE", "/usr/X11R6/lib")
+ import_lib("Xext", "/usr/X11R6/lib")
+ import_lib("X11", "/usr/X11R6/lib")
+end
+
+readonly proc import_Motif() is
+ import_lib("Xm", "/usr/X11R6/lib")
+end
+
+readonly proc import_DECPEX() is
+ % DEC PEX differs from MIT PEX, and is only supported on Digital machines.
+end
+
+readonly proc import_OpenGL() is
+ % import_lib (GLU, "/usr/lib")
+ % import_lib (GL, "/usr/lib")
+ % import_lib (Xext, "/usr/lib")
+end
+
+readonly proc import_TCP() is
+end
+
+readonly PLATFORM_SUPPORTS_X = (not stale ("/usr/X11R6/lib/libX11.a",
+ "/usr/X11R6/lib/libX11.a"))
+readonly PLATFORM_SUPPORTS_MOTIF = (not stale ("/usr/X11R6/lib/libXm.a",
+ "/usr/X11R6/lib/libXm.a"))
+readonly PLATFORM_SUPPORTS_DECPEX = ""
+readonly PLATFORM_SUPPORTS_OPENGL = ""
+
+% Does your X11 server have the shared memory extension?
+readonly X11_WITH_SHARED_MEM = "TRUE"
+
+%-------------------------------------------------------------------- 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
+
+%---------------------------------------------------- C compiler and linker ---
+% The following definitions are used to compile and link C modules.
+% Note that these definitions can be overridden on the m3build command
+% line with "-D". (e.g. m3build -DCC=gcc)
+%
+% _ifdef(a,b,c) == if defined(a) return b else return c
+%
+% The actual definitions must be kept on one line due to finicky details
+% of the bootstrap process.
+
+CC = _ifdef ("CC", CC, [ "cc", "-fpic" ])
+%--- C compiler with flags for compiling a single ".c" file
+
+LINK = _ifdef ("LINK", LINK, [ "cc", "-Wl,-R!PREFIX!/lib/m3/" & TARGET & ":!PREFIX!/lib:/usr/X11R6/lib" ])
+%--- C compiler with flags for linking
+
+MAKELIB = _ifdef ("MAKELIB", MAKELIB, [ "ar", "cru" ])
+%--- program to build library archives
+
+RANLIB = _ifdef ("RANLIB", RANLIB, [ "ranlib" ])
+%--- program to index libraries
+
+ASM = _ifdef ("ASM", ASM, [ "as" ])
+%--- assembler
+
+BOOT_LINK = _ifdef ("BOOT_LINK", BOOT_LINK, [ "cc" ])
+%--- C compiler with flags for linking, used during the bootstrap process.
+% We have to use "cc" for the bootstrap, because the "-z2" option
+% ("libraries systematically linked with all programs") doesn't get used
+% during the bootstrap process. If we use "ld", then the C library isn't
+% linked in.
+
+%------------------------------------------------------------- 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 = _ifdef ("GNU_CC", GNU_CC, "cc")
+GNU_CFLAGS = _ifdef ("GNU_CFLAGS", GNU_CFLAGS, "-O")
+GNU_MAKE = _ifdef ("GNU_MAKE", GNU_MAKE, "make")
+
+%-------------------------------------------------------- Modula-3 compiler ---
+% The syntax for the values passed to most of the M3_CONFIG options is
+% "@pgm@arg1@...@argn@" where "@" is an arbitrary character. The
+% separator character must begin and end the value.
+
+% Where is the driver?
+M3 = LIB_USE & "/m3"
+
+% What are the standard flags?
+M3OPTIONS = [ "-w1", "-why", "-O" ]
+% ------ FOR DEBUGGING INFO, add "-g"
+
+M3_CONFIG = [
+ "-Y1" & _pack_args (CC),
+ "-Y2" & _pack_args (LINK),
+ "-Y3" & _pack_args (MAKELIB),
+ "-Y4" & _pack_args (RANLIB),
+ "-Y7" & _pack_args (ASM),
+
+ "-Y6@" & LIB_USE & "/m3cgc1@-quiet@-fpic@",
+ % --- the Modula-3 IL to assembly language pass
+
+ "-z2@-lm@",
+ % --- libraries systematically linked with all programs
+
+ "-z3" & LIB_USE & SL & "report_coverage.o",
+ % --- library linked in programs compiled with "-Z" coverage option
+
+ "-z5" & NAMING_CONVENTIONS,
+ % Set the host naming conventions.
+
+ "-z60",
+ % Values of "-z6":
+ % "0" => the m3 driver will split library names and pass -L/-l
+ % arguments to the linker
+ % "1" => the m3 driver will pass libraries with full path names
+ % "2" => like "0" except that for shared libraries, the driver
+ % passes -Rdir as well as -Ldir to the linker
+
+ "-zA0",
+ % The "-zA" option specifies the maximum size (in megabytes) that Pass0
+ % is allowed to reach as a persistent server before the driver kills it.
+ % Setting it to zero disables server mode.
+ % NOTE: the current compiler is buggy, leave "-zA" alone!
+
+ "-zB@-O@", % --- pass 1 options implied by "-O"
+ "-zC@-O@", % --- pass 6 options implied by "-O"
+ "-zD@@", % --- pass 7 options implied by "-O"
+
+ "-zE@-g@", % --- pass 1 options implied by "-g"
+ "-zF@-g@", % --- pass 6 options implied by "-g"
+ "-zG@@", % --- pass 7 options implied by "-g"
+
+ "-zH" & NAMING_CONVENTIONS,
+ % --- the target's naming conventions
+
+ "-zI" & TARGET,
+ % --- the target architecture
+
+ % "-zJ10",
+ % The option "-zJx1" specifies that pass "x" is "noisy", "-zJx0"
+ % specifices that it's not. The default is to assume that passes
+ % are not noisy. The driver collects the standard output of noisy
+ % passes in a file and then deletes the file, unless "-keep" or
+ % "-verbose" is specified.
+
+ "-zK0",
+ % --- Set the value of "-zK" to "1" if you want the m3 driver to
+ % supply -Bdynamic/-Bstatic options to the linker, "0" otherwise.
+
+ "-Bdynamic",
+ % --- libraries are shared by default. If you give -zK1 you should
+ % also provide an initial -Bdynamic or -Bstatic.
+
+ "-zL0"
+ % --- Set the value of "-zL" to "1" if you want .M3LINK files produced
+ % for a dynamic loader
+]
+
+proc build_standalone() is
+ M3_CONFIG += "-Y2@cc@-static@"
+ M3_CONFIG += "-Y6@" & LIB_USE & "/m3cgc1@-quiet@"
+end
+
+proc build_shared() is
+ % --- reset the linker to use shared libraries.
+end
+
+%-------------------------------------------------------------------- hooks ---
+% These are the "last chance" hooks that are called each time a library
+% or program is built. They might build shared libraries or strip
+% executables...
+
+proc before_library_hooks(x) is
+end
+
+proc after_library_hooks(x) is
+ local lib_a = format ("lib%s.a", x)
+ local lib_so = format ("lib%s.so", x)
+ local lib_sox = format ("lib%s.so.6", x)
+ local link_so = format ("%s%s%s%s%s%s%s", PKG_INSTALL, SL, BUILD_PACKAGE,
+ SL, BUILD_DIR, SL, lib_so)
+ if defined ("_all")
+ if stale (lib_a, lib_a)
+ write ("missing ", lib_a, ": not building ", lib_sox, CR)
+ else
+ if stale (lib_sox, lib_a)
+ exec ("cc -shared -Wl,-soname," & lib_sox,
+ "-o", lib_sox, COMPILE_OBJECTS)
+ end
+ install_derived (lib_sox)
+ >> M3SHIP_FILE in
+ write ("link_file(\"", escape(lib_sox), "\", \"", escape(link_so),
+ "\")", CR)
+ end
+ install_link_to_derived (lib_sox, LIB_INSTALL)
+ install_link_to_derived (lib_so, LIB_INSTALL)
+ end
+ end
+ deriveds (lib_sox, no_extension)
+ deriveds (lib_so, no_extension)
+end
+
+proc before_program_hooks(x) is
+end
+
+proc after_program_hooks(x) is
+end
+
+%------------------------------------------------------------- installation ---
+% "install_file" is called during an "m3build install" for
+% each file that neededs to be externally exported.
+
+readonly proc install_file (src, dest, mode) is
+ Note_install (src, dest)
+ % exec ("@cp -p -f", src, dest)
+ exec ("@install -c -m", mode, src, dest)
+end
+
+%---------------------------------------------- the rest of the environment ---
+
+if defined("_bootstrap") include("COMMON.BOOT") end
+include ("COMMON")
diff --git a/lang/modula-3-lib/files/patch-ah b/lang/modula-3-lib/files/patch-ah
index 98878bedaa92..f09633f8d008 100644
--- a/lang/modula-3-lib/files/patch-ah
+++ b/lang/modula-3-lib/files/patch-ah
@@ -11,211 +11,3 @@ Update the m3build templates for FreeBSD-2.1 and later.
SL, BUILD_DIR, SL, src)
local link = format ("%s%s%s", dest, SL, src)
>> M3SHIP_FILE in
---- m3/m3build/templates/FreeBSD2.orig Thu Jun 20 12:17:07 1996
-+++ m3/m3build/templates/FreeBSD2 Sat Jun 6 10:39:25 1998
-@@ -8,8 +8,9 @@
- % Modified On Thu Apr 8 13:45:49 PDT 1993 by muller
- %
- % Sun Nov 27 20:19:31 MET 1994 by ow
-+% Fri Feb 2 15:04:50 PST 1996 by jdp@polstra.com
- %
--% FreeBSD 2.0 configuration (with shared library support in comments)
-+% FreeBSD 2.1 and 2.2 configuration, with shared library support
- %
-
- %-------------------------------------------------- compilation environment ---
-@@ -44,6 +45,8 @@
- MAN_INSTALL = INSTALL_ROOT & "man" % man pages
- HTML_INSTALL = INSTALL_ROOT & "lib/m3/www" % public hypertext
-
-+WDROOT = $HOME & "/m3/pkg" % handy default for overrides
-+
- % The manual pages normally go in subdirectories man{1,...8} of
- % the MAN_INSTALL directory. If you prefer to have them all in
- % a single section, define MAN_SECTION to be that section's name.
-@@ -56,7 +59,12 @@
- LIB_USE = LIB_INSTALL
- PKG_USE = PKG_INSTALL
-
--readonly INSTALL_IMPLS = "TRUE"
-+% This is a relative path from LIB_USE to PKG_USE, so that we can avoid
-+% installing absolute symbolic links. If you cannot support such relative
-+% links, then make it the same as PKG_USE.
-+LIB_TO_PKG = "../pkg"
-+
-+readonly INSTALL_IMPLS = ""
- % "TRUE"
- % => save all source files during the install
- % => makes debugging easier and browsing more fruitful
-@@ -90,15 +98,17 @@
- % "import_TCP" is called from the tcp package.
-
- readonly proc import_X11R4() is
-- import_lib("Xaw", "/usr/X386/lib")
-- import_lib("Xmu", "/usr/X386/lib")
-- import_lib("Xext", "/usr/X386/lib")
-- import_lib("Xt", "/usr/X386/lib")
-- import_lib("X11", "/usr/X386/lib")
-+ import_lib("Xaw", "/usr/X11R6/lib")
-+ import_lib("Xmu", "/usr/X11R6/lib")
-+ import_lib("Xt", "/usr/X11R6/lib")
-+ import_lib("SM", "/usr/X11R6/lib")
-+ import_lib("ICE", "/usr/X11R6/lib")
-+ import_lib("Xext", "/usr/X11R6/lib")
-+ import_lib("X11", "/usr/X11R6/lib")
- end
-
- readonly proc import_Motif() is
-- import_lib("Xm", "/usr/X386/lib")
-+ import_lib("Xm", "/usr/X11R6/lib")
- end
-
- readonly proc import_DECPEX() is
-@@ -114,8 +124,10 @@
- readonly proc import_TCP() is
- end
-
--readonly PLATFORM_SUPPORTS_X = "TRUE"
--readonly PLATFORM_SUPPORTS_MOTIF = "TRUE"
-+readonly PLATFORM_SUPPORTS_X = (not stale ("/usr/X11R6/lib/libX11.a",
-+ "/usr/X11R6/lib/libX11.a"))
-+readonly PLATFORM_SUPPORTS_MOTIF = (not stale ("/usr/X11R6/lib/libXm.a",
-+ "/usr/X11R6/lib/libXm.a"))
- readonly PLATFORM_SUPPORTS_DECPEX = ""
- readonly PLATFORM_SUPPORTS_OPENGL = ""
-
-@@ -128,9 +140,9 @@
- % 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
-+%readonly proc emacs_compile (el) is
-+% exec ("emacs -batch -f batch-byte-compile", el)
-+%end
-
- %---------------------------------------------------- C compiler and linker ---
- % The following definitions are used to compile and link C modules.
-@@ -142,33 +154,27 @@
- % The actual definitions must be kept on one line due to finicky details
- % of the bootstrap process.
-
--
--%% The versions of ar and ranlib shipped with FreeBSD 2.0
--%% definitelty do not work with the Modula-3 archives.
--%% ar sometimes complains about `too many open files' and
--%% ranlib often says `inappropriate file type for object'.
--%% I haven't looked into this further, since newer versions
--%% of the GNU binutils package work quite well. - Olaf Wagner 2/13/95
--
--
--CC = _ifdef ("CC", CC, [ "gcc" ])
-+CC = _ifdef ("CC", CC, [ "cc", "-fpic" ])
- %--- C compiler with flags for compiling a single ".c" file
--% ------ FOR SHARED LIBS, add -fPIC
-
--LINK = _ifdef ("LINK", LINK, [ "gcc" ])
-+LINK = _ifdef ("LINK", LINK, [ "ld", "-e", "start", "-dc", "-dp", "/usr/lib/crt0.o" ])
- %--- C compiler with flags for linking
--% ------ FOR SHARED LIBS, add -Xlinker -Bdynamic
-
--MAKELIB = _ifdef ("MAKELIB", MAKELIB, [ "/usr/bin/ar", "cru" ])
-+MAKELIB = _ifdef ("MAKELIB", MAKELIB, [ "ar", "cru" ])
- %--- program to build library archives
-
- RANLIB = _ifdef ("RANLIB", RANLIB, [ "ranlib" ])
- %--- program to index libraries
-
--ASM = _ifdef ("ASM", ASM, [ "/usr/bin/as" ])
-+ASM = _ifdef ("ASM", ASM, [ "as", "-k" ])
- %--- assembler
--% ------ FOR SHARED LIBS with /usr/bin/as from the FreeBSD distribution,
--% add -k -W
-+
-+BOOT_LINK = _ifdef ("BOOT_LINK", BOOT_LINK, [ "cc" ])
-+%--- C compiler with flags for linking, used during the bootstrap process.
-+% We have to use "cc" for the bootstrap, because the "-z2" option
-+% ("libraries systematically linked with all programs") doesn't get used
-+% during the bootstrap process. If we use "ld", then the C library isn't
-+% linked in.
-
- %------------------------------------------------------------- GNU variants ---
- % The two large pieces of GNU software used by the Modula-3 system
-@@ -179,9 +185,9 @@
- % To use the GNU defaults for CC and CFLAGS, specify "*".
- %
-
--GNU_CC = _ifdef ("GNU_CC", GNU_CC, "*")
--GNU_CFLAGS = _ifdef ("GNU_CFLAGS", GNU_CFLAGS, "*")
--GNU_MAKE = _ifdef ("GNU_MAKE", GNU_MAKE, "gmake")
-+GNU_CC = _ifdef ("GNU_CC", GNU_CC, "cc")
-+GNU_CFLAGS = _ifdef ("GNU_CFLAGS", GNU_CFLAGS, "-O")
-+GNU_MAKE = _ifdef ("GNU_MAKE", GNU_MAKE, "make")
-
- %-------------------------------------------------------- Modula-3 compiler ---
- % The syntax for the values passed to most of the M3_CONFIG options is
-@@ -192,7 +198,8 @@
- M3 = LIB_USE & "/m3"
-
- % What are the standard flags?
--M3OPTIONS = [ "-w1", "-why", "-g" ]
-+M3OPTIONS = [ "-w1", "-why", "-O" ]
-+% ------ FOR DEBUGGING INFO, add "-g"
-
- M3_CONFIG = [
- "-Y1" & _pack_args (CC),
-@@ -201,11 +208,11 @@
- "-Y4" & _pack_args (RANLIB),
- "-Y7" & _pack_args (ASM),
-
-- "-Y6@" & LIB_USE & "/m3cgc1@-quiet@",
-+ "-Y6@" & LIB_USE & "/m3cgc1@-quiet@-fpic@",
- % --- the Modula-3 IL to assembly language pass
-- % ------ FOR SHARED LIBS, add -fPIC
-
-- "-z2@-lm@", % --- libraries systematically linked with all programs
-+ "-z2@-lm@/usr/lib/libgcc.a@-lc@/usr/lib/libgcc.a@",
-+ % --- libraries systematically linked with all programs
-
- "-z3" & LIB_USE & SL & "report_coverage.o",
- % --- library linked in programs compiled with "-Z" coverage option
-@@ -248,7 +255,7 @@
- % passes in a file and then deletes the file, unless "-keep" or
- % "-verbose" is specified.
-
-- "-zK0",
-+ "-zK1",
- % --- Set the value of "-zK" to "1" if you want the m3 driver to
- % supply -Bdynamic/-Bstatic options to the linker, "0" otherwise.
-
-@@ -263,9 +270,9 @@
-
- proc build_standalone() is
- % --- reset the linker to avoid shared libraries.
-- M3_CONFIG += "-Y2@cc@-static@"
- M3_CONFIG += "-Y6@" & LIB_USE & "/m3cgc1@-quiet@"
-- M3_CONFIG += "-Y7@/usr/bin/as@"
-+ M3_CONFIG += "-Y7@as@"
-+ M3_CONFIG += "-Bstatic"
- end
-
- proc build_shared() is
-@@ -282,7 +289,7 @@
-
- proc after_library_hooks(x) is
- local lib_a = format ("lib%s.a", x)
-- local lib_so = format ("lib%s.so.1.1", x)
-+ local lib_so = format ("lib%s.so.6.0", x)
- local dest = format ("%s%s%s%s%s", PKG_INSTALL, SL, BUILD_PACKAGE,
- SL, BUILD_DIR)
-
-@@ -291,7 +298,7 @@
- write ("missing ", lib_a, ": not building ", lib_so, CR)
- else
- if stale (lib_so, lib_a)
-- exec ("/usr/bin/ld -Bshareable -assert pure-text -o",
-+ exec ("ld -Bshareable -assert pure-text -o",
- lib_so, COMPILE_OBJECTS)
- end
- install_derived (lib_so)
diff --git a/lang/modula-3-lib/files/patch-bt b/lang/modula-3-lib/files/patch-bt
new file mode 100644
index 000000000000..da04f7886c19
--- /dev/null
+++ b/lang/modula-3-lib/files/patch-bt
@@ -0,0 +1,22 @@
+--- m3/m3core/src/runtime/FreeBSD2/_fpsetjmp.s.orig Mon Nov 7 13:11:12 1994
++++ m3/m3core/src/runtime/FreeBSD2/_fpsetjmp.s Fri Aug 28 13:45:40 1998
+@@ -55,6 +55,9 @@
+ .globl __fpsetjmp;
+ .type __fpsetjmp,@function;
+ __fpsetjmp:
++.globl _fpsetjmp;
++.type _fpsetjmp,@function;
++_fpsetjmp:
+ movl 4(%esp),%eax
+ movl 0(%esp),%edx
+ movl %edx, 0(%eax)
+@@ -71,6 +74,9 @@
+ .globl __fplongjmp;
+ .type __fplongjmp,@function;
+ __fplongjmp:
++.globl _fplongjmp;
++.type _fplongjmp,@function;
++_fplongjmp:
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ movl 0(%edx),%ecx
diff --git a/lang/modula-3-lib/files/patch-bu b/lang/modula-3-lib/files/patch-bu
new file mode 100644
index 000000000000..f231da9b6a5f
--- /dev/null
+++ b/lang/modula-3-lib/files/patch-bu
@@ -0,0 +1,29 @@
+--- m3/m3core/src/runtime/FreeBSD2/RTStackASM.s.orig Mon Oct 17 09:50:40 1994
++++ m3/m3core/src/runtime/FreeBSD2/RTStackASM.s Fri Aug 28 13:44:44 1998
+@@ -3,6 +3,8 @@
+
+ .globl _RTStack__CurrentFrame
+ _RTStack__CurrentFrame:
++ .globl RTStack__CurrentFrame
++RTStack__CurrentFrame:
+ # STACK = ret frame
+ popl %eax # STACK = frame
+ pushl %eax
+@@ -19,6 +21,8 @@
+
+ .globl _RTStack__PreviousFrame
+ _RTStack__PreviousFrame:
++ .globl RTStack__PreviousFrame
++RTStack__PreviousFrame:
+ movl 4(%esp), %eax # eax = ^callee
+ movl 4(%eax), %eax # eax = callee.ebp
+ pushl 0(%eax) # push bp of caller
+@@ -33,6 +37,8 @@
+
+ .globl _RTStack__Unwind
+ _RTStack__Unwind:
++ .globl RTStack__Unwind
++RTStack__Unwind:
+ movl 4(%esp), %eax # eax = ^to
+ movl 8(%eax), %esp
+ movl 4(%eax), %ebp
diff --git a/lang/modula-3-lib/pkg-plist b/lang/modula-3-lib/pkg-plist
index a6eaed0a27c6..c788852480f9 100644
--- a/lang/modula-3-lib/pkg-plist
+++ b/lang/modula-3-lib/pkg-plist
@@ -1,44 +1,44 @@
etc/rc.d/50.m3.sh
-lib/m3/FreeBSD2/libDiGraph.so.6.0
-lib/m3/FreeBSD2/libGeometry.so.6.0
-lib/m3/FreeBSD2/libImages.so.6.0
-lib/m3/FreeBSD2/libTempFiles.so.6.0
-lib/m3/FreeBSD2/libjvideo.so.6.0
-lib/m3/FreeBSD2/libm3.so.6.0
-lib/m3/FreeBSD2/libm3X11R4.so.6.0
-lib/m3/FreeBSD2/libm3core.so.6.0
-lib/m3/FreeBSD2/libm3formsvbt.so.6.0
-lib/m3/FreeBSD2/libm3formsvbtpixmaps.so.6.0
-lib/m3/FreeBSD2/libm3parseparams.so.6.0
-lib/m3/FreeBSD2/libm3tcp.so.6.0
-lib/m3/FreeBSD2/libm3tools.so.6.0
-lib/m3/FreeBSD2/libm3ui.so.6.0
-lib/m3/FreeBSD2/libm3vbtkit.so.6.0
-lib/m3/FreeBSD2/libset.so.6.0
-lib/m3/FreeBSD2/libtable-list.so.6.0
-lib/m3/FreeBSD2/libtcpextras.so.6.0
-lib/m3/FreeBSD2/libvideovbt.so.6.0
-lib/m3/FreeBSD2/libweb.so.6.0
-lib/m3/pkg/X11R4/FreeBSD2/libm3X11R4.so.6.0
-lib/m3/pkg/digraph/FreeBSD2/libDiGraph.so.6.0
-lib/m3/pkg/formsvbt/FreeBSD2/libm3formsvbt.so.6.0
-lib/m3/pkg/formsvbtpixmaps/FreeBSD2/libm3formsvbtpixmaps.so.6.0
-lib/m3/pkg/images/FreeBSD2/libImages.so.6.0
-lib/m3/pkg/jvideo/FreeBSD2/libjvideo.so.6.0
-lib/m3/pkg/libm3/FreeBSD2/libm3.so.6.0
-lib/m3/pkg/m3core/FreeBSD2/libm3core.so.6.0
-lib/m3/pkg/m3tools/FreeBSD2/libm3tools.so.6.0
-lib/m3/pkg/parseparams/FreeBSD2/libm3parseparams.so.6.0
-lib/m3/pkg/realgeometry/FreeBSD2/libGeometry.so.6.0
-lib/m3/pkg/set/FreeBSD2/libset.so.6.0
-lib/m3/pkg/table-list/FreeBSD2/libtable-list.so.6.0
-lib/m3/pkg/tcp/FreeBSD2/libm3tcp.so.6.0
-lib/m3/pkg/tcpextras/FreeBSD2/libtcpextras.so.6.0
-lib/m3/pkg/tempfiles/FreeBSD2/libTempFiles.so.6.0
-lib/m3/pkg/ui/FreeBSD2/libm3ui.so.6.0
-lib/m3/pkg/vbtkit/FreeBSD2/libm3vbtkit.so.6.0
-lib/m3/pkg/videovbt/FreeBSD2/libvideovbt.so.6.0
-lib/m3/pkg/web/FreeBSD2/libweb.so.6.0
+lib/m3/FreeBSD2/libDiGraph.so
+lib/m3/FreeBSD2/libGeometry.so
+lib/m3/FreeBSD2/libImages.so
+lib/m3/FreeBSD2/libTempFiles.so
+lib/m3/FreeBSD2/libjvideo.so
+lib/m3/FreeBSD2/libm3.so
+lib/m3/FreeBSD2/libm3X11R4.so
+lib/m3/FreeBSD2/libm3core.so
+lib/m3/FreeBSD2/libm3formsvbt.so
+lib/m3/FreeBSD2/libm3formsvbtpixmaps.so
+lib/m3/FreeBSD2/libm3parseparams.so
+lib/m3/FreeBSD2/libm3tcp.so
+lib/m3/FreeBSD2/libm3tools.so
+lib/m3/FreeBSD2/libm3ui.so
+lib/m3/FreeBSD2/libm3vbtkit.so
+lib/m3/FreeBSD2/libset.so
+lib/m3/FreeBSD2/libtable-list.so
+lib/m3/FreeBSD2/libtcpextras.so
+lib/m3/FreeBSD2/libvideovbt.so
+lib/m3/FreeBSD2/libweb.so
+lib/m3/pkg/X11R4/FreeBSD2/libm3X11R4.so
+lib/m3/pkg/digraph/FreeBSD2/libDiGraph.so
+lib/m3/pkg/formsvbt/FreeBSD2/libm3formsvbt.so
+lib/m3/pkg/formsvbtpixmaps/FreeBSD2/libm3formsvbtpixmaps.so
+lib/m3/pkg/images/FreeBSD2/libImages.so
+lib/m3/pkg/jvideo/FreeBSD2/libjvideo.so
+lib/m3/pkg/libm3/FreeBSD2/libm3.so
+lib/m3/pkg/m3core/FreeBSD2/libm3core.so
+lib/m3/pkg/m3tools/FreeBSD2/libm3tools.so
+lib/m3/pkg/parseparams/FreeBSD2/libm3parseparams.so
+lib/m3/pkg/realgeometry/FreeBSD2/libGeometry.so
+lib/m3/pkg/set/FreeBSD2/libset.so
+lib/m3/pkg/table-list/FreeBSD2/libtable-list.so
+lib/m3/pkg/tcp/FreeBSD2/libm3tcp.so
+lib/m3/pkg/tcpextras/FreeBSD2/libtcpextras.so
+lib/m3/pkg/tempfiles/FreeBSD2/libTempFiles.so
+lib/m3/pkg/ui/FreeBSD2/libm3ui.so
+lib/m3/pkg/vbtkit/FreeBSD2/libm3vbtkit.so
+lib/m3/pkg/videovbt/FreeBSD2/libvideovbt.so
+lib/m3/pkg/web/FreeBSD2/libweb.so
share/modula-3-lib/COPYRIGHT
-@exec /sbin/ldconfig -m %D/lib/m3/FreeBSD2
-@unexec /sbin/ldconfig -R
+@exec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -m %D/lib/m3/FreeBSD2
+@unexec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -R
diff --git a/lang/modula-3-lib/pkg-plist.noX11 b/lang/modula-3-lib/pkg-plist.noX11
index c8c45304362d..ed12238b7853 100644
--- a/lang/modula-3-lib/pkg-plist.noX11
+++ b/lang/modula-3-lib/pkg-plist.noX11
@@ -1,28 +1,28 @@
etc/rc.d/50.m3.sh
-lib/m3/FreeBSD2/libDiGraph.so.6.0
-lib/m3/FreeBSD2/libGeometry.so.6.0
-lib/m3/FreeBSD2/libTempFiles.so.6.0
-lib/m3/FreeBSD2/libm3.so.6.0
-lib/m3/FreeBSD2/libm3core.so.6.0
-lib/m3/FreeBSD2/libm3parseparams.so.6.0
-lib/m3/FreeBSD2/libm3tcp.so.6.0
-lib/m3/FreeBSD2/libm3tools.so.6.0
-lib/m3/FreeBSD2/libset.so.6.0
-lib/m3/FreeBSD2/libtable-list.so.6.0
-lib/m3/FreeBSD2/libtcpextras.so.6.0
-lib/m3/FreeBSD2/libweb.so.6.0
-lib/m3/pkg/digraph/FreeBSD2/libDiGraph.so.6.0
-lib/m3/pkg/libm3/FreeBSD2/libm3.so.6.0
-lib/m3/pkg/m3core/FreeBSD2/libm3core.so.6.0
-lib/m3/pkg/m3tools/FreeBSD2/libm3tools.so.6.0
-lib/m3/pkg/parseparams/FreeBSD2/libm3parseparams.so.6.0
-lib/m3/pkg/realgeometry/FreeBSD2/libGeometry.so.6.0
-lib/m3/pkg/set/FreeBSD2/libset.so.6.0
-lib/m3/pkg/table-list/FreeBSD2/libtable-list.so.6.0
-lib/m3/pkg/tcp/FreeBSD2/libm3tcp.so.6.0
-lib/m3/pkg/tcpextras/FreeBSD2/libtcpextras.so.6.0
-lib/m3/pkg/tempfiles/FreeBSD2/libTempFiles.so.6.0
-lib/m3/pkg/web/FreeBSD2/libweb.so.6.0
+lib/m3/FreeBSD2/libDiGraph.so
+lib/m3/FreeBSD2/libGeometry.so
+lib/m3/FreeBSD2/libTempFiles.so
+lib/m3/FreeBSD2/libm3.so
+lib/m3/FreeBSD2/libm3core.so
+lib/m3/FreeBSD2/libm3parseparams.so
+lib/m3/FreeBSD2/libm3tcp.so
+lib/m3/FreeBSD2/libm3tools.so
+lib/m3/FreeBSD2/libset.so
+lib/m3/FreeBSD2/libtable-list.so
+lib/m3/FreeBSD2/libtcpextras.so
+lib/m3/FreeBSD2/libweb.so
+lib/m3/pkg/digraph/FreeBSD2/libDiGraph.so
+lib/m3/pkg/libm3/FreeBSD2/libm3.so
+lib/m3/pkg/m3core/FreeBSD2/libm3core.so
+lib/m3/pkg/m3tools/FreeBSD2/libm3tools.so
+lib/m3/pkg/parseparams/FreeBSD2/libm3parseparams.so
+lib/m3/pkg/realgeometry/FreeBSD2/libGeometry.so
+lib/m3/pkg/set/FreeBSD2/libset.so
+lib/m3/pkg/table-list/FreeBSD2/libtable-list.so
+lib/m3/pkg/tcp/FreeBSD2/libm3tcp.so
+lib/m3/pkg/tcpextras/FreeBSD2/libtcpextras.so
+lib/m3/pkg/tempfiles/FreeBSD2/libTempFiles.so
+lib/m3/pkg/web/FreeBSD2/libweb.so
share/modula-3-lib/COPYRIGHT
-@exec /sbin/ldconfig -m %D/lib/m3/FreeBSD2
-@unexec /sbin/ldconfig -R
+@exec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -m %D/lib/m3/FreeBSD2
+@unexec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -R
diff --git a/lang/modula-3-lib/scripts/configure b/lang/modula-3-lib/scripts/configure
index 7a814e57703d..4275660b42e6 100644
--- a/lang/modula-3-lib/scripts/configure
+++ b/lang/modula-3-lib/scripts/configure
@@ -1,36 +1,45 @@
#! /bin/sh
#
-# $Id: configure,v 1.2 1998/05/29 17:58:09 jdp Exp $
+# $Id: configure,v 1.3 1998/06/02 23:22:23 jdp Exp $
umask 022
-files_to_patch="\
- ${WRKSRC}/m3/m3build/templates/FreeBSD2"
temp_prefix=${WRKSRC}/installed
+plist_src=${PKGDIR}/${PLIST##*/}
+template_src=${FILESDIR}/FreeBSD2.${PORTOBJFORMAT}
+template="${WRKSRC}/m3/m3build/templates/FreeBSD2"
-if [ -f /usr/lib/crt0.o ]; then
- crt=/usr/lib/crt0.o
-elif [ -f /usr/lib/aout/crt0.o ]; then
- crt=/usr/lib/aout/crt0.o
+if [ "${PORTOBJFORMAT}" = aout -a -f /usr/lib/aout/crt0.o ]; then
+ crt0=/usr/lib/aout/crt0.o
else
- echo "Cannot find a \"crt0.o\" file" >&2
- exit 1
+ crt0=/usr/lib/crt0.o
fi
-
-if [ -f /usr/lib/libgcc.a ]; then
- libgcc=/usr/lib/libgcc.a
-elif [ -f /usr/lib/aout/libgcc.a ]; then
+if [ "${PORTOBJFORMAT}" = aout -a -f /usr/lib/aout/libgcc.a ]; then
libgcc=/usr/lib/aout/libgcc.a
else
- echo "Cannot find a \"libgcc.a\" file" >&2
- exit 1
+ libgcc=/usr/lib/libgcc.a
fi
-for i in ${files_to_patch}; do
- test -f ${i}.bak || cp -p ${i} ${i}.bak
- rm -f ${i}
- sed -e "s|/usr/local/|${temp_prefix}/|g" \
- -e "s|/usr/lib/crt0\.o|${crt}|g" \
- -e "s|/usr/lib/libgcc\.a|${libgcc}|g" \
- ${i}.bak >${i}
-done
+# Copy the appropriate m3build template file into place, patching up
+# various pathnames in the process.
+rm -f ${template}
+sed -e "s|/usr/local/|${temp_prefix}/|g" \
+ -e "s|!PREFIX!|${PREFIX}|g" \
+ -e "s|/usr/lib/crt0\.o|${crt0}|g" \
+ -e "s|/usr/lib/libgcc\.a|${libgcc}|g" \
+ ${template_src} >${template}
+
+# Our PLIST templates contain only the "libfoo.so" names for shared
+# libraries. Here we add the "libfoo.so.${MAJOR}" names. This saves
+# us from having to fix the PLIST every time we bump the version number.
+sed -e "/\.so\$/p" \
+ -e "s/\.so\$/&.${MAJOR}/" \
+ ${plist_src} > ${PLIST}
+
+# Also generate a "PLIST.real" file which includes the minor version
+# numbers on shared library names if the object format is a.out.
+if [ "${PORTOBJFORMAT}" = aout ]; then
+ sed -e "s/\.so\.${MAJOR}\$/&.0/" ${PLIST} > ${PLIST}.real
+else
+ cp ${PLIST} ${PLIST}.real
+fi