summaryrefslogtreecommitdiff
path: root/shmem
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2000-05-03 17:15:49 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2000-05-03 17:15:49 +0000
commit0d8fbf6e5859151fddbabed7a9999289401526af (patch)
treea1800dc0cb0525d9c0aa242ec0a1091fc75dcce6 /shmem
parentbf4bde4b8fdcf1e8207e87af2c98d02dc382c311 (diff)
downloadlibapr-0d8fbf6e5859151fddbabed7a9999289401526af.tar.gz
Update MM to the latest version. retrieved from
http://www.engelschall.com/sw/mm git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60018 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'shmem')
-rw-r--r--shmem/unix/mm/ChangeLog250
-rw-r--r--shmem/unix/mm/INSTALL5
-rw-r--r--shmem/unix/mm/LICENSE2
-rw-r--r--shmem/unix/mm/Makefile.in21
-rw-r--r--shmem/unix/mm/PORTING87
-rw-r--r--shmem/unix/mm/README68
-rw-r--r--shmem/unix/mm/THANKS61
-rw-r--r--shmem/unix/mm/aclocal.m4112
-rwxr-xr-xshmem/unix/mm/config.guess196
-rwxr-xr-xshmem/unix/mm/config.sub2
-rw-r--r--shmem/unix/mm/configure.in22
-rwxr-xr-xshmem/unix/mm/fbtool2
-rwxr-xr-xshmem/unix/mm/ltconfig183
-rw-r--r--shmem/unix/mm/ltmain.sh99
-rw-r--r--shmem/unix/mm/mm-config.113
-rw-r--r--shmem/unix/mm/mm-config.in2
-rw-r--r--shmem/unix/mm/mm-config.pod2
-rw-r--r--shmem/unix/mm/mm.3156
-rw-r--r--shmem/unix/mm/mm.h46
-rw-r--r--shmem/unix/mm/mm.pod144
-rw-r--r--shmem/unix/mm/mm_alloc.c6
-rw-r--r--shmem/unix/mm/mm_conf.h.in50
-rw-r--r--shmem/unix/mm/mm_core.c47
-rw-r--r--shmem/unix/mm/mm_global.c2
-rw-r--r--shmem/unix/mm/mm_lib.c2
-rw-r--r--shmem/unix/mm/mm_test.c42
-rw-r--r--shmem/unix/mm/mm_vers.c20
-rwxr-xr-xshmem/unix/mm/shtool1744
28 files changed, 1173 insertions, 2213 deletions
diff --git a/shmem/unix/mm/ChangeLog b/shmem/unix/mm/ChangeLog
new file mode 100644
index 000000000..2f0503ef6
--- /dev/null
+++ b/shmem/unix/mm/ChangeLog
@@ -0,0 +1,250 @@
+ __ __ __ __
+ | \/ | \/ |
+ | |\/| | |\/| |
+ | | | | | | |
+ |_| |_|_| |_|
+
+ MM - Shared Memory Library
+
+ ChangeLog
+ =========
+ _ _
+ / | / |
+ | | | |
+ | |_| |
+ __|_(_)_|__________________________________________________________
+
+ Changes between 1.1.0 and 1.1.1 (30-Apr-2000 to 30-Apr-2000)
+
+ *) Fixed compilation under Solaris where the SunOS4 and BS2000 kludges
+ for <sys/shm.h> conflicted with the Sun vendor includes (which
+ unfortunately use the defines).
+ [Ralf S. Engelschall, Jeff Beard <jeff@cyberxape.com>]
+
+ Changes between 1.0.12 and 1.1.0 (28-Sep-1999 to 30-Apr-2000)
+
+ *) Fixed `make test' feedback procedure in Makefile.in now that the
+ platform list is stored in the PORTING file.
+ [Ralf S. Engelschall]
+
+ *) Renamed file CHANGES to ChangeLog.
+ [Ralf S. Engelschall]
+
+ *) Fixed pointer arithmentic in memset/memcpy replacements
+ by casting `void *' arguments to `char *'.
+ [Sascha Schumann <sascha@schumann.cx>]
+
+ *) Added BS2000 support for <sys/shm.h> stuff.
+ [Martin Kraemer <martin.kraemer@mch.sni.de>]
+
+ *) Added an include for <fcntl.h> to maximum shared mem segment size
+ check in aclocal.m4. This especially fixes compile problems under for
+ Solaris 8.
+ [Alexander Demenchuk <alder@untech.com>, Greg Gears <gears@netair.com>]
+
+ *) Fixed a warning under IRIX related to size_t comparisons
+ [Ralf S. Engelschall]
+
+ *) Added support for IBM OS/390
+ [Jeff Trawick <trawick@ibm.net>]
+
+ *) Upgraded to GNU libtool from version 1.3.3 to 1.3.4
+ and upgraded GNU shtool from version 1.4.6 to 1.4.9
+ [Ralf S. Engelschall]
+
+ *) Upgraded config.guess to GNU Pth's version and
+ use "/sbin/sysctl" under FreeBSD instead of just "sysctl"
+ [Jeff Trawick <trawick@ibm.net>]
+
+ *) Added platform support for the esoteric Unix look-alike BeOS
+ [David Reid" <dreid@jetnet.co.uk>]
+
+ *) Added `make check' as an alias for `make test'
+ [Ralf S. Engelschall]
+
+ *) Adjusted copyright messages for year 2000
+ [Ralf S. Engelschall]
+
+ *) Fixed Autoconf checks for SunOS
+ [Ralf S. Engelschall]
+
+ *) Fixed a bug in aclocal.m4's AC_CHECK_DEFINE macro.
+ [Ralf S. Engelschall]
+
+ *) Updated the manual page (typos, fixes, etc.)
+ [Ralf S. Engelschall]
+
+ *) Splitted README into README, PORTING and THANKS document.
+ [Ralf S. Engelschall]
+
+ _ ___
+ / | / _ \
+ | || | | |
+ | || |_| |
+ __|_(_)___/________________________________________________________
+
+ Changes between 1.0.11 and 1.0.12 (06-Sep-1999 to 28-Sep-1999)
+
+ *) Recreated configure with latest Autoconf 2.13.1 (snapshot)
+ *) Always use --mode=xxx for libtool calls to avoid problems under
+ situations where $CC doesn't allow libtool to guess the mode
+ correctly.
+
+ Changes between 1.0.10 and 1.0.11 (27-Aug-1999 to 06-Sep-1999)
+
+ *) Cleaned up various file permission in source tree
+ *) Enhanced mm-config.in: new --all option and less newlines
+ *) Added support --silent to libtool glue code in aclocal.m4
+ *) Upgraded to GNU Pth's more recent config.{guess,sub}
+ *) Upgraded to GNU shtool 1.4.6
+ *) Fixed --section for mm-config in Makefile.in
+ *) Added `void *' casts to MAP_FAILED (= -1) values to avoid
+ warnings under some platforms.
+ *) Fixed a few typos in mm.pod
+
+ Changes between 1.0.9 and 1.0.10 (02-Jul-1999 to 27-Aug-1999)
+
+ *) Changed "make dist" and "make snap" to use "shtool tarball"
+ *) Added #define KERNEL for SunOS to get SHM_R und SHM_W values.
+ *) Upgraded to GNU libtool 1.3.3
+ *) Upgraded to GNU shtool 1.4.5
+ *) Downgraded required Autoconf version to 2.12
+ *) Added MM version number to test report
+ *) Added --enable-batch
+ *) Moved mm_lock_mode in mm.h to top to avoid warnings
+
+ Changes between 1.0.8 and 1.0.9 (24-Jun-1999 to 02-Jul-1999)
+
+ *) Fixed a nasty bug related to {MM,mm}_[un]lock():
+ an additional semicolon broke the semantics.
+ *) Upgraded to released shtool 1.4.0
+ *) Fixed `make test'
+
+ Changes between 1.0.7 and 1.0.8 (22-Jun-1999 to 24-Jun-1999)
+
+ *) Added important MAP_FAILED fallback also to Autoconf stuff
+ *) Upgraded to latest shtool 1.3.0-dev to fix two Awk problems
+
+ Changes between 1.0.6 and 1.0.7 (06-Jun-1999 to 22-Jun-1999)
+
+ *) Upgraded to latest shtool 1.3.0-dev
+ *) Avoid -g under non-debugging situation
+ *) Complain with a fatal error message when MM_SHM_MAXSEGSIZE
+ couldn't be determined.
+ *) Updated config.guess/config.sub
+ *) Fixed a nasty permission bug for the lock files:
+ they were opened write-only, but at least fcntl()
+ requires them to be opened read-write.
+ *) Check return value of mm_core_lock() in mm_alloc.c
+
+ Changes between 1.0.5 and 1.0.6 (02-Jun-1999 to 06-Jun-1999)
+
+ *) Fixed mm_malloc() function: it returned the wrong pointer when a chunk
+ was reused and forgot to lock/unlock the data structures.
+ *) Fixed internal best-fit algorithm for finding a free memory chunk:
+ - things got inserted out of order in the list
+ - when chunk is found which matches size exactly it stops immediately
+ - lowered chunk splitting threshold to MIN(2*size,128)
+ *) Moved internal definitions in mm.h to private section
+
+ Changes between 1.0.4 and 1.0.5 (21-May-1999 to 02-Jun-1999)
+
+ *) Fixed output of mm-config.in
+ *) Fixed output of configure --help
+ *) Upgraded to GNU libtool 1.3.2
+ *) Upgraded to shtool 1.2.9
+ *) Made libtool calls visible but use --quiet
+ *) Hint user to send feedback only on errors or for new platform
+ *) Removed unnecessary "elf" hint for FreeBSD from config.guess
+
+ Changes between 1.0.3 and 1.0.4 (15-May-1999 to 21-May-1999)
+
+ *) Fixed maximum memory size determination and internal handling
+ *) Documented the mm_lib_xxx() functions.
+
+ Changes between 1.0.2 and 1.0.3 (26-Apr-1999 to 15-May-1999)
+
+ *) Added {MM,mm,mm_core}_permission() function
+ *) Fixed version information and mod_ssl URL in manual page
+ *) Upgraded config.{guess,sub} from libtool 1.3 distribution
+ *) Upgraded to GNU libtool 1.3
+ *) Upgraded to shtool 1.2.7
+ *) Fixed public includes for xx_t types
+ *) Fixed mm_vers.c and shtool type inside CVS
+
+ Changes between 1.0.1 and 1.0.2 (18-Apr-1999 to 26-Apr-1999)
+
+ *) Upgraded to GNU libtool 1.2f
+ *) Upgraded to shtool 1.1.0
+
+ Changes between 1.0.0 and 1.0.1 (18-Mar-1999 to 18-Apr-1999)
+
+ *) Fixed "dist" Makefile target to not distribute CVS stuff
+ *) Upgraded lshtool to the latest version
+ *) Const'ification of the API
+
+ Changes between 1.0b6 and 1.0.0 (18-Mar-1999 to 28-Mar-1999)
+
+ *) Finally cleaned up and polished the mm.pod manual page.
+ *) Fixed mm-config program
+
+ Changes between 1.0b5 and 1.0b6 (18-Mar-1999 to 18-Mar-1999)
+
+ *) Added {MM,mm}_maxsize() to manual page
+ *) Changed MM_create() signature to match mm_create()
+
+ Changes between 1.0b4 and 1.0b5 (15-Mar-1999 to 18-Mar-1999)
+
+ *) Make sure the maximum allocateable size takes
+ the overhead of the memory pool into account.
+ *) Fixed lshtool and this way hex version string
+ *) Fixed Makefile for mm_test target dependecies
+ *) Added {MM,mm}_maxsize() function to let one
+ determine in advance the maximum allocateable pool
+
+ Changes between 1.0b3 and 1.0b4 (15-Mar-1999 to 15-Mar-1999)
+
+ *) Added mm-config.pod manpage
+ *) Split mm-config --ldflags into --ldflags and --libs
+ *) Removed TODO and fulltest files
+
+ Changes between 1.0b2 and 1.0b3 (13-Mar-1999 to 15-Mar-1999)
+
+ *) Added Autoconf check for determining max shared mem segment size
+ *) Changed -1 to MAP_FAILED when available
+ *) Replaced 8KB default shared memory segment size with max size
+ *) Added mm_core_maxsegsize() function
+ *) Use a remembered offset for mmap() on temporary files
+ *) Imported source tree into CVS
+ *) Added read-only locking support
+ *) Fixed MMFILE and MMZERO variants
+
+ Changes between 1.0b1 and 1.0b2 (12-Mar-1999 to 13-Mar-1999)
+
+ *) Updated the mm.pod manual page.
+ *) Split README into README and LICENSE files
+ *) Fixed becho problems
+ *) Added a test suite summary
+ *) Added INSTALL file
+ *) Reduced mm_test's memory size from 1MB to 512KB
+ *) Fixed unsigned long and %X related warnings
+
+ Changes between 1.0b0 and 1.0b1 (11-Mar-1999 to 12-Mar-1999)
+
+ *) Enhanced mm_test
+ *) Added {MM,mm}_available() function
+ *) Fixed MMZERO
+ *) Fixed IPC Semaphore initialization
+ *) Added --with-{sem,shm}=TYPE options
+ *) Fixed "make test" and mm_memory_display() function
+ *) Added mm_lib.c source with mm_lib_xx() functions
+
+ Changes between 0.9.0 and 1.0b0 (10-Mar-1999 to 11-Mar-1999)
+
+ *) Switched to GNU Autoconf and GNU Libtool
+
+ Changes between GENESIS and 0.9.0 (Jan-1999 to 10-Mar-1999)
+
+ *) Created initial version on FreeBSD
+ *) Ported to Linux and Solaris
+
diff --git a/shmem/unix/mm/INSTALL b/shmem/unix/mm/INSTALL
index 1f42c1d4a..15b638863 100644
--- a/shmem/unix/mm/INSTALL
+++ b/shmem/unix/mm/INSTALL
@@ -3,9 +3,12 @@
| |\/| | |\/| |
| | | | | | |
|_| |_|_| |_|
-
+
MM - Shared Memory Library
+ INSTALL
+ =======
+
To install the MM library into /path/to/mm/{bin,lib,include,man}/ perform
the following steps in your shell:
diff --git a/shmem/unix/mm/LICENSE b/shmem/unix/mm/LICENSE
index 3bd1c3d41..c95b7d240 100644
--- a/shmem/unix/mm/LICENSE
+++ b/shmem/unix/mm/LICENSE
@@ -1,6 +1,6 @@
====================================================================
- Copyright (c) 1999 Ralf S. Engelschall. All rights reserved.
+ Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
diff --git a/shmem/unix/mm/Makefile.in b/shmem/unix/mm/Makefile.in
index 206580d2c..681f7ab48 100644
--- a/shmem/unix/mm/Makefile.in
+++ b/shmem/unix/mm/Makefile.in
@@ -1,5 +1,5 @@
## ====================================================================
-## Copyright (c) 1999 Ralf S. Engelschall. All rights reserved.
+## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
@@ -74,31 +74,29 @@ _VERSION = \
.SUFFIXES: .o .lo
.c.o:
- $(LIBTOOL) --quiet --mode=compile \
- $(CC) -c $(CFLAGS) $<
+ $(LIBTOOL) --quiet --mode=compile $(CC) -c $(CFLAGS) $<
.c.lo:
- $(LIBTOOL) --quiet --mode=compile \
- $(CC) -c $(CFLAGS) $<
+ $(LIBTOOL) --quiet --mode=compile $(CC) -c $(CFLAGS) $<
all: libmm.la $(MAN) mm_test
libmm.la: $(OBJ) $(LOBJ)
- $(LIBTOOL) --quiet --mode=link \
- $(CC) -o libmm.la $(LOBJ) \
+ $(LIBTOOL) --quiet --mode=link $(CC) -o libmm.la $(LOBJ) \
-rpath $(libdir) -version-info `$(SHTOOL) version -l c -d libtool mm_vers.c`
mm_alloc.c mm_core.c mm_global.c: mm_conf.h mm.h mm_vers.c
+check: test
test: mm_test
-@./mm_test; \
if [ $$? -eq 0 ]; then \
PLATFORM=`$(SHELL) ./config.guess`; \
PLATFORM=`$(SHELL) ./config.sub $$PLATFORM`; \
- if [ ".`grep $$PLATFORM README`" = . ]; then \
+ if [ ".`grep $$PLATFORM PORTING`" = . ]; then \
echo "Please send the following summary via Email to the author"; \
echo "Ralf S. Engelschall <rse@engelschall.com> for inclusion into"; \
- echo "the list of successfully tested platforms (see README file):"; \
+ echo "the list of successfully tested platforms (see PORTING file):"; \
echo ""; \
echo "Ok" >.fbtool; \
$(SHELL) ./fbtool -d; \
@@ -118,8 +116,7 @@ debug: mm_test
@$(LIBTOOL) --mode=execute gdb mm_test
mm_test: mm_test.lo libmm.la
- $(LIBTOOL) --quiet --mode=link \
- $(CC) -o $@ mm_test.lo libmm.la
+ $(LIBTOOL) --quiet --mode=link $(CC) -o $@ mm_test.lo libmm.la
mm.3: mm.pod
V1=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \
@@ -157,7 +154,7 @@ ltconfig:
echo "ltconfig <-- $$F"; cp $$F .
shtool:
- shtoolize -o shtool all
+ shtoolize -o shtool version echo mkdir install fixperm tarball
install: all
$(SHTOOL) mkdir -f -p -m 755 $(bindir)
diff --git a/shmem/unix/mm/PORTING b/shmem/unix/mm/PORTING
new file mode 100644
index 000000000..04d4c2419
--- /dev/null
+++ b/shmem/unix/mm/PORTING
@@ -0,0 +1,87 @@
+ __ __ __ __
+ | \/ | \/ |
+ | |\/| | |\/| |
+ | | | | | | |
+ |_| |_|_| |_|
+
+ MM - Shared Memory Library
+
+ PORTING
+ =======
+
+ The MM library was successfully tested on the following platforms (and
+ should automatically adjust to other platforms, of course):
+
+ o i686-pc-freebsd3.1 FreeBSD 3.1
+ o i686-pc-freebsd3.2 FreeBSD 3.2
+ o i686-pc-freebsd3.3 FreeBSD 3.3
+ o i586-pc-freebsd3.4 FreeBSD 3.4
+ o i686-pc-freebsd3.4 FreeBSD 3.4
+ o i586-pc-freebsd2.2.7 FreeBSD 2.2.7
+ o i586-pc-freebsd2.2.8 FreeBSD 2.2.8
+ o i486-pc-freebsd2.2.6 FreeBSD 2.2.6
+ o i586-pc-freebsd2.2.2 FreeBSD 2.2.2
+ o i686-pc-freebsd4.0 FreeBSD 4.0
+ o i386-unknown-openbsd2.4 OpenBSD 2.4
+ o i386-unknown-openbsd2.5 OpenBSD 2.5
+ o i386-unknown-netbsd1.4 NetBSD 1.4/x86
+ o i386-unknown-netbsd1.4.2 NetBSD 1.4.2/x86
+ o sparc-unknown-netbsd1.4.1 NetBSD 1.4.1/sparc
+ o sparc-unknown-netbsd1.4.2 NetBSD 1.4.2/sparc
+ o alpha-unknown-netbsd1.4.2 NetBSD 1.4.2/alpha
+ o i386-pc-bsdi2.1 BSDI 2.1
+ o i386-pc-bsdi4.0.1 BSDI 4.0.1
+ o i586-pc-linux-gnu RedHat 5.2
+ o i586-pc-linux-gnu RedHat 5.0
+ o i686-pc-linux-gnu Redhat 6.0
+ o i686-pc-linux-gnu Slackware 7.0
+ o i486-pc-linux-gnulibc1 Linux
+ o i686-pc-linux-gnulibc1 Linux
+ o i686-pc-linux-gnulibc1 Slackware 4.0
+ o i586-pc-linux-gnulibc1 Slackware 4.0
+ o sparc64-unknown-linux-gnu Linux
+ o sparc-unknown-linux-gnu Linux
+ o alphaev6-unknown-linux-gnu Linux
+ o alpha-unknown-linux-gnu Linux
+ o powerpc-unknown-linux-gnulibc1 MkLinux DR3
+ o sparc-sun-sunos4.1.4 SunOS 4.1.4
+ o sparc-sun-sunos4.1.3_U1 SunOS 4.1.3_U1
+ o sparc-sun-solaris2.5.1 Solaris 2.5.1
+ o sparc-sun-solaris2.6 Solaris 2.6
+ o sparc-sun-solaris2.7 Solaris 2.7
+ o i386-pc-solaris2.6 Solaris 2.6/x86
+ o i386-pc-solaris2.7 Solaris 2.7/x86
+ o i386-pc-solaris2.8 Solaris 2.7/x86
+ o sparc-sun-solaris2.8 Solaris 2.8
+ o alphaev56-dec-osf4.0d Digital Unix v4.0D
+ o alphaev56-dec-osf4.0c Digital Unix v4.0C
+ o alphaev6-dec-osf5.0 Digital Unix v5.0 (Tru64)
+ o powerpc-ibm-aix4.2.0.0 AIX 4.2.0
+ o powerpc-ibm-aix4.2.1.0 AIX 4.2.1
+ o rs6000-ibm-aix4.2.1.0 AIX 4.2.1
+ o powerpc-ibm-aix4.3.1.0 AIX 4.3.1
+ o powerpc-ibm-aix4.3.2.0 AIX 4.3.2
+ o rs6000-ibm-aix4.3.2.0 AIX 4.3.2
+ o alphaev56-unknown-linux-gnu Linux/Alpha
+ o powerpc-unknown-linux-gnu LinuxPPC 4
+ o m68k-apple-aux3.1.1 A/UX 3.1.1
+ o hppa1.1-hp-hpux10.10 HP-UX 10.10
+ o hppa1.1-hp-hpux10.20 HP-UX 10.20
+ o hppa2.0-hp-hpux10.20 HP-UX 10.20
+ o hppa1.1-hp-hpux11.00 HP-UX 11.00
+ o hppa2.0w-hp-hpux11.00 HP-UX 11.00
+ o arm-unknown-linux-gnu Corel Netwinder SA110
+ o mips-sni-sysv4 SIEMENS ReliantUNIX
+ o mips-sgi-irix5.3 IRIX 5.3
+ o mips-sgi-irix6.2 IRIX 6.2
+ o mips-sgi-irix6.3 IRIX 6.3
+ o mips-sgi-irix6.4 IRIX 6.4
+ o mips-sgi-irix6.5 IRIX 6.5.4
+ o i686-pc-cygwin Win32 CygWin 20.1
+ o alpha-dec-osf3.2 OSF/1 3.2
+ o alpha-dec-osf4.0d OSF/1 4.0d
+ o alpha-dec-osf4.0e OSF/1 4.0e
+ o alphaev6-dec-osf4.0f OSF/1 4.0f
+ o i686-UnixWare7.1.0-sysv5 UnixWare 7.1
+ o i686-pc-sco3.2v5.0.5 SCO OpenServer 5.0.5
+
diff --git a/shmem/unix/mm/README b/shmem/unix/mm/README
index 5a19d6c08..626e130e5 100644
--- a/shmem/unix/mm/README
+++ b/shmem/unix/mm/README
@@ -5,8 +5,8 @@
|_| |_|_| |_|
MM - Shared Memory Library
- Copyright (c) 1999 Ralf S. Engelschall, All rights reserved.
- Version 1.0.8 (24-Jun-1999)
+ Copyright (c) 1999-2000 Ralf S. Engelschall, All rights reserved.
+ Version 1.1.1 (30-Apr-2000)
The MM library is a 2-layer abstraction library which simplifies the usage
of shared memory between forked (and this way strongly related) processes
@@ -16,67 +16,9 @@
high-level malloc(3)-style API for a convenient and well known way to work
with data-structures inside those shared memory segments.
- This library was successfully tested on the following platforms (and
- should automatically adjust to other platforms, of course):
-
- o i386-unknown-freebsd3.1 FreeBSD 3.1
- o i386-unknown-freebsd3.2 FreeBSD 3.2
- o i386-unknown-freebsd2.2.7 FreeBSD 2.2.7
- o i386-unknown-freebsd2.2.8 FreeBSD 2.2.8
- o i386-unknown-freebsd2.2.2 FreeBSD 2.2.2
- o i386-unknown-openbsd2.5 OpenBSD 2.5
- o i386-pc-bsdi4.0.1 BSDI 4.0.1
- o i586-pc-linux-gnu RedHat 5.2
- o i586-pc-linux-gnu RedHat 5.0
- o i686-pc-linux-gnu Redhat 6.0
- o i486-pc-linux-gnulibc1 Linux
- o i686-pc-linux-gnulibc1 Slackware 4.0
- o i586-pc-linux-gnulibc1 Slackware 4.0
- o sparc-sun-solaris2.6 Solaris 2.6
- o sparc-sun-solaris2.7 Solaris 2.7
- o i386-pc-solaris2.7 Solaris 2.7
- o alphaev56-dec-osf4.0d Digital Unix v4.0D
- o alphaev56-dec-osf4.0c Digital Unix v4.0C
- o powerpc-ibm-aix4.2.0.0 AIX 4.2
- o powerpc-ibm-aix4.3.1.0 AIX 4.2
- o alphaev56-unknown-linux-gnu Linux/Alpha
- o powerpc-unknown-linux-gnu LinuxPPC 4
- o m68k-apple-aux3.1.1 A/UX 3.1.1
- o hppa1.1-hp-hpux10.10 HP-UX 10.10
- o hppa1.1-hp-hpux10.20 HP-UX 10.20
- o hppa2.0-hp-hpux10.20 HP-UX 10.20
- o arm-unknown-linux-gnu Corel Netwinder SA110
- o mips-sni-sysv4 SIEMENS ReliantUNIX
- o mips-sgi-irix6.2 IRIX 6.2
- o mips-sgi-irix6.3 IRIX 6.3
- o mips-sgi-irix6.4 IRIX 6.4
- o mips-sgi-irix6.5 IRIX 6.5.4
-
- Credit has to be given to the following people who contributed ideas,
- bugfixes, hints, gave platform feedback, etc. (in alphabetical order):
-
- o Ronald Appelfelder <ra@intraregio.net>
- o Robert Belleman <robbel@wins.uva.nl>
- o Jeff Clark <hotwire@hoser.com>
- o Eric Cholet <cholet@logilune.com>
- o Dean Gaudet <dgaudet@arctic.org>
- o Ask Bjoern Hansen <ask@netcetera.dk>
- o Jim Jagielski <jim@jagunet.com>
- o Mats Josefsson <matjos@rsv.se>
- o Sergey Kachanovsky <ranger@tversu.ru>
- o Martin Kraemer <martin.kraemer@mch.sni.de>
- o Rasmus Lerdorf <rasmus@lerdorf.on.ca>
- o Dave Malhotra <davem@glue.umd.edu>
- o Christophe Massiot <massiot@via.ecp.fr>
- o Patrick <puzzled@symplex.net>
- o Charles Randall <crandall@matchlogic.com>
- o David Rees <drees@ucsd.edu>
- o Christian Reiber <chrei@en.muc.de>
- o Dan Sullivan <sullivan@epa.gov>
- o Tom Vaughan <tvaughan@aventail.com>
- o Rick Watson <rick@akbar.cc.utexas.edu>
- o Mark Wilkie <mark@exceptionmedia.com>
- o Cliff Woolley <jwoolley@wlu.edu>
+ This library was successfully tested on FreeBSD, OpenBSD, NetBSD, BSDI,
+ Linux, SunOS, Solaris, Tru64, AIX, A/UX, HP-UX, ReliantUNIX, IRIX, UnixWare
+ and even Win32 Cygwin, BeOS and OS/390.
The documentation and latest release can be found on
http://www.engelschall.com/sw/mm/
diff --git a/shmem/unix/mm/THANKS b/shmem/unix/mm/THANKS
new file mode 100644
index 000000000..d2081ee0b
--- /dev/null
+++ b/shmem/unix/mm/THANKS
@@ -0,0 +1,61 @@
+ __ __ __ __
+ | \/ | \/ |
+ | |\/| | |\/| |
+ | | | | | | |
+ |_| |_|_| |_|
+
+ MM - Shared Memory Library
+
+ THANKS
+ ======
+
+ Credit has to be given to the following people who contributed ideas,
+ bugfixes, hints, gave platform feedback, etc. (in alphabetical order):
+
+ o Ronald Appelfelder <ra@intraregio.net>
+ o Robert Belleman <robbel@wins.uva.nl>
+ o Ryan Bloom <rbb@apache.org>
+ o Volker Borchert <bt@teknon.de>
+ o William Campbell <william@stand.demon.co.uk>
+ o Richard Cardwell <ricc@hplb.hpl.hp.com>
+ o Jeff Clark <hotwire@hoser.com>
+ o Eric Cholet <cholet@logilune.com>
+ o Alexander Demenchuk <alder@untech.com>
+ o Jason Dillon <jason@planet57.com>
+ o Joe France <france@sysar.com>
+ o Richard Furda <riso@best.ca>
+ o Dean Gaudet <dgaudet@arctic.org>
+ o Greg Gears <gears@netair.com>
+ o Ask Bjoern Hansen <ask@netcetera.dk>
+ o Robin Hunt <robin@sharenet.co.za>
+ o Markus Kilbinger <kilbi@rad.rwth-aachen.de>
+ o Kristian Köhntopp <kk@netuse.de>
+ o Jim Jagielski <jim@jagunet.com>
+ o Bob Jones <jonesr@pjm.com>
+ o Mats Josefsson <matjos@rsv.se>
+ o Sergey Kachanovsky <ranger@tversu.ru>
+ o Martin Kraemer <martin.kraemer@mch.sni.de>
+ o Mike Latinovich <mlatin@boing.skysys.org>
+ o Rasmus Lerdorf <rasmus@lerdorf.on.ca>
+ o Dave Malhotra <davem@glue.umd.edu>
+ o Christophe Massiot <massiot@via.ecp.fr>
+ o Thomas J. Menini <menini@lvip.net>
+ o Patrick <puzzled@symplex.net>
+ o Charles Randall <crandall@matchlogic.com>
+ o David Rees <drees@ucsd.edu>
+ o Martin Rosenbach <Rosenbach@seninn.verwalt-berlin.de>
+ o David Reid <dreid@jetnet.co.uk>
+ o Scott Rothgaber <scott@easley.net>
+ o Saeid Sadeghi <Saeid.Sadeghi@unilever.com>
+ o Mehul N. Sanghvi <mehul@kirsun.ne.mediaone.net>
+ o Joaquim Sanmarti <qss@gtd.es>
+ o Sascha Schumann <sascha@schumann.cx>
+ o Dan Sullivan <sullivan@epa.gov>
+ o Jeff Trawick <trawick@ibm.net>
+ o Tom Vaughan <tvaughan@aventail.com>
+ o Kai Voigt <k@123.org>
+ o Martin Waterworth <m.waterworth@qut.edu.au>
+ o Rick Watson <rick@akbar.cc.utexas.edu>
+ o Mark Wilkie <mark@exceptionmedia.com>
+ o Cliff Woolley <jwoolley@wlu.edu>
+
diff --git a/shmem/unix/mm/aclocal.m4 b/shmem/unix/mm/aclocal.m4
index 0bbf26bc4..d7b97fc45 100644
--- a/shmem/unix/mm/aclocal.m4
+++ b/shmem/unix/mm/aclocal.m4
@@ -1,6 +1,43 @@
-dnl ##
-dnl ##
-dnl ##
+## ====================================================================
+## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions
+## are met:
+##
+## 1. Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+##
+## 2. Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+##
+## 3. All advertising materials mentioning features or use of this
+## software must display the following acknowledgment:
+## "This product includes software developed by
+## Ralf S. Engelschall <rse@engelschall.com>."
+##
+## 4. Redistributions of any form whatsoever must retain the following
+## acknowledgment:
+## "This product includes software developed by
+## Ralf S. Engelschall <rse@engelschall.com>."
+##
+## THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY
+## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR
+## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+## OF THE POSSIBILITY OF SUCH DAMAGE.
+## ====================================================================
+divert(-1)
+
define(AC_PROG_LIBTOOL,[dnl
AC_ARG_ENABLE(static,dnl
[ --enable-static build static libraries (default=yes)],
@@ -25,9 +62,7 @@ AC_MSG_ERROR([libtool configuration failed])
LIBTOOL="\$(TOP)/libtool"
AC_SUBST(LIBTOOL)
])dnl
-dnl ##
-dnl ##
-dnl ##
+
define(AC_CHECK_DEBUGGING,[dnl
AC_MSG_CHECKING(for compilation debug mode)
AC_ARG_ENABLE(debug,dnl
@@ -62,28 +97,27 @@ msg=disabled
])dnl
AC_MSG_RESULT([$msg])
])
-dnl ##
-dnl ##
-dnl ##
+
define(AC_CONFIGURE_PART,[dnl
AC_MSG_RESULT()
AC_MSG_RESULT(${T_MD}$1:${T_ME})
])dnl
-dnl ##
-dnl ##
-dnl ##
+
define(AC_CHECK_DEFINE,[dnl
-AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1,
-AC_EGREP_CPP([YES_IS_DEFINED], [
+ AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1,
+ AC_EGREP_CPP([YES_IS_DEFINED], [
#include <$2>
#ifdef $1
YES_IS_DEFINED
#endif
-], ac_cv_define_$1=yes; AC_DEFINE(HAVE_$1), ac_cv_define_$1=no)
-)])dnl
-dnl ##
-dnl ##
-dnl ##
+ ], ac_cv_define_$1=yes, ac_cv_define_$1=no)
+ )
+ if test "$ac_cv_define_$1" = "yes" ; then
+ AC_DEFINE(HAVE_$1)
+ fi
+])dnl
+AC_DEFINE(HAVE_$1)
+
define(AC_IFALLYES,[dnl
ac_rc=yes
for ac_spec in $1; do
@@ -116,9 +150,7 @@ else
$3
fi
])dnl
-dnl ##
-dnl ##
-dnl ##
+
define(AC_BEGIN_DECISION,[dnl
ac_decision_item='$1'
ac_decision_msg='FAILED'
@@ -155,9 +187,7 @@ else
AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg])
fi
])dnl
-dnl ##
-dnl ##
-dnl ##
+
AC_DEFUN(AC_TEST_FILE,
[AC_REQUIRE([AC_PROG_CC])
ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
@@ -177,9 +207,7 @@ else
ifelse([$3], , , [$3])
fi
])
-dnl ##
-dnl ## AC_PROG_NM - find the path to a BSD-compatible name lister
-dnl ##
+
AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
@@ -211,9 +239,7 @@ NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
AC_SUBST(NM)
])
-dnl #
-dnl #
-dnl #
+
define(AC_CHECK_MAXSEGSIZE,[dnl
AC_MSG_CHECKING(for shared memory maximum segment size)
OCFLAGS="$CFLAGS"
@@ -228,29 +254,33 @@ changequote(<<, >>)dnl
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <fcntl.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
#ifdef TEST_MMAP
#include <sys/mman.h>
#endif
#ifdef TEST_SHMGET
+#ifdef MM_OS_SUNOS
+#define KERNEL 1
+#endif
+#ifdef MM_OS_BS2000
+#define _KMEMUSER
+#endif
#include <sys/ipc.h>
-#ifndef _OSD_POSIX
#include <sys/shm.h>
+#ifdef MM_OS_SUNOS
+#undef KERNEL
+#endif
+#ifdef MM_OS_BS2000
+#undef _KMEMUSER
+#endif
#if !defined(SHM_R)
#define SHM_R 0400
#endif
#if !defined(SHM_W)
#define SHM_W 0200
-#endif
-#else
-#define _KMEMUSER 1 /* BS2000 needs this to enable SHM_[RW] */
-#include <sys/shm.h>
-#undef _KMEMUSER
#endif
#endif
#if !defined(MAP_FAILED)
@@ -369,3 +399,5 @@ test ".$msg" = .unknown && AC_MSG_ERROR([Unable to determine maximum shared memo
AC_MSG_RESULT([$msg])
AC_DEFINE_UNQUOTED(MM_SHM_MAXSEGSIZE, $MM_SHM_MAXSEGSIZE)
])
+
+divert
diff --git a/shmem/unix/mm/config.guess b/shmem/unix/mm/config.guess
index 5523028af..9c362ec93 100755
--- a/shmem/unix/mm/config.guess
+++ b/shmem/unix/mm/config.guess
@@ -226,7 +226,7 @@ EOF
exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
+ # "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
@@ -627,172 +627,52 @@ EOF
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
- # uname on the ARM produces all sorts of strangeness, and we need to
- # filter it out.
- case "$UNAME_MACHINE" in
- armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
- arm* | sa110*) UNAME_MACHINE="arm" ;;
+ # determine canonical machine name
+ MACHINE="$UNAME_MACHINE"
+ case "$MACHINE" in
+ arm*|sa110*) MACHINE="arm" ;;
esac
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- ld_help_string=`cd /; ld --help 2>&1`
- ld_supported_emulations=`echo $ld_help_string \
- | sed -ne '/supported emulations:/!d
- s/[ ][ ]*/ /g
- s/.*supported emulations: *//
- s/ .*//
- p'`
- case "$ld_supported_emulations" in
- *ia64) echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 ;;
- i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
- i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
- sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- elf32ppc | elf32ppclinux)
- # Determine Lib Version
- cat >$dummy.c <<EOF
+ # determine (distribution) vendor
+ VENDOR="gnu"
+ for tagfile in dummy `cd /etc && echo *-release *_version 2>/dev/null`; do
+ test ! -f /etc/$tagfile && continue
+ VENDOR=`echo $tagfile | sed -e 's/-release$//' -e 's/_version$//' |\
+ tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ done
+
+ # determine kernel version
+ KERNEL=`echo ${UNAME_RELEASE} | sed -e 's/^\([0-9]*\.[0-9]*\)\..*$/\1/'`
+
+ # determine [g]libc version
+ cat >$dummy.c <<EOF
+#include <stdio.h>
#include <features.h>
-#if defined(__GLIBC__)
-extern char __libc_version[];
-extern char __libc_release[];
-#endif
main(argc, argv)
- int argc;
- char *argv[];
+int argc;
+char *argv[];
{
-#if defined(__GLIBC__)
- printf("%s %s\n", __libc_version, __libc_release);
+#if defined(__GLIBC__) && !defined(__GLIBC_MINOR__)
+ printf("%d", __GLIBC__);
+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+ printf("%d.%d", __GLIBC__, __GLIBC_MINOR__);
+#elif defined(__GNU_LIBRARY__)
+ printf("%d", __GNU_LIBRARY__);
#else
- printf("unkown\n");
+ printf("1");
#endif
- return 0;
+ return 0;
}
EOF
- LIBC=""
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
- if test "$?" = 0 ; then
- ./$dummy | grep 1\.99 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
- fi
- rm -f $dummy.c $dummy
- echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
- esac
-
- if test "${UNAME_MACHINE}" = "alpha" ; then
- sed 's/^ //' <<EOF >$dummy.s
- .globl main
- .ent main
- main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
- .end main
-EOF
- LIBC=""
- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
- if test "$?" = 0 ; then
- ./$dummy
- case "$?" in
- 7)
- UNAME_MACHINE="alpha"
- ;;
- 15)
- UNAME_MACHINE="alphaev5"
- ;;
- 14)
- UNAME_MACHINE="alphaev56"
- ;;
- 10)
- UNAME_MACHINE="alphapca56"
- ;;
- 16)
- UNAME_MACHINE="alphaev6"
- ;;
- esac
-
- objdump --private-headers $dummy | \
- grep ld.so.1 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
- fi
- rm -f $dummy.s $dummy
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
- elif test "${UNAME_MACHINE}" = "mips" ; then
- cat >$dummy.c <<EOF
-#ifdef __cplusplus
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __MIPSEB__
- printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
- printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
- else
- # Either a pre-BFD a.out linker (linux-gnuoldld)
- # or one that does not give us useful --help.
- # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
- # If ld does not provide *any* "supported emulations:"
- # that means it is gnuoldld.
- echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
- test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+ LIBC="1"
+ $CC_FOR_BUILD $dummy.c -o $dummy # 2>/dev/null
+ if [ $? = 0 ]; then
+ LIBC=`./$dummy | sed -e 's/^\([0-9]*\.[0-9]*\)\..*$/\1/'`
+ fi
+ rm -f $dummy.c $dummy
- case "${UNAME_MACHINE}" in
- i?86)
- VENDOR=pc;
- ;;
- *)
- VENDOR=unknown;
- ;;
- esac
- # Determine whether the default compiler is a.out or elf
- cat >$dummy.c <<EOF
-#include <features.h>
-#ifdef __cplusplus
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __ELF__
-# ifdef __GLIBC__
-# if __GLIBC__ >= 2
- printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
-# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-#else
- printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
- fi ;;
+ echo "${MACHINE}-${VENDOR}-linux${KERNEL}glibc${LIBC}"
+ ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i?86:DYNIX/ptx:4*:*)
@@ -896,7 +776,7 @@ EOF
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
BS2000:POSIX-BC:*:*)
- echo bs2000-siemens-sysv4
+ echo BS2000-siemens-sysv4
exit 0 ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
diff --git a/shmem/unix/mm/config.sub b/shmem/unix/mm/config.sub
index 0fd1ade4a..a32397837 100755
--- a/shmem/unix/mm/config.sub
+++ b/shmem/unix/mm/config.sub
@@ -850,7 +850,7 @@ case $basic_machine in
basic_machine=c4x-none
os=-coff
;;
- bs2000-siemens)
+ BS2000-siemens)
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
diff --git a/shmem/unix/mm/configure.in b/shmem/unix/mm/configure.in
index e7de4dd96..3f2bb7b95 100644
--- a/shmem/unix/mm/configure.in
+++ b/shmem/unix/mm/configure.in
@@ -7,7 +7,7 @@ dnl # standard Autoconf prolog
dnl #
AC_PREREQ(2.12)dnl
-AC_REVISION(1.0)dnl
+AC_REVISION($1.0$)dnl
dnl # shtool bootstrap
SHTOOL="\$(TOP)/shtool"
@@ -22,12 +22,12 @@ AC_SUBST(MM_VERSION_STR)
dnl # friendly header ;-)
echo "Configuring ${T_MD}MM${T_ME} (Shared Memory Library), Version ${T_MD}${MM_VERSION_STR}${T_ME}"
-echo "Copyright (c) 1999 Ralf S. Engelschall, All Rights Reserved."
+echo "Copyright (c) 1999-2000 Ralf S. Engelschall, All Rights Reserved."
echo "Platform: ${T_MD}${PLATFORM}${T_ME}"
dnl # autoconf initialization
AC_INIT(README)
-AC_CONFIG_HEADER(mm_conf.h)dnl
+AC_CONFIG_HEADER(mm_conf.h)
AC_PREFIX_DEFAULT(/usr/local)
dnl # determine build mode
@@ -81,7 +81,8 @@ AC_CHECK_DEFINE(CHILD_MAX, limits.h)
dnl # some special defines for brain dead platforms
case $PLATFORM in
- *-*-sunos* ) AC_DEFINE(MM_OS_SUNOS) ;;
+ *-*-sunos* ) AC_DEFINE(MM_OS_SUNOS) ;;
+ BS2000-*-* ) AC_DEFINE(MM_OS_BS2000) ;;
esac
dnl #
@@ -90,10 +91,9 @@ dnl #
AC_CONFIGURE_PART(Virtual Memory Page Size)
-AC_HAVE_HEADERS(unistd.h)
+AC_HAVE_HEADERS(unistd.h kernel/OS.h)
AC_HAVE_FUNCS(getpagesize sysconf)
AC_CHECK_DEFINE(_SC_PAGESIZE, unistd.h)
-AC_HAVE_HEADERS(kernel/OS.h)
AC_CHECK_DEFINE(B_PAGE_SIZE, kernel/OS.h)
AC_BEGIN_DECISION([memory page size determination])
@@ -134,7 +134,7 @@ AC_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl
AC_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON,
AC_DECIDE(MM_SHMT_MMANON, [4.4BSD-style mmap() via MAP_ANON]))
AC_IFALLYES(header:kernel/OS.h func:create_area,
- AC_DECIDE(MM_SHMT_BEOS, [BeOS areas]))
+ AC_DECIDE(MM_SHMT_BEOS, [BeOS areas]))
case $PLATFORM in
*-*-linux* )
# Linux has problems with MM_SHMT_MMANON
@@ -143,7 +143,7 @@ case $PLATFORM in
;;
esac
AC_ARG_WITH(shm,dnl
-[ --with-shm=TYPE force shared memory type: MMFILE MMZERO MMPOSX MMANON IPCSHM],
+[ --with-shm=TYPE force shared memory type: MMFILE MMZERO MMPOSX MMANON IPCSHM BEOS],
AC_DECISION_FORCE(MM_SHMT_$withval)
)dnl
AC_END_DECISION
@@ -164,7 +164,7 @@ AC_CHECK_DEFINE(F_SETLK, fcntl.h)
AC_CHECK_DEFINE(IPC_PRIVATE, sys/ipc.h)
AC_CHECK_DEFINE(SEM_UNDO, sys/sem.h)
AC_HAVE_HEADERS(kernel/OS.h)
-AC_CHECK_FUNCS(create_sem, kernel/OS.h)
+AC_CHECK_FUNCS(create_sem)
AC_MSG_CHECKING(whether union semun is defined in sys/sem.h)
AC_TRY_COMPILE([
@@ -189,9 +189,9 @@ AC_IFALLYES(header:sys/ipc.h header:sys/sem.h header:sys/file.h dnl
AC_IFALLYES(header:fcntl.h define:F_SETLK,
AC_DECIDE(MM_SEMT_FCNTL, [SVR4-style fcntl() on temporary file]))
AC_IFALLYES(header:kernel/OS.h func:create_sem,
- AC_DECIDE(MM_SEMT_BEOS, [BeOS semaphores/benaphores]))
+ AC_DECIDE(MM_SEMT_BEOS, [BeOS semaphores]))
AC_ARG_WITH(sem,dnl
-[ --with-sem=TYPE force semaphore type: FLOCK FCNTL IPCSEM],
+[ --with-sem=TYPE force semaphore type: FLOCK FCNTL IPCSEM BEOS],
AC_DECISION_FORCE(MM_SEMT_$withval)
)dnl
AC_END_DECISION
diff --git a/shmem/unix/mm/fbtool b/shmem/unix/mm/fbtool
index 5b6b22318..ead314880 100755
--- a/shmem/unix/mm/fbtool
+++ b/shmem/unix/mm/fbtool
@@ -1,7 +1,7 @@
#!/bin/sh
##
## fbtool -- MM library feedback tool
-## Copyright (c) 1999 Ralf S. Engelschall, All Rights Reserved.
+## Copyright (c) 1999-2000 Ralf S. Engelschall, All Rights Reserved.
##
if [ ! -f .fbtool ]; then
diff --git a/shmem/unix/mm/ltconfig b/shmem/unix/mm/ltconfig
index 65ec6f65d..a01334f92 100755
--- a/shmem/unix/mm/ltconfig
+++ b/shmem/unix/mm/ltconfig
@@ -53,7 +53,7 @@ fi
# Find the correct PATH separator. Usually this is `:', but
# DJGPP uses `;' like DOS.
-if test "X${PATH_SEPARATOR+set}" != "Xset"; then
+if test "X${PATH_SEPARATOR+set}" != Xset; then
UNAME=${UNAME-`uname 2>/dev/null`}
case X$UNAME in
*-DOS) PATH_SEPARATOR=';' ;;
@@ -63,9 +63,9 @@ fi
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
-if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
-if test "X${echo_test_string+set}" != "Xset"; then
+if test "X${echo_test_string+set}" != Xset; then
# find a string as large as possible, as long as the shell can cope with it
for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
@@ -169,10 +169,10 @@ progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
# Constants:
PROGRAM=ltconfig
PACKAGE=libtool
-VERSION=1.3.3
-TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
+VERSION=1.3.4
+TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
rm="rm -f"
help="Try \`$progname --help' for more information."
@@ -369,8 +369,8 @@ exec 5>>./config.log
# Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
+if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi
if test -n "$cache_file" && test -r "$cache_file"; then
echo "loading cache $cache_file within ltconfig"
@@ -462,7 +462,7 @@ aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
- if test "${COLLECT_NAMES+set}" != set; then
+ if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -663,7 +663,7 @@ if test "$with_gcc" = yes; then
link_static_flag='-static'
case "$host_os" in
- beos* | irix5* | irix6* | osf3* | osf4*)
+ beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
aix*)
@@ -718,7 +718,7 @@ else
# We can build DLLs from non-PIC.
;;
- osf3* | osf4*)
+ osf3* | osf4* | osf5*)
# All OSF/1 code is PIC.
wl='-Wl,'
link_static_flag='-non_shared'
@@ -1187,7 +1187,7 @@ EOF
;;
netbsd*)
- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
@@ -1196,7 +1196,7 @@ EOF
fi
;;
- solaris*)
+ solaris* | sysv5*)
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
cat <<EOF 1>&2
@@ -1244,7 +1244,12 @@ EOF
whole_archive_flag_spec=
;;
*)
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
;;
esac
fi
@@ -1405,7 +1410,7 @@ else
old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
;;
- osf3* | osf4*)
+ osf3*)
if test "$with_gcc" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
@@ -1417,6 +1422,18 @@ else
hardcode_libdir_separator=:
;;
+ osf4* | osf5*) # As osf3* with the addition of the -msym flag
+ if test "$with_gcc" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
sco3.2v5*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_shlibpath_var=no
@@ -1461,6 +1478,18 @@ else
export_dynamic_flag_spec='-Bexport'
;;
+ sysv5*)
+ no_undefined_flag=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
+ hardcode_libdir_flag_spec=
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
uts4*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-L$libdir'
@@ -1474,14 +1503,28 @@ else
;;
sysv4*MP*)
- if test -d /usr/nec ;then
- # archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
- archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
+ hardcode_direct=yes
+ hardcode_minus_L=no
hardcode_shlibpath_var=no
- runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
- ld_shlibs=yes
- fi
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ unixware7*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
;;
*)
@@ -1589,11 +1632,11 @@ void nm_test_func(){}
main(){nm_test_var='a';nm_test_func();return(0);}
EOF
- echo "$progname:1592: checking if global_symbol_pipe works" >&5
- if { (eval echo $progname:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
+ echo "$progname:1635: checking if global_symbol_pipe works" >&5
+ if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { echo "$progname:1596: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
+ if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
@@ -1645,7 +1688,7 @@ EOF
save_CFLAGS="$CFLAGS"
LIBS="conftstm.$objext"
CFLAGS="$CFLAGS$no_builtin_flag"
- if { (eval echo $progname:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
pipe_works=yes
else
echo "$progname: failed program was:" >&5
@@ -1787,8 +1830,9 @@ beos*)
bsdi4*)
version_type=linux
- library_names_spec='${libname}.so$major ${libname}.so'
- soname_spec='${libname}.so'
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
@@ -1796,6 +1840,7 @@ bsdi4*)
file_magic_test_file=/shlib/libc.so
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ export_dynamic_flag_spec=-rdynamic
# the default ld.so.conf also contains /usr/contrib/lib and
# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
# libtool to hard-code these into programs
@@ -1841,10 +1886,9 @@ freebsd*)
need_version=yes
;;
esac
- finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
case "$host_os" in
- freebsd2* | freebsd3.[01]*)
+ freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*)
shlibpath_overrides_runpath=yes
;;
*) # from 3.2 on
@@ -1896,8 +1940,6 @@ irix5* | irix6*)
*-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;;
esac
- # this will be overridden with pass_all, but let us keep it just in case
- deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
;;
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
@@ -1972,7 +2014,7 @@ os2*)
shlibpath_var=LIBPATH
;;
-osf3* | osf4*)
+osf3* | osf4* | osf5*)
version_type=osf
need_version=no
soname_spec='${libname}${release}.so'
@@ -2167,7 +2209,7 @@ else
if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
lt_cv_dlopen=no lt_cv_dlopen_libs=
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "$progname:2170: checking for dlopen in -ldl" >&5
+echo "$progname:2212: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2175,17 +2217,20 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2178 "ltconfig"
+#line 2220 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
char dlopen();
int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo $progname:2188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:2233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2204,18 +2249,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "$progname:2207: checking for dlopen" >&5
+echo "$progname:2252: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2212 "ltconfig"
+#line 2257 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
char dlopen();
int main() {
@@ -2231,7 +2279,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo $progname:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -2248,7 +2296,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "$progname:2251: checking for dld_link in -ldld" >&5
+echo "$progname:2299: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2256,17 +2304,20 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2259 "ltconfig"
+#line 2307 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
char dld_link();
int main() {
dld_link()
; return 0; }
EOF
-if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:2320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2285,18 +2336,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "$progname:2288: checking for shl_load" >&5
+echo "$progname:2339: checking for shl_load" >&5
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2293 "ltconfig"
+#line 2344 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
char shl_load();
int main() {
@@ -2312,7 +2366,7 @@ shl_load();
; return 0; }
EOF
-if { (eval echo $progname:2315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shl_load=yes"
else
@@ -2330,7 +2384,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "$progname:2333: checking for shl_load in -ldld" >&5
+echo "$progname:2387: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2338,18 +2392,21 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2341 "ltconfig"
+#line 2395 "ltconfig"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
char shl_load();
int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo $progname:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:2409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2392,17 +2449,17 @@ fi
for ac_hdr in dlfcn.h; do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "$progname:2395: checking for $ac_hdr" >&5
+echo "$progname:2452: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2400 "ltconfig"
+#line 2457 "ltconfig"
#include <$ac_hdr>
int fnord = 0;
EOF
-ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo $progname:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_try="$ac_compile >/dev/null 2>conftest.out"
+{ (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2430,7 +2487,7 @@ done
LIBS="$lt_cv_dlopen_libs $LIBS"
echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
-echo "$progname:2433: checking whether a program can dlopen itself" >&5
+echo "$progname:2490: checking whether a program can dlopen itself" >&5
if test "${lt_cv_dlopen_self+set}" = set; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2438,7 +2495,7 @@ else
lt_cv_dlopen_self=cross
else
cat > conftest.c <<EOF
-#line 2441 "ltconfig"
+#line 2498 "ltconfig"
#if HAVE_DLFCN_H
#include <dlfcn.h>
@@ -2484,7 +2541,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
-if { (eval echo $progname:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
lt_cv_dlopen_self=yes
else
@@ -2503,7 +2560,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
if test "$lt_cv_dlopen_self" = yes; then
LDFLAGS="$LDFLAGS $link_static_flag"
echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
-echo "$progname:2506: checking whether a statically linked program can dlopen itself" >&5
+echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5
if test "${lt_cv_dlopen_self_static+set}" = set; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2511,7 +2568,7 @@ else
lt_cv_dlopen_self_static=cross
else
cat > conftest.c <<EOF
-#line 2514 "ltconfig"
+#line 2571 "ltconfig"
#if HAVE_DLFCN_H
#include <dlfcn.h>
@@ -2557,7 +2614,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
-if { (eval echo $progname:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
lt_cv_dlopen_self_static=yes
else
@@ -2649,7 +2706,7 @@ case "$ltmain" in
# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
#
# Copyright (C) 1996-1999 Free Software Foundation, Inc.
-# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -2675,7 +2732,7 @@ Xsed="sed -e s/^X//"
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
-if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
### BEGIN LIBTOOL CONFIG
EOF
@@ -2938,7 +2995,7 @@ case "$ltmain" in
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
-if test "${COLLECT_NAMES+set}" != set; then
+if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -2948,6 +3005,10 @@ EOF
# Append the ltmain.sh script.
sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
chmod +x "$ofile"
;;
diff --git a/shmem/unix/mm/ltmain.sh b/shmem/unix/mm/ltmain.sh
index f479d1ef5..b01e311ff 100644
--- a/shmem/unix/mm/ltmain.sh
+++ b/shmem/unix/mm/ltmain.sh
@@ -54,8 +54,8 @@ modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION=1.3.3
-TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
+VERSION=1.3.4
+TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
default_mode=
help="Try \`$progname --help' for more information."
@@ -435,7 +435,7 @@ compiler."
fbsd_hideous_sh_bug=$base_compile
# All platforms use -DPIC, to notify preprocessed assembler code.
- command="$base_compile $pic_flag -DPIC $srcfile"
+ command="$base_compile $srcfile $pic_flag -DPIC"
if test "$build_old_libs" = yes; then
lo_libobj="$libobj"
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
@@ -521,9 +521,17 @@ compiler."
exit $error
fi
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir="."
+ else
+ xdir="$xdir"
+ fi
+ baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
+ libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
# Now arrange that obj and lo_libobj become the same file
- $show "$LN_S $obj $lo_libobj"
- if $run $LN_S $obj $lo_libobj; then
+ $show "(cd $xdir && $LN_S $baseobj $libobj)"
+ if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
exit 0
else
error=$?
@@ -613,8 +621,6 @@ compiler."
# libtool link mode
link)
modename="$modename: link"
- C_compiler="$CC" # save it, to compile generated C sources
- CC="$nonopt"
case "$host" in
*-*-cygwin* | *-*-mingw* | *-*-os2*)
# It is impossible to link a dll without this setting, and
@@ -802,8 +808,8 @@ compiler."
allow_undefined=yes
;;
esac
- compile_command="$CC"
- finalize_command="$CC"
+ compile_command="$nonopt"
+ finalize_command="$nonopt"
compile_rpath=
finalize_rpath=
@@ -1851,7 +1857,7 @@ compiler."
int main() { return 0; }
EOF
$rm conftest
- $C_compiler -o conftest conftest.c $deplibs
+ $CC -o conftest conftest.c $deplibs
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
for i in $deplibs; do
@@ -1884,7 +1890,7 @@ EOF
# If $name is empty we are operating on a -L argument.
if test "$name" != "" ; then
$rm conftest
- $C_compiler -o conftest conftest.c $i
+ $CC -o conftest conftest.c $i
# Did it work?
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
@@ -2047,12 +2053,19 @@ EOF
done
# Ensure that we have .o objects for linkers which dislike .lo
- # (e.g. aix) incase we are running --disable-static
+ # (e.g. aix) in case we are running --disable-static
for obj in $libobjs; do
- oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
- if test ! -f $oldobj; then
- $show "${LN_S} $obj $oldobj"
- $run ${LN_S} $obj $oldobj || exit $?
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir="."
+ else
+ xdir="$xdir"
+ fi
+ baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+ if test ! -f $xdir/$oldobj; then
+ $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
+ $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
fi
done
@@ -2311,8 +2324,16 @@ EOF
# Just create a symlink.
$show $rm $libobj
$run $rm $libobj
- $show "$LN_S $obj $libobj"
- $run $LN_S $obj $libobj || exit $?
+ xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$libobj"; then
+ xdir="."
+ else
+ xdir="$xdir"
+ fi
+ baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+ oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+ $show "(cd $xdir && $LN_S $oldobj $baseobj)"
+ $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
fi
if test -n "$gentop"; then
@@ -2598,16 +2619,21 @@ static const void *lt_preloaded_setup() {
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2*|*-*-freebsd3.0*)
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag -DPIC";;
esac
esac
# Now compile the dynamic symbol file.
- $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
- $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+ $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
# Clean up the generated files.
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
@@ -2776,7 +2802,7 @@ sed_quote_subst='$sed_quote_subst'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
-if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
relink_command=\"$relink_command\"
@@ -2865,7 +2891,7 @@ else
fi"
else
echo >> $output "\
- program='$outputname$exeext'
+ program='$outputname'
progdir=\"\$thisdir/$objdir\"
"
fi
@@ -2995,14 +3021,21 @@ fi\
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\"
else
- # Ensure that we have .o objects in place incase we decided
+ # Ensure that we have .o objects in place in case we decided
# not to build a shared library, and have fallen back to building
# static libs even though --disable-static was passed!
for oldobj in $oldobjs; do
if test ! -f $oldobj; then
- obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
- $show "${LN_S} $obj $oldobj"
- $run ${LN_S} $obj $oldobj || exit $?
+ xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$oldobj"; then
+ xdir="."
+ else
+ xdir="$xdir"
+ fi
+ baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
+ obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
+ $show "(cd $xdir && ${LN_S} $obj $baseobj)"
+ $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
fi
done
@@ -3672,8 +3705,10 @@ libdir='$install_libdir'\
done
if test -z "$run"; then
- # Export the shlibpath_var.
- eval "export $shlibpath_var"
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
# Restore saved enviroment variables
if test "${save_LC_ALL+set}" = set; then
@@ -3690,8 +3725,10 @@ libdir='$install_libdir'\
exit 1
else
# Display what would be done.
- eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
- $echo "export $shlibpath_var"
+ if test -n "$shlibpath_var"; then
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ fi
$echo "$cmd$args"
exit 0
fi
diff --git a/shmem/unix/mm/mm-config.1 b/shmem/unix/mm/mm-config.1
index 512f0d4e8..16e1f9fbe 100644
--- a/shmem/unix/mm/mm-config.1
+++ b/shmem/unix/mm/mm-config.1
@@ -1,11 +1,12 @@
.rn '' }`
-''' $RCSfile: mm-config.1,v $$Revision: 1.2 $$Date: 1999/09/27 07:42:06 $
+''' $RCSfile: mm-config.1,v $$Revision: 1.3 $$Date: 2000/05/03 17:15:48 $
'''
''' $Log: mm-config.1,v $
-''' Revision 1.2 1999/09/27 07:42:06 rse
-''' Update the MM version APR contains to a more recent one.
+''' Revision 1.3 2000/05/03 17:15:48 rbb
+''' Update MM to the latest version. retrieved from
+''' http://www.engelschall.com/sw/mm
'''
-''' Revision 1.7 1999/09/06 11:32:17 rse
+''' Revision 1.11 2000/04/30 18:35:59 rse
''' *** empty log message ***
'''
'''
@@ -99,7 +100,7 @@
.nr % 0
.rr F
.\}
-.TH MM-CONFIG 1 "06-Sep-1999" "MM 1.0.11" "Shared Memory Library"
+.TH MM-CONFIG 1 "30-Apr-2000" "MM 1.1.1" "Shared Memory Library"
.UC
.if n .hy 0
.if n .na
@@ -196,7 +197,7 @@
.SH "NAME"
\fBmm-config\fR \- MM library configuration/build utility
.SH "VERSION"
-MM 1.0.11 (06-Sep-1999)
+MM 1.1.1 (30-Apr-2000)
.SH "SYNOPSIS"
\fBmm-config\fR
[\fB--help\fR]
diff --git a/shmem/unix/mm/mm-config.in b/shmem/unix/mm/mm-config.in
index 7e4e774cf..bfb3a248b 100644
--- a/shmem/unix/mm/mm-config.in
+++ b/shmem/unix/mm/mm-config.in
@@ -3,7 +3,7 @@
## mm-config -- MM library build configuration utility
##
## ====================================================================
-## Copyright (c) 1999 Ralf S. Engelschall. All rights reserved.
+## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
diff --git a/shmem/unix/mm/mm-config.pod b/shmem/unix/mm/mm-config.pod
index 1891a62e8..9dbf6c4a1 100644
--- a/shmem/unix/mm/mm-config.pod
+++ b/shmem/unix/mm/mm-config.pod
@@ -1,5 +1,5 @@
## ====================================================================
-## Copyright (c) 1999 Ralf S. Engelschall. All rights reserved.
+## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
diff --git a/shmem/unix/mm/mm.3 b/shmem/unix/mm/mm.3
index 94ef391a3..46108f406 100644
--- a/shmem/unix/mm/mm.3
+++ b/shmem/unix/mm/mm.3
@@ -1,12 +1,10 @@
.rn '' }`
-''' $RCSfile: mm.3,v $$Revision: 1.3 $$Date: 2000/03/10 00:06:32 $
+''' $RCSfile: mm.3,v $$Revision: 1.4 $$Date: 2000/05/03 17:15:49 $
'''
''' $Log: mm.3,v $
-''' Revision 1.3 2000/03/10 00:06:32 rbb
-''' Fix all the License issues. Including:
-''' s/Apache Group/Apache Software Foundation/
-''' s/1999/2000/
-''' s/Sascha's license/ASF license
+''' Revision 1.4 2000/05/03 17:15:49 rbb
+''' Update MM to the latest version. retrieved from
+''' http://www.engelschall.com/sw/mm
'''
'''
.de Sh
@@ -99,7 +97,7 @@
.nr % 0
.rr F
.\}
-.TH mm 3 "06-Sep-1999" "MM 1.0.11" "Shared Memory Library"
+.TH mm 3 "30-Apr-2000" "MM 1.1.1" "Shared Memory Library"
.UC
.if n .hy 0
.if n .na
@@ -196,7 +194,7 @@
.SH "NAME"
\fBMM \- Shared Memory Library\fR
.SH "VERSION"
-MM 1.0.11 (06-Sep-1999)
+MM 1.1.1 (30-Apr-2000)
.SH "SYNOPSIS"
.PP
.Vb 1
@@ -270,7 +268,7 @@ with data-structures inside those shared memory segments.
.PP
The abbreviation \fBMM\fR is historically and originally comes from the phrase
``\fImemory mapped\fR'\*(R' as used by the POSIX.1 \fImmap\fR\|(2) function. Because this
-facility is internally used by this library on most platforms to create the
+facility is internally used by this library on most platforms to establish the
shared memory segments.
.Sh "\s-1LIBRARY\s0 \s-1STRUCTURE\s0"
This library is structured into three main APIs which are internally based on
@@ -283,89 +281,90 @@ based data structures without the need to change the code dramatically. All
which is needed is to prefix the \s-1POSIX\s0.1 memory allocation functions with
`\f(CWMM_\fR\*(R', i.e. `\f(CWmalloc\fR\*(R' becomes `\f(CWMM_malloc\fR\*(R', `\f(CWstrdup\fR\*(R' becomes
`\f(CWMM_strdup\fR\*(R', etc. This \s-1API\s0 internally uses just a global `\f(CWMM *\fR\*(R' pool for
-calling the corresponding functions (with prefix `\f(CWmm_\fR') of the \fIStandard
-Malloc-Style \s-1API\s0\fR.
+calling the corresponding functions (those with prefix `\f(CWmm_\fR') of the
+\fIStandard Malloc-Style \s-1API\s0\fR.
.Ip "\fBStandard Malloc-Style \s-1API\s0\fR" 4
This is the standard high-level memory allocation \s-1API\s0. Its interface is
similar to the \fIGlobal Malloc-Replacement \s-1API\s0\fR but it uses an explicit `\f(CWMM *\fR\*(R'
-pool to operate on. That's why every function of this \s-1API\s0 has an argument of
-type `\f(CWMM *\fR\*(R' as the first argument. This \s-1API\s0 provides a comfortable way to
+pool to operate on. That is why every function of this \s-1API\s0 has an argument of
+type `\f(CWMM *\fR\*(R' as its first argument. This \s-1API\s0 provides a comfortable way to
work with small dynamically allocated shared memory chunks inside large
-statically allocated shared memory segments. It's internally based on the
+statically allocated shared memory segments. It is internally based on the
\fILow-Level Shared Memory \s-1API\s0\fR for creating the underlaying shared memory
segment.
.Ip "\fBLow-Level Shared Memory \s-1API\s0\fR" 4
This is the basis of the whole \fB\s-1MM\s0\fR library. It provides low-level functions
-for creating shared memory segments with mutual exclusion (in short: \fImutex\fR)
+for creating shared memory segments with mutual exclusion (in short \fImutex\fR)
capabilities in a portable way. Internally the shared memory and mutex
facility is implemented in various platform-dependent ways. A list of
implementation variants follows under the next topic.
.Sh "\s-1SHARED\s0 \s-1MEMORY\s0 \s-1IMPLEMENTATION\s0"
Internally the shared memory facility is implemented in various
-platform-dependent variants. Each has it's own advantages and disadvantages
+platform-dependent ways. Each way has its own advantages and disadvantages
(in addition to the fact that some variants aren't available at all on some
-platforms). The \s-1MM\s0 libraries configuration procedure tried hard to make a good
-decision. The implemented variants are now given for overview and background
-reasons with their advantages and disadvantages and in an ascending order,
-i.e. the \s-1MM\s0 configuration mechanism chooses the last available one in the list
-as the preferred variant.
+platforms). The \fB\s-1MM\s0\fR library's configuration procedure tries hard to make a
+good decision. The implemented variants are now given for overview and
+background reasons with their advantages and disadvantages and in an ascending
+order, i.e. the \fB\s-1MM\s0\fR configuration mechanism chooses the last available one
+in the list as the preferred variant.
.Ip "Classical mmap(2) on temporary file (\s-1MMFILE\s0)" 4
\fIAdvantage:\fR maximum portable.
-\fIDisadvantage:\fR needs a temporary file on the filesystem
+\fIDisadvantage:\fR needs a temporary file on the filesystem.
.Ip "mmap(2) via \s-1POSIX\s0.1 shm_open(3) on temporary file (\s-1MMPOSX\s0)" 4
\fIAdvantage:\fR standardized by \s-1POSIX\s0.1 and theoretically portable.
\fIDisadvantage:\fR needs a temporary file on the filesystem and is
is usually not available on existing Unix platform.
.Ip "\s-1SVR4-\s0style mmap(2) on \f(CW/dev/zero\fR device (\s-1MMZERO\s0)" 4
-\fIAdvantage:\fR widely available on mostly portable on \s-1SVR4\s0 platforms.
-\fIDisadvantage:\fR needs the \f(CW/dev/zero/\fR device and an \fImmap\fR\|(2)
-which supports memory mapping through it.
+\fIAdvantage:\fR widely available and mostly portable on \s-1SVR4\s0 platforms.
+\fIDisadvantage:\fR needs the \f(CW/dev/zero/\fR device and a \fImmap\fR\|(2)
+which supports memory mapping through this device.
.Ip "4.4BSD\-style mmap(2) via \f(CWMAP_ANON\fR facility (\s-1MMANON\s0)" 4
-\fIAdvantage:\fR doesn't need a temporary file or external device
+\fIAdvantage:\fR does not need a temporary file or external device.
\fIDisadvantage:\fR usually only available on \s-1BSD\s0 platforms and derivatives.
.Ip "SysV \s-1IPC\s0 shmget(2) (\s-1IPCSHM\s0)" 4
-\fIAdvantage:\fR doesn't need a temporary file or external device
-\fIDisadvantage:\fR although available on mostly all modern Unix platforms it has
-hard restrictions like the maximum size of a single shared memory segment (can
+\fIAdvantage:\fR does not need a temporary file or external device.
+\fIDisadvantage:\fR although available on mostly all modern Unix platforms, it has
+strong restrictions like the maximum size of a single shared memory segment (can
be as small as 100KB, but depends on the platform).
.Sh "\s-1LOCKING\s0 \s-1IMPLEMENTATION\s0"
As for the shared memory facility, internally the locking facility is
-implemented in various platform-dependent variants. A short overview of
+implemented in various platform-dependent ways. A short overview of
implemented variants is given:
.Ip "4.2BSD\-style flock(2) on temporary file (\s-1FLOCK\s0)" 4
\fIAdvantage:\fR exists on a lot of platforms, especially on older Unix
derivates. \fIDisadvantage:\fR needs a temporary file on the filesystem and has
-to reopen filedescriptors to it in \fIeach\fR\|(!) \fIfork\fR\|(2)ed child process.
+to re-open file-descriptors to it in \fIeach\fR\|(!) \fIfork\fR\|(2)'ed child process.
.Ip "SysV \s-1IPC\s0 semget(2) (\s-1IPCSEM\s0)" 4
-\fIAdvantage:\fR exists on a lot of platforms and doesn't need a temporary file.
+\fIAdvantage:\fR exists on a lot of platforms and does not need a temporary file.
\fIDisadvantage:\fR an unmeant termination of the application leads to a
-semaphore leak because the facility doesn't allow an \*(L"remove in advance\*(R" trick
-(as the \s-1IPC\s0 shared memory facility does!) for safe cleanups.
+semaphore leak because the facility does not allow a ``remove in advance'\*(R'
+trick (as the \s-1IPC\s0 shared memory facility does) for safe cleanups.
.Ip "\s-1SVR4-\s0style fcntl(2) on temporary file (\s-1FCNTL\s0)" 4
\fIAdvantage:\fR exists on a lot of platforms and is also the most powerful
-variant (although not always the fastest one). \fIDisadvantage:\fR needs a
+variant (although not always the fastest one). \fIDisadvantage:\fR needs a
temporary file.
.Sh "\s-1MEMORY\s0 \s-1ALLOCATION\s0 \s-1STRATEGY\s0"
The memory allocation strategy the \fIStandard Malloc-Style \s-1API\s0\fR functions use
internally is the following:
.Ip "\fBAllocation\fR" 4
-When a chunk of memory has to be allocated, the internal list of free chunks
-is searched for a minimal-sized chunk which is larger or equal than the size
-of the to be allocated chunk (some sort of a \fIbest fit algorithm\fR).
+If a chunk of memory has to be allocated, the internal list of free chunks
+is searched for a minimal-size chunk which is larger or equal than the size of
+the to be allocated chunk (a \fIbest fit\fR strategy>).
.Sp
-When a chunk is found which matches this best-fit criteria, but is still a lot
+If a chunk is found which matches this best-fit criteria, but is still a lot
larger than the requested size, it is split into two chunks: One with exactly
-the requested size (which is the resulting chunk) and one with the remaining
-size (which is immediately re-inserted into the list of free chunks).
+the requested size (which is the resulting chunk given back) and one with the
+remaining size (which is immediately re-inserted into the list of free
+chunks).
.Sp
-When no fitting chunk is found at all in the list of free chunks, a new one is
+If no fitting chunk is found at all in the list of free chunks, a new one is
created from the spare area of the shared memory segment until the segment is
full (in which case an \fIout of memory\fR error occurs).
.Ip "\fBDeallocation\fR" 4
-When a chunk of memory has to be deallocated, it is inserted in sorted manner
-into the internal list of free chunks. The insertion operation automatically
-merges the chunk with a previous and/or next free chunk when possible, i.e.
-the free chunks stay physically seamless (one after another) in memory, to
+If a chunk of memory has to be deallocated, it is inserted in sorted manner
+into the internal list of free chunks. The insertion operation automatically
+merges the chunk with a previous and/or a next free chunk if possible, i.e.
+if the free chunks stay physically seamless (one after another) in memory, to
automatically form larger free chunks out of smaller ones.
.Sp
This way the shared memory segment is automatically defragmented when memory
@@ -375,22 +374,22 @@ This strategy reduces memory waste and fragmentation caused by small and
frequent allocations and deallocations to a minimum.
.PP
The internal implementation of the list of free chunks is not specially
-optimized (for instance by using binary search trees or even splay trees,
-etc.), because it's assumed that the total amount of entries in the list of
+optimized (for instance by using binary search trees or even \fIsplay\fR trees,
+etc), because it is assumed that the total amount of entries in the list of
free chunks is always small (caused both by the fact that shared memory
segments are usually a lot smaller than heaps and the fact that we always
-defragment by merging the free chunks when possible).
+defragment by merging the free chunks if possible).
.SH "API FUNCTIONS"
In the following all API functions are described in detail.
-The order directly follows the one in the SYNOPSIS.
+The order directly follows the one in the \fBSYNOPSIS\fR.
.Sh "Global Malloc-Replacement \s-1API\s0"
.Ip "int \fBMM_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" 4
-This initialized the global shared memory pool with \fIsize\fR and \fIfile\fR and
-has be called \fIbefore\fR any \fIfork\fR\|(2) operations are performed by the
+This initializes the global shared memory pool with \fIsize\fR and \fIfile\fR and
+has to be called \fIbefore\fR any \fIfork\fR\|(2) operations are performed by the
application.
.Ip "int \fBMM_permission\fR(mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" 4
This sets the filesystem \fImode\fR, \fIowner\fR and \fIgroup\fR for the global shared
-memory pool (has effects only when the underlaying shared memory segment
+memory pool (has effects only if the underlaying shared memory segment
implementation is actually based on external auxiliary files). The arguments
are directly passed through to \fIchmod\fR\|(2) and \fIchown\fR\|(2).
.Ip "void \fBMM_destroy\fR(void);" 4
@@ -399,12 +398,11 @@ child processes were killed.
.Ip "int \fBMM_lock\fR(mm_lock_mode \fImode\fR);" 4
This locks the global shared memory pool for the current process in order to
perform either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) or
-exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) operations inside the global
-shared memory pool.
+exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations inside the
+global shared memory pool.
.Ip "int \fBMM_unlock\fR(void);" 4
-This unlocks the global shared memory pool for the current process after
-mutual exclusion operations were performed inside the global shared memory
-pool.
+This unlocks the global shared memory pool for the current process after the
+critical operations were performed inside the global shared memory pool.
.Ip "void *\fBMM_malloc\fR(size_t \fIsize\fR);" 4
Identical to the \s-1POSIX\s0.1 \fImalloc\fR\|(3) function but instead of allocating
memory from the \fIheap\fR it allocates it from the global shared memory pool.
@@ -424,7 +422,7 @@ string copy in the \fIheap\fR it creates it in the global shared memory pool.
.Ip "size_t \fBMM_sizeof\fR(const void *\fIptr\fR);" 4
This function returns the size in bytes of the chunk starting at \fIptr\fR when
\fIptr\fR was previously allocated with \fIMM_malloc\fR\|(3). The result is undefined
-when \fIptr\fR was not previously allocated with \fIMM_malloc\fR\|(3).
+if \fIptr\fR was not previously allocated with \fIMM_malloc\fR\|(3).
.Ip "size_t \fBMM_maxsize\fR(void);" 4
This function returns the maximum size which is allowed
as the first argument to the \fIMM_create\fR\|(3) function.
@@ -439,10 +437,10 @@ This creates a shared memory pool which has space for approximately a total of
\fIsize\fR bytes with the help of \fIfile\fR. Here \fIfile\fR is a filesystem path to a
file which need not to exist (and perhaps is never created because this
depends on the platform and chosen shared memory and mutex implementation).
-The return value is a pointer to an \f(CWMM\fR structure which should be treated as
+The return value is a pointer to a \f(CWMM\fR structure which should be treated as
opaque by the application. It describes the internals of the created shared
memory pool. In case of an error \f(CWNULL\fR is returned. A \fIsize\fR of 0 means to
-allocate the maximum allowed size which is platform dependent and between a
+allocate the maximum allowed size which is platform dependent and is between a
few \s-1KB\s0 and the soft limit of 64MB.
.Ip "int \fBmm_permission\fR(\s-1MM\s0 *\fImm\fR, mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" 4
This sets the filesystem \fImode\fR, \fIowner\fR and \fIgroup\fR for the shared memory
@@ -456,11 +454,11 @@ filesystem corresponding the to shared memory pool are unlinked.
.Ip "int \fBmm_lock\fR(\s-1MM\s0 *\fImm\fR, mm_lock_mode \fImode\fR);" 4
This locks the shared memory pool \fImm\fR for the current process in order to
perform either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) or
-exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) operations inside the global
-shared memory pool.
+exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations inside the
+global shared memory pool.
.Ip "int \fBmm_unlock\fR(\s-1MM\s0 *\fImm\fR);" 4
-This unlocks the shared memory pool \fImm\fR for the current process after mutual
-exclusion operations were performed inside the global shared memory pool.
+This unlocks the shared memory pool \fImm\fR for the current process after
+critical operations were performed inside the global shared memory pool.
.Ip "void *\fBmm_malloc\fR(\s-1MM\s0 *\fImm\fR, size_t \fIsize\fR);" 4
This function allocates \fIsize\fR bytes from the shared memory pool \fImm\fR and
returns either a (virtual memory word aligned) pointer to it or \f(CWNULL\fR in
@@ -528,7 +526,7 @@ at \fIcore\fR is no longer allowed and will usually lead to a segmentation fault
.Ip "int \fBmm_core_lock\fR(const void *\fIcore\fR, mm_lock_mode \fImode\fR);" 4
This function acquires an advisory lock for the current process on the shared
memory segment \fIcore\fR for either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR)
-or exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) operations between
+or exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations between
\fIfork\fR\|(2)'ed child processes.
.Ip "int \fBmm_core_unlock\fR(const void *\fIcore\fR);" 4
This function releases a previously acquired advisory lock for the current
@@ -546,15 +544,15 @@ limit of 64MB.
This is just a utility function which can be used to align the number \fIsize\fR
to the next virtual memory \fIpage\fR boundary used by the underlaying platform.
The memory page boundary under Unix platforms is usually somewhere between
-2048 and 16384 bytes. You don't have to align the \fIsize\fR arguments of other
+2048 and 16384 bytes. You do not have to align the \fIsize\fR arguments of other
\fB\s-1MM\s0\fR library functions yourself, because this is already done internally.
This function is exported by the \fB\s-1MM\s0\fR library just for convenience reasons in
-case an application wants to perform simular calculations for other purposes.
+case an application wants to perform similar calculations for other purposes.
.Ip "size_t \fBmm_core_align2word\fR(size_t \fIsize\fR);" 4
This is another utility function which can be used to align the number \fIsize\fR
to the next virtual memory \fIword\fR boundary used by the underlaying platform.
The memory word boundary under Unix platforms is usually somewhere between 4
-and 16 bytes. You don't have to align the \fIsize\fR arguments of other \fB\s-1MM\s0\fR
+and 16 bytes. You do not have to align the \fIsize\fR arguments of other \fB\s-1MM\s0\fR
library functions yourself, because this is already done internally. This
function is exported by the \fB\s-1MM\s0\fR library just for convenience reasons in case
an application wants to perform simular calculations for other purposes.
@@ -564,24 +562,24 @@ This is a function which is used internally by the various \s-1MM\s0 function to
an error string. It's usually not called directly from applications.
.Ip "char *\fBmm_lib_error_get\fR(void);" 4
This is a function which is used internally by \fIMM_error\fR\|(3) and \fImm_error\fR\|(3)
-functions to get the current error string. It's usually not called directly
+functions to get the current error string. It is usually not called directly
from applications.
.Ip "int \fBmm_lib_version\fR(void);" 4
This function returns a hex-value ``0x\fIV\fR\fI\s-1RR\s0\fR\fIT\fR\fI\s-1LL\s0\fR'\*(R' which describes the
-current \s-1MM\s0 library version. \fIV\fR is the version, \fI\s-1RR\s0\fR the revisions, \fI\s-1LL\s0\fR
+current \fB\s-1MM\s0\fR library version. \fIV\fR is the version, \fI\s-1RR\s0\fR the revisions, \fI\s-1LL\s0\fR
the level and \fIT\fR the type of the level (alphalevel=0, betalevel=1,
-patchlevel=2, etc). For instance \s-1MM\s0 version 1.0.4 is encoded as 0x100204. The
-reason for this unusual mapping is that this way the version number is
+patchlevel=2, etc). For instance \fB\s-1MM\s0\fR version 1.0.4 is encoded as 0x100204.
+The reason for this unusual mapping is that this way the version number is
steadily \fIincreasing\fR.
.SH "RESTRICTIONS"
The maximum size of a continuous shared memory segment one can allocate
depends on the underlaying platform. This cannot be changed, of course. But
currently the high-level \fImalloc\fR\|(3)\-style API just uses a single shared memory
segment as the underlaying data structure for an \f(CWMM\fR object which means that
-the maximum amount of memory a \f(CWMM\fR object represents also depends on the
+the maximum amount of memory an \f(CWMM\fR object represents also depends on the
platform.
.PP
-This should be changed in later versions by allowing the high-level
+This should be changed in later versions by allowing at least the high-level
\fImalloc\fR\|(3)\-style API to internally use multiple shared memory segments to form
the \f(CWMM\fR object. This way \f(CWMM\fR objects could have arbitrary sizes, although
the maximum size of an allocatable chunk still is bounded by the maximum size
@@ -595,10 +593,10 @@ mm-\fIconfig\fR\|(1).
http://www.engelschall.com/sw/mm/
.SH "HISTORY"
-This library was originally written in January 1999 by \fIRalf S. Engelschall\fR
-<rse@engelschall.com> for use in the \fBExtended API\fR (EAPI) of the \fBApache\fR
-HTTP server project (see www.apache.org), which was originally invented for
-\fBmod_ssl\fR (see http://www.modssl.org/).
+This library was originally written in January 1999 by \fIRalf S.
+Engelschall\fR <rse@engelschall.com> for use in the \fBExtended API\fR (EAPI)
+of the \fBApache\fR HTTP server project (see www.apache.org), which was
+originally invented for \fBmod_ssl\fR (see http://www.modssl.org/).
.PP
Its base idea (a malloc-style API for handling shared memory) was originally
derived from the non-publically available \fImm_malloc\fR library written in
diff --git a/shmem/unix/mm/mm.h b/shmem/unix/mm/mm.h
index 531dca1b4..bc14b1ac8 100644
--- a/shmem/unix/mm/mm.h
+++ b/shmem/unix/mm/mm.h
@@ -1,5 +1,5 @@
/* ====================================================================
- * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved.
+ * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -44,8 +44,8 @@
**
*/
-#ifndef MM_H
-#define MM_H 1
+#ifndef _MM_H_
+#define _MM_H_
#ifdef __cplusplus
extern "C" {
@@ -82,9 +82,8 @@ typedef enum {
#include <sys/types.h>
#ifdef MM_OS_SUNOS
-#define KERNEL 1
#include <memory.h>
-/* SunOS lacks prototypes */
+/* SunOS4 lacks prototypes */
extern int getpagesize(void);
extern int munmap(caddr_t, int);
extern int ftruncate(int, off_t);
@@ -122,12 +121,12 @@ extern char *strerror(int);
#define memcpy(to,from,len) bcopy(from,to,len)
#else
#define memcpy(to,from,len) \
- { int i; for (i = 0; i < (len); i++) *((char *)(to)+i) = *((char *)(from)+i); }
+ { int i; for (i = 0; i < (len); i++) *(((char *)(to))+i) = *(((char *)(from))+i); }
#endif
#endif
#if !defined(HAVE_MEMSET)
#define memset(to,ch,len) \
- { int i; for (i = 0; i < (len); i++) *((char *)(to)+i) = (ch); }
+ { int i; for (i = 0; i < (len); i++) *(((char *)(to))+i) = (ch); }
#endif
#define ERR(type,str) mm_lib_error_set(type,str)
@@ -169,13 +168,29 @@ extern char *strerror(int);
#endif
#if defined(MM_SHMT_IPCSHM)
+#ifdef MM_OS_SUNOS
+#define KERNEL 1
+#endif
+#ifdef MM_OS_BS2000
+#define _KMEMUSER
+#endif
#include <sys/shm.h>
+#ifdef MM_OS_SUNOS
+#undef KERNEL
+#endif
+#ifdef MM_OS_BS2000
+#undef _KMEMUSER
+#endif
#if !defined(SHM_R)
#define SHM_R 0400
#endif
#if !defined(SHM_W)
#define SHM_W 0200
-#endif
+#endif
+#endif
+
+#ifdef MM_SHMT_BEOS
+#include <kernel/OS.h>
#endif
#if defined(MM_SEMT_IPCSEM)
@@ -193,10 +208,6 @@ union semun {
#include <sys/file.h>
#endif
-#ifdef MM_SHMT_BEOS
-#include <kernel/OS.h>
-#endif
-
#define MM_ALLOC_MINSIZE (1024*8)
#define MM_CORE_FILEMODE (S_IRUSR|S_IWUSR)
#define MM_CORE_DEFAULT_PAGESIZE (1024*8)
@@ -276,10 +287,6 @@ struct mem_core {
#if defined(MM_SHMT_BEOS)
area_id mc_areaid;
#endif
-#if defined(MM_SEMT_BEOS)
- sem_id mc_semid;
- int32 mc_ben;
-#endif
#if !defined(MM_SEMT_FLOCK)
int mc_fdsem;
#endif
@@ -294,6 +301,10 @@ struct mem_core {
#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL)
char mc_fnsem[MM_MAXPATH];
#endif
+#if defined(MM_SEMT_BEOS)
+ sem_id mc_semid;
+ int32 mc_ben;
+#endif
mem_word mc_base;
};
typedef struct mem_core mem_core;
@@ -364,4 +375,5 @@ int mm_lib_version(void);
}
#endif
-#endif /* MM_H */
+#endif /* _MM_H_ */
+
diff --git a/shmem/unix/mm/mm.pod b/shmem/unix/mm/mm.pod
index 7746612b5..e462dacaf 100644
--- a/shmem/unix/mm/mm.pod
+++ b/shmem/unix/mm/mm.pod
@@ -1,5 +1,5 @@
## ====================================================================
-## Copyright (c) 1999 Ralf S. Engelschall. All rights reserved.
+## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
@@ -120,7 +120,7 @@ with data-structures inside those shared memory segments.
The abbreviation B<MM> is historically and originally comes from the phrase
``I<memory mapped>'' as used by the POSIX.1 mmap(2) function. Because this
-facility is internally used by this library on most platforms to create the
+facility is internally used by this library on most platforms to establish the
shared memory segments.
=head2 LIBRARY STRUCTURE
@@ -139,24 +139,24 @@ based data structures without the need to change the code dramatically. All
which is needed is to prefix the POSIX.1 memory allocation functions with
`C<MM_>', i.e. `C<malloc>' becomes `C<MM_malloc>', `C<strdup>' becomes
`C<MM_strdup>', etc. This API internally uses just a global `C<MM *>' pool for
-calling the corresponding functions (with prefix `C<mm_>') of the I<Standard
-Malloc-Style API>.
+calling the corresponding functions (those with prefix `C<mm_>') of the
+I<Standard Malloc-Style API>.
=item B<Standard Malloc-Style API>
This is the standard high-level memory allocation API. Its interface is
similar to the I<Global Malloc-Replacement API> but it uses an explicit `C<MM *>'
-pool to operate on. That's why every function of this API has an argument of
-type `C<MM *>' as the first argument. This API provides a comfortable way to
+pool to operate on. That is why every function of this API has an argument of
+type `C<MM *>' as its first argument. This API provides a comfortable way to
work with small dynamically allocated shared memory chunks inside large
-statically allocated shared memory segments. It's internally based on the
+statically allocated shared memory segments. It is internally based on the
I<Low-Level Shared Memory API> for creating the underlaying shared memory
segment.
=item B<Low-Level Shared Memory API>
This is the basis of the whole B<MM> library. It provides low-level functions
-for creating shared memory segments with mutual exclusion (in short: I<mutex>)
+for creating shared memory segments with mutual exclusion (in short I<mutex>)
capabilities in a portable way. Internally the shared memory and mutex
facility is implemented in various platform-dependent ways. A list of
implementation variants follows under the next topic.
@@ -166,20 +166,20 @@ implementation variants follows under the next topic.
=head2 SHARED MEMORY IMPLEMENTATION
Internally the shared memory facility is implemented in various
-platform-dependent variants. Each has it's own advantages and disadvantages
+platform-dependent ways. Each way has its own advantages and disadvantages
(in addition to the fact that some variants aren't available at all on some
-platforms). The MM libraries configuration procedure tried hard to make a good
-decision. The implemented variants are now given for overview and background
-reasons with their advantages and disadvantages and in an ascending order,
-i.e. the MM configuration mechanism chooses the last available one in the list
-as the preferred variant.
+platforms). The B<MM> library's configuration procedure tries hard to make a
+good decision. The implemented variants are now given for overview and
+background reasons with their advantages and disadvantages and in an ascending
+order, i.e. the B<MM> configuration mechanism chooses the last available one
+in the list as the preferred variant.
=over 4
=item Classical mmap(2) on temporary file (MMFILE)
I<Advantage:> maximum portable.
-I<Disadvantage:> needs a temporary file on the filesystem
+I<Disadvantage:> needs a temporary file on the filesystem.
=item mmap(2) via POSIX.1 shm_open(3) on temporary file (MMPOSX)
@@ -189,20 +189,20 @@ is usually not available on existing Unix platform.
=item SVR4-style mmap(2) on C</dev/zero> device (MMZERO)
-I<Advantage:> widely available on mostly portable on SVR4 platforms.
-I<Disadvantage:> needs the C</dev/zero/> device and an mmap(2)
-which supports memory mapping through it.
+I<Advantage:> widely available and mostly portable on SVR4 platforms.
+I<Disadvantage:> needs the C</dev/zero/> device and a mmap(2)
+which supports memory mapping through this device.
=item 4.4BSD-style mmap(2) via C<MAP_ANON> facility (MMANON)
-I<Advantage:> doesn't need a temporary file or external device
+I<Advantage:> does not need a temporary file or external device.
I<Disadvantage:> usually only available on BSD platforms and derivatives.
=item SysV IPC shmget(2) (IPCSHM)
-I<Advantage:> doesn't need a temporary file or external device
-I<Disadvantage:> although available on mostly all modern Unix platforms it has
-hard restrictions like the maximum size of a single shared memory segment (can
+I<Advantage:> does not need a temporary file or external device.
+I<Disadvantage:> although available on mostly all modern Unix platforms, it has
+strong restrictions like the maximum size of a single shared memory segment (can
be as small as 100KB, but depends on the platform).
=back
@@ -210,7 +210,7 @@ be as small as 100KB, but depends on the platform).
=head2 LOCKING IMPLEMENTATION
As for the shared memory facility, internally the locking facility is
-implemented in various platform-dependent variants. A short overview of
+implemented in various platform-dependent ways. A short overview of
implemented variants is given:
=over 4
@@ -219,19 +219,19 @@ implemented variants is given:
I<Advantage:> exists on a lot of platforms, especially on older Unix
derivates. I<Disadvantage:> needs a temporary file on the filesystem and has
-to reopen filedescriptors to it in each(!) fork(2)ed child process.
+to re-open file-descriptors to it in each(!) fork(2)'ed child process.
=item SysV IPC semget(2) (IPCSEM)
-I<Advantage:> exists on a lot of platforms and doesn't need a temporary file.
+I<Advantage:> exists on a lot of platforms and does not need a temporary file.
I<Disadvantage:> an unmeant termination of the application leads to a
-semaphore leak because the facility doesn't allow an "remove in advance" trick
-(as the IPC shared memory facility does!) for safe cleanups.
+semaphore leak because the facility does not allow a ``remove in advance''
+trick (as the IPC shared memory facility does) for safe cleanups.
=item SVR4-style fcntl(2) on temporary file (FCNTL)
I<Advantage:> exists on a lot of platforms and is also the most powerful
-variant (although not always the fastest one). I<Disadvantage:> needs a
+variant (although not always the fastest one). I<Disadvantage:> needs a
temporary file.
=back
@@ -245,25 +245,26 @@ internally is the following:
=item B<Allocation>
-When a chunk of memory has to be allocated, the internal list of free chunks
-is searched for a minimal-sized chunk which is larger or equal than the size
-of the to be allocated chunk (some sort of a I<best fit algorithm>).
+If a chunk of memory has to be allocated, the internal list of free chunks
+is searched for a minimal-size chunk which is larger or equal than the size of
+the to be allocated chunk (a I<best fit> strategy>).
-When a chunk is found which matches this best-fit criteria, but is still a lot
+If a chunk is found which matches this best-fit criteria, but is still a lot
larger than the requested size, it is split into two chunks: One with exactly
-the requested size (which is the resulting chunk) and one with the remaining
-size (which is immediately re-inserted into the list of free chunks).
+the requested size (which is the resulting chunk given back) and one with the
+remaining size (which is immediately re-inserted into the list of free
+chunks).
-When no fitting chunk is found at all in the list of free chunks, a new one is
+If no fitting chunk is found at all in the list of free chunks, a new one is
created from the spare area of the shared memory segment until the segment is
full (in which case an I<out of memory> error occurs).
=item B<Deallocation>
-When a chunk of memory has to be deallocated, it is inserted in sorted manner
-into the internal list of free chunks. The insertion operation automatically
-merges the chunk with a previous and/or next free chunk when possible, i.e.
-the free chunks stay physically seamless (one after another) in memory, to
+If a chunk of memory has to be deallocated, it is inserted in sorted manner
+into the internal list of free chunks. The insertion operation automatically
+merges the chunk with a previous and/or a next free chunk if possible, i.e.
+if the free chunks stay physically seamless (one after another) in memory, to
automatically form larger free chunks out of smaller ones.
This way the shared memory segment is automatically defragmented when memory
@@ -275,16 +276,16 @@ This strategy reduces memory waste and fragmentation caused by small and
frequent allocations and deallocations to a minimum.
The internal implementation of the list of free chunks is not specially
-optimized (for instance by using binary search trees or even splay trees,
-etc.), because it's assumed that the total amount of entries in the list of
+optimized (for instance by using binary search trees or even I<splay> trees,
+etc), because it is assumed that the total amount of entries in the list of
free chunks is always small (caused both by the fact that shared memory
segments are usually a lot smaller than heaps and the fact that we always
-defragment by merging the free chunks when possible).
+defragment by merging the free chunks if possible).
=head1 API FUNCTIONS
In the following all API functions are described in detail.
-The order directly follows the one in the SYNOPSIS.
+The order directly follows the one in the B<SYNOPSIS>.
=head2 Global Malloc-Replacement API
@@ -292,14 +293,14 @@ The order directly follows the one in the SYNOPSIS.
=item int B<MM_create>(size_t I<size>, const char *I<file>);
-This initialized the global shared memory pool with I<size> and I<file> and
-has be called I<before> any fork(2) operations are performed by the
+This initializes the global shared memory pool with I<size> and I<file> and
+has to be called I<before> any fork(2) operations are performed by the
application.
=item int B<MM_permission>(mode_t I<mode>, uid_t I<owner>, gid_t I<group>);
This sets the filesystem I<mode>, I<owner> and I<group> for the global shared
-memory pool (has effects only when the underlaying shared memory segment
+memory pool (has effects only if the underlaying shared memory segment
implementation is actually based on external auxiliary files). The arguments
are directly passed through to chmod(2) and chown(2).
@@ -312,14 +313,13 @@ child processes were killed.
This locks the global shared memory pool for the current process in order to
perform either shared/read-only (I<mode> is C<MM_LOCK_RD>) or
-exclusive/read-write (I<mode> is C<MM_LOCK_RW>) operations inside the global
-shared memory pool.
+exclusive/read-write (I<mode> is C<MM_LOCK_RW>) critical operations inside the
+global shared memory pool.
=item int B<MM_unlock>(void);
-This unlocks the global shared memory pool for the current process after
-mutual exclusion operations were performed inside the global shared memory
-pool.
+This unlocks the global shared memory pool for the current process after the
+critical operations were performed inside the global shared memory pool.
=item void *B<MM_malloc>(size_t I<size>);
@@ -351,7 +351,7 @@ string copy in the I<heap> it creates it in the global shared memory pool.
This function returns the size in bytes of the chunk starting at I<ptr> when
I<ptr> was previously allocated with MM_malloc(3). The result is undefined
-when I<ptr> was not previously allocated with MM_malloc(3).
+if I<ptr> was not previously allocated with MM_malloc(3).
=item size_t B<MM_maxsize>(void);
@@ -379,10 +379,10 @@ This creates a shared memory pool which has space for approximately a total of
I<size> bytes with the help of I<file>. Here I<file> is a filesystem path to a
file which need not to exist (and perhaps is never created because this
depends on the platform and chosen shared memory and mutex implementation).
-The return value is a pointer to an C<MM> structure which should be treated as
+The return value is a pointer to a C<MM> structure which should be treated as
opaque by the application. It describes the internals of the created shared
memory pool. In case of an error C<NULL> is returned. A I<size> of 0 means to
-allocate the maximum allowed size which is platform dependent and between a
+allocate the maximum allowed size which is platform dependent and is between a
few KB and the soft limit of 64MB.
=item int B<mm_permission>(MM *I<mm>, mode_t I<mode>, uid_t I<owner>, gid_t I<group>);
@@ -402,13 +402,13 @@ filesystem corresponding the to shared memory pool are unlinked.
This locks the shared memory pool I<mm> for the current process in order to
perform either shared/read-only (I<mode> is C<MM_LOCK_RD>) or
-exclusive/read-write (I<mode> is C<MM_LOCK_RW>) operations inside the global
-shared memory pool.
+exclusive/read-write (I<mode> is C<MM_LOCK_RW>) critical operations inside the
+global shared memory pool.
=item int B<mm_unlock>(MM *I<mm>);
-This unlocks the shared memory pool I<mm> for the current process after mutual
-exclusion operations were performed inside the global shared memory pool.
+This unlocks the shared memory pool I<mm> for the current process after
+critical operations were performed inside the global shared memory pool.
=item void *B<mm_malloc>(MM *I<mm>, size_t I<size>);
@@ -509,7 +509,7 @@ at I<core> is no longer allowed and will usually lead to a segmentation fault.
This function acquires an advisory lock for the current process on the shared
memory segment I<core> for either shared/read-only (I<mode> is C<MM_LOCK_RD>)
-or exclusive/read-write (I<mode> is C<MM_LOCK_RW>) operations between
+or exclusive/read-write (I<mode> is C<MM_LOCK_RW>) critical operations between
fork(2)'ed child processes.
=item int B<mm_core_unlock>(const void *I<core>);
@@ -535,17 +535,17 @@ limit of 64MB.
This is just a utility function which can be used to align the number I<size>
to the next virtual memory I<page> boundary used by the underlaying platform.
The memory page boundary under Unix platforms is usually somewhere between
-2048 and 16384 bytes. You don't have to align the I<size> arguments of other
+2048 and 16384 bytes. You do not have to align the I<size> arguments of other
B<MM> library functions yourself, because this is already done internally.
This function is exported by the B<MM> library just for convenience reasons in
-case an application wants to perform simular calculations for other purposes.
+case an application wants to perform similar calculations for other purposes.
=item size_t B<mm_core_align2word>(size_t I<size>);
This is another utility function which can be used to align the number I<size>
to the next virtual memory I<word> boundary used by the underlaying platform.
The memory word boundary under Unix platforms is usually somewhere between 4
-and 16 bytes. You don't have to align the I<size> arguments of other B<MM>
+and 16 bytes. You do not have to align the I<size> arguments of other B<MM>
library functions yourself, because this is already done internally. This
function is exported by the B<MM> library just for convenience reasons in case
an application wants to perform simular calculations for other purposes.
@@ -564,16 +564,16 @@ an error string. It's usually not called directly from applications.
=item char *B<mm_lib_error_get>(void);
This is a function which is used internally by MM_error(3) and mm_error(3)
-functions to get the current error string. It's usually not called directly
+functions to get the current error string. It is usually not called directly
from applications.
=item int B<mm_lib_version>(void);
This function returns a hex-value ``0xI<V>I<RR>I<T>I<LL>'' which describes the
-current MM library version. I<V> is the version, I<RR> the revisions, I<LL>
+current B<MM> library version. I<V> is the version, I<RR> the revisions, I<LL>
the level and I<T> the type of the level (alphalevel=0, betalevel=1,
-patchlevel=2, etc). For instance MM version 1.0.4 is encoded as 0x100204. The
-reason for this unusual mapping is that this way the version number is
+patchlevel=2, etc). For instance B<MM> version 1.0.4 is encoded as 0x100204.
+The reason for this unusual mapping is that this way the version number is
steadily I<increasing>.
=back
@@ -584,10 +584,10 @@ The maximum size of a continuous shared memory segment one can allocate
depends on the underlaying platform. This cannot be changed, of course. But
currently the high-level malloc(3)-style API just uses a single shared memory
segment as the underlaying data structure for an C<MM> object which means that
-the maximum amount of memory a C<MM> object represents also depends on the
+the maximum amount of memory an C<MM> object represents also depends on the
platform.
-This should be changed in later versions by allowing the high-level
+This should be changed in later versions by allowing at least the high-level
malloc(3)-style API to internally use multiple shared memory segments to form
the C<MM> object. This way C<MM> objects could have arbitrary sizes, although
the maximum size of an allocatable chunk still is bounded by the maximum size
@@ -613,10 +613,10 @@ http://www.engelschall.com/sw/mm/
=head1 HISTORY
-This library was originally written in January 1999 by I<Ralf S. Engelschall>
-<rse@engelschall.com> for use in the B<Extended API> (EAPI) of the B<Apache>
-HTTP server project (see www.apache.org), which was originally invented for
-B<mod_ssl> (see http://www.modssl.org/).
+This library was originally written in January 1999 by I<Ralf S.
+Engelschall> <rse@engelschall.com> for use in the B<Extended API> (EAPI)
+of the B<Apache> HTTP server project (see www.apache.org), which was
+originally invented for B<mod_ssl> (see http://www.modssl.org/).
Its base idea (a malloc-style API for handling shared memory) was originally
derived from the non-publically available I<mm_malloc> library written in
diff --git a/shmem/unix/mm/mm_alloc.c b/shmem/unix/mm/mm_alloc.c
index 049a4ab20..00d59d295 100644
--- a/shmem/unix/mm/mm_alloc.c
+++ b/shmem/unix/mm/mm_alloc.c
@@ -1,5 +1,5 @@
/* ====================================================================
- * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved.
+ * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -59,10 +59,6 @@ MM *mm_create(size_t usize, const char *file)
/* defaults */
maxsize = mm_maxsize();
- if (usize < 0) {
- errno = EINVAL;
- return NULL;
- }
if (usize == 0)
usize = maxsize;
if (usize > maxsize)
diff --git a/shmem/unix/mm/mm_conf.h.in b/shmem/unix/mm/mm_conf.h.in
index 5d6be09f0..e9d81f1a3 100644
--- a/shmem/unix/mm/mm_conf.h.in
+++ b/shmem/unix/mm/mm_conf.h.in
@@ -1,9 +1,51 @@
+/* ====================================================================
+ * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by
+ * Ralf S. Engelschall <rse@engelschall.com>."
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by
+ * Ralf S. Engelschall <rse@engelschall.com>."
+ *
+ * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ */
+
/*
+**
** mm_conf.h
+**
*/
-#ifndef MM_CONF_HH
-#define MM_CONF_HH
+#ifndef _MM_CONF_H_
+#define _MM_CONF_H_
/* VM Page Size Determination */
#undef MM_VMPS_GETPAGESIZE
@@ -36,9 +78,11 @@
#undef HAVE_BCOPY
#undef HAVE_MEMORY_H
#undef MM_OS_SUNOS
+#undef MM_OS_BS2000
#undef HAVE_PATH_MAX
#undef HAVE__POSIX_PATH_MAX
#undef HAVE_MAXPATHLEN
#undef HAVE_UNION_SEMUN
-#endif /* MM_CONF_HH */
+#endif /* _MM_CONF_H_ */
+
diff --git a/shmem/unix/mm/mm_core.c b/shmem/unix/mm/mm_core.c
index 37d938ea0..4b9a62bd9 100644
--- a/shmem/unix/mm/mm_core.c
+++ b/shmem/unix/mm/mm_core.c
@@ -1,5 +1,5 @@
/* ====================================================================
- * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved.
+ * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -242,10 +242,11 @@ void *mm_core_create(size_t usersize, const char *file)
#endif /* MM_SHMT_MMANON */
#if defined(MM_SHMT_BEOS)
- if ((temparea = create_area("mm",(void*)&area, B_ANY_ADDRESS,
- size, B_LAZY_LOCK, B_READ_AREA | B_WRITE_AREA)) < 0)
+ if ((temparea = create_area("mm", (void*)&area, B_ANY_ADDRESS,
+ size, B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA)) < 0)
FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to create the memory area");
#endif /* MM_SHMT_BEOS */
+
#if defined(MM_SHMT_MMPOSX)
shm_unlink(fnmem); /* Ok when it fails */
if ((fdmem = shm_open(fnmem, O_RDWR|O_CREAT, MM_CORE_FILEMODE)) == -1)
@@ -343,18 +344,18 @@ void *mm_core_create(size_t usersize, const char *file)
mc->mc_fdsem[1].pid = 0;
mc->mc_fdsem[1].fd = -1;
#else
- mc->mc_fdsem = fdsem;
+ mc->mc_fdsem = fdsem;
#endif
#if defined(MM_SEMT_BEOS)
mc->mc_semid = create_sem(0, "mm_semid");
- mc->mc_ben=0;
+ mc->mc_ben = 0;
#endif
#if defined(MM_SHMT_BEOS)
mc->mc_areaid = temparea;
#endif
#if defined(MM_SEMT_IPCSEM)
mc->mc_fdsem_rd = fdsem_rd;
- mc->mc_readers = 0;
+ mc->mc_readers = 0;
#endif
#if defined(MM_SHMT_MMFILE)
memcpy(mc->mc_fnmem, fnmem, MM_MAXPATH);
@@ -384,17 +385,16 @@ void *mm_core_create(size_t usersize, const char *file)
if (fdmem != -1)
close(fdmem);
#endif
-#if defined(MM_SHMT_IPCSHM)
- if (fdmem != -1)
- shmctl(fdmem, IPC_RMID, NULL);
+#if defined(MM_SEMT_BEOS)
+ delete_sem(mc->mc_semid);
#endif
#if defined(MM_SHMT_BEOS)
delete_area(mc->mc_areaid);
#endif
-#if defined(MM_SEMT_BEOS)
- delete_sem(mc->mc_semid);
+#if defined(MM_SHMT_IPCSHM)
+ if (fdmem != -1)
+ shmctl(fdmem, IPC_RMID, NULL);
#endif
-
#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL)
if (fdsem != -1)
close(fdsem);
@@ -554,16 +554,16 @@ int mm_core_lock(const void *core, mm_lock_mode mode)
mc->mc_lockmode = mode;
#endif
#if defined(MM_SEMT_BEOS)
- rc=0;
- if (atomic_add (&mc->mc_ben, 1) > 0){
- /* someone already in lock..acquire sem and wait */
- if (acquire_sem(mc->mc_semid) != B_NO_ERROR){
- atomic_add(&mc->mc_ben,-1);
- rc = -1;
- }
+ rc = 0;
+ if (atomic_add(&mc->mc_ben, 1) > 0) {
+ /* someone already in lock... acquire sem and wait */
+ if (acquire_sem(mc->mc_semid) != B_NO_ERROR) {
+ atomic_add(&mc->mc_ben, -1);
+ rc = -1;
+ }
}
#endif
-
+
if (rc < 0) {
ERR(MM_ERR_CORE|MM_ERR_SYSTEM, "Failed to lock");
rc = FALSE;
@@ -608,10 +608,9 @@ int mm_core_unlock(const void *core)
}
#endif
#if defined(MM_SEMT_BEOS)
- rc=0;
- if (atomic_add(&mc->mc_ben, -1) > 1){
- release_sem(mc->mc_semid);
- }
+ rc = 0;
+ if (atomic_add(&mc->mc_ben, -1) > 1)
+ release_sem(mc->mc_semid);
#endif
if (rc < 0) {
diff --git a/shmem/unix/mm/mm_global.c b/shmem/unix/mm/mm_global.c
index 53efcca58..33b046463 100644
--- a/shmem/unix/mm/mm_global.c
+++ b/shmem/unix/mm/mm_global.c
@@ -1,5 +1,5 @@
/* ====================================================================
- * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved.
+ * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/shmem/unix/mm/mm_lib.c b/shmem/unix/mm/mm_lib.c
index 0e7c34e86..967c336ff 100644
--- a/shmem/unix/mm/mm_lib.c
+++ b/shmem/unix/mm/mm_lib.c
@@ -1,5 +1,5 @@
/* ====================================================================
- * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved.
+ * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/shmem/unix/mm/mm_test.c b/shmem/unix/mm/mm_test.c
index 38e5570ec..5c344d49a 100644
--- a/shmem/unix/mm/mm_test.c
+++ b/shmem/unix/mm/mm_test.c
@@ -1,5 +1,47 @@
+/* ====================================================================
+ * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by
+ * Ralf S. Engelschall <rse@engelschall.com>."
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by
+ * Ralf S. Engelschall <rse@engelschall.com>."
+ *
+ * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ */
+
/*
+**
** mm_test.c -- Test Suite for MM Library
+**
*/
#include <stdio.h>
diff --git a/shmem/unix/mm/mm_vers.c b/shmem/unix/mm/mm_vers.c
index ab61a88b1..706beb547 100644
--- a/shmem/unix/mm/mm_vers.c
+++ b/shmem/unix/mm/mm_vers.c
@@ -1,13 +1,13 @@
/*
** mm_vers.c -- Version Information
-** [automatically generated and maintained by shtool]
+** [automatically generated and maintained by GNU shtool]
*/
#ifdef _AS_HEADER
#ifndef _MM_VERS_C
#define _MM_VERS_C
-#define MM_VERSION 0x100211
+#define MM_VERSION 0x101201
extern const int MM_Version;
extern const char MM_VersionStr[];
extern const char MM_Hello[];
@@ -20,13 +20,13 @@ extern const char MM_PlainID[];
#else
-const int MM_Version = 0x100211;
-const char MM_VersionStr[] = "1.0.11 (06-Sep-1999)";
-const char MM_Hello[] = "This is MM, Version 1.0.11 (06-Sep-1999)";
-const char MM_GNUVersion[] = "MM Version 1.0.11";
-const char MM_WhatID[] = "@(#)MM Version 1.0.11 (06-Sep-1999)";
-const char MM_RCSIdentID[] = "$Id: mm_vers.c,v 1.2 1999/09/27 07:42:10 rse Exp $";
-const char MM_WebID[] = "MM/1.0.11";
-const char MM_PlainID[] = "1.0.11";
+const int MM_Version = 0x101201;
+const char MM_VersionStr[] = "1.1.1 (30-Apr-2000)";
+const char MM_Hello[] = "This is MM, Version 1.1.1 (30-Apr-2000)";
+const char MM_GNUVersion[] = "MM Version 1.1.1";
+const char MM_WhatID[] = "@(#)MM Version 1.1.1 (30-Apr-2000)";
+const char MM_RCSIdentID[] = "$Id: mm_vers.c,v 1.3 2000/05/03 17:15:49 rbb Exp $";
+const char MM_WebID[] = "MM/1.1.1";
+const char MM_PlainID[] = "1.1.1";
#endif
diff --git a/shmem/unix/mm/shtool b/shmem/unix/mm/shtool
index cacca7eb6..183a3185b 100755
--- a/shmem/unix/mm/shtool
+++ b/shmem/unix/mm/shtool
@@ -1,13 +1,13 @@
#!/bin/sh
##
## GNU shtool -- The GNU Portable Shell Tool
-## Copyright (c) 1994-1999 Ralf S. Engelschall <rse@engelschall.com>
+## Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>
##
## See http://www.gnu.org/software/shtool/ for more information.
## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
##
-## Version 1.4.6 (05-Sep-1999)
-## Ingredients: all available modules
+## Version 1.4.9 (16-Apr-2000)
+## Ingredients: 6/17 available modules
##
##
@@ -39,21 +39,23 @@
##
## Available commands:
## echo Print string with optional construct expansion
-## mdate Pretty-print modification time of a file or dir
-## table Pretty print a field-separated list as a table
-## prop Display progress with a running propeller
-## move Move files with simultan substitution
## install Install a program, script or datafile
## mkdir Make one or more directories
-## mkln Make link with calculation of relative paths
-## mkshadow Make a shadow tree
## fixperm Fix file permissions inside a source tree
## tarball Roll distribution tarballs
-## guessos Simple OS/platform guesser
+## version Generate and maintain a version information file
+##
+## Not available commands (because module was not built-in):
+## mdate Pretty-print modification time of a file or dir
+## table Pretty-print a field-separated list as a table
+## prop Display progress with a running propeller
+## move Move files with simultaneous substitution
+## mkln Make link with calculation of relative paths
+## mkshadow Make a shadow tree through symbolic links
+## guessos Simple operating system guesser
## arx Extended archive command
## slo Separate linker options by library class
## scpp Sharing C Pre-Processor
-## version Generate and maintain a version information file
## path Deal with program paths
##
@@ -63,8 +65,8 @@ if [ $# -eq 0 ]; then
exit 1
fi
if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
- echo "This is GNU shtool, version 1.4.6 (05-Sep-1999)"
- echo "Copyright (c) 1994-1999 Ralf S. Engelschall <rse@engelschall.com>"
+ echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)"
+ echo "Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>"
echo "Report bugs to <bug-shtool@gnu.org>"
echo ''
echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]"
@@ -76,31 +78,33 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo ''
echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:'
echo ' echo [-n] [-e] [<str> ...]'
- echo ' mdate [-n] [-z] [-s] [-d] [-f<str>] [-o<spec>] <path>'
- echo ' table [-F<sep>] [-w<width>] [-c<cols>] [-s<strip>] <str><sep><str>...'
- echo ' prop [-p<str>]'
- echo ' move [-v] [-t] [-e] [-p] <src-file> <dst-file>'
echo ' install [-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>]'
echo ' [-e<ext>] <file> <path>'
echo ' mkdir [-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]'
- echo ' mkln [-t] [-f] [-s] <src-path> [<src-path> ...] <dst-path>'
- echo ' mkshadow [-v] [-t] [-a] <src-dir> <dst-dir>'
echo ' fixperm [-v] [-t] <path> [<path> ...]'
echo ' tarball [-t] [-v] [-o <tarball>] [-c <prog>] [-d <dir>] [-u'
echo ' <user>] [-g <group>] [-e <pattern>] <path> [<path> ...]'
- echo ' guessos '
- echo ' arx [-t] [-C<cmd>] <op> <archive> [<file> ...]'
- echo ' slo -- -L<dir> -l<lib> [ -L<dir> -l<lib> ... ]'
- echo ' scpp [-v] [-p] [-o<ofile>] [-t<tfile>] [-M<mark>] [-D<dname>]'
- echo ' [-C<cname>] <file> [<file> ...]'
echo ' version [-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-i<knob>]'
echo ' [-d<type>] <file>'
+ echo ''
+ echo 'Not available <cmd-name> (because module was not built-in):'
+ echo ' mdate [-n] [-z] [-s] [-d] [-f<str>] [-o<spec>] <path>'
+ echo ' table [-F<sep>] [-w<width>] [-c<cols>] [-s<strip>] <str><sep><str>...'
+ echo ' prop [-p<str>]'
+ echo ' move [-v] [-t] [-e] [-p] <src-file> <dst-file>'
+ echo ' mkln [-t] [-f] [-s] <src-path> [<src-path> ...] <dst-path>'
+ echo ' mkshadow [-v] [-t] [-a] <src-dir> <dst-dir>'
+ echo ' guessos '
+ echo ' arx [-t] [-C<cmd>] <op> <archive> [<file> ...]'
+ echo ' slo [-p<str>] -- -L<dir> -l<lib> [-L<dir> -l<lib> ...]'
+ echo ' scpp [-v] [-p] [-f<filter>] [-o<ofile>] [-t<tfile>] [-M<mark>]'
+ echo ' [-D<dname>] [-C<cname>] <file> [<file> ...]'
echo ' path [-s] [-r] [-d] [-b] [-m] [-p<path>] <str> [<str> ...]'
echo ''
exit 0
fi
if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
- echo "GNU shtool 1.4.6 (05-Sep-1999)"
+ echo "GNU shtool 1.4.9 (16-Apr-2000)"
exit 0
fi
if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
@@ -109,7 +113,7 @@ if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
fi
name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'`
case "$name" in
- echo|mdate|table|prop|move|install|mkdir|mkln|mkshadow|fixperm|tarball|guessos|arx|slo|scpp|version|path )
+ echo|install|mkdir|fixperm|tarball|version )
# implicit tool command selection
tool="$name"
;;
@@ -132,113 +136,63 @@ case $tool in
str_tool="echo"
str_usage="[-n] [-e] [<str> ...]"
arg_spec="0+"
- opt_spec="ne"
- ;;
- mdate )
- str_tool="mdate"
- str_usage="[-n] [-z] [-s] [-d] [-f<str>] [-o<spec>] <path>"
- arg_spec="1"
- opt_spec="nzsdf:!o:!"
- opt_f=" "
- opt_o="dmy"
- ;;
- table )
- str_tool="table"
- str_usage="[-F<sep>] [-w<width>] [-c<cols>] [-s<strip>] <str><sep><str>..."
- arg_spec="1+"
- opt_spec="F:!w:!c:!s:!"
- opt_F=":"
- opt_w=15
- opt_c=3
- opt_s=79
- ;;
- prop )
- str_tool="prop"
- str_usage="[-p<str>]"
- arg_spec="0"
- opt_spec="p:"
- ;;
- move )
- str_tool="move"
- str_usage="[-v] [-t] [-e] [-p] <src-file> <dst-file>"
- arg_spec="2"
- opt_spec="vtep"
+ opt_spec="n.e."
+ opt_n=no
+ opt_e=no
;;
install )
str_tool="install"
str_usage="[-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>] [-e<ext>] <file> <path>"
- arg_spec="2"
- opt_spec="vtcCsm:o:g:e:"
+ arg_spec="2="
+ opt_spec="v.t.c.C.s.m:o:g:e:"
+ opt_v=no
+ opt_t=no
+ opt_c=no
+ opt_C=no
+ opt_s=no
+ opt_m=""
+ opt_o=""
+ opt_g=""
+ opt_e=""
;;
mkdir )
str_tool="mkdir"
str_usage="[-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]"
arg_spec="1+"
- opt_spec="tfpm:"
- ;;
- mkln )
- str_tool="mkln"
- str_usage="[-t] [-f] [-s] <src-path> [<src-path> ...] <dst-path>"
- arg_spec="2+"
- opt_spec="tfs"
- ;;
- mkshadow )
- str_tool="mkshadow"
- str_usage="[-v] [-t] [-a] <src-dir> <dst-dir>"
- arg_spec="2"
- opt_spec="vta"
+ opt_spec="t.f.p.m:"
+ opt_t=no
+ opt_f=no
+ opt_p=no
+ opt_m=""
;;
fixperm )
str_tool="fixperm"
str_usage="[-v] [-t] <path> [<path> ...]"
- gen_tmpfile=yes
arg_spec="1+"
- opt_spec="vt"
+ opt_spec="v.t."
+ opt_v=no
+ opt_t=no
;;
tarball )
str_tool="tarball"
str_usage="[-t] [-v] [-o <tarball>] [-c <prog>] [-d <dir>] [-u <user>] [-g <group>] [-e <pattern>] <path> [<path> ...]"
gen_tmpfile=yes
arg_spec="1+"
- opt_spec="tvo:c:d:u:g:e:!"
+ opt_spec="t.v.o:c:d:u:g:e:"
+ opt_t=no
+ opt_v=no
+ opt_o=""
+ opt_c=""
+ opt_d=""
+ opt_u=""
+ opt_g=""
opt_e="CVS,\\.cvsignore,\\.[oa]\$"
;;
- guessos )
- str_tool="guessos"
- str_usage=""
- arg_spec="0"
- opt_spec=""
- ;;
- arx )
- str_tool="arx"
- str_usage="[-t] [-C<cmd>] <op> <archive> [<file> ...]"
- arg_spec="2+"
- opt_spec="tC:!"
- opt_C="ar"
- ;;
- slo )
- str_tool="slo"
- str_usage="-- -L<dir> -l<lib> [ -L<dir> -l<lib> ... ]"
- arg_spec="1+"
- opt_spec=""
- ;;
- scpp )
- str_tool="scpp"
- str_usage="[-v] [-p] [-o<ofile>] [-t<tfile>] [-M<mark>] [-D<dname>] [-C<cname>] <file> [<file> ...]"
- gen_tmpfile=yes
- arg_spec="1+"
- opt_spec="vpo:!t:!M:!D:!C:!"
- opt_o="lib.h"
- opt_t="lib.h.in"
- opt_M="%%MARK%%"
- opt_D="cpp"
- opt_C="intern"
- ;;
version )
str_tool="version"
str_usage="[-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-i<knob>] [-d<type>] <file>"
arg_spec="1+"
- opt_spec="l:!n:!p:!s:!i:!d:!"
+ opt_spec="l:n:p:s:i:d:"
opt_l="txt"
opt_n="unknown"
opt_p="unknown"
@@ -247,13 +201,10 @@ case $tool in
opt_d="NO"
gen_tmpfile=yes
;;
- path )
- str_tool="path"
- str_usage="[-s] [-r] [-d] [-b] [-m] [-p<path>] <str> [<str> ...]"
- gen_tmpfile=yes
- arg_spec="1+"
- opt_spec="srdbmp:!"
- opt_p="$PATH"
+ -* )
+ echo "$0:Error: unknown option \`$tool'" 2>&1
+ echo "$0:Hint: run \`$0 -h' for usage" 2>&1
+ exit 1
;;
* )
echo "$0:Error: unknown command \`$tool'" 2>&1
@@ -268,36 +219,24 @@ esac
# determine name of tool
if [ ".$tool" != . ]; then
- # inside shtool
+ # used inside shtool script
toolcmd="$0 $tool"
toolcmdhelp="shtool $tool"
msgprefix="shtool:$tool"
else
- # standalone
+ # used as standalone script
toolcmd="$0"
- toolcmdhelp="sh.$tool"
+ toolcmdhelp="sh $0"
msgprefix="$str_tool"
fi
# parse argument specification string
-eval `echo $arg_spec | sed -e 's/^\([0-9]*\)\(.*\)/arg_NUMS="\1"; arg_MODE="\2"/'`
-test ".$arg_MODE" = . && arg_MODE="="
+eval `echo $arg_spec |\
+ sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'`
# parse option specification string
-for opt in `echo "h$opt_spec" | sed -e 's/\([a-zA-Z0-9][!:+]*\)/\1 /g'`; do
- opt_MODE="."; opt_INIT="."
- eval `echo $opt |\
- sed -e 's/^\([a-zA-Z0-9]\)/opt_THIS="\1";/' \
- -e 's/";\([:+]\)/"; opt_MODE="\1";/' \
- -e 's/";\(!\)/"; opt_INIT="\1"/'`
- eval "opt_MODE_${opt_THIS}=${opt_MODE}"
- if [ ".$opt_INIT" != ".!" ]; then
- case "$opt_MODE" in
- "." ) eval "opt_${opt_THIS}=no" ;;
- ":"|"+" ) eval "opt_${opt_THIS}=\"\"" ;;
- esac
- fi
-done
+eval `echo h.$opt_spec |\
+ sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'`
# interate over argument line
opt_PREV=''
@@ -315,7 +254,7 @@ while [ $# -gt 0 ]; do
opt_OPT="$opt_PREV"
opt_ARG="$1"
opt_ARG_OK=yes
- opt_PREV=""
+ opt_PREV=''
else
# split argument into option and argument
case "$1" in
@@ -325,8 +264,7 @@ while [ $# -gt 0 ]; do
-e 's/";\(.*\)$/"; opt_ARG="\1"/'`
;;
-[a-zA-Z0-9])
- opt_OPT=`awk 'BEGIN { printf("%s", substr(OPT, 2)); }' \
- "OPT=$1" </dev/null"`
+ opt_OPT=`echo "x$1" | cut -c3-`
opt_ARG=''
;;
*)
@@ -349,15 +287,15 @@ while [ $# -gt 0 ]; do
# process option
case $opt_MODE in
- "." )
+ '.' )
# boolean option
eval "opt_${opt_OPT}=yes"
;;
- ":" )
+ ':' )
# option with argument (multiple occurances override)
eval "opt_${opt_OPT}=\"\$opt_ARG\""
;;
- "+" )
+ '+' )
# option with argument (multiple occurances append)
eval "opt_${opt_OPT}=\"\$opt_${opt_OPT} \$opt_ARG\""
;;
@@ -382,14 +320,14 @@ fi
# complain about incorrect number of arguments
case $arg_MODE in
- "=" )
+ '=' )
if [ $# -ne $arg_NUMS ]; then
echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2
echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
exit 1
fi
;;
- "+" )
+ '+' )
if [ $# -lt $arg_NUMS ]; then
echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2
echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
@@ -400,13 +338,12 @@ esac
# establish a temporary file on request
if [ ".$gen_tmpfile" = .yes ]; then
- tmpdir="/tmp"
if [ ".$TMPDIR" != . ]; then
tmpdir="$TMPDIR"
+ elif [ ".$TEMPDIR" != . ]; then
+ tmpdir="$TEMPDIR"
else
- if [ ".$TEMPDIR" != . ]; then
- tmpdir="$TEMPDIR"
- fi
+ tmpdir="/tmp"
fi
tmpfile="$tmpdir/.shtool.$$"
rm -f $tmpfile >/dev/null 2>&1
@@ -422,7 +359,7 @@ case $tool in
echo )
##
## echo -- Print string with optional construct expansion
- ## Copyright (c) 1998-1999 Ralf S. Engelschall <rse@engelschall.com>
+ ## Copyright (c) 1998-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for WML as buildinfo
##
@@ -449,8 +386,8 @@ echo )
term_bold=''
term_norm=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
- # the most important terminals we directly know
case $TERM in
+ # for the most important terminal types we directly know the sequences
xterm|xterm*|vt220|vt220*)
term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' </dev/null 2>/dev/null`
term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' </dev/null 2>/dev/null`
@@ -459,35 +396,37 @@ echo )
term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' </dev/null 2>/dev/null`
term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' </dev/null 2>/dev/null`
;;
- esac
- # then try a possibly existing "tput" or "tcout" utility
- paths=`echo $PATH | sed -e 's/:/ /g'`
- for tool in tput tcout; do
- for dir in $paths; do
- if [ -r "$dir/$tool" ]; then
- for seq in bold md smso; do # smso is last
- bold="`$dir/$tool $seq 2>/dev/null`"
- if [ ".$bold" != . ]; then
- term_bold="$bold"
+ # for all others, we try to use a possibly existing `tput' or `tcout' utility
+ * )
+ paths=`echo $PATH | sed -e 's/:/ /g'`
+ for tool in tput tcout; do
+ for dir in $paths; do
+ if [ -r "$dir/$tool" ]; then
+ for seq in bold md smso; do # 'smso' is last
+ bold="`$dir/$tool $seq 2>/dev/null`"
+ if [ ".$bold" != . ]; then
+ term_bold="$bold"
+ break
+ fi
+ done
+ if [ ".$term_bold" != . ]; then
+ for seq in sgr0 me rmso reset; do # 'reset' is last
+ norm="`$dir/$tool $seq 2>/dev/null`"
+ if [ ".$norm" != . ]; then
+ term_norm="$norm"
+ break
+ fi
+ done
+ fi
break
fi
done
- if [ ".$term_bold" != . ]; then
- for seq in sgr0 me rmso reset; do # 'reset' is last
- norm="`$dir/$tool $seq 2>/dev/null`"
- if [ ".$norm" != . ]; then
- term_norm="$norm"
- break
- fi
- done
+ if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
+ break;
fi
- break
- fi
- done
- if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
- break;
- fi
- done
+ done
+ ;;
+ esac
if [ ".$term_bold" = . -o ".$term_norm" = . ]; then
echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2
fi
@@ -628,348 +567,22 @@ echo )
# create output
if [ .$opt_n = .no ]; then
- echo $seo $text
+ echo $seo "$text"
else
# the harder part: echo -n is best, because
- # awk complains about some \xx sequences.
+ # awk may complain about some \xx sequences.
if [ ".$minusn" != . ]; then
- echo $seo $minusn $text
+ echo $seo $minusn "$text"
else
echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text"
fi
fi
;;
-mdate )
- ##
- ## mdate -- Pretty-print modification time of a file or dir
- ## Copyright (c) 1995-1997 Free Software Foundation, Inc.
- ## Originally idea and basis code by Ulrich Drepper
- ## Enhanced by Ralf S. Engelschall for shtool
- ##
-
- fod="$1"
- case "$opt_o" in
- [dmy][dmy][dmy] )
- ;;
- * ) echo "$msgprefix:Error: invalid argument to option \`-o': $opt_o" 1>&2
- exit 1
- ;;
- esac
- if [ ! -r "$fod" ]; then
- echo "$msgprefix:Error: file or directory not found: $fod" 1>&2
- exit 1
- fi
-
- # prevent "date" giving response in another language
- LANG=C; export LANG
- LC_ALL=C; export LC_ALL
- LC_TIME=C; export LC_TIME
-
- # get the extended ls output of the file or directory.
- if ls -L /dev/null >/dev/null 2>&1; then
- set - x`ls -L -l -d $fod`
- else
- set - x`ls -l -d $fod`
- fi
-
- # The month is at least the fourth argument
- # (3 shifts here, the next inside the loop).
- shift; shift; shift
-
- # Find the month. Next argument is day, followed by the year or time.
- month=""
- while [ ".$month" = . ]; do
- shift
- case $1 in
- Jan) month=January; nummonth=1 ;;
- Feb) month=February; nummonth=2 ;;
- Mar) month=March; nummonth=3 ;;
- Apr) month=April; nummonth=4 ;;
- May) month=May; nummonth=5 ;;
- Jun) month=June; nummonth=6 ;;
- Jul) month=July; nummonth=7 ;;
- Aug) month=August; nummonth=8 ;;
- Sep) month=September; nummonth=9 ;;
- Oct) month=October; nummonth=10 ;;
- Nov) month=November; nummonth=11 ;;
- Dec) month=December; nummonth=12 ;;
- esac
- done
- day="$2"
- year="$3"
-
- # We finally have to deal with the problem that the "ls" output
- # gives either the time of the day or the year.
- case $year in
- *:*)
- this_year=`date '+%Y' 2>/dev/null`
- if [ ".$this_year" = . ]; then
- this_year=`date '+%y'`
- case $this_year in
- [5-9][0-9]) this_year="19$this_year" ;;
- [0-4][0-9]) this_year="20$this_year" ;;
- esac
- fi
- # for the following months of the last year the time notation
- # is usually also used for files modified in the last year.
- this_month=`date '+%m'`
- if (expr $nummonth \> $this_month) >/dev/null; then
- this_year=`expr $this_year - 1`
- fi
- year="$this_year"
- ;;
- esac
-
- # Optionally fill day and month with leeding zeros
- if [ ".$opt_z" = .yes ]; then
- case $day in
- [0-9][0-9] ) ;;
- [0-9] ) day="0$day" ;;
- esac
- case $nummonth in
- [0-9][0-9] ) ;;
- [0-9] ) nummonth="0$nummonth" ;;
- esac
- fi
-
- # Optionally use digits for month
- if [ ".$opt_d" = .yes ]; then
- month="$nummonth"
- fi
-
- # Optionally shorten the month name to three characters
- if [ ".$opt_s" = .yes ]; then
- month=`echo $month | cut -c1-3`
- fi
-
- # Output the resulting date string
- echo dummy | awk '{
- for (i = 0; i < 3; i++) {
- now = substr(order, 1, 1);
- order = substr(order, 2);
- if (now == "d")
- out = day;
- else if (now == "m")
- out = month;
- else if (now == "y")
- out = year;
- if (i < 2)
- printf("%s%s", out, field);
- else
- printf("%s", out);
- }
- if (newline != "yes")
- printf("\n");
- }' "day=$day" "month=$month" "year=$year" \
- "field=$opt_f" "order=$opt_o" "newline=$opt_n"
- ;;
-
-table )
- ##
- ## table -- Pretty print a field-separated list as a table
- ## Copyright (c) 1998-1999 Ralf S. Engelschall <rse@engelschall.com>
- ## Originally written for Apache
- ##
-
- if [ $opt_c -gt 4 ]; then
- echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2
- exit 1
- fi
- case "x$opt_F" in
- x? ) ;;
- * ) echo "$msgprefix:Error: Invalid separator (one char allowed only)" 1>&2; exit 1 ;;
- esac
-
- # split the list into a table
- list=`
- IFS="$opt_F"
- for entry in $*; do
- if [ ".$entry" != . ]; then
- echo "$entry"
- fi
- done |\
- awk "
- BEGIN { list = \"\"; n = 0; }
- {
- list = list \\$1;
- n = n + 1;
- if (n < $opt_c) {
- list = list \":\";
- }
- if (n == $opt_c) {
- list = list \"\\n\";
- n = 0;
- }
- }
- END { print list; }
- "
- `
-
- # format table cells and make sure table
- # doesn't exceed maximum width
- OIFS="$IFS"
- IFS='
-'
- for entry in $list; do
- case $opt_c in
- 1 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s\\n\", \$1); }'" ;;
- 2 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s\\n\", \$1, \$2); }'" ;;
- 3 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3); }'" ;;
- 4 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3, \$4); }'" ;;
- esac
- done |\
- awk "{
- if (length(\$0) > $opt_s) {
- printf(\"%s\\n\", substr(\$0, 0, $opt_s-1));
- } else {
- print \$0;
- }
- }"
- IFS="$OIFS"
- ;;
-
-prop )
- ##
- ## prop -- Display progress with a running propeller
- ## Copyright (c) 1998-1999 Ralf S. Engelschall <rse@engelschall.com>
- ## Originally written for mod_ssl
- ##
-
- perl=''
- for dir in `echo $PATH | sed -e 's/:/ /g'` .; do
- if [ -f "$dir/perl" ]; then
- perl="$dir/perl"
- break
- fi
- done
- if [ ".$perl" != . ]; then
- # Perl is preferred because writing to STDERR in
- # Perl really writes immediately as one would expect
- $perl -e '
- @p = ("|","/","-","\\");
- $i = 0;
- while (<STDIN>) {
- printf(STDERR "\r%s...%s\b", $ARGV[0], $p[$i++]);
- $i = 0 if ($i > 3);
- }
- printf(STDERR "\r%s \n", $ARGV[0]);
- ' "$opt_p"
- else
- # But when Perl doesn't exists we use Awk even
- # some Awk's buffer even the /dev/stderr writing :-(
- awk '
- BEGIN {
- split("|#/#-#\\", p, "#");
- i = 1;
- }
- {
- printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr";
- if (i > 4) { i = 1; }
- }
- END {
- printf("\r%s \n", prefix) > "/dev/stderr";
- }
- ' "prefix=$opt_p"
- fi
- ;;
-
-move )
- ##
- ## move -- Move files with simultan substitution
- ## Copyright (c) 1999 Ralf S. Engelschall <rse@engelschall.com>
- ## Originally written for shtool
- ##
-
- src="$1"
- dst="$2"
-
- # consistency checks
- if [ ".$src" = . -o ".$dst" = . ]; then
- echo "$msgprefix:Error: Invalid arguments" 1>&2
- exit 1
- fi
- if [ ".$src" = ".$dst" ]; then
- echo "$msgprefix:Error: Source and destination files are the same" 1>&2
- exit 1
- fi
- expsrc="$src"
- if [ ".$opt_e" = .yes ]; then
- expsrc="`echo $expsrc`"
- fi
- if [ ".$opt_e" = .yes ]; then
- if [ ".`echo "$src" | sed -e 's;^.*\\*.*$;;'`" = ".$src" ]; then
- echo "$msgprefix:Error: Source doesn't contain wildcard ('*'): $dst" 1>&2
- exit 1
- fi
- if [ ".`echo "$dst" | sed -e 's;^.*%[1-9].*$;;'`" = ".$dst" ]; then
- echo "$msgprefix:Error: Destination doesn't contain substitution ('%N'): $dst" 1>&2
- exit 1
- fi
- if [ ".$expsrc" = ".$src" ]; then
- echo "$msgprefix:Error: Sources not found or no asterisk : $src" 1>&2
- exit 1
- fi
- else
- if [ ! -r "$src" ]; then
- echo "$msgprefix:Error: Source not found: $src" 1>&2
- exit 1
- fi
- fi
-
- # determine substitution patterns
- if [ ".$opt_e" = .yes ]; then
- srcpat=`echo "$src" | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 's;\\*;\\\\(.*\\\\);g'`
- dstpat=`echo "$dst" | sed -e 's;%\([1-9]\);\\\\\1;g'`
- fi
-
- # iterate over source(s)
- for onesrc in $expsrc; do
- if [ .$opt_e = .yes ]; then
- onedst=`echo $onesrc | sed -e "s;$srcpat;$dstpat;"`
- else
- onedst="$dst"
- fi
- errorstatus=0
- if [ ".$opt_v" = .yes ]; then
- echo "$onesrc -> $onedst"
- fi
- if [ ".$opt_p" = .yes ]; then
- if [ -r $onedst ]; then
- if cmp -s $onesrc $onedst; then
- if [ ".$opt_t" = .yes ]; then
- echo "rm -f $onesrc" 1>&2
- fi
- rm -f $onesrc || errorstatus=$?
- else
- if [ ".$opt_t" = .yes ]; then
- echo "mv -f $onesrc $onedst" 1>&2
- fi
- mv -f $onesrc $onedst || errorstatus=$?
- fi
- else
- if [ ".$opt_t" = .yes ]; then
- echo "mv -f $onesrc $onedst" 1>&2
- fi
- mv -f $onesrc $onedst || errorstatus=$?
- fi
- else
- if [ ".$opt_t" = .yes ]; then
- echo "mv -f $onesrc $onedst" 1>&2
- fi
- mv -f $onesrc $onedst || errorstatus=$?
- fi
- if [ $errorstatus -ne 0 ]; then
- break;
- fi
- done
- exit $errorstatus
- ;;
-
install )
##
## install -- Install a program, script or datafile
- ## Copyright (c) 1997-1999 Ralf S. Engelschall <rse@engelschall.com>
+ ## Copyright (c) 1997-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
##
@@ -1076,24 +689,24 @@ install )
mkdir )
##
## mkdir -- Make one or more directories
- ## Copyright (c) 1996-1999 Ralf S. Engelschall <rse@engelschall.com>
+ ## Copyright (c) 1996-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for public domain by Noah Friedman <friedman@prep.ai.mit.edu>
## Cleaned up and enhanced for shtool
##
errstatus=0
for p in ${1+"$@"}; do
- # when the directory already exists...
+ # if the directory already exists...
if [ -d "$p" ]; then
if [ ".$opt_f" = .no ]; then
- echo "$msgprefix:Error: file exists: $p" 1>&2
+ echo "$msgprefix:Error: directory already exists: $p" 1>&2
errstatus=1
break
else
continue
fi
fi
- # when the directory has to be created
+ # if the directory has to be created...
if [ ".$opt_p" = .no ]; then
if [ ".$opt_t" = .yes ]; then
echo "mkdir $p" 1>&2
@@ -1107,7 +720,7 @@ mkdir )
-e 's/\// /g' \
-e 's/^%/\//'`
shift
- pathcomp=
+ pathcomp=''
for d in ${1+"$@"}; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
@@ -1132,273 +745,21 @@ mkdir )
exit $errstatus
;;
-mkln )
- ##
- ## mkln -- Make link with calculation of relative paths
- ## Copyright (c) 1999 Ralf S. Engelschall <rse@engelschall.com>
- ## Originally written for shtool
- ##
-
- args=$?
- srcs=""
- while [ $# -gt 1 ]; do
- srcs="$srcs $1"
- shift
- done
- dst="$1"
- if [ ! -d $dst ]; then
- if [ $args -gt 2 ]; then
- echo "$msgprefix:Error: multiple sources not allowed when target isn't a directory" 1>&2
- exit 1
- fi
- fi
-
- # determine link options
- lnopt=""
- if [ ".$opt_f" = .yes ]; then
- lnopt="$lnopt -f"
- fi
- if [ ".$opt_s" = .yes ]; then
- lnopt="$lnopt -s"
- fi
-
- # iterate over sources
- for src in $srcs; do
- # determine if one of the paths is an absolute path,
- # because then we _have_ to use an absolute symlink
- oneisabs=0
- srcisabs=0
- dstisabs=0
- case $src in
- /* ) oneisabs=1; srcisabs=1 ;;
- esac
- case $dst in
- /* ) oneisabs=1; dstisabs=1 ;;
- esac
-
- # split source and destination into dir and base name
- if [ -d $src ]; then
- srcdir=`echo $src | sed -e 's;/*$;;'`
- srcbase=""
- else
- srcdir=`echo $src | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'`
- srcbase=`echo $src | sed -e 's;.*/\([^/]*\)$;\1;'`
- fi
- if [ -d $dst ]; then
- dstdir=`echo $dst | sed -e 's;/*$;;'`
- dstbase=""
- else
- dstdir=`echo $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'`
- dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'`
- fi
-
- # consistency check
- if [ ".$dstdir" != . ]; then
- if [ ! -d $dstdir ]; then
- echo "$msgprefix:Error: destination directory not found: $dstdir" 1>&2
- exit 1
- fi
- fi
-
- # make sure the source is reachable from the destination
- if [ $dstisabs = 1 ]; then
- if [ $srcisabs = 0 ]; then
- if [ -d $srcdir ]; then
- srcdir="`cd $srcdir; pwd | sed -e 's;/*$;;'`"
- srcisabs=1
- oneisabs=1
- fi
- fi
- fi
-
- # split away a common prefix
- prefix=""
- if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then
- prefix="$srcdir/"
- srcdir=""
- dstdir=""
- else
- while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do
- presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'`
- predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'`
- if [ ".$presrc" != ".$predst" ]; then
- break
- fi
- prefix="$prefix$presrc/"
- srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'`
- dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'`
- done
- fi
-
- # destination prefix is just the common prefix
- dstpre="$prefix"
-
- # determine source prefix which is the reverse directory
- # step-up corresponding to the destination directory
- srcpre=""
- if [ $oneisabs = 0 ] || [ ".$prefix" != . -a ".$prefix" != ./ ]; then
- pl="$dstdir/"
- OIFS="$IFS"; IFS='/'
- for pe in $pl; do
- [ ".$pe" = . ] && continue
- srcpre="../$srcpre"
- done
- IFS="$OIFS"
- else
- if [ $srcisabs = 1 ]; then
- srcpre="$prefix"
- fi
- fi
-
- # determine destination symlink name
- if [ ".$dstbase" = . ]; then
- if [ ".$srcbase" != . ]; then
- dstbase="$srcbase"
- else
- dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'`
- fi
- fi
-
- # now finalize source and destination directory paths
- srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'`
- dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'`
-
- # run the final link command
- if [ ".$opt_t" = .yes ]; then
- echo "ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase"
- fi
- eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase
- done
- ;;
-
-mkshadow )
- ##
- ## mkshadow -- Make a shadow tree
- ## Copyright (c) 1998-1999 Ralf S. Engelschall <rse@engelschall.com>
- ## Originally written for Apache
- ##
-
- # source and destination directory
- src=`echo "$1" | sed -e 's:/$::'`
- dst=`echo "$2" | sed -e 's:/$::'`
-
- # check whether source exists
- if [ ! -d $src ]; then
- echo "$msgprefix:Error: source directory not found: \`$src'" 1>&2
- exit 1
- fi
-
- # determine if one of the paths is an absolute path,
- # because then we have to use an absolute symlink
- oneisabs=0
- case $src in
- /* ) oneisabs=1 ;;
- esac
- case $dst in
- /* ) oneisabs=1 ;;
- esac
-
- # determine reverse directory for destination directory
- dstrevdir=''
- if [ $oneisabs = 0 ]; then
- # (inlined fp2rp)
- OIFS="$IFS"; IFS='/'
- for pe in $dst; do
- dstrevdir="../$dstrevdir"
- done
- IFS="$OIFS"
- else
- src="`cd $src; pwd`";
- fi
-
- # create directory tree at destination
- if [ ! -d $dst ]; then
- if [ ".$opt_t" = .yes ]; then
- echo "mkdir $dst" 1>&2
- fi
- mkdir $dst
- fi
- if [ ".$opt_a" = .yes ]; then
- DIRS=`cd $src; find . -type d -print |\
- sed -e '/^\.$/d' -e 's:^\./::'`
- else
- DIRS=`cd $src; find . -type d -print |\
- sed -e '/\/CVS/d' -e '/^\.$/d' -e 's:^\./::'`
- fi
- for dir in $DIRS; do
- if [ ".$opt_t" = .yes ]; then
- echo "mkdir $dst/$dir" 1>&2
- fi
- mkdir $dst/$dir
- done
-
- # fill directory tree with symlinks to files
- if [ ".$opt_a" = .yes ]; then
- FILES="`cd $src; find . -depth -print |\
- sed -e 's/^\.\///'`"
- else
- FILES="`cd $src; find . -depth -print |\
- sed -e '/\.o$/d' -e '/\.a$/d' -e '/\.so$/d' \
- -e '/\.cvsignore$/d' -e '/\/CVS/d' \
- -e '/\/\.#/d' -e '/\.orig$/d' \
- -e 's/^\.\///'`"
- fi
- for file in $FILES; do
- # don't use `-type f' above for find because of symlinks
- if [ -d "$src/$file" ]; then
- continue
- fi
- basename=`echo $file | sed -e 's:^.*/::'`
- dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'`
- from=`echo "$src/$file" | sed -e 's/^\.\///'`
- to="$dst/$dir$basename"
- if [ $oneisabs = 0 ]; then
- if [ ".$dir" != . ]; then
- subdir=`echo $dir | sed -e 's:/$::'`
- # (inlined fp2rp)
- revdir=''
- OIFS="$IFS"; IFS='/'
- for pe in $subdir; do
- revdir="../$revdir"
- done
- IFS="$OIFS"
- # finalize from
- from="$revdir$from"
- fi
- from="$dstrevdir$from"
- fi
- if [ ".$opt_v" = .yes ]; then
- echo " $to" 1>&2
- fi
- if [ ".$opt_t" = .yes ]; then
- echo "ln -s $from $to" 1>&2
- fi
- ln -s $from $to
- done
- ;;
-
fixperm )
##
## fixperm -- Fix file permissions inside a source tree
- ## Copyright (c) 1996-1999 Ralf S. Engelschall <rse@engelschall.com>
+ ## Copyright (c) 1996-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for ePerl
##
paths="$*"
# check whether the test command supports the -x option
- cat >$tmpfile <<EOT
-if [ -x / ] || [ -x /bin ] || [ -x /bin/ls ]; then
- exit 0
-fi
-exit 1
-EOT
- if sh $tmpfile 2>/dev/null; then
+ if [ -x /bin/sh ] 2>/dev/null; then
minusx="-x"
else
minusx="-r"
fi
- rm -f $tmpfile
# iterate over paths
for p in $paths; do
@@ -1443,25 +804,18 @@ EOT
tarball )
##
## tarball -- Roll distribution tarballs
- ## Copyright (c) 1999 Ralf S. Engelschall <rse@engelschall.com>
+ ## Copyright (c) 1999-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
##
srcs="$*"
# check whether the test command supports the -x option
- cat >$tmpfile <<EOT
-if [ -x / ] || [ -x /bin ] || [ -x /bin/ls ]; then
- exit 0
-fi
-exit 1
-EOT
- if sh $tmpfile 2>/dev/null; then
+ if [ -x /bin/sh ] 2>/dev/null; then
minusx="-x"
else
minusx="-r"
fi
- rm -f $tmpfile
# find the tools
paths="`echo $PATH |\
@@ -1579,14 +933,14 @@ EOT
echo "chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1" 2>&1
fi
chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1 ||\
- echo "$msgprefix:Warning: cannot set user name \`$opt_u' (need root priviledges)"
+ echo "$msgprefix:Warning: cannot set user name \`$opt_u' (would require root priviledges)"
fi
if [ ".$opt_g" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1" 2>&1
fi
chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1 ||\
- echo "$msgprefix:Warning: cannot set group name \`$opt_g' (need root priviledges)"
+ echo "$msgprefix:Warning: cannot set group name \`$opt_g' (would require root priviledges)"
fi
if [ ".$opt_t" = .yes ]; then
echo "(cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) | cat $compress >$tmpfile.out" 1>&2
@@ -1610,697 +964,10 @@ EOT
rm -f $tmpfile.lst $tmpfile.out
;;
-guessos )
- ##
- ## guessos -- Simple OS/platform guesser
- ## Copyright (c) 1996-2000 The Apache Group, http://www.apache.org/
- ## The Apache license applies (see http://www.apache.org/docs/LICENSE)
- ## Originally written for Apache
- ##
-
- MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
- RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
- SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown"
- VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
-
- XREL=`(uname -X) 2>/dev/null | grep "^Release" | awk '{print $3}'`
- if [ "x$XREL" != "x" ]; then
- if [ -f /etc/kconfig ]; then
- case "$XREL" in
- 4.0|4.1) echo "${MACHINE}-whatever-isc4"; exit 0 ;;
- esac
- else
- case "$XREL" in
- 3.2v4.2)
- echo "whatever-whatever-sco3"; exit 0
- ;;
- 3.2v5.0*)
- echo "whatever-whatever-sco5"; exit 0
- ;;
- 4.2MP)
- if [ "x$VERSION" = "x2.1.1" ]; then
- echo "${MACHINE}-whatever-unixware211"; exit 0
- elif [ "x$VERSION" = "x2.1.2" ]; then
- echo "${MACHINE}-whatever-unixware212"; exit 0
- else
- echo "${MACHINE}-whatever-unixware2"; exit 0
- fi
- ;;
- 4.2)
- echo "whatever-whatever-unixware1"; exit 0
- ;;
- 5)
- case "$VERSION" in
- 7*) echo "${MACHINE}-whatever-unixware7"; exit 0 ;;
- esac
- ;;
- esac
- fi
- fi
- case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
- MiNT:*)
- echo "m68k-atari-mint"; exit 0
- ;;
- A/UX:*)
- echo "m68k-apple-aux3"; exit 0
- ;;
- AIX:*)
- MACH=`echo $MACHINE | sed -e 's;[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F];;'`
- echo "${MACH}-ibm-aix${VERSION}.${RELEASE}"; exit 0
- ;;
- dgux:*)
- echo "${MACHINE}-dg-dgux"; exit 0
- ;;
- HI-UX:*)
- echo "${MACHINE}-hi-hiux"; exit 0
- ;;
- HP-UX:*)
- HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo "${MACHINE}-hp-hpux${HPUXVER}"; exit 0
- ;;
- IRIX:*)
- if [ -f /usr/lib32/mips4/libm.so ]; then
- echo "${MACHINE}/32-sgi-irix${RELEASE}"; exit 0
- else
- echo "${MACHINE}-sgi-irix${RELEASE}"; exit 0
- fi
- ;;
- IRIX64:*)
- echo "${MACHINE}/64-sgi-irix${RELEASE}"; exit 0
- ;;
- Linux:*)
- V='whatever'
- case "$MACHINE" in
- i?86) V='pc' ;;
- esac
- R=''
- case "$RELEASE" in
- [1-9].*) R=`echo $RELEASE | cut -c1` ;;
- esac
- echo "${MACHINE}-${V}-linux-gnu${R}"; exit 0
- ;;
- LynxOS:*)
- echo "${MACHINE}-lynx-lynxos"; exit 0
- ;;
- BSD/386|BSD/OS:3.*)
- echo "${MACHINE}-whatever-bsdi3"; exit 0
- ;;
- BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*)
- echo "i486-whatever-bsdi"; exit 0
- ;;
- BSD/386:*|BSD/OS:*)
- echo "${MACHINE}-whatever-bsdi"; exit 0
- ;;
- FreeBSD:*)
- VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'`
- MACH=`/sbin/sysctl -n hw.model`
- ARCH='whatever'
- case ${MACH} in
- *386* ) MACH="i386" ;;
- *486* ) MACH="i486" ;;
- Pentium\ II*) MACH="i686" ;;
- Pentium* ) MACH="i586" ;;
- Alpha* ) MACH="alpha" ;;
- * ) MACH="$MACHINE" ;;
- esac
- case ${MACH} in
- i[0-9]86 ) ARCH="pc" ;;
- esac
- echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0
- ;;
- NetBSD:*:*:*486*)
- echo "i486-whatever-netbsd${RELEASE}"; exit 0
- ;;
- NetBSD:*)
- echo "${MACHINE}-whatever-netbsd${RELEASE}"; exit 0
- ;;
- OpenBSD:*)
- echo "${MACHINE}-whatever-openbsd"; exit 0
- ;;
- OSF1:*:*:*alpha*)
- VERS=`echo $RELEASE | sed -e 's;^V;;'`
- echo "${MACHINE}-dec-osf${VERS}"; exit 0
- ;;
- QNX:*)
- if [ "$VERSION" -gt 422 ]; then
- echo "${MACHINE}-qssl-qnx32"
- else
- echo "${MACHINE}-qssl-qnx"
- fi
- exit 0
- ;;
- Paragon*:*:*:*)
- echo "i860-intel-osf1"; exit 0
- ;;
- SunOS:5.*)
- VERSION=`echo $RELEASE | sed -e 's;^5\.;;'`
- echo "${MACHINE}-sun-solaris2.${VERSION}"; exit 0
- ;;
- SunOS:*)
- echo "${MACHINE}-sun-sunos4"; exit 0
- ;;
- UNIX_System_V:4.*:*)
- echo "${MACHINE}-whatever-sysv4"; exit 0
- ;;
- unix:3.0.9*:*:88k)
- echo "${MACHINE}-encore-sysv4"; exit 0
- ;;
- *:4*:R4*:m88k)
- echo "${MACHINE}-whatever-sysv4"; exit 0
- ;;
- UnixWare:5:99*:*)
- # Gemini, beta release of next rev of unixware
- echo "${MACHINE}-whatever-unixware212"; exit 0
- ;;
- DYNIX/ptx:4*:*)
- echo "${MACHINE}-whatever-sysv4"; exit 0
- ;;
- *:4.0:3.0:[345][0-9]?? | *:4.0:3.0:3[34]??[/,]* | library:*)
- echo "x86-ncr-sysv4"; exit 0
- ;;
- ULTRIX:*)
- echo "${MACHINE}-unknown-ultrix"; exit 0
- ;;
- SINIX-?:* | ReliantUNIX-?:*)
- echo "${MACHINE}-siemens-sysv4"; exit 0
- ;;
- POSIX*BS2000)
- echo "${MACHINE}-siemens-sysv4"; exit 0
- ;;
- machten:*)
- echo "${MACHINE}-tenon-${SYSTEM}"; exit 0;
- ;;
- ConvexOS:*:11.*:*)
- echo "${MACHINE}-v11-${SYSTEM}"; exit 0;
- ;;
- UNIX_SV:*:*:maxion)
- echo "${MACHINE}-ccur-sysv4"; exit 0;
- ;;
- PowerMAX_OS:*:*:Night_Hawk)
- MACHINE=`uname -p`
- echo "${MACHINE}-concurrent-powermax"; exit 0;
- ;;
- UNIX_SV:*)
- if [ -d /usr/nec ];then
- echo "mips-nec-sysv4"; exit 0;
- fi
- ;;
- NonStop-UX:4.[02]*:[BC]*:*)
- echo "${MACHINE}-tandem-sysv4"; exit 0;
- ;;
- Rhapsody:*:*:*)
- case "${MACHINE}" in
- "Power Macintosh") MACHINE=powerpc ;;
- esac
- echo "${MACHINE}-apple-rhapsody${RELEASE}"; exit 0
- ;;
- "Mac OS":*:*:*)
- MACHINE=`uname -p`
- echo "${MACHINE}-apple-macos${RELEASE}"; exit 0
- ;;
- "RISC iX":*)
- echo "arm-whatever-riscix"; exit 0;
- ;;
- *:4.0:2:*)
- echo "whatever-unisys-sysv4"; exit 0;
- ;;
- *:*:dcosx:NILE*)
- echo "pyramid-pyramid-svr4"; exit 0;
- ;;
- *:*:*:"DRS 6000")
- echo "drs6000-whatever-whatever"; exit 0;
- ;;
- AmigaOS:*:*:* )
- echo "${MACHINE}-whatever-${SYSTEM}${RELEASE}"; exit 0
- ;;
- esac
-
- # Now NeXT
- ISNEXT=`(hostinfo) 2>/dev/null`
- case "$ISNEXT" in
- *NeXT*)
- # Swiped from a friendly uname clone for NEXT/OPEN Step.
- NEXTOSVER="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`"
- if [ "$NEXTOSVER" -gt 3.3 ]; then
- NEXTOS="openstep"
- else
- NEXTOS="nextstep"
- fi
- NEXTREL="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`"
- NEXTARCH=`arch`
- echo "${NEXTARCH}-next-${NEXTOS}${NEXTREL}" ; exit 0
- ;;
- esac
-
- # Fallback
- echo "${MACHINE}-whatever-${SYSTEM}/${RELEASE}/${VERSION}"
- ;;
-
-arx )
- ##
- ## arx -- Extended archive command
- ## Copyright (c) 1999 Ralf S. Engelschall <rse@engelschall.com>
- ## Originally written for shtool
- ##
-
- ar_prg="$opt_C"
- ar_cmd="$1"; shift
- archive="$1"; shift
- files="$*"
-
- # walk through the file list and expand archives members
- tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'`
- nfiles=''
- if [ ".$files" != . ]; then
- for file in $files; do
- if [ ! -f $file ]; then
- echo "$msgprefix:Error: input file not found: $file" 1>&2
- exit 1
- fi
- case $file in
- *.a )
- if [ ! -d $tmpdir ]; then
- if [ ".$opt_t" = .yes ]; then
- echo "mkdir $tmpdir" 1>&2
- fi
- mkdir $tmpdir
- fi
- case $tmpdir in
- .arx )
- from="../$file"
- ;;
- * )
- dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'`
- base=`echo $file | sed -e 's;.*/\([^/]*\)$;\1;'`
- from="`cd $dir; pwd`/$base"
- ;;
- esac
- if [ ".$opt_t" = .yes ]; then
- echo "(cd $tmpdir && $ar_prg x $from)" 1>&2
- fi
- (cd $tmpdir && eval $ar_prg x $from)
- if [ $? -ne 0 ]; then
- echo "$msgprefix:Error: member extraction failed for archive: $file" 1>&2
- exit 1
- fi
- for member in - `eval $ar_prg t $file`; do
- [ ".$member" = .- ] && continue
- nfiles="$nfiles $tmpdir/$member"
- done
- ;;
- * )
- nfiles="$nfiles $file"
- ;;
- esac
- done
- fi
-
- # run the final archive command
- if [ ".$opt_t" = .yes ]; then
- echo "$ar_prg $ar_cmd $archive $nfiles" 1>&2
- fi
- eval $ar_prg $ar_cmd $archive $nfiles
- if [ $? -ne 0 ]; then
- echo "$msgprefix:Error: archive command failed" 1>&2
- exit $?
- fi
-
- # cleanup and die gracefully
- if [ -d $tmpdir ]; then
- if [ ".$opt_t" = .yes ]; then
- echo "rm -rf $tmpdir" 1>&2
- fi
- rm -rf $tmpdir
- fi
- ;;
-
-slo )
- ##
- ## slo -- Separate linker options by library class
- ## Copyright (c) 1998-1999 Ralf S. Engelschall <rse@engelschall.com>
- ## Originally written for Apache
- ##
-
- DIFS="$IFS"
-
- # parse out -L and -l options from command line
- DIRS=''
- LIBS=''
- ARGV=''
- optprev=''
- for opt
- do
- # concatenate with previous option if exists
- if [ ".$optprev" != . ]; then
- opt="${optprev}${opt}";
- optprev=''
- fi
- # remember options for arg when used stand-alone
- if [ ".$opt" = ".-L" -o ".$opt" = ".-l" ]; then
- optprev="$opt"
- continue;
- fi
- # split argument into option plus option argument
- arg="`echo $opt | cut -c3-`"
- opt="`echo $opt | cut -c1-2`"
- # store into containers
- case $opt in
- -L) DIRS="$DIRS:$arg" ;;
- -l) LIBS="$LIBS:$arg" ;;
- *) ARGV="$ARGV $opt" ;;
- esac
- done
-
- # set linker default directories
- DIRS_DEFAULT='/lib:/usr/lib'
- if [ ".$LD_LIBRARY_PATH" != . ]; then
- DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH"
- fi
-
- # sort options by class
- DIRS_OBJ=''
- LIBS_OBJ=''
- DIRS_PIC=''
- LIBS_PIC=''
- DIRS_DSO=''
- LIBS_DSO=''
-
- # for each library...
- OIFS="$IFS" IFS=':'
- for lib in $LIBS; do
- [ ".$lib" = . ] && continue
-
- found='no'
- found_indefdir='no'
- found_type=''
- found_dir=''
-
- # for each directory...
- OIFS2="$IFS" IFS=":$DIFS"
- for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do
- [ ".$dir" = . ] && continue
- [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes
- [ ! -d $dir ] && continue
-
- # search the file
- OIFS3="$IFS" IFS="$DIFS"
- for file in '' `cd $dir && ls lib${lib}.* 2>/dev/null`; do
- [ ".$file" = . ] && continue
- case $file in
- *.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* )
- found=yes;
- found_type=DSO;
- break
- ;;
- *.lo|*.la )
- found=yes;
- found_type=PIC
- ;;
- *.a )
- if [ ".$found_type" = . ]; then
- found=yes
- found_type=OBJ
- fi
- ;;
- esac
- done
- IFS="$OIFS3"
- if [ ".$found" = .yes ]; then
- found_dir="$dir"
- break
- fi
- done
- IFS="$OIFS2"
-
- if [ ".$found" = .yes ]; then
- if [ ".$found_indefdir" != .yes ]; then
- eval "dirlist=\"\${DIRS_${found_type}}:\""
- if [ ".`echo \"$dirlist\" | fgrep :$found_dir:`" = . ]; then
- eval "DIRS_${found_type}=\"\$DIRS_${found_type}:${found_dir}\""
- fi
- eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\""
- else
- eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\""
- fi
- else
- LIBS_OBJ="$LIBS_OBJ:$lib"
- #dirlist="`echo $DIRS $DIRS_DEFAULT | sed -e 's/:/ /g'`"
- #echo "slo:Warning: library \"$lib\" not found in any of the following dirs:" 2>&1
- #echo "slo:Warning: $dirlist" 1>&1
- fi
- done
- IFS="$OIFS"
-
- # also pass-through unused dirs even if it's useless
- OIFS="$IFS" IFS=':'
- for dir in $DIRS; do
- dirlist="${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:"
- if [ ".`echo \"$dirlist\" | fgrep :$dir:`" = . ]; then
- DIRS_OBJ="$DIRS_OBJ:$dir"
- fi
- done
- IFS="$OIFS"
-
- # reassemble the options but separated by type
- for type in OBJ PIC DSO; do
- OIFS="$IFS" IFS=':'
- eval "libs=\"\$LIBS_${type}\""
- opts=''
- for lib in $libs; do
- [ ".$lib" = . ] && continue
- opts="$opts -l$lib"
- done
- eval "LIBS_${type}=\"$opts\""
-
- eval "dirs=\"\$DIRS_${type}\""
- opts=''
- for dir in $dirs; do
- [ ".$dir" = . ] && continue
- opts="$opts -L$dir"
- done
- eval "DIRS_${type}=\"$opts\""
- IFS="$OIFS"
- done
-
- # give back results
- for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do
- eval "val=\"\$${var}\""
- val="`echo $val | sed -e 's/^ *//'`"
- echo "SLO_${var}=\"${val}\""
- done
- ;;
-
-scpp )
- ##
- ## scpp -- Sharing C Pre-Processor
- ## Copyright (c) 1999 Ralf S. Engelschall <rse@engelschall.com>
- ## Originally written for GNU pth
- ##
-
- srcs="$*"
- output="${opt_o}.n"
-
- # find a reasonable Awk
- awk=''
- paths=`echo $PATH |\
- sed -e 's%/*:%:%g' -e 's%/$%%' \
- -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \
- -e 's/:/ /g'`
- for name in gawk nawk awk; do
- for path in $paths; do
- if [ -r "$path/$name" ]; then
- awk="$path/$name"
- break
- fi
- done
- if [ ".$awk" != . ]; then
- break
- fi
- done
- if [ ".$awk" = . ]; then
- echo "$msgprefix:Error: cannot find a reasonable Awk" 1>&2
- exit 1
- fi
-
- # parse source file(s)
- if [ ".$opt_v" = .yes ]; then
- echo "Parsing:" | $awk '{ printf("%s", $0); }' 1>&2
- fi
- for src in $srcs; do
- if [ ".$opt_v" = .yes ]; then
- echo $src | $awk '{ printf(" %s", $0); }' 1>&2
- fi
- $awk <$src '
- BEGIN {
- ln = 0;
- fln = 0;
- level = 0;
- mode = "";
- store = "";
- }
- {
- ln++;
- }
- /^#if.*/ {
- level++;
- }
- /^#if [a-zA-Z_][a-zA-Z0-9_]* *$/ {
- if ($2 == define) {
- mode = "D";
- printf("D:#line %d \"%s\"\n", ln, src);
- next;
- }
- }
- /^#endif.*/ {
- level--;
- if (mode == "D" && level == 0) {
- mode = "";
- next;
- }
- }
- /^[a-zA-Z_][a-zA-Z0-9_].*;.*/ {
- if ($1 == class) {
- printf("V:#line %d \"%s\"\n", ln, src);
- printf("V:%s\n", $0);
- printf("J:%s\n", $0);
- next;
- }
- }
- /^[a-zA-Z_][a-zA-Z0-9_].*=.*/ {
- if ($1 == class) {
- printf("V:#line %d \"%s\"\n", ln, src);
- printf("V:%s\n", $0);
- printf("J:%s\n", $0);
- next;
- }
- }
- /^[a-zA-Z_][a-zA-Z0-9_]*/ {
- if ($1 == class) {
- fln = ln;
- store = $0;
- mode = "F";
- next;
- }
- }
- /^\{ *$/ {
- if (mode == "F") {
- printf("F:#line %d \"%s\"\n", fln, src);
- printf("F:%s;\n", store);
- printf("I:%s;\n", store);
- store = "";
- mode = "";
- next;
- }
- }
- {
- if (mode == "D")
- printf("D:%s\n", $0);
- else if (mode == "F")
- store = store " " $0;
- }
- ' "src=$src" "define=$opt_D" "class=$opt_C" >>$tmpfile
- done
- if [ ".$opt_v" = .yes ]; then
- echo "" 1>&2
- fi
-
- # start generating output header
- echo "/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */" >$output
- echo "#line 1 \"$opt_t\"" >>$output
- sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd' |\
- sed -e "/^${opt_M} *\$/d" >>$output
-
- # merge in the define blocks
- grep '^D:' $tmpfile | sed -e 's/^D://' >>$output
-
- # generate standard prolog
- echo "#line 1 \"_ON_THE_FLY_\"" >>$output
- echo "" >>$output
- echo "/* make sure the scpp source extensions are skipped */" >>$output
- echo "#define $opt_D 0" >>$output
- echo "#define $opt_C /**/" >>$output
-
- # generate namespace hiding for variables
- echo "" >>$output
- echo "/* move intern variables to hidden namespace */" >>$output
- grep '^J:' $tmpfile | sed >>$output \
- -e 's/^J://' \
- -e 's/ */ /g' \
- -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\];.*$/#define \1 __\1/' \
- -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \
- -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \
- -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/'
-
- # generate namespace hiding for functions
- echo "" >>$output
- echo "/* move intern functions to hidden namespace */" >>$output
- grep '^I:' $tmpfile | sed >>$output \
- -e 's/^I://' \
- -e 's/\([ (]\) */\1/g' \
- -e 's/ *\([),]\)/\1/g' \
- -e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/'
-
- # generate prototypes for variables
- echo "" >>$output
- echo "/* prototypes for intern variables */" >>$output
- grep '^V:' $tmpfile | sed >>$output \
- -e 's/^V://' \
- -e 's/ */ /g' \
- -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\);.*$/\1;/' \
- -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\) =.*$/\1;/' \
- -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\);.*$/\1;/' \
- -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \
- -e 's/ ;/;/g' \
- -e "s/^$opt_C /extern /"
-
- # generate prototypes for functions
- echo "" >>$output
- echo "/* prototypes for intern functions */" >>$output
- grep '^F:' $tmpfile | sed >>$output \
- -e 's/^F://' \
- -e 's/\([ (]\) */\1/g' \
- -e 's/ *\([),]\)/\1/g' \
- -e 's/\([* ]\)[a-zA-Z0-9_]*,/\1,/g' \
- -e 's/\([* ]\)[a-zA-Z0-9_]*);/\1);/g' \
- -e 's/(\*[a-zA-Z0-9_]*)(/(*)(/g' \
- -e 's/\([ (]\) */\1/g' \
- -e 's/ *\([),]\)/\1/g' \
- -e "s/^$opt_C /extern /"
-
- # finish generating output header
- n=`(echo ''; sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd') |\
- wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'`
- echo "#line $n \"$opt_t\"" >>$output
- sed <$opt_t -e "/^${opt_M} *\$/,\$p" -e 'd' |\
- sed -e "/^${opt_M} *\$/d" >>$output
-
- # create final output file
- if [ -f $opt_o ]; then
- if [ ".$opt_p" = .yes ]; then
- grep -v '^#line' $opt_o >$tmpfile.o
- grep -v '^#line' $output >$tmpfile.n
- out_old="$tmpfile.o"
- out_new="$tmpfile.n"
- else
- out_old="$opt_o"
- out_new="$output"
- fi
- if cmp -s $out_old $out_new; then
- :
- else
- cp $output $opt_o
- fi
- else
- cp $output $opt_o
- fi
- rm -f $output
- rm -f $tmpfile $tmpfile.* >/dev/null 2>&1
- ;;
-
version )
##
## version -- Generate and maintain a version information file
- ## Copyright (c) 1994-1999 Ralf S. Engelschall <rse@engelschall.com>
+ ## Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for ePerl
##
@@ -2493,7 +1160,7 @@ EOT
cat >$tmpfile <<'EOT'
/*
** @FILE@ -- Version Information
-** [automatically generated and maintained by shtool]
+** [automatically generated and maintained by GNU shtool]
*/
#ifdef _AS_HEADER
@@ -2518,7 +1185,7 @@ const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@
const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)";
const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@";
const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)";
-const char @PREFIX@_RCSIdentID[] = "$Id: shtool,v 1.4 2000/03/31 08:36:19 fielding Exp $";
+const char @PREFIX@_RCSIdentID[] = "$Id: shtool,v 1.5 2000/05/03 17:15:49 rbb Exp $";
const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@";
const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@";
@@ -2529,7 +1196,7 @@ EOT
cat >$tmpfile <<'EOT'
##
## @FILE@ -- Version Information
-## [automatically generated and maintained by shtool]
+## [automatically generated and maintained by GNU shtool]
##
$@PREFIX@_Version = 0x@HEX@;
@@ -2537,7 +1204,7 @@ $@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YE
$@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)";
$@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@";
$@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)";
-$@PREFIX@_RCSIdentID = "\$Id: shtool,v 1.4 2000/03/31 08:36:19 fielding Exp $/";
+$@PREFIX@_RCSIdentID = "\$Id: shtool,v 1.5 2000/05/03 17:15:49 rbb Exp $/";
$@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@";
$@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@";
@@ -2565,155 +1232,6 @@ EOT
exit 0
;;
-path )
- ##
- ## path -- Deal with program paths
- ## Copyright (c) 1998-1999 Ralf S. Engelschall <rse@engelschall.com>
- ## Originally written for Apache
- ##
-
- namelist="$*"
-
- # check whether the test command supports the -x option
- cat >$tmpfile <<EOT
-if [ -x / ] || [ -x /bin ] || [ -x /bin/ls ]; then
- exit 0
-fi
-exit 1
-EOT
- if sh $tmpfile 2>/dev/null; then
- minusx="-x"
- else
- minusx="-r"
- fi
- rm -f $tmpfile
-
- # split path string
- paths="`echo $opt_p |\
- sed -e 's/^:/.:/' \
- -e 's/::/:.:/g' \
- -e 's/:$/:./' \
- -e 's/:/ /g'`"
-
- # SPECIAL REQUEST
- # translate forward to reverse path
- if [ ".$opt_r" = .yes ]; then
- if [ "x$namelist" = "x." ]; then
- rp='.'
- else
- rp=''
- for pe in `IFS="$IFS/"; echo $namelist`; do
- rp="../$rp"
- done
- fi
- echo $rp | sed -e 's:/$::'
- exit 0
- fi
-
- # SPECIAL REQUEST
- # strip out directory or base name
- if [ ".$opt_d" = .yes ]; then
- echo "$namelist" |\
- sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'
- exit 0
- fi
- if [ ".$opt_b" = .yes ]; then
- echo "$namelist" |\
- sed -e 's;.*/\([^/]*\)$;\1;'
- exit 0
- fi
-
- # MAGIC SITUATION
- # Perl Interpreter (perl)
- if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then
- rm -f $tmpfile
- touch $tmpfile
- c=0
- found=0
- for dir in $paths; do
- dir=`echo $dir | sed -e 's;/*$;;'`
- for perl in perl5 perl miniperl; do
- if [ $minusx "$dir/$perl" ] && [ ! -d "$dir/$perl" ]; then
- perl="$dir/$perl"
- version=`$perl -v | grep version |\
- sed -e 's/.* version //' -e 's/ built.*//' -e 's/ with.*//'`
- versionnum="`echo $version | sed -e 's/\.//g' -e 's/_//g'`"
- versionnum=`expr $versionnum - $c`
- echo "$versionnum $perl" >>$tmpfile
- found=1
- fi
- done
- c=`expr $c + 1`
- done
- if [ $found = 1 ]; then
- perl="`cat $tmpfile | sort -u | tail -1 | cut '-d ' -f2`"
- rm -f $tmpfile
- echo "$perl"
- exit 0
- fi
- exit 1
- fi
-
- # MAGIC SITUATION
- # C pre-processor (cpp)
- if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then
- cat >$tmpfile.c <<EOT
-#include <assert.h>
- Syntax Error
-EOT
- # 1. try the standard cc -E approach
- cpp="${CC-cc} -E"
- (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out
- my_error=`grep -v '^ *+' $tmpfile.out`
- if [ ".$my_error" != . ]; then
- # 2. try the cc -E approach and GCC's -traditional-ccp option
- cpp="${CC-cc} -E -traditional-cpp"
- (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out
- my_error=`grep -v '^ *+' $tmpfile.out`
- if [ ".$my_error" != . ]; then
- # 3. try a standalone cpp command in path and lib dirs
- for path in $paths /lib /usr/lib /usr/local/lib; do
- path=`echo $path | sed -e 's;/*$;;'`
- if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then
- cpp="$path/cpp"
- break
- fi
- done
- if [ ".$cpp" != . ]; then
- (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out
- my_error=`grep -v '^ *+' $tmpfile.out`
- if [ ".$my_error" != . ]; then
- # ok, we gave up...
- cpp=''
- fi
- fi
- fi
- fi
- rm -f $tmpfile.c $tmpfile.out
- if [ ".$cpp" != . ]; then
- echo "$cpp"
- exit 0
- fi
- exit 1
- fi
-
- # STANDARD SITUATION
- # iterate over names
- for name in $namelist; do
- # iterate over paths
- for path in $paths; do
- path=`echo $path | sed -e 's;/*$;;'`
- if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then
- if [ ".$opt_s" != .yes ]; then
- echo "$path/$name" 2>&1
- fi
- exit 0
- fi
- done
- done
- exit 1
- ;;
-
esac
exit 0