Annotation of OpenXM/src/ox_math/mathlink/configure-cygwin, Revision 1.5
1.1 ohara 1: #!/bin/sh
1.5 ! ohara 2: # $OpenXM: OpenXM/src/ox_math/mathlink/configure-cygwin,v 1.4 2003/11/16 17:25:20 ohara Exp $
1.1 ohara 3:
1.3 ohara 4: BASE="/usr/local/mathematica/AddOns/MathLink/DeveloperKit"
5: OpenXM_HOME=${OpenXM_HOME:-../../../../OpenXM}
1.4 ohara 6: DISTDIR=${OpenXM_HOME}/../OpenXM_dist
7: DISTFILE=Windows-ml_v3r9.zip
8: URL=http://support.wolfram.com/mathematica/mathlink/updates/v3r9/"${DISTFILE}"
1.1 ohara 9:
10: _fetch () {
1.4 ohara 11: oxfetch.sh "${URL}" ${DISTDIR}
12: if [ ! -f "${DISTDIR}/${DISTFILE}" ] ; then
1.3 ohara 13: echo 'MathLink libraries cannot be fetched.'
14: exit 1
15: fi
1.5 ! ohara 16: unzip -q "${DISTDIR}/${DISTFILE}"
1.3 ohara 17: }
18:
19: _xcopy () {
20: if [ -e ./ml ] ; then
21: rm -rf ./ml
22: fi
23: mkdir -p ./ml
24: cp "${BASE}"/Windows/CompilerAdditions/mldev32/*/* \
25: "${BASE}"/Windows/SystemAdditions/* ./ml/
26: chmod +x ./ml/*
27: if [ -d ./Windows ]; then
28: rm -rf ./Windows
1.1 ohara 29: fi
30: }
31:
1.3 ohara 32: _make () {
33: if [ -d ./ml ]; then
34: (cd ./ml ; _dlltool; _patch)
1.1 ohara 35: fi
36: }
37:
38: _dlltool () {
39: for i in ml32i1 ml32i2; do
40: (echo EXPORTS ; nm "$i"m.lib | grep 'T _' | sed 's/.* T _//' ) > $i.def
41: dlltool --dllname $i.dll --def $i.def --output-lib lib$i.a -k
1.3 ohara 42: rm -f $i.def
1.1 ohara 43: done
1.3 ohara 44: }
45:
46: _patch () {
47: nm libml32i1.a | grep 'T _MLGetString@' > .patch
48: if [ ! -s .patch ]; then
49: mv -f mathlink.h mathlink.h.orig
50: sed -e 's/^\(#[ ]*define[ ][ ]*MLAPI\)[ ][ ]*APIENTRY[ ]*/\1/' mathlink.h.orig > mathlink.h
51: fi
52: }
53:
54: _install () {
55: if [ ! -d ${OpenXM_HOME}/bin ]; then
56: mkdir -p ${OpenXM_HOME}/bin
57: fi
58: install -m 755 ./ml/*.dll ./ml/*.mlp ${OpenXM_HOME}/bin/
1.1 ohara 59: }
60:
61: if [ ! -f ./.configure_done ]; then
1.4 ohara 62: if [ ! -d "${BASE}" -o -f "${DISTDIR}/${DISTFILE}" ]; then
1.3 ohara 63: _fetch
64: BASE=.
65: fi
66: _xcopy
67: _make
68: _install
69: touch .configure_done
1.1 ohara 70: fi
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>