aboutsummaryrefslogtreecommitdiffstats
path: root/lang/sml-nj-devel
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>1998-11-20 16:14:12 +0800
committerjkoshy <jkoshy@FreeBSD.org>1998-11-20 16:14:12 +0800
commit09d39318f1fad51d34ce86d7a7eb9319e358d343 (patch)
treef83f8330e432bcbef44ef98313400fe63efc1e17 /lang/sml-nj-devel
parenta59840e991eace598ae3abf8da99a3532f7ddd93 (diff)
downloadfreebsd-ports-gnome-09d39318f1fad51d34ce86d7a7eb9319e358d343.tar.gz
freebsd-ports-gnome-09d39318f1fad51d34ce86d7a7eb9319e358d343.tar.zst
freebsd-ports-gnome-09d39318f1fad51d34ce86d7a7eb9319e358d343.zip
Upgrade to v110.9.1. Unbreak.
Diffstat (limited to 'lang/sml-nj-devel')
-rw-r--r--lang/sml-nj-devel/Makefile63
-rw-r--r--lang/sml-nj-devel/distinfo24
-rw-r--r--lang/sml-nj-devel/pkg-comment2
-rw-r--r--lang/sml-nj-devel/pkg-descr5
-rw-r--r--lang/sml-nj-devel/pkg-plist153
-rw-r--r--lang/sml-nj-devel/scripts/get-cm81
6 files changed, 281 insertions, 47 deletions
diff --git a/lang/sml-nj-devel/Makefile b/lang/sml-nj-devel/Makefile
index 9a20dc500de8..0c88dcaec814 100644
--- a/lang/sml-nj-devel/Makefile
+++ b/lang/sml-nj-devel/Makefile
@@ -3,53 +3,70 @@
# Date created: 7 July 1998
# Whom: jkoshy
#
-# $Id: Makefile,v 1.1.1.1 1998/07/15 10:05:42 jkoshy Exp $
+# $Id: Makefile,v 1.2 1998/07/20 07:56:58 jkoshy Exp $
#
-DISTNAME= 110-bin.x86-unix
-PKGNAME= smlnj-110
+DISTNAME= 110.9.1-bin.x86-unix
+PKGNAME= smlnj-110.9.1
CATEGORIES= lang
-MASTER_SITES= ftp://ftp.research.bell-labs.com/dist/smlnj/release/110/ \
- ftp://rodin.stanford.edu/pub/smlnj/release/110/ \
- ftp://flint.cs.yale.edu/pub/smlnj/release/110/ \
- ftp://ftp.diku.dk/pub/smlnj/release/110/ \
- ftp://ftp.cl.cam.ac.uk/MIRRORED/smlnj/release/110/ \
- ftp://sunsite.doc.ic.ac.uk/computing/programming/languages/ml/smlnj/release/110/ \
- ftp://ftp.ntua.gr/pub/lang/smlnj/release/110/ \
- ftp://compiler.kaist.ac.kr/pub/sml/release/110/
-DISTFILES= 110-bin.x86-unix.tar.Z 110-cm.tar.Z 110-cml.tar.Z \
- 110-config.tar.Z 110-eXene.tar.Z \
- 110-ml-burg.tar.Z 110-ml-lex.tar.Z 110-ml-yacc.tar.Z \
- 110-runtime.tar.Z 110-sml-nj.tar.Z 110-smlnj-c.tar.Z \
- 110-smlnj-lib.tar.Z
+MASTER_SITES= ftp://ftp.research.bell-labs.com/dist/smlnj/working/110.9.1/ \
+ ftp://rodin.stanford.edu/pub/smlnj/working/110.9.1/ \
+ ftp://flint.cs.yale.edu/pub/smlnj/working/110.9.1/ \
+ ftp://ftp.diku.dk/pub/smlnj/working/110.9.1/ \
+ ftp://ftp.cl.cam.ac.uk/MIRRORED/smlnj/working/110.9.1/ \
+ ftp://sunsite.doc.ic.ac.uk/computing/programming/languages/ml/smlnj/working/110.9.1/ \
+ ftp://ftp.ntua.gr/pub/lang/smlnj/working/110.9.1/ \
+ ftp://compiler.kaist.ac.kr/pub/sml/working/110.9.1/
+DISTFILES= 110.9.1-bin.x86-unix.tar.Z 110.9.1-cm.tar.Z 110.9.1-cml.tar.Z \
+ 110.9.1-config.tar.Z 110.9.1-eXene.tar.Z \
+ 110.9.1-ml-burg.tar.Z 110.9.1-ml-lex.tar.Z 110.9.1-ml-yacc.tar.Z \
+ 110.9.1-runtime.tar.Z 110.9.1-smlnj-c.tar.Z \
+ 110.9.1-smlnj-lib.tar.Z
MAINTAINER= jkoshy@freebsd.org
DIST_SUBDIR= sml-nj
NO_WRKSUBDIR= yes
-EXTRACT_ONLY= 110-config.tar.Z
+EXTRACT_ONLY= 110.9.1-config.tar.Z
USE_GMAKE= yes
SML_BASE= ${PREFIX}/lib/sml-nj
SML_LIBDIR= ${SML_BASE}/lib
SML_BINDIR= ${SML_BASE}/bin
SML_SRCDIR= ${SML_BASE}/src
-SML_EXES= ml-burg ml-lex ml-yacc sml sml-cm
+SML_EXES= ml-burg ml-lex ml-yacc sml
-BROKEN= Need to install documentation and library sources.
+# make symlinks to the dist files
+post-extract:
+ cd ${WRKDIR} && ${LN} -sf ${_DISTDIR}/* .
# The build target needs to run $WRKDIR/config/install.sh
do-build:
- cd ${WRKDIR} && ./config/install.sh
+ cd ${WRKDIR} && unset PWD && ./config/install.sh
+# install target
+# 1. create installation directories
+# 2. copy the ./bin directory across
+# 3. edit bin/.run_sml to override BIN_DIR
+# 4. copy all .stable files in CM/ directories
+# 5. find all .cm files reachable from $WRKDIR/lib and copy them across
+# 6. copy the aliases in ./lib changing WRKDIR to SML_LIBDIR
+# 7. install links to executables in $PREFIX/bin
do-install:
- ${MKDIR} ${SML_BASE}
- ${MKDIR} ${SML_BINDIR}
+ ${MKDIR} ${SML_BASE} ${SML_BINDIR} ${SML_LIBDIR}
tar -C ${WRKDIR} -cf - bin | tar -C ${SML_BASE} -xf -
- ${RM} ${SML_BINDIR}/.run-sml
+ ${RM} -f ${SML_BINDIR}/.run-sml
${SED} -e "s,^BIN_DIR=.*\$$,BIN_DIR=${SML_BINDIR}," \
< ${WRKDIR}/bin/.run-sml > ${SML_BINDIR}/.run-sml
chmod 755 ${SML_BINDIR}/.run-sml
+ cd ${WRKDIR} && tar -cf - `find . -name '*.stable' | ${GREP} CM` | \
+ tar -C ${SML_BASE} -xf -
+ cd ${WRKDIR} && tar -cf - `${SCRIPTDIR}/get-cm ${WRKDIR}` | \
+ tar -C ${SML_BASE} -xf -
+ for file in ${WRKDIR}/lib/*; do\
+ ${SED} -e "s,${WRKDIR},${SML_BASE}," < $$file > \
+ ${SML_LIBDIR}/`basename $$file`; \
+ done
.for file in ${SML_EXES}
-${LN} -s ${SML_BINDIR}/${file} ${PREFIX}/bin/${file}
.endfor
diff --git a/lang/sml-nj-devel/distinfo b/lang/sml-nj-devel/distinfo
index abd5b12ccfc4..7b0f41725548 100644
--- a/lang/sml-nj-devel/distinfo
+++ b/lang/sml-nj-devel/distinfo
@@ -1,13 +1,11 @@
-MD5 (sml-nj/110-bin.x86-unix.tar.Z) = edba93d7d94f6019c6dd0b22ee3a3c46
-MD5 (sml-nj/110-cm.tar.Z) = 4e7987ca57ec35ff19d11bb3bec6dd73
-MD5 (sml-nj/110-cml.tar.Z) = bea1f47d442d788924496ae281860e66
-MD5 (sml-nj/110-config.tar.Z) = ade21a6dad2bf8cf06a8544070837fb7
-MD5 (sml-nj/110-doc.tar.Z) = 08984248309121db8b61327825f0401b
-MD5 (sml-nj/110-eXene.tar.Z) = ebeae292ca5d46b2ed6446f5319be0db
-MD5 (sml-nj/110-ml-burg.tar.Z) = 8f41d64c588a13007a4b735bbeefbc13
-MD5 (sml-nj/110-ml-lex.tar.Z) = 9502487da4ec579937cf894c02f08204
-MD5 (sml-nj/110-ml-yacc.tar.Z) = 0d18c288ebdc65fe05314b050a88b368
-MD5 (sml-nj/110-runtime.tar.Z) = 7b08a2d45ed47e90fb88557d8aaac409
-MD5 (sml-nj/110-sml-nj.tar.Z) = 8ba3c20048f68b18ae29a9bc53401dc8
-MD5 (sml-nj/110-smlnj-c.tar.Z) = a346c88785b82c598e0511c4dedeb244
-MD5 (sml-nj/110-smlnj-lib.tar.Z) = ee85ede6fd63827ca1ced2198d8ad0c1
+MD5 (sml-nj/110.9.1-bin.x86-unix.tar.Z) = a8d2a792ef392a0ddd8ece325fd4b892
+MD5 (sml-nj/110.9.1-cm.tar.Z) = ee3987dbee99b5f0b59cb09c1a956a0d
+MD5 (sml-nj/110.9.1-cml.tar.Z) = 8c33edee5e75fd18600ef9f0b5b253ae
+MD5 (sml-nj/110.9.1-config.tar.Z) = 7a386efc49ca847745f818dcbe5a36bf
+MD5 (sml-nj/110.9.1-eXene.tar.Z) = 33f16b9d64f2c02f36172e434f29f136
+MD5 (sml-nj/110.9.1-ml-burg.tar.Z) = c25007873fbe1dd6ae68a2f0a54e7089
+MD5 (sml-nj/110.9.1-ml-lex.tar.Z) = acd4a503f087fb0a4a044d3ff6da5d24
+MD5 (sml-nj/110.9.1-ml-yacc.tar.Z) = 478430b7bcaa41f1d3f1cc66055078d7
+MD5 (sml-nj/110.9.1-runtime.tar.Z) = b73c165b4cf445601926f53566a1a589
+MD5 (sml-nj/110.9.1-smlnj-c.tar.Z) = c15c3295fd1a9afd9eb5aa67ae34543f
+MD5 (sml-nj/110.9.1-smlnj-lib.tar.Z) = 53f49d01d3f6c3b4eb175ce07a7c8759
diff --git a/lang/sml-nj-devel/pkg-comment b/lang/sml-nj-devel/pkg-comment
index a93bdc94503d..f298a37965a3 100644
--- a/lang/sml-nj-devel/pkg-comment
+++ b/lang/sml-nj-devel/pkg-comment
@@ -1 +1 @@
-Standard ML of New Jersey.
+a popular functional language from Bell Labs.
diff --git a/lang/sml-nj-devel/pkg-descr b/lang/sml-nj-devel/pkg-descr
index 318b31534f13..326183f2b0f8 100644
--- a/lang/sml-nj-devel/pkg-descr
+++ b/lang/sml-nj-devel/pkg-descr
@@ -3,9 +3,8 @@ including the new Basis library with a few minor omissions and discrepancies.
See also: http://cm.bell-labs.com/cm/cs/what/smlnj/index.html
-This port installs most parts of the ML system by default. If you are
-interested in a lighter implementation of ML, the Moscow-ML port is
-recommended.
+If you are interested in a lighter weight implementation of ML,
+the Moscow-ML port is recommended.
- Joseph Koshy
<jkoshy@freebsd.org>
diff --git a/lang/sml-nj-devel/pkg-plist b/lang/sml-nj-devel/pkg-plist
index 1b64017c6199..6fec3f1eab41 100644
--- a/lang/sml-nj-devel/pkg-plist
+++ b/lang/sml-nj-devel/pkg-plist
@@ -2,21 +2,160 @@ bin/ml-burg
bin/ml-lex
bin/ml-yacc
bin/sml
-bin/sml-cm
lib/sml-nj/bin/.heap/sml.x86-bsd
-lib/sml-nj/bin/.heap/sml-cm.x86-bsd
lib/sml-nj/bin/.heap/ml-yacc.x86-bsd
lib/sml-nj/bin/.heap/ml-lex.x86-bsd
lib/sml-nj/bin/.heap/ml-burg.x86-bsd
lib/sml-nj/bin/.run/run.x86-freebsd
lib/sml-nj/bin/.arch-n-opsys
lib/sml-nj/bin/.run-sml
-lib/sml-nj/bin/sml
-lib/sml-nj/bin/sml-cm
-lib/sml-nj/bin/ml-yacc
-lib/sml-nj/bin/ml-lex
lib/sml-nj/bin/ml-burg
-@dirrm lib/sml-nj/bin/.run
+lib/sml-nj/bin/ml-lex
+lib/sml-nj/bin/ml-yacc
+lib/sml-nj/bin/sml
+lib/sml-nj/lib/cml-lib.cm
+lib/sml-nj/lib/cml.cm
+lib/sml-nj/lib/eXene.cm
+lib/sml-nj/lib/html-lib.cm
+lib/sml-nj/lib/ml-yacc-lib.cm
+lib/sml-nj/lib/pp-lib.cm
+lib/sml-nj/lib/reactive-lib.cm
+lib/sml-nj/lib/regexp-lib.cm
+lib/sml-nj/lib/smlnj-lib.cm
+lib/sml-nj/lib/unix-lib.cm
+lib/sml-nj/src/ml-yacc/lib/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/ml-yacc/lib/sources.cm
+lib/sml-nj/src/smlnj-lib/HTML/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/smlnj-lib/HTML/sources.cm
+lib/sml-nj/src/smlnj-lib/PP/devices/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/smlnj-lib/PP/devices/sources.cm
+lib/sml-nj/src/smlnj-lib/PP/src/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/smlnj-lib/PP/src/sources.cm
+lib/sml-nj/src/smlnj-lib/PP/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/smlnj-lib/PP/sources.cm
+lib/sml-nj/src/smlnj-lib/Reactive/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/smlnj-lib/Reactive/sources.cm
+lib/sml-nj/src/smlnj-lib/RegExp/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/smlnj-lib/RegExp/sources.cm
+lib/sml-nj/src/smlnj-lib/Unix/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/smlnj-lib/Unix/sources.cm
+lib/sml-nj/src/smlnj-lib/Util/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/smlnj-lib/Util/sources.cm
+lib/sml-nj/src/cml/cml-lib/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/cml/cml-lib/CM/x86-unix/trace-cml.cm.stable
+lib/sml-nj/src/cml/cml-lib/sources.cm
+lib/sml-nj/src/cml/cml-lib/trace-cml.cm
+lib/sml-nj/src/cml/src/IO/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/cml/src/IO/sources.cm
+lib/sml-nj/src/cml/src/OS/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/cml/src/OS/sources.cm
+lib/sml-nj/src/cml/src/Sockets/CM/x86-unix/layer2.cm.stable
+lib/sml-nj/src/cml/src/Sockets/CM/x86-unix/layer3.cm.stable
+lib/sml-nj/src/cml/src/Sockets/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/cml/src/Sockets/CM/x86-unix/layer1.cm.stable
+lib/sml-nj/src/cml/src/Sockets/layer1.cm
+lib/sml-nj/src/cml/src/Sockets/layer2.cm
+lib/sml-nj/src/cml/src/Sockets/layer3.cm
+lib/sml-nj/src/cml/src/Sockets/sources.cm
+lib/sml-nj/src/cml/src/Unix/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/cml/src/Unix/CM/x86-unix/os.cm.stable
+lib/sml-nj/src/cml/src/Unix/os.cm
+lib/sml-nj/src/cml/src/Unix/sources.cm
+lib/sml-nj/src/cml/src/core-cml/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/cml/src/core-cml/sources.cm
+lib/sml-nj/src/cml/src/glue/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/cml/src/glue/sources.cm
+lib/sml-nj/src/cml/src/util/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/cml/src/util/sources.cm
+lib/sml-nj/src/cml/src/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/cml/src/sources.cm
+lib/sml-nj/src/eXene/graph-util/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/eXene/graph-util/sources.cm
+lib/sml-nj/src/eXene/lib/CM/x86-unix/base.cm.stable
+lib/sml-nj/src/eXene/lib/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/eXene/lib/base.cm
+lib/sml-nj/src/eXene/lib/sources.cm
+lib/sml-nj/src/eXene/styles/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/eXene/styles/sources.cm
+lib/sml-nj/src/eXene/widgets/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/eXene/widgets/sources.cm
+lib/sml-nj/src/eXene/CM/x86-unix/sources.cm.stable
+lib/sml-nj/src/eXene/sources.cm
@dirrm lib/sml-nj/bin/.heap
+@dirrm lib/sml-nj/bin/.run
@dirrm lib/sml-nj/bin
+@dirrm lib/sml-nj/lib
+@dirrm lib/sml-nj/src/ml-yacc/lib/CM/x86-unix
+@dirrm lib/sml-nj/src/ml-yacc/lib/CM
+@dirrm lib/sml-nj/src/ml-yacc/lib
+@dirrm lib/sml-nj/src/ml-yacc
+@dirrm lib/sml-nj/src/smlnj-lib/HTML/CM/x86-unix
+@dirrm lib/sml-nj/src/smlnj-lib/HTML/CM
+@dirrm lib/sml-nj/src/smlnj-lib/HTML
+@dirrm lib/sml-nj/src/smlnj-lib/PP/devices/CM/x86-unix
+@dirrm lib/sml-nj/src/smlnj-lib/PP/devices/CM
+@dirrm lib/sml-nj/src/smlnj-lib/PP/devices
+@dirrm lib/sml-nj/src/smlnj-lib/PP/src/CM/x86-unix
+@dirrm lib/sml-nj/src/smlnj-lib/PP/src/CM
+@dirrm lib/sml-nj/src/smlnj-lib/PP/src
+@dirrm lib/sml-nj/src/smlnj-lib/PP/CM/x86-unix
+@dirrm lib/sml-nj/src/smlnj-lib/PP/CM
+@dirrm lib/sml-nj/src/smlnj-lib/PP
+@dirrm lib/sml-nj/src/smlnj-lib/Reactive/CM/x86-unix
+@dirrm lib/sml-nj/src/smlnj-lib/Reactive/CM
+@dirrm lib/sml-nj/src/smlnj-lib/Reactive
+@dirrm lib/sml-nj/src/smlnj-lib/RegExp/CM/x86-unix
+@dirrm lib/sml-nj/src/smlnj-lib/RegExp/CM
+@dirrm lib/sml-nj/src/smlnj-lib/RegExp
+@dirrm lib/sml-nj/src/smlnj-lib/Unix/CM/x86-unix
+@dirrm lib/sml-nj/src/smlnj-lib/Unix/CM
+@dirrm lib/sml-nj/src/smlnj-lib/Unix
+@dirrm lib/sml-nj/src/smlnj-lib/Util/CM/x86-unix
+@dirrm lib/sml-nj/src/smlnj-lib/Util/CM
+@dirrm lib/sml-nj/src/smlnj-lib/Util
+@dirrm lib/sml-nj/src/smlnj-lib
+@dirrm lib/sml-nj/src/cml/cml-lib/CM/x86-unix
+@dirrm lib/sml-nj/src/cml/cml-lib/CM
+@dirrm lib/sml-nj/src/cml/cml-lib
+@dirrm lib/sml-nj/src/cml/src/IO/CM/x86-unix
+@dirrm lib/sml-nj/src/cml/src/IO/CM
+@dirrm lib/sml-nj/src/cml/src/IO
+@dirrm lib/sml-nj/src/cml/src/OS/CM/x86-unix
+@dirrm lib/sml-nj/src/cml/src/OS/CM
+@dirrm lib/sml-nj/src/cml/src/OS
+@dirrm lib/sml-nj/src/cml/src/Sockets/CM/x86-unix
+@dirrm lib/sml-nj/src/cml/src/Sockets/CM
+@dirrm lib/sml-nj/src/cml/src/Sockets
+@dirrm lib/sml-nj/src/cml/src/Unix/CM/x86-unix
+@dirrm lib/sml-nj/src/cml/src/Unix/CM
+@dirrm lib/sml-nj/src/cml/src/Unix
+@dirrm lib/sml-nj/src/cml/src/core-cml/CM/x86-unix
+@dirrm lib/sml-nj/src/cml/src/core-cml/CM
+@dirrm lib/sml-nj/src/cml/src/core-cml
+@dirrm lib/sml-nj/src/cml/src/glue/CM/x86-unix
+@dirrm lib/sml-nj/src/cml/src/glue/CM
+@dirrm lib/sml-nj/src/cml/src/glue
+@dirrm lib/sml-nj/src/cml/src/util/CM/x86-unix
+@dirrm lib/sml-nj/src/cml/src/util/CM
+@dirrm lib/sml-nj/src/cml/src/util
+@dirrm lib/sml-nj/src/cml/src/CM/x86-unix
+@dirrm lib/sml-nj/src/cml/src/CM
+@dirrm lib/sml-nj/src/cml/src
+@dirrm lib/sml-nj/src/cml
+@dirrm lib/sml-nj/src/eXene/graph-util/CM/x86-unix
+@dirrm lib/sml-nj/src/eXene/graph-util/CM
+@dirrm lib/sml-nj/src/eXene/graph-util
+@dirrm lib/sml-nj/src/eXene/lib/CM/x86-unix
+@dirrm lib/sml-nj/src/eXene/lib/CM
+@dirrm lib/sml-nj/src/eXene/lib
+@dirrm lib/sml-nj/src/eXene/styles/CM/x86-unix
+@dirrm lib/sml-nj/src/eXene/styles/CM
+@dirrm lib/sml-nj/src/eXene/styles
+@dirrm lib/sml-nj/src/eXene/widgets/CM/x86-unix
+@dirrm lib/sml-nj/src/eXene/widgets/CM
+@dirrm lib/sml-nj/src/eXene/widgets
+@dirrm lib/sml-nj/src/eXene/CM/x86-unix
+@dirrm lib/sml-nj/src/eXene/CM
+@dirrm lib/sml-nj/src/eXene
+@dirrm lib/sml-nj/src
@dirrm lib/sml-nj
diff --git a/lang/sml-nj-devel/scripts/get-cm b/lang/sml-nj-devel/scripts/get-cm
new file mode 100644
index 000000000000..88992a05219f
--- /dev/null
+++ b/lang/sml-nj-devel/scripts/get-cm
@@ -0,0 +1,81 @@
+#!/bin/sh
+#
+# usage: get-cm work_dir
+#
+# Find all .cm Group and Library descriptions that are referenced
+# from the top level alias files in $SML_BASE/lib/
+
+# temp file
+tmpfile="${TMP:-/tmp}/chomp$$"
+
+# attempt to change directory to work dir
+cd $1 || exit 1
+work_dir=`pwd` # get the canonical name for the current directory
+
+trap "rm -f $tmpfile" 0 1 2 3 15
+
+# hack to remove SML comments '(* ... *)'
+
+strip_comments()
+{
+ # caveat: the following assumes gcc is present ...
+ gcc -x c -E -P -ansi -DOPSYS_UNIX $1 | awk '{
+ line = $0
+ if (match(line, "\\(\\*")) {
+ while (match($0, "\\(\\*")) {
+ if (RSTART > 1) {
+ print substr($0, 0, RSTART-1);
+ }
+ sub("^.*\\(\\*", "");
+ while (!match($0, "\\*\\)")) {
+ getline
+ }
+ $0 = substr($0, RSTART+RLENGTH);
+ }
+ }
+ print
+ }'
+}
+
+# return canonical name for a path with embedded ..'s
+
+canonical()
+{
+ echo $(cd `dirname $1` && pwd)/`basename $1`
+}
+
+# initial list of CM description files
+global_cm_list="$(cat ./lib/*.cm | awk '{ print $2 }')"
+
+set -- $global_cm_list
+
+touch $tmpfile
+
+# process the global list
+while [ $# -ge 1 ]; do
+
+ cm_file="$1"; shift
+ global_cm_list="$*"
+
+ echo $cm_file >> $tmpfile
+
+ cm_dir=`dirname $cm_file`
+ cm_new=$(strip_comments $cm_file | grep '\.cm' | \
+ awk '{ print $1 }')
+
+ # append new CM files to current global list
+ for i in $cm_new; do
+ new_cm_file=$(canonical $cm_dir/$i)
+ if [ -r $new_cm_file ]; then
+ if ! grep "^$new_cm_file" $tmpfile > /dev/null; then
+ global_cm_list="$new_cm_file $global_cm_list"
+ echo $new_cm_file >> $tmpfile
+ fi
+ fi
+ done
+
+ set -- $global_cm_list
+done
+
+# output to stdout
+sort -u < $tmpfile | sed -e "s,^$work_dir/,,"