/[rdesktop]/sourceforge.net/trunk/rdesktop/configure
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /sourceforge.net/trunk/rdesktop/configure

Parent Directory Parent Directory | Revision Log Revision Log


Revision 298 - (show annotations)
Thu Jan 30 10:57:38 2003 UTC (21 years, 4 months ago) by matthewc
File size: 5502 byte(s)
Avoid using non-portable += in generated Makeconf.

1 #!/bin/sh
2 #
3 # rdesktop: A Remote Desktop Protocol client
4 # configure script
5 # Copyright (C) Matthew Chapman 1999-2002
6 #
7
8 echo "rdesktop build configuration script"
9 echo
10
11 echo "# Generated by $0 $*" >Makeconf
12
13
14 # Process command line options
15
16 cflags='-DKEYMAP_PATH=\"$(KEYMAP_PATH)\"'
17 ldflags=''
18 rpath=
19
20 for arg in $*; do
21 optarg=`echo $arg | sed 's/[-a-z]*=//'`
22 case $arg in
23 --prefix=*)
24 echo "prefix = $optarg" >>Makeconf
25 ;;
26 --exec-prefix=*)
27 echo "exec_prefix = $optarg" >>Makeconf
28 ;;
29 --bindir=*)
30 echo "bindir = $optarg" >>Makeconf
31 ;;
32 --mandir=*)
33 echo "mandir = $optarg" >>Makeconf
34 ;;
35 --sharedir=*)
36 echo "datadir = $optarg" >>Makeconf
37 ;;
38 --with-x*)
39 extraxdir=$optarg
40 ;;
41 --with-openssl*)
42 extrassldir=$optarg
43 ;;
44 --without-openssl*)
45 withoutopenssl=yes
46 ;;
47 --with-egd-socket=*)
48 extraegdpath=$optarg
49 ;;
50 --with-debug)
51 cflags="$cflags -g -DWITH_DEBUG"
52 ;;
53 --with-debug-kbd)
54 cflags="$cflags -g -DWITH_DEBUG_KBD"
55 ;;
56 --without-debug*)
57 ;;
58 *)
59 echo "Target directories:"
60 echo " --prefix=PREFIX location for architecture-independent files"
61 echo " --exec-prefix=EPREFIX location for architecture-dependent files"
62 echo " --bindir=BINDIR location for program binaries [EPREFIX/bin]"
63 echo " --mandir=MANDIR location for man pages [PREFIX/man]"
64 echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]"
65 echo
66 echo "Build configuration:"
67 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"
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"
71 echo " --with-debug enable protocol debugging output"
72 echo " --with-debug-kbd enable debugging of keyboard handling"
73 echo
74 rm -f Makeconf
75 exit 1
76 ;;
77 esac
78 done
79
80
81 # Find compiler
82
83 compilers="$CC gcc cc"
84
85 for compiler in $compilers; do
86 if [ -x "`which $compiler`" ]; then
87 cc=$compiler
88 break
89 fi
90 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
108
109 xdirs="$extraxdir /usr/X11R6 /usr/X11 /usr/openwin /usr /usr/local/X11R6 /usr/local/X11 /usr/local"
110
111 for dir in $xdirs; do
112 if [ -f $dir/include/X11/Xlib.h ]; then
113 xdir=$dir
114 break
115 fi
116 done
117
118 if [ -z "$xdir" ]; then
119 echo "ERROR: could not find X Window System headers"
120 echo "(searched for include/X11/Xlib.h in: $xdirs)"
121
122 # additional helpful information for Linux users
123 if [ -f /etc/redhat_release ]; then
124 echo You probably need to install the XFree86-devel package
125 elif [ -f /etc/debian_version ]; then
126 echo You probably need to install the xlibs-dev package
127 fi
128 exit 1
129 fi
130
131 echo "X Window System:"
132 echo " includes $xdir/include"
133 echo " libraries $xdir/lib"
134 echo
135
136 if [ $xdir != "/usr" ]; then
137 cflags="$cflags -I$xdir/include"
138 ldflags="$ldflags -L$xdir/lib"
139 rpath="$rpath:$xdir/lib"
140 fi
141
142 ldflags="$ldflags -lX11"
143
144
145 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"
148
149 for dir in $ssldirs; do
150 if [ -f $dir/include/openssl/rc4.h ]; then
151 ssldir=$dir
152 break
153 fi
154 done
155
156 if [ -z "$ssldir" ]; then
157 echo "WARNING: could not find OpenSSL headers"
158 echo "(searched for include/openssl/rc4.h in: $ssldirs)"
159 echo "Using in-tree crypto; installing OpenSSL is recommended."
160 echo
161 else
162 echo "OpenSSL:"
163 echo " includes $ssldir/include"
164 echo " libraries $ssldir/lib"
165 echo
166
167 echo "CRYPTOBJ =" >>Makeconf
168
169 if [ $ssldir != "/usr" ]; then
170 cflags="$cflags -I$ssldir/include"
171 ldflags="$ldflags -L$ssldir/lib"
172 rpath="$rpath:$ssldir/lib"
173 fi
174
175 cflags="$cflags -DWITH_OPENSSL"
176 ldflags="$ldflags -lcrypto"
177 fi
178 fi
179
180
181 # Find EGD socket if we don't have /dev/urandom or /dev/random
182
183 if [ ! -c /dev/random -a ! -c /dev/urandom ]; then
184 egdpaths="$extraegdpath /var/run/egd-pool /dev/egd-pool /etc/egd-pool /etc/entropy"
185
186 for path in $egdpaths; do
187 # -e isn't portable, so we use -r
188 if [ -r $path ]; then
189 egdpath=$path
190 break
191 fi
192 done
193
194 if [ -z "$egdpath" ]; then
195 echo "WARNING: could not find /dev/urandom, /dev/random or Entropy Gathering Daemon (EGD) socket"
196 echo "(searched: $egdpaths)"
197 echo "Session keys may be less secure; installing a system randomness source is recommended."
198 echo
199 else
200 echo "Entropy Gathering Daemon (EGD):"
201 echo " socket $egdpath"
202 echo
203 cflags="$cflags -DEGD_SOCKET=\\\"$egdpath\\\""
204 fi
205 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
224 echo "LDFLAGS = $ldflags" >>Makeconf
225
226 echo "configure complete - now run make"
227

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26