13 |
|
|
14 |
# Process command line options |
# Process command line options |
15 |
|
|
16 |
cflags= |
cflags='-DKEYMAP_PATH=\"$(KEYMAP_PATH)\"' |
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 |
49 |
;; |
;; |
50 |
|
--with-libvncserver) |
51 |
|
withvncserver=yes |
52 |
|
;; |
53 |
|
--with-libvncserver-config=*) |
54 |
|
vncserverconfig=$optarg |
55 |
|
;; |
56 |
--with-debug) |
--with-debug) |
57 |
cflags="$cflags -g -DWITH_DEBUG" |
cflags="$cflags -g -DWITH_DEBUG" |
58 |
;; |
;; |
59 |
--with-debug-kbd) |
--with-debug-kbd) |
60 |
cflags="$cflags -g -DWITH_DEBUG_KBD" |
cflags="$cflags -g -DWITH_DEBUG_KBD" |
61 |
;; |
;; |
62 |
|
--with-debug-rdp5) |
63 |
|
cflags="$cflags -g -DWITH_DEBUG_RDP5" |
64 |
|
;; |
65 |
--without-debug*) |
--without-debug*) |
66 |
;; |
;; |
67 |
*) |
*) |
75 |
echo "Build configuration:" |
echo "Build configuration:" |
76 |
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" |
77 |
echo " --with-openssl=DIR look for OpenSSL at DIR/include, DIR/lib" |
echo " --with-openssl=DIR look for OpenSSL at DIR/include, DIR/lib" |
78 |
|
echo " --without-openssl use in-tree crypto, even if OpenSSL is available" |
79 |
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" |
80 |
|
echo " --with-libvncserver make rdp2vnc" |
81 |
|
echo " --with-libvncserver-config=CMD" |
82 |
|
echo " use CMD as libvncserver-config" |
83 |
echo " --with-debug enable protocol debugging output" |
echo " --with-debug enable protocol debugging output" |
84 |
echo " --with-debug-kbd enable debugging of keyboard handling" |
echo " --with-debug-kbd enable debugging of keyboard handling" |
85 |
echo |
echo |
90 |
done |
done |
91 |
|
|
92 |
|
|
93 |
# Platform-specific options |
# Find compiler |
94 |
|
|
95 |
need_runpath=no |
compilers="$CC gcc cc" |
96 |
|
|
97 |
case `uname -s` in |
for compiler in $compilers; do |
98 |
SunOS) |
if [ -x "`which $compiler`" ]; then |
99 |
ldflags="$ldflags -lsocket -lnsl" |
cc=$compiler |
100 |
need_runpath=yes |
break |
101 |
;; |
fi |
102 |
esac |
done |
103 |
|
|
104 |
|
if [ -z "$cc" ]; then |
105 |
|
echo "ERROR: could not find a C compiler (tried: $compilers)" |
106 |
|
echo "You probably want to install gcc" |
107 |
|
exit 1 |
108 |
|
fi |
109 |
|
|
110 |
|
echo "CC = $cc" >>Makeconf |
111 |
|
|
112 |
|
if $cc -v 2>&1 |grep '^gcc' >/dev/null; then |
113 |
|
cflags="$cflags -Wall -O2" |
114 |
|
else |
115 |
|
cflags="$cflags -O" |
116 |
|
fi |
117 |
|
|
118 |
|
|
119 |
# Find X installation |
# Find X installation |
148 |
if [ $xdir != "/usr" ]; then |
if [ $xdir != "/usr" ]; then |
149 |
cflags="$cflags -I$xdir/include" |
cflags="$cflags -I$xdir/include" |
150 |
ldflags="$ldflags -L$xdir/lib" |
ldflags="$ldflags -L$xdir/lib" |
151 |
if [ $need_runpath = "yes" ]; then |
rpath="$rpath:$xdir/lib" |
|
ldflags="$ldflags -R$xdir/lib" |
|
|
fi |
|
152 |
fi |
fi |
153 |
|
|
154 |
ldflags="$ldflags -lX11" |
ldflags="$ldflags" |
155 |
|
targets="$targets rdesktop" |
|
|
|
|
# Find OpenSSL installation if available |
|
156 |
|
|
157 |
ssldirs="$extrassldir /usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local" |
if [ -z "$withoutopenssl" ]; then |
158 |
|
# Find OpenSSL installation if available |
159 |
for dir in $ssldirs; do |
ssldirs="$extrassldir /usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local" |
160 |
if [ -f $dir/include/openssl/rc4.h ]; then |
|
161 |
ssldir=$dir |
for dir in $ssldirs; do |
162 |
break |
if [ -f $dir/include/openssl/rc4.h ]; then |
163 |
|
ssldir=$dir |
164 |
|
break |
165 |
|
fi |
166 |
|
done |
167 |
|
|
168 |
|
if [ -z "$ssldir" ]; then |
169 |
|
echo "WARNING: could not find OpenSSL headers" |
170 |
|
echo "(searched for include/openssl/rc4.h in: $ssldirs)" |
171 |
|
echo "Using in-tree crypto; installing OpenSSL is recommended." |
172 |
|
echo |
173 |
|
else |
174 |
|
echo "OpenSSL:" |
175 |
|
echo " includes $ssldir/include" |
176 |
|
echo " libraries $ssldir/lib" |
177 |
|
echo |
178 |
|
|
179 |
|
echo "CRYPTOBJ =" >>Makeconf |
180 |
|
|
181 |
|
if [ $ssldir != "/usr" ]; then |
182 |
|
cflags="$cflags -I$ssldir/include" |
183 |
|
ldflags="$ldflags -L$ssldir/lib" |
184 |
|
rpath="$rpath:$ssldir/lib" |
185 |
|
fi |
186 |
|
|
187 |
|
cflags="$cflags -DWITH_OPENSSL" |
188 |
|
ldflags="$ldflags -lcrypto" |
189 |
fi |
fi |
190 |
done |
fi |
191 |
|
|
192 |
if [ -z "$ssldir" ]; then |
if [ ! -z "$withvncserver" ]; then |
193 |
echo "WARNING: could not find OpenSSL headers" |
if [ -z "$vncserverconfig" ]; then |
194 |
echo "(searched for include/openssl/rc4.h in: $ssldirs)" |
vncserverconfig=libvncserver-config |
|
echo "Using in-tree crypto; installing OpenSSL is recommended." |
|
|
echo |
|
|
else |
|
|
echo "OpenSSL:" |
|
|
echo " includes $ssldir/include" |
|
|
echo " libraries $ssldir/lib" |
|
|
echo |
|
|
|
|
|
echo "CRYPTOBJ =" >>Makeconf |
|
|
|
|
|
if [ $ssldir != "/usr" ]; then |
|
|
cflags="$cflags -I$ssldir/include" |
|
|
ldflags="$ldflags -L$ssldir/lib" |
|
|
if [ $need_runpath = "yes" ]; then |
|
|
ldflags="$ldflags -R$ssldir/lib" |
|
|
fi |
|
195 |
fi |
fi |
196 |
|
|
197 |
cflags="$cflags -DWITH_OPENSSL" |
echo "VNCINC=`$vncserverconfig --cflags`" >> Makeconf |
198 |
ldflags="$ldflags -lcrypto" |
echo "LDVNC=`$vncserverconfig --libs`" >> Makeconf |
199 |
|
echo "CCLD=`$vncserverconfig --link`" >> Makeconf |
200 |
|
echo >> Makeconf |
201 |
|
targets="$targets rdp2vnc" |
202 |
|
|
203 |
|
echo "Found libvncserver: Building rdp2vnc" |
204 |
fi |
fi |
205 |
|
|
206 |
|
|
207 |
# 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 |
208 |
|
|
209 |
if [ ! -c /dev/random -a ! -c /dev/urandom ]; then |
if [ ! -c /dev/random -a ! -c /dev/urandom ]; then |
210 |
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" |
211 |
|
|
230 |
fi |
fi |
231 |
fi |
fi |
232 |
|
|
233 |
echo "CFLAGS += $cflags" >>Makeconf |
|
234 |
echo "LDFLAGS += $ldflags" >>Makeconf |
# Platform-specific options |
235 |
|
|
236 |
|
# strip leading colon from rpath |
237 |
|
rpath=`echo $rpath |sed 's/^://'` |
238 |
|
|
239 |
|
case `uname -s` in |
240 |
|
SunOS) |
241 |
|
ldflags="$ldflags -lsocket -lnsl -R$rpath" |
242 |
|
;; |
243 |
|
OSF1) |
244 |
|
ldflags="$ldflags -Wl,-rpath,$rpath" |
245 |
|
;; |
246 |
|
esac |
247 |
|
|
248 |
|
|
249 |
|
echo "CFLAGS = $cflags" >>Makeconf |
250 |
|
echo "LDFLAGS = $ldflags" >>Makeconf |
251 |
|
echo "TARGETS = $targets" >>Makeconf |
252 |
|
|
253 |
echo "configure complete - now run make" |
echo "configure complete - now run make" |
254 |
|
|