7 |
|
|
8 |
echo "# Generated by $0 $*" >Makeconf |
echo "# Generated by $0 $*" >Makeconf |
9 |
|
|
10 |
|
|
11 |
|
# Process command line options |
12 |
|
|
13 |
|
cflags= |
14 |
|
ldflags= |
15 |
|
|
16 |
for arg in $*; do |
for arg in $*; do |
17 |
optarg=`echo $arg | sed 's/[-a-z]*=//'` |
optarg=`echo $arg | sed 's/[-a-z]*=//'` |
18 |
case $arg in |
case $arg in |
19 |
--prefix=*) |
--prefix=*) |
20 |
echo "PREFIX = $optarg" >>Makeconf |
echo "prefix = $optarg" >>Makeconf |
21 |
;; |
;; |
22 |
--exec-prefix=*) |
--exec-prefix=*) |
23 |
echo "EPREFIX = $optarg" >>Makeconf |
echo "exec_prefix = $optarg" >>Makeconf |
24 |
;; |
;; |
25 |
--bindir=*) |
--bindir=*) |
26 |
echo "BINDIR = $optarg" >>Makeconf |
echo "bindir = $optarg" >>Makeconf |
27 |
;; |
;; |
28 |
--mandir=*) |
--mandir=*) |
29 |
echo "MANDIR = $optarg" >>Makeconf |
echo "mandir = $optarg" >>Makeconf |
30 |
;; |
;; |
31 |
--sharedir=*) |
--sharedir=*) |
32 |
echo "SHAREDIR = $optarg" >>Makeconf |
echo "datadir = $optarg" >>Makeconf |
33 |
;; |
;; |
34 |
--with-openssl*) |
--with-openssl*) |
|
echo "CFLAGS += -DWITH_OPENSSL" >>Makeconf |
|
|
echo "LDLIBS += -lcrypto" >>Makeconf |
|
|
echo "CRYPTOBJ =" >>Makeconf |
|
35 |
;; |
;; |
36 |
--without-openssl*) |
--without-openssl*) |
37 |
;; |
;; |
38 |
--with-debug) |
--with-debug) |
39 |
echo "CFLAGS += -g -DWITH_DEBUG" >>Makeconf |
cflags="$cflags -g -DWITH_DEBUG" |
40 |
;; |
;; |
41 |
--with-debug-kbd) |
--with-debug-kbd) |
42 |
echo "CFLAGS += -g -DWITH_DEBUG_KBD" >>Makeconf |
cflags="$cflags -g -DWITH_DEBUG_KBD" |
43 |
;; |
;; |
44 |
--without-debug*) |
--without-debug*) |
45 |
;; |
;; |
54 |
echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]" |
echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]" |
55 |
echo |
echo |
56 |
echo "Build configuration:" |
echo "Build configuration:" |
57 |
echo " --with-openssl use system OpenSSL libraries for crypto" |
echo " --with-debug enable protocol debugging output" |
|
echo " --with-debug enable debugging output" |
|
58 |
echo " --with-debug-kbd enable debugging of keyboard handling" |
echo " --with-debug-kbd enable debugging of keyboard handling" |
59 |
echo |
echo |
60 |
rm -f Makeconf |
rm -f Makeconf |
63 |
esac |
esac |
64 |
done |
done |
65 |
|
|
66 |
|
|
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 |
|
xdirs="/usr /usr/X11R6 /usr/X11 /usr/openwin /usr/local /usr/local/X11R6 /usr/local/X11" |
82 |
|
|
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 |
|
ssldirs="/usr /usr/openssl /usr/ssl /usr/local /usr/local/openssl /usr/local/ssl" |
117 |
|
|
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 |
echo "configure complete - now run make" |
echo "configure complete - now run make" |