/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 267 - (hide annotations)
Tue Nov 19 11:06:12 2002 UTC (21 years, 6 months ago) by astrand
File size: 5466 byte(s)
Fixed broken --without-openssl.

1 matty 30 #!/bin/sh
2     #
3     # rdesktop: A Remote Desktop Protocol client
4     # configure script
5 matthewc 207 # Copyright (C) Matthew Chapman 1999-2002
6 matty 30 #
7    
8 matthewc 202 echo "rdesktop build configuration script"
9     echo
10    
11 matty 30 echo "# Generated by $0 $*" >Makeconf
12    
13 matthewc 156
14 matthewc 189 # Process command line options
15 matthewc 156
16 matthewc 189 cflags=
17     ldflags=
18 matthewc 221 rpath=
19 matthewc 156
20 matty 30 for arg in $*; do
21 matthewc 220 optarg=`echo $arg | sed 's/[-a-z]*=//'`
22 matty 30 case $arg in
23     --prefix=*)
24 matthewc 156 echo "prefix = $optarg" >>Makeconf
25 matty 30 ;;
26     --exec-prefix=*)
27 matthewc 156 echo "exec_prefix = $optarg" >>Makeconf
28 matty 30 ;;
29     --bindir=*)
30 matthewc 156 echo "bindir = $optarg" >>Makeconf
31 matty 30 ;;
32     --mandir=*)
33 matthewc 156 echo "mandir = $optarg" >>Makeconf
34 matty 30 ;;
35 astrand 98 --sharedir=*)
36 matthewc 156 echo "datadir = $optarg" >>Makeconf
37 astrand 98 ;;
38 matthewc 220 --with-x*)
39     extraxdir=$optarg
40     ;;
41 matty 32 --with-openssl*)
42 matthewc 220 extrassldir=$optarg
43 matty 32 ;;
44     --without-openssl*)
45 astrand 267 withoutopenssl=yes
46 matty 32 ;;
47 matthewc 220 --with-egd-socket=*)
48     extraegdpath=$optarg
49     ;;
50 astrand 63 --with-debug)
51 matthewc 189 cflags="$cflags -g -DWITH_DEBUG"
52 matty 30 ;;
53 astrand 63 --with-debug-kbd)
54 matthewc 189 cflags="$cflags -g -DWITH_DEBUG_KBD"
55 astrand 63 ;;
56 matty 30 --without-debug*)
57     ;;
58     *)
59     echo "Target directories:"
60 matthewc 220 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 matty 30 echo
66     echo "Build configuration:"
67 matthewc 220 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 astrand 267 echo " --without-openssl use in-tree crypto, even if OpenSSL is available"
70 matthewc 220 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 matty 30 echo
74     rm -f Makeconf
75     exit 1
76     ;;
77     esac
78     done
79    
80 matthewc 189
81 matthewc 258 # 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 matthewc 189 # Find X installation
108    
109 matthewc 220 xdirs="$extraxdir /usr/X11R6 /usr/X11 /usr/openwin /usr /usr/local/X11R6 /usr/local/X11 /usr/local"
110 matthewc 189
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 matthewc 220 echo "(searched for include/X11/Xlib.h in: $xdirs)"
121 matthewc 189
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 matthewc 202 echo "X Window System:"
132     echo " includes $xdir/include"
133     echo " libraries $xdir/lib"
134     echo
135    
136 matthewc 189 if [ $xdir != "/usr" ]; then
137     cflags="$cflags -I$xdir/include"
138     ldflags="$ldflags -L$xdir/lib"
139 matthewc 221 rpath="$rpath:$xdir/lib"
140 matthewc 189 fi
141    
142     ldflags="$ldflags -lX11"
143    
144    
145 astrand 267 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 matthewc 189 fi
178     fi
179 astrand 267
180 matthewc 189
181 matthewc 220 # Find EGD socket if we don't have /dev/urandom or /dev/random
182 matthewc 221
183 matthewc 220 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 matthewc 221
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 matthewc 189 echo "CFLAGS += $cflags" >>Makeconf
224     echo "LDFLAGS += $ldflags" >>Makeconf
225    
226 matty 30 echo "configure complete - now run make"
227 matthewc 221

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26