/[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 258 - (show annotations)
Thu Nov 14 13:56:16 2002 UTC (21 years, 6 months ago) by matthewc
File size: 5215 byte(s)
Look for a compiler out of $CC gcc cc, check if gcc (to use -Wall -O2)

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=
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 ;;
46 --with-egd-socket=*)
47 extraegdpath=$optarg
48 ;;
49 --with-debug)
50 cflags="$cflags -g -DWITH_DEBUG"
51 ;;
52 --with-debug-kbd)
53 cflags="$cflags -g -DWITH_DEBUG_KBD"
54 ;;
55 --without-debug*)
56 ;;
57 *)
58 echo "Target directories:"
59 echo " --prefix=PREFIX location for architecture-independent files"
60 echo " --exec-prefix=EPREFIX location for architecture-dependent files"
61 echo " --bindir=BINDIR location for program binaries [EPREFIX/bin]"
62 echo " --mandir=MANDIR location for man pages [PREFIX/man]"
63 echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]"
64 echo
65 echo "Build configuration:"
66 echo " --with-x=DIR look for X Window System at DIR/include, DIR/lib"
67 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
72 rm -f Makeconf
73 exit 1
74 ;;
75 esac
76 done
77
78
79 # Find compiler
80
81 compilers="$CC gcc cc"
82
83 for compiler in $compilers; do
84 if [ -x "`which $compiler`" ]; then
85 cc=$compiler
86 break
87 fi
88 done
89
90 if [ -z "$cc" ]; then
91 echo "ERROR: could not find a C compiler (tried: $compilers)"
92 echo "You probably want to install gcc"
93 exit 1
94 fi
95
96 echo "CC = $cc" >>Makeconf
97
98 if $cc -v 2>&1 |grep '^gcc' >/dev/null; then
99 cflags="$cflags -Wall -O2"
100 else
101 cflags="$cflags -O"
102 fi
103
104
105 # Find X installation
106
107 xdirs="$extraxdir /usr/X11R6 /usr/X11 /usr/openwin /usr /usr/local/X11R6 /usr/local/X11 /usr/local"
108
109 for dir in $xdirs; do
110 if [ -f $dir/include/X11/Xlib.h ]; then
111 xdir=$dir
112 break
113 fi
114 done
115
116 if [ -z "$xdir" ]; then
117 echo "ERROR: could not find X Window System headers"
118 echo "(searched for include/X11/Xlib.h in: $xdirs)"
119
120 # additional helpful information for Linux users
121 if [ -f /etc/redhat_release ]; then
122 echo You probably need to install the XFree86-devel package
123 elif [ -f /etc/debian_version ]; then
124 echo You probably need to install the xlibs-dev package
125 fi
126 exit 1
127 fi
128
129 echo "X Window System:"
130 echo " includes $xdir/include"
131 echo " libraries $xdir/lib"
132 echo
133
134 if [ $xdir != "/usr" ]; then
135 cflags="$cflags -I$xdir/include"
136 ldflags="$ldflags -L$xdir/lib"
137 rpath="$rpath:$xdir/lib"
138 fi
139
140 ldflags="$ldflags -lX11"
141
142
143 # Find OpenSSL installation if available
144
145 ssldirs="$extrassldir /usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
146
147 for dir in $ssldirs; do
148 if [ -f $dir/include/openssl/rc4.h ]; then
149 ssldir=$dir
150 break
151 fi
152 done
153
154 if [ -z "$ssldir" ]; then
155 echo "WARNING: could not find OpenSSL headers"
156 echo "(searched for include/openssl/rc4.h in: $ssldirs)"
157 echo "Using in-tree crypto; installing OpenSSL is recommended."
158 echo
159 else
160 echo "OpenSSL:"
161 echo " includes $ssldir/include"
162 echo " libraries $ssldir/lib"
163 echo
164
165 echo "CRYPTOBJ =" >>Makeconf
166
167 if [ $ssldir != "/usr" ]; then
168 cflags="$cflags -I$ssldir/include"
169 ldflags="$ldflags -L$ssldir/lib"
170 rpath="$rpath:$ssldir/lib"
171 fi
172
173 cflags="$cflags -DWITH_OPENSSL"
174 ldflags="$ldflags -lcrypto"
175 fi
176
177
178 # Find EGD socket if we don't have /dev/urandom or /dev/random
179
180 if [ ! -c /dev/random -a ! -c /dev/urandom ]; then
181 egdpaths="$extraegdpath /var/run/egd-pool /dev/egd-pool /etc/egd-pool /etc/entropy"
182
183 for path in $egdpaths; do
184 # -e isn't portable, so we use -r
185 if [ -r $path ]; then
186 egdpath=$path
187 break
188 fi
189 done
190
191 if [ -z "$egdpath" ]; then
192 echo "WARNING: could not find /dev/urandom, /dev/random or Entropy Gathering Daemon (EGD) socket"
193 echo "(searched: $egdpaths)"
194 echo "Session keys may be less secure; installing a system randomness source is recommended."
195 echo
196 else
197 echo "Entropy Gathering Daemon (EGD):"
198 echo " socket $egdpath"
199 echo
200 cflags="$cflags -DEGD_SOCKET=\\\"$egdpath\\\""
201 fi
202 fi
203
204
205 # Platform-specific options
206
207 # strip leading colon from rpath
208 rpath=`echo $rpath |sed 's/^://'`
209
210 case `uname -s` in
211 SunOS)
212 ldflags="$ldflags -lsocket -lnsl -R$rpath"
213 ;;
214 OSF1)
215 ldflags="$ldflags -Wl,-rpath,$rpath"
216 ;;
217 esac
218
219
220 echo "CFLAGS += $cflags" >>Makeconf
221 echo "LDFLAGS += $ldflags" >>Makeconf
222
223 echo "configure complete - now run make"
224

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26