/[rdesktop]/sourceforge.net/trunk/rdesktop/configure.ac
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.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 833 - (show annotations)
Tue Mar 8 03:33:36 2005 UTC (19 years, 3 months ago) by stargo
File size: 7779 byte(s)
basic libao output-driver. works on Mac OSX.
no volume control possible

1 AC_INIT(rdesktop, 1.4.0)
2
3 AC_CONFIG_SRCDIR([rdesktop.c])
4
5 AC_PROG_CC
6 if test "$GCC" = yes; then
7 CFLAGS="$CFLAGS -Wall"
8 fi
9
10 AC_PROG_INSTALL
11 AC_LANG_C
12 AC_HEADER_STDC
13 AC_C_BIGENDIAN([AC_DEFINE(B_ENDIAN)], [AC_DEFINE(L_ENDIAN)])
14 AC_PATH_XTRA
15
16 AC_SEARCH_LIBS(socket, socket)
17 AC_SEARCH_LIBS(inet_aton, resolv)
18
19 AC_CHECK_HEADER(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H))
20 AC_CHECK_HEADER(sys/modem.h, AC_DEFINE(HAVE_SYS_MODEM_H))
21 AC_CHECK_HEADER(sys/filio.h, AC_DEFINE(HAVE_SYS_FILIO_H))
22 AC_CHECK_HEADER(sys/strtio.h, AC_DEFINE(HAVE_SYS_STRTIO_H))
23
24 rpath=""
25
26 #
27 # OpenSSL detection borrowed from stunnel
28 #
29 checkssldir() { :
30 if test -f "$1/include/openssl/ssl.h"; then
31 ssldir="$1"
32 return 0
33 fi
34 return 1
35 }
36 AC_MSG_CHECKING([for OpenSSL directory])
37 AC_ARG_WITH(openssl,
38 [ --with-openssl=DIR look for OpenSSL at DIR/include, DIR/lib],
39 [
40 dnl Check the specified location only
41 checkssldir "$withval"
42 ],
43 [
44 dnl Search default locations of OpenSSL library
45 for maindir in /usr/local /usr/lib /usr/pkg /usr /var/ssl /opt; do
46 for dir in $maindir $maindir/openssl $maindir/ssl; do
47 checkssldir $dir && break 2
48 done
49 done
50 ]
51 )
52 if test -z "$ssldir"; then
53 AC_MSG_RESULT([Not found])
54 echo
55 echo "Couldn't find your OpenSSL library installation dir"
56 echo "Use --with-openssl option to fix this problem"
57 echo
58 exit 1
59 fi
60 AC_MSG_RESULT([$ssldir])
61 AC_SUBST(ssldir)
62 AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
63
64 dnl Add OpenSSL includes and libraries
65 CFLAGS="$CFLAGS -I$ssldir/include"
66 AC_ARG_ENABLE(static-openssl,
67 [ --enable-static-openssl link OpenSSL statically],
68 [
69 LIBS="$LIBS $ssldir/lib/libcrypto.a"
70 ],
71 [
72 LIBS="$LIBS -L$ssldir/lib -lcrypto"
73 rpath="$rpath:$ssldir/lib"
74 ])
75
76
77 #
78 # Alignment
79 #
80 AC_MSG_CHECKING([if architecture needs alignment])
81 AC_TRY_RUN([
82 #include <stdlib.h>
83 #include <signal.h>
84 int main(int argc, char **argv)
85 {
86 unsigned char test[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 };
87 signal(SIGBUS, exit);
88 signal(SIGABRT, exit);
89 signal(SIGSEGV, exit);
90 if (*((unsigned int *)(test + 1)) != 0x55443322 && *((unsigned int *)(test + 1)) != 0x22334455) {
91 return 1;
92 }
93 return 0;
94 }],
95 [AC_MSG_RESULT(no)],
96 [AC_MSG_RESULT(yes)
97 AC_DEFINE(NEED_ALIGN)],
98 [AC_MSG_RESULT(assuming yes)
99 AC_DEFINE(NEED_ALIGN)])
100
101
102 #
103 # EGD
104 #
105 AC_ARG_WITH(egd-socket,
106 [ --with-egd-socket=PATH look for Entropy Gathering Daemon socket at PATH],
107 [EGD_SOCKET="$withval"],
108 [EGD_SOCKET="/var/run/egd-pool"]
109 )
110 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
111
112
113 #
114 # rdp2vnc
115 #
116 vncserverconfig=libvncserver-config
117 AC_ARG_WITH(libvncserver-config,
118 [ --with-libvncserver-config=CMD use CMD as libvncserver-config],
119 [vncserverconfig="$withval"]
120 )
121 AC_ARG_WITH(libvncserver,
122 [ --with-libvncserver make rdp2vnc],
123 [
124 VNCINC=`$vncserverconfig --cflags`
125 AC_SUBST(VNCINC)
126 LDVNC=`$vncserverconfig --libs`
127 AC_SUBST(LDVNC)
128 VNCLINK=`$vncserverconfig --link`
129 AC_SUBST(VNCLINK)
130 RDP2VNCTARGET="rdp2vnc"
131 AC_SUBST(RDP2VNCTARGET)
132 ]
133 )
134
135 #
136 # sound
137 #
138 AC_ARG_WITH(libao,
139 [ --with-libao=DIR look for libao at DIR/include, DIR/lib],
140 [
141 CFLAGS="$CFLAGS -I$withval/include"
142 CPPFLAGS="$CPPFLAGS -I$withval/include"
143 LIBS="$LIBS -L$withval/lib"
144 rpath="$rpath:$withval/lib"
145 ]
146 )
147
148 sound="yes"
149 AC_ARG_WITH(sound,
150 [ --with-sound select sound system ("oss", "sgi", "sun" or "libao") ],
151 [
152 sound="$withval"
153 ])
154 if test "$sound" = yes; then
155 AC_CHECK_HEADER(ao/ao.h, [sound=libao])
156 AC_CHECK_HEADER(sys/soundcard.h, [sound=oss])
157 AC_CHECK_HEADER(dmedia/audio.h, [sound=sgi])
158 AC_CHECK_HEADER(sys/audioio.h, [sound=sun])
159 fi
160 if test "$sound" = no; then
161 break
162 elif test "$sound" = oss; then
163 SOUNDOBJ="rdpsnd.o rdpsnd_oss.o"
164 AC_DEFINE(WITH_RDPSND)
165 elif test "$sound" = sgi; then
166 SOUNDOBJ="rdpsnd.o rdpsnd_sgi.o"
167 LDFLAGS="$LDFLAGS -laudio"
168 AC_DEFINE(WITH_RDPSND)
169 elif test "$sound" = sun; then
170 SOUNDOBJ="rdpsnd.o rdpsnd_sun.o"
171 AC_DEFINE(WITH_RDPSND)
172 elif test "$sound" = libao; then
173 SOUNDOBJ="rdpsnd.o rdpsnd_libao.o"
174 LDFLAGS="$LDFLAGS -lao"
175 AC_DEFINE(WITH_RDPSND)
176 else
177 AC_MSG_WARN([sound support disabled])
178 AC_MSG_WARN([Currently supported systems are Open Sound System (oss), SGI AL (sgi), Sun/BSD (sun) and libao])
179 fi
180 AC_SUBST(SOUNDOBJ)
181
182 AC_MSG_CHECKING([checking for sound support])
183
184 #
185 # dirfd
186 #
187 dnl Find out how to get the file descriptor associated with an open DIR*.
188 dnl From Jim Meyering
189
190 AC_DEFUN([UTILS_FUNC_DIRFD],
191 [
192
193 AC_HEADER_DIRENT
194 dirfd_headers='
195 #if HAVE_DIRENT_H
196 # include <dirent.h>
197 #else /* not HAVE_DIRENT_H */
198 # define dirent direct
199 # if HAVE_SYS_NDIR_H
200 # include <sys/ndir.h>
201 # endif /* HAVE_SYS_NDIR_H */
202 # if HAVE_SYS_DIR_H
203 # include <sys/dir.h>
204 # endif /* HAVE_SYS_DIR_H */
205 # if HAVE_NDIR_H
206 # include <ndir.h>
207 # endif /* HAVE_NDIR_H */
208 #endif /* HAVE_DIRENT_H */
209 '
210 AC_CHECK_FUNCS(dirfd)
211 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
212
213 AC_CACHE_CHECK([whether dirfd is a macro],
214 jm_cv_func_dirfd_macro,
215 [AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
216 #ifdef dirfd
217 dirent_header_defines_dirfd
218 #endif],
219 jm_cv_func_dirfd_macro=yes,
220 jm_cv_func_dirfd_macro=no)])
221
222 # Use the replacement only if we have no function, macro,
223 # or declaration with that name.
224 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
225 = no,no,no; then
226 AC_REPLACE_FUNCS([dirfd])
227 AC_CACHE_CHECK(
228 [how to get the file descriptor associated with an open DIR*],
229 gl_cv_sys_dir_fd_member_name,
230 [
231 dirfd_save_CFLAGS=$CFLAGS
232 for ac_expr in d_fd dd_fd; do
233
234 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
235 AC_TRY_COMPILE(
236 [$dirfd_headers
237 ],
238 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
239 dir_fd_found=yes
240 )
241 CFLAGS=$dirfd_save_CFLAGS
242 test "$dir_fd_found" = yes && break
243 done
244 test "$dir_fd_found" = yes || ac_expr=no_such_member
245
246 gl_cv_sys_dir_fd_member_name=$ac_expr
247 ]
248 )
249 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
250 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
251 $gl_cv_sys_dir_fd_member_name,
252 [the name of the file descriptor member of DIR])
253 fi
254 AH_VERBATIM(DIR_TO_FD,
255 [#ifdef DIR_FD_MEMBER_NAME
256 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
257 #else
258 # define DIR_TO_FD(Dir_p) -1
259 #endif
260 ]
261 )
262 fi
263 ])
264
265 UTILS_FUNC_DIRFD
266
267
268 #
269 # IPv6
270 #
271 AC_ARG_WITH(ipv6,
272 [ --with-ipv6 enable IPv6-support],
273 [ AC_DEFINE(IPv6) ])
274
275
276 #
277 # debugging
278 #
279 AC_ARG_WITH(debug,
280 [ --with-debug enable protocol debugging output],
281 [ AC_DEFINE(WITH_DEBUG) ])
282
283 AC_ARG_WITH(debug-kbd,
284 [ --with-debug-kbd enable debugging of keyboard handling],
285 [ AC_DEFINE(WITH_DEBUG_KBD) ])
286
287 AC_ARG_WITH(debug-rdp5,
288 [ --with-debug-rdp5 enable debugging of RDP5 code],
289 [ AC_DEFINE(WITH_DEBUG_RDP5) ])
290
291 AC_ARG_WITH(debug-clipboard,
292 [ --with-debug-clipboard enable debugging of clipboard code],
293 [ AC_DEFINE(WITH_DEBUG_CLIPBOARD) ])
294
295
296 #
297 # target-specific stuff
298 #
299 # strip leading colon from rpath
300 rpath=`echo $rpath |sed 's/^://'`
301 AC_CANONICAL_HOST
302 case "$host" in
303 *-*-solaris*)
304 LDFLAGS="$LDFLAGS -R$rpath"
305 ;;
306 *-dec-osf*)
307 LDFLAGS="$LDFLAGS -Wl,-rpath,$rpath"
308 ;;
309 *-*-hpux*)
310 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
311 ;;
312 *-*-irix6.5*)
313 LIBS="$LIBS -L$ssldir/lib32 -lcrypto"
314 CFLAGS="$CFLAGS -D__SGI_IRIX__"
315 ;;
316 esac
317
318
319 AC_OUTPUT(Makefile)
320
321 dnl Local Variables:
322 dnl comment-start: "dnl "
323 dnl comment-end: ""
324 dnl comment-start-skip: "\\bdnl\\b\\s *"
325 dnl compile-command: "autoconf"
326 dnl End:

  ViewVC Help
Powered by ViewVC 1.1.26