15 |
|
|
16 |
cflags= |
cflags= |
17 |
ldflags= |
ldflags= |
18 |
|
rpath= |
19 |
|
|
20 |
for arg in $*; do |
for arg in $*; do |
21 |
optarg=`echo $arg | sed 's/[-a-z]*=//'` |
optarg=`echo $arg | sed 's/[-a-z]*=//'` |
42 |
extrassldir=$optarg |
extrassldir=$optarg |
43 |
;; |
;; |
44 |
--without-openssl*) |
--without-openssl*) |
45 |
|
withoutopenssl=yes |
46 |
;; |
;; |
47 |
--with-egd-socket=*) |
--with-egd-socket=*) |
48 |
extraegdpath=$optarg |
extraegdpath=$optarg |
66 |
echo "Build configuration:" |
echo "Build configuration:" |
67 |
echo " --with-x=DIR look for X Window System at DIR/include, DIR/lib" |
echo " --with-x=DIR look for X Window System at DIR/include, DIR/lib" |
68 |
echo " --with-openssl=DIR look for OpenSSL at DIR/include, DIR/lib" |
echo " --with-openssl=DIR look for OpenSSL at DIR/include, DIR/lib" |
69 |
|
echo " --without-openssl use in-tree crypto, even if OpenSSL is available" |
70 |
echo " --with-egd-socket=PATH look for Entropy Gathering Daemon socket at PATH" |
echo " --with-egd-socket=PATH look for Entropy Gathering Daemon socket at PATH" |
71 |
echo " --with-debug enable protocol debugging output" |
echo " --with-debug enable protocol debugging output" |
72 |
echo " --with-debug-kbd enable debugging of keyboard handling" |
echo " --with-debug-kbd enable debugging of keyboard handling" |
78 |
done |
done |
79 |
|
|
80 |
|
|
81 |
# Platform-specific options |
# Find compiler |
82 |
|
|
83 |
need_runpath=no |
compilers="$CC gcc cc" |
84 |
|
|
85 |
case `uname -s` in |
for compiler in $compilers; do |
86 |
SunOS) |
if [ -x "`which $compiler`" ]; then |
87 |
ldflags="$ldflags -lsocket -lnsl" |
cc=$compiler |
88 |
need_runpath=yes |
break |
89 |
;; |
fi |
90 |
esac |
done |
91 |
|
|
92 |
|
if [ -z "$cc" ]; then |
93 |
|
echo "ERROR: could not find a C compiler (tried: $compilers)" |
94 |
|
echo "You probably want to install gcc" |
95 |
|
exit 1 |
96 |
|
fi |
97 |
|
|
98 |
|
echo "CC = $cc" >>Makeconf |
99 |
|
|
100 |
|
if $cc -v 2>&1 |grep '^gcc' >/dev/null; then |
101 |
|
cflags="$cflags -Wall -O2" |
102 |
|
else |
103 |
|
cflags="$cflags -O" |
104 |
|
fi |
105 |
|
|
106 |
|
|
107 |
# Find X installation |
# Find X installation |
136 |
if [ $xdir != "/usr" ]; then |
if [ $xdir != "/usr" ]; then |
137 |
cflags="$cflags -I$xdir/include" |
cflags="$cflags -I$xdir/include" |
138 |
ldflags="$ldflags -L$xdir/lib" |
ldflags="$ldflags -L$xdir/lib" |
139 |
if [ $need_runpath = "yes" ]; then |
rpath="$rpath:$xdir/lib" |
|
ldflags="$ldflags -R$xdir/lib" |
|
|
fi |
|
140 |
fi |
fi |
141 |
|
|
142 |
ldflags="$ldflags -lX11" |
ldflags="$ldflags -lX11" |
143 |
|
|
144 |
|
|
145 |
# Find OpenSSL installation if available |
if [ -z "$withoutopenssl" ]; then |
146 |
|
# Find OpenSSL installation if available |
147 |
ssldirs="$extrassldir /usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local" |
ssldirs="$extrassldir /usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local" |
148 |
|
|
149 |
for dir in $ssldirs; do |
for dir in $ssldirs; do |
150 |
if [ -f $dir/include/openssl/rc4.h ]; then |
if [ -f $dir/include/openssl/rc4.h ]; then |
151 |
ssldir=$dir |
ssldir=$dir |
152 |
break |
break |
153 |
fi |
fi |
154 |
done |
done |
155 |
|
|
156 |
if [ -z "$ssldir" ]; then |
if [ -z "$ssldir" ]; then |
157 |
echo "WARNING: could not find OpenSSL headers" |
echo "WARNING: could not find OpenSSL headers" |
158 |
echo "(searched for include/openssl/rc4.h in: $ssldirs)" |
echo "(searched for include/openssl/rc4.h in: $ssldirs)" |
159 |
echo "Using in-tree crypto; installing OpenSSL is recommended." |
echo "Using in-tree crypto; installing OpenSSL is recommended." |
160 |
echo |
echo |
161 |
else |
else |
162 |
echo "OpenSSL:" |
echo "OpenSSL:" |
163 |
echo " includes $ssldir/include" |
echo " includes $ssldir/include" |
164 |
echo " libraries $ssldir/lib" |
echo " libraries $ssldir/lib" |
165 |
echo |
echo |
166 |
|
|
167 |
echo "CRYPTOBJ =" >>Makeconf |
echo "CRYPTOBJ =" >>Makeconf |
168 |
|
|
169 |
if [ $ssldir != "/usr" ]; then |
if [ $ssldir != "/usr" ]; then |
170 |
cflags="$cflags -I$ssldir/include" |
cflags="$cflags -I$ssldir/include" |
171 |
ldflags="$ldflags -L$ssldir/lib" |
ldflags="$ldflags -L$ssldir/lib" |
172 |
if [ $need_runpath = "yes" ]; then |
rpath="$rpath:$ssldir/lib" |
173 |
ldflags="$ldflags -R$ssldir/lib" |
fi |
174 |
fi |
|
175 |
|
cflags="$cflags -DWITH_OPENSSL" |
176 |
|
ldflags="$ldflags -lcrypto" |
177 |
fi |
fi |
|
|
|
|
cflags="$cflags -DWITH_OPENSSL" |
|
|
ldflags="$ldflags -lcrypto" |
|
178 |
fi |
fi |
179 |
|
|
180 |
|
|
181 |
# Find EGD socket if we don't have /dev/urandom or /dev/random |
# Find EGD socket if we don't have /dev/urandom or /dev/random |
182 |
|
|
183 |
if [ ! -c /dev/random -a ! -c /dev/urandom ]; then |
if [ ! -c /dev/random -a ! -c /dev/urandom ]; then |
184 |
egdpaths="$extraegdpath /var/run/egd-pool /dev/egd-pool /etc/egd-pool /etc/entropy" |
egdpaths="$extraegdpath /var/run/egd-pool /dev/egd-pool /etc/egd-pool /etc/entropy" |
185 |
|
|
204 |
fi |
fi |
205 |
fi |
fi |
206 |
|
|
207 |
|
|
208 |
|
# Platform-specific options |
209 |
|
|
210 |
|
# strip leading colon from rpath |
211 |
|
rpath=`echo $rpath |sed 's/^://'` |
212 |
|
|
213 |
|
case `uname -s` in |
214 |
|
SunOS) |
215 |
|
ldflags="$ldflags -lsocket -lnsl -R$rpath" |
216 |
|
;; |
217 |
|
OSF1) |
218 |
|
ldflags="$ldflags -Wl,-rpath,$rpath" |
219 |
|
;; |
220 |
|
esac |
221 |
|
|
222 |
|
|
223 |
echo "CFLAGS += $cflags" >>Makeconf |
echo "CFLAGS += $cflags" >>Makeconf |
224 |
echo "LDFLAGS += $ldflags" >>Makeconf |
echo "LDFLAGS += $ldflags" >>Makeconf |
225 |
|
|
226 |
echo "configure complete - now run make" |
echo "configure complete - now run make" |
227 |
|
|