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]*=//'` |
22 |
case $arg in |
case $arg in |
23 |
--prefix=*) |
--prefix=*) |
24 |
echo "prefix = $optarg" >>Makeconf |
echo "prefix = $optarg" >>Makeconf |
35 |
--sharedir=*) |
--sharedir=*) |
36 |
echo "datadir = $optarg" >>Makeconf |
echo "datadir = $optarg" >>Makeconf |
37 |
;; |
;; |
38 |
|
--with-x*) |
39 |
|
extraxdir=$optarg |
40 |
|
;; |
41 |
--with-openssl*) |
--with-openssl*) |
42 |
|
extrassldir=$optarg |
43 |
;; |
;; |
44 |
--without-openssl*) |
--without-openssl*) |
45 |
;; |
;; |
46 |
|
--with-egd-socket=*) |
47 |
|
extraegdpath=$optarg |
48 |
|
;; |
49 |
--with-debug) |
--with-debug) |
50 |
cflags="$cflags -g -DWITH_DEBUG" |
cflags="$cflags -g -DWITH_DEBUG" |
51 |
;; |
;; |
56 |
;; |
;; |
57 |
*) |
*) |
58 |
echo "Target directories:" |
echo "Target directories:" |
59 |
echo " --prefix=PREFIX location for architecture-independent files" |
echo " --prefix=PREFIX location for architecture-independent files" |
60 |
echo " --exec-prefix=EPREFIX location for architecture-dependent files" |
echo " --exec-prefix=EPREFIX location for architecture-dependent files" |
61 |
echo " --bindir=BINDIR location for program binaries [EPREFIX/bin]" |
echo " --bindir=BINDIR location for program binaries [EPREFIX/bin]" |
62 |
echo " --mandir=MANDIR location for man pages [PREFIX/man]" |
echo " --mandir=MANDIR location for man pages [PREFIX/man]" |
63 |
echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]" |
echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]" |
64 |
echo |
echo |
65 |
echo "Build configuration:" |
echo "Build configuration:" |
66 |
echo " --with-debug enable protocol debugging output" |
echo " --with-x=DIR look for X Window System at DIR/include, DIR/lib" |
67 |
echo " --with-debug-kbd enable debugging of keyboard handling" |
echo " --with-openssl=DIR look for OpenSSL at DIR/include, DIR/lib" |
68 |
|
echo " --with-egd-socket=PATH look for Entropy Gathering Daemon socket at PATH" |
69 |
|
echo " --with-debug enable protocol debugging output" |
70 |
|
echo " --with-debug-kbd enable debugging of keyboard handling" |
71 |
echo |
echo |
72 |
rm -f Makeconf |
rm -f Makeconf |
73 |
exit 1 |
exit 1 |
76 |
done |
done |
77 |
|
|
78 |
|
|
|
# Platform-specific options |
|
|
|
|
|
need_runpath=no |
|
|
|
|
|
case `uname -s` in |
|
|
SunOS) |
|
|
ldflags="$ldflags -lsocket -lnsl" |
|
|
need_runpath=yes |
|
|
;; |
|
|
esac |
|
|
|
|
|
|
|
79 |
# Find X installation |
# Find X installation |
80 |
|
|
81 |
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" |
82 |
|
|
83 |
for dir in $xdirs; do |
for dir in $xdirs; do |
84 |
if [ -f $dir/include/X11/Xlib.h ]; then |
if [ -f $dir/include/X11/Xlib.h ]; then |
89 |
|
|
90 |
if [ -z "$xdir" ]; then |
if [ -z "$xdir" ]; then |
91 |
echo "ERROR: could not find X Window System headers" |
echo "ERROR: could not find X Window System headers" |
92 |
echo "(searched for include/X11/Xlib.h in $xdirs)" |
echo "(searched for include/X11/Xlib.h in: $xdirs)" |
93 |
|
|
94 |
# additional helpful information for Linux users |
# additional helpful information for Linux users |
95 |
if [ -f /etc/redhat_release ]; then |
if [ -f /etc/redhat_release ]; then |
108 |
if [ $xdir != "/usr" ]; then |
if [ $xdir != "/usr" ]; then |
109 |
cflags="$cflags -I$xdir/include" |
cflags="$cflags -I$xdir/include" |
110 |
ldflags="$ldflags -L$xdir/lib" |
ldflags="$ldflags -L$xdir/lib" |
111 |
if [ $need_runpath = "yes" ]; then |
rpath="$rpath:$xdir/lib" |
|
ldflags="$ldflags -R$xdir/lib" |
|
|
fi |
|
112 |
fi |
fi |
113 |
|
|
114 |
ldflags="$ldflags -lX11" |
ldflags="$ldflags -lX11" |
116 |
|
|
117 |
# Find OpenSSL installation if available |
# Find OpenSSL installation if available |
118 |
|
|
119 |
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" |
120 |
|
|
121 |
for dir in $ssldirs; do |
for dir in $ssldirs; do |
122 |
if [ -f $dir/include/openssl/rc4.h ]; then |
if [ -f $dir/include/openssl/rc4.h ]; then |
127 |
|
|
128 |
if [ -z "$ssldir" ]; then |
if [ -z "$ssldir" ]; then |
129 |
echo "WARNING: could not find OpenSSL headers" |
echo "WARNING: could not find OpenSSL headers" |
130 |
echo "(searched for include/openssl/rc4.h in $ssldirs)" |
echo "(searched for include/openssl/rc4.h in: $ssldirs)" |
131 |
echo "Using in-tree crypto; installing OpenSSL is recommended." |
echo "Using in-tree crypto; installing OpenSSL is recommended." |
132 |
echo |
echo |
133 |
else |
else |
141 |
if [ $ssldir != "/usr" ]; then |
if [ $ssldir != "/usr" ]; then |
142 |
cflags="$cflags -I$ssldir/include" |
cflags="$cflags -I$ssldir/include" |
143 |
ldflags="$ldflags -L$ssldir/lib" |
ldflags="$ldflags -L$ssldir/lib" |
144 |
if [ $need_runpath = "yes" ]; then |
rpath="$rpath:$ssldir/lib" |
|
ldflags="$ldflags -R$ssldir/lib" |
|
|
fi |
|
145 |
fi |
fi |
146 |
|
|
147 |
cflags="$cflags -DWITH_OPENSSL" |
cflags="$cflags -DWITH_OPENSSL" |
149 |
fi |
fi |
150 |
|
|
151 |
|
|
152 |
|
# Find EGD socket if we don't have /dev/urandom or /dev/random |
153 |
|
|
154 |
|
if [ ! -c /dev/random -a ! -c /dev/urandom ]; then |
155 |
|
egdpaths="$extraegdpath /var/run/egd-pool /dev/egd-pool /etc/egd-pool /etc/entropy" |
156 |
|
|
157 |
|
for path in $egdpaths; do |
158 |
|
# -e isn't portable, so we use -r |
159 |
|
if [ -r $path ]; then |
160 |
|
egdpath=$path |
161 |
|
break |
162 |
|
fi |
163 |
|
done |
164 |
|
|
165 |
|
if [ -z "$egdpath" ]; then |
166 |
|
echo "WARNING: could not find /dev/urandom, /dev/random or Entropy Gathering Daemon (EGD) socket" |
167 |
|
echo "(searched: $egdpaths)" |
168 |
|
echo "Session keys may be less secure; installing a system randomness source is recommended." |
169 |
|
echo |
170 |
|
else |
171 |
|
echo "Entropy Gathering Daemon (EGD):" |
172 |
|
echo " socket $egdpath" |
173 |
|
echo |
174 |
|
cflags="$cflags -DEGD_SOCKET=\\\"$egdpath\\\"" |
175 |
|
fi |
176 |
|
fi |
177 |
|
|
178 |
|
|
179 |
|
# Platform-specific options |
180 |
|
|
181 |
|
# strip leading colon from rpath |
182 |
|
rpath=`echo $rpath |sed 's/^://'` |
183 |
|
|
184 |
|
case `uname -s` in |
185 |
|
SunOS) |
186 |
|
ldflags="$ldflags -lsocket -lnsl -R$rpath" |
187 |
|
;; |
188 |
|
OSF1) |
189 |
|
ldflags="$ldflags -Wl,-rpath,$rpath" |
190 |
|
;; |
191 |
|
esac |
192 |
|
|
193 |
|
|
194 |
echo "CFLAGS += $cflags" >>Makeconf |
echo "CFLAGS += $cflags" >>Makeconf |
195 |
echo "LDFLAGS += $ldflags" >>Makeconf |
echo "LDFLAGS += $ldflags" >>Makeconf |
196 |
|
|
197 |
echo "configure complete - now run make" |
echo "configure complete - now run make" |
198 |
|
|