17 |
ldflags= |
ldflags= |
18 |
|
|
19 |
for arg in $*; do |
for arg in $*; do |
20 |
optarg=`echo $arg | sed 's/[-a-z]*=//'` |
optarg=`echo $arg | sed 's/[-a-z]*=//'` |
21 |
case $arg in |
case $arg in |
22 |
--prefix=*) |
--prefix=*) |
23 |
echo "prefix = $optarg" >>Makeconf |
echo "prefix = $optarg" >>Makeconf |
34 |
--sharedir=*) |
--sharedir=*) |
35 |
echo "datadir = $optarg" >>Makeconf |
echo "datadir = $optarg" >>Makeconf |
36 |
;; |
;; |
37 |
|
--with-x*) |
38 |
|
extraxdir=$optarg |
39 |
|
;; |
40 |
--with-openssl*) |
--with-openssl*) |
41 |
|
extrassldir=$optarg |
42 |
;; |
;; |
43 |
--without-openssl*) |
--without-openssl*) |
44 |
;; |
;; |
45 |
|
--with-egd-socket=*) |
46 |
|
extraegdpath=$optarg |
47 |
|
;; |
48 |
--with-debug) |
--with-debug) |
49 |
cflags="$cflags -g -DWITH_DEBUG" |
cflags="$cflags -g -DWITH_DEBUG" |
50 |
;; |
;; |
55 |
;; |
;; |
56 |
*) |
*) |
57 |
echo "Target directories:" |
echo "Target directories:" |
58 |
echo " --prefix=PREFIX location for architecture-independent files" |
echo " --prefix=PREFIX location for architecture-independent files" |
59 |
echo " --exec-prefix=EPREFIX location for architecture-dependent files" |
echo " --exec-prefix=EPREFIX location for architecture-dependent files" |
60 |
echo " --bindir=BINDIR location for program binaries [EPREFIX/bin]" |
echo " --bindir=BINDIR location for program binaries [EPREFIX/bin]" |
61 |
echo " --mandir=MANDIR location for man pages [PREFIX/man]" |
echo " --mandir=MANDIR location for man pages [PREFIX/man]" |
62 |
echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]" |
echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]" |
63 |
echo |
echo |
64 |
echo "Build configuration:" |
echo "Build configuration:" |
65 |
echo " --with-debug enable protocol debugging output" |
echo " --with-x=DIR look for X Window System at DIR/include, DIR/lib" |
66 |
echo " --with-debug-kbd enable debugging of keyboard handling" |
echo " --with-openssl=DIR look for OpenSSL at DIR/include, DIR/lib" |
67 |
|
echo " --with-egd-socket=PATH look for Entropy Gathering Daemon socket at PATH" |
68 |
|
echo " --with-debug enable protocol debugging output" |
69 |
|
echo " --with-debug-kbd enable debugging of keyboard handling" |
70 |
echo |
echo |
71 |
rm -f Makeconf |
rm -f Makeconf |
72 |
exit 1 |
exit 1 |
89 |
|
|
90 |
# Find X installation |
# Find X installation |
91 |
|
|
92 |
xdirs="/usr/X11R6 /usr/X11 /usr/openwin /usr /usr/local/X11R6 /usr/local/X11 /usr/local" |
xdirs="$extraxdir /usr/X11R6 /usr/X11 /usr/openwin /usr /usr/local/X11R6 /usr/local/X11 /usr/local" |
93 |
|
|
94 |
for dir in $xdirs; do |
for dir in $xdirs; do |
95 |
if [ -f $dir/include/X11/Xlib.h ]; then |
if [ -f $dir/include/X11/Xlib.h ]; then |
100 |
|
|
101 |
if [ -z "$xdir" ]; then |
if [ -z "$xdir" ]; then |
102 |
echo "ERROR: could not find X Window System headers" |
echo "ERROR: could not find X Window System headers" |
103 |
echo "(searched for include/X11/Xlib.h in $xdirs)" |
echo "(searched for include/X11/Xlib.h in: $xdirs)" |
104 |
|
|
105 |
# additional helpful information for Linux users |
# additional helpful information for Linux users |
106 |
if [ -f /etc/redhat_release ]; then |
if [ -f /etc/redhat_release ]; then |
129 |
|
|
130 |
# Find OpenSSL installation if available |
# Find OpenSSL installation if available |
131 |
|
|
132 |
ssldirs="/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" |
133 |
|
|
134 |
for dir in $ssldirs; do |
for dir in $ssldirs; do |
135 |
if [ -f $dir/include/openssl/rc4.h ]; then |
if [ -f $dir/include/openssl/rc4.h ]; then |
140 |
|
|
141 |
if [ -z "$ssldir" ]; then |
if [ -z "$ssldir" ]; then |
142 |
echo "WARNING: could not find OpenSSL headers" |
echo "WARNING: could not find OpenSSL headers" |
143 |
echo "(searched for include/openssl/rc4.h in $ssldirs)" |
echo "(searched for include/openssl/rc4.h in: $ssldirs)" |
144 |
echo "Using in-tree crypto; installing OpenSSL is recommended." |
echo "Using in-tree crypto; installing OpenSSL is recommended." |
145 |
echo |
echo |
146 |
else |
else |
164 |
fi |
fi |
165 |
|
|
166 |
|
|
167 |
|
# Find EGD socket if we don't have /dev/urandom or /dev/random |
168 |
|
if [ ! -c /dev/random -a ! -c /dev/urandom ]; then |
169 |
|
egdpaths="$extraegdpath /var/run/egd-pool /dev/egd-pool /etc/egd-pool /etc/entropy" |
170 |
|
|
171 |
|
for path in $egdpaths; do |
172 |
|
# -e isn't portable, so we use -r |
173 |
|
if [ -r $path ]; then |
174 |
|
egdpath=$path |
175 |
|
break |
176 |
|
fi |
177 |
|
done |
178 |
|
|
179 |
|
if [ -z "$egdpath" ]; then |
180 |
|
echo "WARNING: could not find /dev/urandom, /dev/random or Entropy Gathering Daemon (EGD) socket" |
181 |
|
echo "(searched: $egdpaths)" |
182 |
|
echo "Session keys may be less secure; installing a system randomness source is recommended." |
183 |
|
echo |
184 |
|
else |
185 |
|
echo "Entropy Gathering Daemon (EGD):" |
186 |
|
echo " socket $egdpath" |
187 |
|
echo |
188 |
|
cflags="$cflags -DEGD_SOCKET=\\\"$egdpath\\\"" |
189 |
|
fi |
190 |
|
fi |
191 |
|
|
192 |
echo "CFLAGS += $cflags" >>Makeconf |
echo "CFLAGS += $cflags" >>Makeconf |
193 |
echo "LDFLAGS += $ldflags" >>Makeconf |
echo "LDFLAGS += $ldflags" >>Makeconf |
194 |
|
|