-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure
executable file
·57 lines (57 loc) · 2.1 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
test -f mc/Name || exit 1
VERSID=`awk '{print substr($2,2)}' mc/Name`
case `uname -s` in
Linux|CYGWIN_NT-*) HARDID=`uname -i 2>/dev/null`
if [ "$HARDID" = "x86_64" ]; then PLATID=l6; else PLATID=lu; fi
test "${HARDID:-unknown}" = "unknown" && HARDID=`uname -m`
test "${HARDID}" = "GenuineIntel" && HARDID=`uname -m`
test "${HARDID}" = "i686" && HARDID=i386
;;
FreeBSD) case `uname -K` in
14*) PLATID=f4;;
*) PLATID=fb;;
esac
HARDID=`uname -p`;;
Darwin) PLATID=md; HARDID=`uname -m`;;
*) echo 'unknown platform - please help porting' >&2;;
esac
HARDID=${HARDID:-x86}
DISTID=mc-$VERSID-$PLATID-$HARDID
for MODEID in arx mc; do cd $MODEID; make -f Makefile.in clean >/dev/null 2>&1; cd ..; done
for MODEID in arx mc; do cd $MODEID/src; make -f Makefile.W32 clean >/dev/null 2>&1; cd ../..; done
rm -rf Makefile dist
test "$1" = "clean" && exit
echo "configuring for $DISTID" >&2
cat >Makefile <<EOF
ARX=\$(DESTDIR)/opt
all: dist/arx.tar.gz
@echo 'you can now run "sudo make install"'
install: all
test -d \$(ARX) || mkdir \$(ARX)
gzip -cd <dist/arx.tar.gz | tar x -p -C \$(ARX) -f -
dist/arx.tar.gz: mc/tst/.tested
-mkdir dist
chmod g-s dist
-mkdir dist/arx dist/arx/man dist/arx/man/man1
for D in bin lib exm; do cp -r mc/\$\$D dist/arx; done
rm -f dist/arx/bin/.copied
( cd dist/arx/bin; ln -sf mc 321; )
for M in db2rdb mc mcunits nro; do cp mc/man/\$\$M.1 dist/arx/man/man1; done
strip dist/arx/bin/* 2>/dev/null || true
chmod -R u+rwX,g-w,g+rX,o-w,o+rX dist
cd dist; tar cf - arx | gzip -c >arx.tar.gz
if [ -d archive ]; then cp dist/arx.tar.gz archive/$DISTID.tar.gz; fi
mc/tst/.tested: arx/lib/libarx.a
rm -f \$@
cd mc; make -f Makefile.in init PLATID="${PLATID}"; cp Makefile.${PLATID} Makefile; make all PLATFORM="${HARDID}" PLATID="${PLATID}"
test -f \$@
arx/lib/libarx.a:
-mkdir arx/lib
cd arx; make -f Makefile.in init PLATID="${PLATID}"; cp Makefile.${PLATID} Makefile; make all PLATFORM="${HARDID}"
test -f \$@
clean:
./configure clean
EOF
echo 'you can now run "make"' >&2
exit