-
Notifications
You must be signed in to change notification settings - Fork 9
/
configure
executable file
·118 lines (101 loc) · 3.99 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/sh
#
# Parse the arguments...
INSTALL_DIR="$HOME/.lc3"
TOP_DIR="`pwd`"
case $1 in
--installdir)
INSTALL_DIR=$2 ;
;;
--help)
echo "--installdir <directory in which to install>"
echo "--help"
exit
;;
esac
# Some binaries that we'll need, and the places that we might find them.
binlist="uname gcc rm cp mkdir chmod sed make ranlib ar"
pathlist="/bin /usr/bin /usr/local/bin /usr/ccs/bin"
libpathlist="/lib /usr/lib /usr/local/lib"
incpathlist="/include /usr/include /usr/local/include"
# Find the binaries (or die trying).
for binary in $binlist ; do
for path in $pathlist ; do
if [ -r $path/$binary ] ; then
eval "$binary=${path}/${binary}" ;
break ;
fi ;
done ;
eval "if [ -z \"\$$binary\" ] ; then echo \"Cannot locate $binary binary.\" ; exit ; fi"
done
# These default values are overridden below for some operating systems.
EXE=""
DYN="so"
# Tailor the variables based on OS.
case `$uname -s` in
CYGWIN*)
EXE=".exe"
DYN="dll"
echo "Configuring for Cygwin..."
;;
Linux*) echo "Configuring for Linux..."
OS_SIM_LIBS="-lcurses"
;;
SunOS*) echo "Configuring for Solaris..."
OS_SIM_LIBS="-lcurses -lsocket -lnsl"
;;
# Darwin*) echo "Configuring for Darwin..."
# eval "gcc=/usr/bin/gcc-4.2";
esac
echo "Installation directory is $INSTALL_DIR"
# Splice it all in to the various Makefile.defs to create the Makefiles.
# ./src
rm -f Makefile
sed -e "s __GCC__ $gcc g" -e "s __EXE__ $EXE g" \
-e "s __RM__ $rm g" -e "s __RANLIB__ $ranlib g" -e "s __AR__ $ar g" \
-e "s __CP__ $cp g" -e "s __MKDIR__ $mkdir g" -e "s __CHMOD__ $chmod g" \
-e "s*__INSTALL_DIR__*$INSTALL_DIR*g" -e "s*__TOP_DIR__*$TOP_DIR*g" \
-e "s __MAKE__ $make g" -e "s __SED__ $sed g" Makefile.def > Makefile
# ./src
cd src
rm -f Makefile
sed -e "s __GCC__ $gcc g" -e "s __EXE__ $EXE g" \
-e "s __RM__ $rm g" -e "s __RANLIB__ $ranlib g" -e "s __AR__ $ar g" \
-e "s __CP__ $cp g" -e "s __MKDIR__ $mkdir g" -e "s __CHMOD__ $chmod g" \
-e "s*__INSTALL_DIR__*$INSTALL_DIR*g" -e "s*__TOP_DIR__*$TOP_DIR*g" \
-e "s __MAKE__ $make g" -e "s __SED__ $sed g" Makefile.def > Makefile
cd ../cpp
rm -f Makefile
sed -e "s __GCC__ $gcc g" -e "s __EXE__ $EXE g" \
-e "s __RM__ $rm g" -e "s __RANLIB__ $ranlib g" -e "s __AR__ $ar g" \
-e "s __CP__ $cp g" -e "s __MKDIR__ $mkdir g" -e "s __CHMOD__ $chmod g" \
-e "s*__INSTALL_DIR__*$INSTALL_DIR*g" -e "s*__TOP_DIR__*$TOP_DIR*g" \
-e "s __MAKE__ $make g" -e "s __SED__ $sed g" Makefile.def > Makefile
cd ../lib
rm -f Makefile
sed -e "s __GCC__ $gcc g" -e "s __EXE__ $EXE g" \
-e "s __RM__ $rm g" -e "s __RANLIB__ $ranlib g" -e "s __AR__ $ar g" \
-e "s __CP__ $cp g" -e "s __MKDIR__ $mkdir g" -e "s __CHMOD__ $chmod g" \
-e "s*__INSTALL_DIR__*$INSTALL_DIR*g" -e "s*__TOP_DIR__*$TOP_DIR*g" \
-e "s __MAKE__ $make g" -e "s __SED__ $sed g" Makefile.def > Makefile
cd ../lburg
rm -f Makefile
sed -e "s __GCC__ $gcc g" -e "s __EXE__ $EXE g" \
-e "s __RM__ $rm g" -e "s __RANLIB__ $ranlib g" -e "s __AR__ $ar g" \
-e "s __CP__ $cp g" -e "s __MKDIR__ $mkdir g" -e "s __CHMOD__ $chmod g" \
-e "s*__INSTALL_DIR__*$INSTALL_DIR*g" -e "s*__TOP_DIR__*$TOP_DIR*g" \
-e "s __MAKE__ $make g" -e "s __SED__ $sed g" Makefile.def > Makefile
cd ../etc
rm -f Makefile
sed -e "s __GCC__ $gcc g" -e "s __EXE__ $EXE g" \
-e "s __RM__ $rm g" -e "s __RANLIB__ $ranlib g" -e "s __AR__ $ar g" \
-e "s __CP__ $cp g" -e "s __MKDIR__ $mkdir g" -e "s __CHMOD__ $chmod g" \
-e "s*__INSTALL_DIR__*$INSTALL_DIR*g" -e "s*__TOP_DIR__*$TOP_DIR*g" \
-e "s __MAKE__ $make g" -e "s __SED__ $sed g" Makefile.def > Makefile
cd ../lc3pp
rm -f Makefile
sed -e "s __GCC__ $gcc g" -e "s __EXE__ $EXE g" \
-e "s __RM__ $rm g" -e "s __RANLIB__ $ranlib g" -e "s __AR__ $ar g" \
-e "s __CP__ $cp g" -e "s __MKDIR__ $mkdir g" -e "s __CHMOD__ $chmod g" \
-e "s*__INSTALL_DIR__*$INSTALL_DIR*g" -e "s*__TOP_DIR__*$TOP_DIR*g" \
-e "s __MAKE__ $make g" -e "s __SED__ $sed g" Makefile.def > Makefile