1 |
matty |
30 |
#!/bin/sh |
2 |
|
|
# |
3 |
|
|
# rdesktop: A Remote Desktop Protocol client |
4 |
|
|
# configure script |
5 |
|
|
# Copyright (C) Matthew Chapman 1999-2001 |
6 |
|
|
# |
7 |
|
|
|
8 |
|
|
echo "# Generated by $0 $*" >Makeconf |
9 |
|
|
|
10 |
matthewc |
156 |
|
11 |
matthewc |
189 |
# Process command line options |
12 |
matthewc |
156 |
|
13 |
matthewc |
189 |
cflags= |
14 |
|
|
ldflags= |
15 |
matthewc |
156 |
|
16 |
matty |
30 |
for arg in $*; do |
17 |
|
|
optarg=`echo $arg | sed 's/[-a-z]*=//'` |
18 |
|
|
case $arg in |
19 |
|
|
--prefix=*) |
20 |
matthewc |
156 |
echo "prefix = $optarg" >>Makeconf |
21 |
matty |
30 |
;; |
22 |
|
|
--exec-prefix=*) |
23 |
matthewc |
156 |
echo "exec_prefix = $optarg" >>Makeconf |
24 |
matty |
30 |
;; |
25 |
|
|
--bindir=*) |
26 |
matthewc |
156 |
echo "bindir = $optarg" >>Makeconf |
27 |
matty |
30 |
;; |
28 |
|
|
--mandir=*) |
29 |
matthewc |
156 |
echo "mandir = $optarg" >>Makeconf |
30 |
matty |
30 |
;; |
31 |
astrand |
98 |
--sharedir=*) |
32 |
matthewc |
156 |
echo "datadir = $optarg" >>Makeconf |
33 |
astrand |
98 |
;; |
34 |
matty |
32 |
--with-openssl*) |
35 |
|
|
;; |
36 |
|
|
--without-openssl*) |
37 |
|
|
;; |
38 |
astrand |
63 |
--with-debug) |
39 |
matthewc |
189 |
cflags="$cflags -g -DWITH_DEBUG" |
40 |
matty |
30 |
;; |
41 |
astrand |
63 |
--with-debug-kbd) |
42 |
matthewc |
189 |
cflags="$cflags -g -DWITH_DEBUG_KBD" |
43 |
astrand |
63 |
;; |
44 |
matty |
30 |
--without-debug*) |
45 |
|
|
;; |
46 |
|
|
*) |
47 |
|
|
echo "rdesktop build configuration script" |
48 |
|
|
echo |
49 |
|
|
echo "Target directories:" |
50 |
|
|
echo " --prefix=PREFIX location for architecture-independent files" |
51 |
|
|
echo " --exec-prefix=EPREFIX location for architecture-dependent files" |
52 |
|
|
echo " --bindir=BINDIR location for program binaries [EPREFIX/bin]" |
53 |
|
|
echo " --mandir=MANDIR location for man pages [PREFIX/man]" |
54 |
astrand |
98 |
echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]" |
55 |
matty |
30 |
echo |
56 |
|
|
echo "Build configuration:" |
57 |
matthewc |
156 |
echo " --with-debug enable protocol debugging output" |
58 |
astrand |
66 |
echo " --with-debug-kbd enable debugging of keyboard handling" |
59 |
matty |
30 |
echo |
60 |
|
|
rm -f Makeconf |
61 |
|
|
exit 1 |
62 |
|
|
;; |
63 |
|
|
esac |
64 |
|
|
done |
65 |
|
|
|
66 |
matthewc |
189 |
|
67 |
|
|
# Platform-specific options |
68 |
|
|
|
69 |
|
|
need_runpath=no |
70 |
|
|
|
71 |
|
|
case `uname -s` in |
72 |
|
|
SunOS) |
73 |
|
|
ldflags="$ldflags -lsocket -lnsl" |
74 |
|
|
need_runpath=yes |
75 |
|
|
;; |
76 |
|
|
esac |
77 |
|
|
|
78 |
|
|
|
79 |
|
|
# Find X installation |
80 |
|
|
|
81 |
matthewc |
191 |
xdirs="/usr/X11R6 /usr/X11 /usr/openwin /usr /usr/local/X11R6 /usr/local/X11 /usr/local" |
82 |
matthewc |
189 |
|
83 |
|
|
for dir in $xdirs; do |
84 |
|
|
if [ -f $dir/include/X11/Xlib.h ]; then |
85 |
|
|
xdir=$dir |
86 |
|
|
break |
87 |
|
|
fi |
88 |
|
|
done |
89 |
|
|
|
90 |
|
|
if [ -z "$xdir" ]; then |
91 |
|
|
echo "ERROR: could not find X Window System headers" |
92 |
|
|
echo "(searched for include/X11/Xlib.h in $xdirs)" |
93 |
|
|
|
94 |
|
|
# additional helpful information for Linux users |
95 |
|
|
if [ -f /etc/redhat_release ]; then |
96 |
|
|
echo You probably need to install the XFree86-devel package |
97 |
|
|
elif [ -f /etc/debian_version ]; then |
98 |
|
|
echo You probably need to install the xlibs-dev package |
99 |
|
|
fi |
100 |
|
|
exit 1 |
101 |
|
|
fi |
102 |
|
|
|
103 |
|
|
if [ $xdir != "/usr" ]; then |
104 |
|
|
cflags="$cflags -I$xdir/include" |
105 |
|
|
ldflags="$ldflags -L$xdir/lib" |
106 |
|
|
if [ $need_runpath = "yes" ]; then |
107 |
|
|
ldflags="$ldflags -R$xdir/lib" |
108 |
|
|
fi |
109 |
|
|
fi |
110 |
|
|
|
111 |
|
|
ldflags="$ldflags -lX11" |
112 |
|
|
|
113 |
|
|
|
114 |
|
|
# Find OpenSSL installation if available |
115 |
|
|
|
116 |
matthewc |
191 |
ssldirs="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local" |
117 |
matthewc |
189 |
|
118 |
|
|
for dir in $ssldirs; do |
119 |
|
|
if [ -f $dir/include/openssl/rc4.h ]; then |
120 |
|
|
ssldir=$dir |
121 |
|
|
break |
122 |
|
|
fi |
123 |
|
|
done |
124 |
|
|
|
125 |
|
|
if [ -z "$ssldir" ]; then |
126 |
|
|
echo "WARNING: could not find OpenSSL headers" |
127 |
|
|
echo "(searched for include/openssl/rc4.h in $ssldirs)" |
128 |
|
|
echo "Using in-tree crypto; installing OpenSSL is recommended." |
129 |
|
|
echo |
130 |
|
|
else |
131 |
|
|
echo "CRYPTOBJ =" >>Makeconf |
132 |
|
|
|
133 |
|
|
if [ $ssldir != "/usr" ]; then |
134 |
|
|
cflags="$cflags -I$ssldir/include" |
135 |
|
|
ldflags="$ldflags -L$ssldir/lib" |
136 |
|
|
if [ $need_runpath = "yes" ]; then |
137 |
|
|
ldflags="$ldflags -R$ssldir/lib" |
138 |
|
|
fi |
139 |
|
|
fi |
140 |
|
|
|
141 |
|
|
cflags="$cflags -DWITH_OPENSSL" |
142 |
|
|
ldflags="$ldflags -lcrypto" |
143 |
|
|
fi |
144 |
|
|
|
145 |
|
|
|
146 |
|
|
echo "CFLAGS += $cflags" >>Makeconf |
147 |
|
|
echo "LDFLAGS += $ldflags" >>Makeconf |
148 |
|
|
|
149 |
matty |
30 |
echo "configure complete - now run make" |