1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(LibVNCServer, 0.9.7, http://sourceforge.net/projects/libvncserver)
3 AM_INIT_AUTOMAKE(LibVNCServer, 0.9.7)
4 AM_CONFIG_HEADER(rfbconfig.h)
5 AX_PREFIX_CONFIG_H([rfb/rfbconfig.h])
16 AC_PATH_PROG([AR], [ar], [/usr/bin/ar],
20 AH_TEMPLATE(WITH_TIGHTVNC_FILETRANSFER, [Disable TightVNCFileTransfer protocol])
21 AC_ARG_WITH(tightvnc-filetransfer,
22 [ --without-filetransfer disable TightVNC file transfer protocol],
23 , [ with_tightvnc_filetransfer=yes ])
24 # AC_DEFINE moved to after libpthread check.
26 AH_TEMPLATE(ALLOW24BPP, [Enable 24 bit per pixel in native framebuffer])
28 [ --without-24bpp disable 24 bpp framebuffers],
30 if test "x$with_24bpp" = "xyes"; then
33 AH_TEMPLATE(FFMPEG, [Use ffmpeg (for vnc2mpg)])
35 [ --with-ffmpeg=dir set ffmpeg home directory],,)
37 AM_CONDITIONAL(WITH_FFMPEG, test ! -z "$with_ffmpeg")
38 if test ! -z "$with_ffmpeg"; then
39 AC_CHECK_LIB(mp3lame, lame_init, HAVE_MP3LAME="true", HAVE_MP3LAME="false" )
41 AM_CONDITIONAL(HAVE_MP3LAME, test "$HAVE_MP3LAME" = "true")
43 # Seem to need this dummy here to induce the 'checking for egrep... grep -E', etc.
44 # before it seemed to be inside the with_jpeg conditional.
45 AC_CHECK_HEADER(thenonexistentheader.h, HAVE_THENONEXISTENTHEADER_H="true")
47 # Checks for X libraries
50 AH_TEMPLATE(HAVE_X11, [X11 build environment present])
52 # See if we are to build x11vnc:
53 AH_TEMPLATE(HAVE_SYSTEM_LIBVNCSERVER, [Use the system libvncserver build environment for x11vnc.])
54 AC_ARG_WITH(system-libvncserver,
55 [ --with-system-libvncserver use installed libvncserver for x11vnc]
56 [ --with-system-libvncserver=DIR use libvncserver installed in DIR for x11vnc],,)
58 [ --with-x11vnc configure for building the x11vnc subdir (if present)]
59 [ you will need to cd to x11vnc and run 'make' etc.],,)
61 if test ! -z "$with_x11vnc" -a "$with_x11vnc" = "yes"; then
63 elif test "$PACKAGE_NAME" = "x11vnc"; then
70 if test "$build_x11vnc" = "yes"; then
72 AH_TEMPLATE(HAVE_XSHM, [MIT-SHM extension build environment present])
73 AH_TEMPLATE(HAVE_XTEST, [XTEST extension build environment present])
74 AH_TEMPLATE(HAVE_XTESTGRABCONTROL, [XTEST extension has XTestGrabControl])
75 AH_TEMPLATE(HAVE_XKEYBOARD, [XKEYBOARD extension build environment present])
76 AH_TEMPLATE(HAVE_LIBXINERAMA, [XINERAMA extension build environment present])
77 AH_TEMPLATE(HAVE_LIBXRANDR, [XRANDR extension build environment present])
78 AH_TEMPLATE(HAVE_LIBXFIXES, [XFIXES extension build environment present])
79 AH_TEMPLATE(HAVE_LIBXDAMAGE, [XDAMAGE extension build environment present])
80 AH_TEMPLATE(HAVE_LIBXTRAP, [DEC-XTRAP extension build environment present])
81 AH_TEMPLATE(HAVE_RECORD, [RECORD extension build environment present])
82 AH_TEMPLATE(HAVE_SOLARIS_XREADSCREEN, [Solaris XReadScreen available])
83 AH_TEMPLATE(HAVE_IRIX_XREADDISPLAY, [IRIX XReadDisplay available])
84 AH_TEMPLATE(HAVE_FBPM, [FBPM extension build environment present])
85 AH_TEMPLATE(HAVE_DPMS, [DPMS extension build environment present])
86 AH_TEMPLATE(HAVE_LINUX_VIDEODEV_H, [video4linux build environment present])
87 AH_TEMPLATE(HAVE_LINUX_FB_H, [linux fb device build environment present])
88 AH_TEMPLATE(HAVE_LINUX_INPUT_H, [linux/input.h present])
89 AH_TEMPLATE(HAVE_LINUX_UINPUT_H, [linux uinput device build environment present])
90 AH_TEMPLATE(HAVE_MACOSX_NATIVE_DISPLAY, [build MacOS X native display support])
92 AC_ARG_WITH(xkeyboard,
93 [ --without-xkeyboard disable xkeyboard extension support],,)
95 [ --without-xinerama disable xinerama extension support],,)
97 [ --without-xrandr disable xrandr extension support],,)
99 [ --without-xfixes disable xfixes extension support],,)
101 [ --without-xdamage disable xdamage extension support],,)
103 [ --without-xtrap disable xtrap extension support],,)
105 [ --without-xrecord disable xrecord extension support],,)
107 [ --without-fbpm disable fbpm extension support],,)
109 [ --without-dpms disable dpms extension support],,)
111 [ --without-v4l disable video4linux support],,)
113 [ --without-fbdev disable linux fb device support],,)
115 [ --without-uinput disable linux uinput device support],,)
116 AC_ARG_WITH(macosx-native,
117 [ --without-macosx-native disable MacOS X native display support],,)
122 if test "x$with_x" = "xno"; then
124 elif test "$X_CFLAGS" != "-DX_DISPLAY_MISSING"; then
125 AC_CHECK_LIB(X11, XGetImage, [AC_DEFINE(HAVE_X11) HAVE_X="true"],
127 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
130 if test $HAVE_X = "true" -a "$build_x11vnc" = "yes"; then
131 X_PRELIBS="$X_PRELIBS -lXext"
133 AC_CHECK_LIB(Xext, XShmGetImage,
134 [AC_DEFINE(HAVE_XSHM)], ,
135 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
137 AC_CHECK_LIB(Xext, XReadScreen,
138 [AC_DEFINE(HAVE_SOLARIS_XREADSCREEN)], ,
139 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
141 AC_CHECK_HEADER(X11/extensions/readdisplay.h,
142 [AC_DEFINE(HAVE_IRIX_XREADDISPLAY)], ,
143 [#include <X11/Xlib.h>])
145 if test "x$with_fbpm" != "xno"; then
146 AC_CHECK_LIB(Xext, FBPMForceLevel,
147 [AC_DEFINE(HAVE_FBPM)], ,
148 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
151 if test "x$with_dpms" != "xno"; then
152 AC_CHECK_LIB(Xext, DPMSForceLevel,
153 [AC_DEFINE(HAVE_DPMS)], ,
154 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
157 AC_CHECK_LIB(Xtst, XTestGrabControl,
158 X_PRELIBS="-lXtst $X_PRELIBS"
159 [AC_DEFINE(HAVE_XTESTGRABCONTROL) HAVE_XTESTGRABCONTROL="true"], ,
160 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
162 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
163 X_PRELIBS="-lXtst $X_PRELIBS"
164 [AC_DEFINE(HAVE_XTEST) HAVE_XTEST="true"], ,
165 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
167 if test "x$with_xrecord" != "xno"; then
168 AC_CHECK_LIB(Xtst, XRecordEnableContextAsync,
169 X_PRELIBS="-lXtst $X_PRELIBS"
170 [AC_DEFINE(HAVE_RECORD)], ,
171 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
174 # we use XTRAP on X11R5, or user can set X11VNC_USE_XTRAP
175 if test "x$with_xtrap" != "xno"; then
176 if test ! -z "$X11VNC_USE_XTRAP" -o -z "$HAVE_XTESTGRABCONTROL"; then
177 AC_CHECK_LIB(XTrap, XETrapSetGrabServer,
178 X_PRELIBS="$X_PRELIBS -lXTrap"
179 [AC_DEFINE(HAVE_LIBXTRAP)], ,
180 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
181 # tru64 uses libXETrap.so
182 AC_CHECK_LIB(XETrap, XETrapSetGrabServer,
183 X_PRELIBS="$X_PRELIBS -lXETrap"
184 [AC_DEFINE(HAVE_LIBXTRAP)], ,
185 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
189 if test "x$with_xkeyboard" != "xno"; then
190 saved_CPPFLAGS="$CPPFLAGS"
191 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
192 AC_CHECK_HEADER(X11/XKBlib.h, HAVE_XKBLIB_H="true",
193 HAVE_XKBLIB_H="false", [#include <X11/Xlib.h>])
194 CPPFLAGS="$saved_CPPFLAGS"
195 if test $HAVE_XKBLIB_H = "true"; then
196 AC_CHECK_LIB(X11, XkbSelectEvents,
197 [AC_DEFINE(HAVE_XKEYBOARD)], ,
198 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
202 if test "x$with_xinerama" != "xno"; then
203 AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
204 X_PRELIBS="$X_PRELIBS -lXinerama"
205 [AC_DEFINE(HAVE_LIBXINERAMA)], ,
206 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
209 if test "x$with_xrandr" != "xno"; then
210 AC_CHECK_LIB(Xrandr, XRRSelectInput,
211 X_PRELIBS="$X_PRELIBS -lXrandr"
212 [AC_DEFINE(HAVE_LIBXRANDR) HAVE_LIBXRANDR="true"], ,
213 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
216 if test "x$with_xfixes" != "xno"; then
217 AC_CHECK_LIB(Xfixes, XFixesGetCursorImage,
218 X_PRELIBS="$X_PRELIBS -lXfixes"
219 [AC_DEFINE(HAVE_LIBXFIXES) HAVE_LIBXFIXES="true"], ,
220 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
223 if test "x$with_xdamage" != "xno"; then
224 AC_CHECK_LIB(Xdamage, XDamageQueryExtension,
225 X_PRELIBS="$X_PRELIBS -lXdamage"
226 [AC_DEFINE(HAVE_LIBXDAMAGE) HAVE_LIBXDAMAGE="true"], ,
227 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
230 if test ! -z "$HAVE_LIBXFIXES" -o ! -z "$HAVE_LIBXDAMAGE"; then
231 # need /usr/sfw/lib in RPATH for Solaris 10 and later
232 case `(uname -sr) 2>/dev/null` in
233 "SunOS 5"*) X_EXTRA_LIBS="$X_EXTRA_LIBS -R/usr/sfw/lib" ;;
236 if test ! -z "$HAVE_LIBXRANDR"; then
237 # also need /usr/X11/include for Solaris 10 10/08 and later
238 case `(uname -sr) 2>/dev/null` in
239 "SunOS 5"*) CPPFLAGS="$CPPFLAGS -I/usr/X11/include" ;;
243 X_LIBS="$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS"
249 AM_CONDITIONAL(HAVE_X, test $HAVE_X != "false")
252 if test "$build_x11vnc" = "yes"; then
254 if test "x$HAVE_X" = "xfalse" -a "x$with_x" != "xno"; then
256 ==========================================================================
257 *** A working X window system build environment is required to build ***
258 x11vnc. Make sure any required X development packages are installed.
259 If they are installed in non-standard locations, one can use the
260 --x-includes=DIR and --x-libraries=DIR configure options or set the
261 CPPFLAGS and LDFLAGS environment variables to indicate where the X
262 window system header files and libraries may be found. On 64+32 bit
263 machines you may need to point to lib64 or lib32 directories to pick up
264 the correct word size.
266 If you want to build x11vnc without X support (e.g. for -rawfb use only
267 or for native Mac OS X), specify the --without-x configure option.
268 ==========================================================================
272 if test "x$HAVE_X" = "xtrue" -a "x$HAVE_XTEST" != "xtrue"; then
274 ==========================================================================
275 *** A working build environment for the XTEST extension was not found ***
276 (libXtst). An x11vnc built this way will be *ONLY BARELY USABLE*.
277 You will be able to move the mouse but not click or type. There can
278 also be deadlocks if an application grabs the X server.
280 It is recommended that you install the necessary development packages
281 for XTEST (perhaps it is named something like libxtst-dev) and run
283 ==========================================================================
288 # set some ld -R nonsense
290 uname_s=`(uname -s) 2>/dev/null`
292 if test "x$uname_s" = "xHP-UX"; then
294 elif test "x$uname_s" = "xOSF1"; then
296 elif test "x$uname_s" = "xDarwin"; then
301 AH_TEMPLATE(HAVE_LIBCRYPT, [libcrypt library present])
303 [ --without-crypt disable support for libcrypt],,)
304 if test "x$with_crypt" != "xno"; then
305 AC_CHECK_FUNCS([crypt], HAVE_LIBC_CRYPT="true")
306 if test -z "$HAVE_LIBC_CRYPT"; then
307 AC_CHECK_LIB(crypt, crypt,
309 [AC_DEFINE(HAVE_LIBCRYPT)], ,)
314 # some OS's need both -lssl and -lcrypto on link line:
315 AH_TEMPLATE(HAVE_LIBCRYPTO, [openssl libcrypto library present])
317 [ --without-crypto disable support for openssl libcrypto],,)
319 AH_TEMPLATE(HAVE_LIBSSL, [openssl libssl library present])
321 [ --without-ssl disable support for openssl libssl]
322 [ --with-ssl=DIR use openssl include/library files in DIR],,)
324 if test "x$with_crypto" != "xno" -a "x$with_ssl" != "xno"; then
325 if test ! -z "$with_ssl" -a "x$with_ssl" != "xyes"; then
326 saved_CPPFLAGS="$CPPFLAGS"
327 saved_LDFLAGS="$LDFLAGS"
328 CPPFLAGS="$CPPFLAGS -I$with_ssl/include"
329 LDFLAGS="$LDFLAGS -L$with_ssl/lib"
330 if test "x$ld_minus_R" = "xno"; then
332 elif test "x$GCC" = "xyes"; then
333 LDFLAGS="$LDFLAGS -Xlinker -R$with_ssl/lib"
335 LDFLAGS="$LDFLAGS -R$with_ssl/lib"
338 AC_CHECK_LIB(crypto, RAND_file_name,
339 [AC_DEFINE(HAVE_LIBCRYPTO) HAVE_LIBCRYPTO="true"], ,)
340 if test ! -z "$with_ssl" -a "x$with_ssl" != "xyes"; then
341 if test "x$HAVE_LIBCRYPTO" != "xtrue"; then
342 CPPFLAGS="$saved_CPPFLAGS"
343 LDFLAGS="$saved_LDFLAGS"
348 AH_TEMPLATE(HAVE_X509_PRINT_EX_FP, [open ssl X509_print_ex_fp available])
349 if test "x$with_ssl" != "xno"; then
350 if test "x$HAVE_LIBCRYPTO" = "xtrue"; then
351 AC_CHECK_LIB(ssl, SSL_library_init,
352 SSL_LIBS="-lssl -lcrypto"
353 [AC_DEFINE(HAVE_LIBSSL) HAVE_LIBSSL="true"], ,
356 AC_CHECK_LIB(ssl, SSL_library_init,
358 [AC_DEFINE(HAVE_LIBSSL) HAVE_LIBSSL="true"], ,)
363 if test "x$HAVE_LIBSSL" != "xtrue" -a "x$with_ssl" != "xno"; then
365 ==========================================================================
366 *** The openssl encryption library libssl.so was not found. ***
367 An x11vnc built this way will not support SSL encryption. To enable
368 SSL install the necessary development packages (perhaps it is named
369 something like libssl-dev) and run configure again.
370 ==========================================================================
373 elif test "x$with_ssl" != "xno"; then
374 AC_CHECK_LIB(ssl, X509_print_ex_fp,
375 [AC_DEFINE(HAVE_X509_PRINT_EX_FP) HAVE_X509_PRINT_EX_FP="true"], , $SSL_LIBS
379 if test "x$with_v4l" != "xno"; then
380 AC_CHECK_HEADER(linux/videodev.h,
381 [AC_DEFINE(HAVE_LINUX_VIDEODEV_H)],,)
383 if test "x$with_fbdev" != "xno"; then
384 AC_CHECK_HEADER(linux/fb.h,
385 [AC_DEFINE(HAVE_LINUX_FB_H)],,)
387 if test "x$with_uinput" != "xno"; then
388 AC_CHECK_HEADER(linux/input.h,
389 [AC_DEFINE(HAVE_LINUX_INPUT_H) HAVE_LINUX_INPUT_H="true"],,)
390 if test "x$HAVE_LINUX_INPUT_H" = "xtrue"; then
391 AC_CHECK_HEADER(linux/uinput.h,
392 [AC_DEFINE(HAVE_LINUX_UINPUT_H)],, [#include <linux/input.h>])
396 if test "x$with_macosx_native" != "xno"; then
397 AC_DEFINE(HAVE_MACOSX_NATIVE_DISPLAY)
400 AH_TEMPLATE(HAVE_AVAHI, [Avahi/mDNS client build environment present])
402 [ --without-avahi disable support for Avahi/mDNS]
403 [ --with-avahi=DIR use avahi include/library files in DIR],,)
404 if test "x$with_avahi" != "xno"; then
405 printf "checking for avahi... "
406 if test ! -z "$with_avahi" -a "x$with_avahi" != "xyes"; then
407 AVAHI_CFLAGS="-I$with_avahi/include"
408 AVAHI_LIBS="-L$with_avahi/lib -lavahi-common -lavahi-client"
409 echo "using $with_avahi"
411 elif pkg-config --atleast-version=0.6.4 avahi-client >/dev/null 2>&1; then
412 AVAHI_CFLAGS=`pkg-config --cflags avahi-client`
413 AVAHI_LIBS=`pkg-config --libs avahi-client`
421 if test "x$with_avahi" = "xyes"; then
422 AC_DEFINE(HAVE_AVAHI)
423 AC_SUBST(AVAHI_CFLAGS)
430 # Checks for libraries.
432 if test ! -z "$with_system_libvncserver" -a "x$with_system_libvncserver" != "xno"; then
433 printf "checking for system libvncserver... "
435 if test "X$VNEED" != "X"; then
438 if test "x$with_system_libvncserver" != "xyes"; then
440 if test "x$ld_minus_R" = "xno"; then
442 elif test "x$GCC" = "xyes"; then
443 rflag="-Xlinker -R$with_system_libvncserver/lib"
445 rflag="-R$with_system_libvncserver/lib"
447 cmd="$with_system_libvncserver/bin/libvncserver-config"
448 if $cmd --version 1>/dev/null 2>&1; then
449 cvers=`$cmd --version 2>/dev/null`
450 cscore=`echo "$cvers" | tr '.' ' ' | awk '{print 10000 * $1 + 100 * $2 + $3}'`
451 nscore=`echo "$vneed" | tr '.' ' ' | awk '{print 10000 * $1 + 100 * $2 + $3}'`
453 if test $cscore -lt $nscore; then
455 with_system_libvncserver=no
457 ==========================================================================
458 *** Need libvncserver version $vneed, have version $cvers ***
459 You are building with a system installed libvncserver and it is not
461 ==========================================================================
464 SYSTEM_LIBVNCSERVER_CFLAGS="-I$with_system_libvncserver/include"
465 SYSTEM_LIBVNCSERVER_LIBS="-L$with_system_libvncserver/lib $rflag -lvncserver -lvncclient"
466 echo "using $with_system_libvncserver"
467 with_system_libvncserver=yes
470 echo " *** cannot run $cmd *** " 1>&2
471 with_system_libvncserver=no
474 elif libvncserver-config --version 1>/dev/null 2>&1; then
476 rprefix=`libvncserver-config --prefix`
477 if test "x$ld_minus_R" = "xno"; then
479 elif test "x$GCC" = "xyes"; then
480 rflag=" -Xlinker -R$rprefix/lib "
482 rflag=" -R$rprefix/lib "
484 cvers=`libvncserver-config --version 2>/dev/null`
485 cscore=`echo "$cvers" | tr '.' ' ' | awk '{print 10000 * $1 + 100 * $2 + $3}'`
486 nscore=`echo "$vneed" | tr '.' ' ' | awk '{print 10000 * $1 + 100 * $2 + $3}'`
488 if test $cscore -lt $nscore; then
491 ==========================================================================
492 *** Need libvncserver version $vneed, have version $cvers ***
493 You are building with a system installed libvncserver and it is not
495 ==========================================================================
498 SYSTEM_LIBVNCSERVER_CFLAGS=`libvncserver-config --cflags`
499 SYSTEM_LIBVNCSERVER_LIBS="$rflag"`libvncserver-config --libs`
500 with_system_libvncserver=yes
504 with_system_libvncserver=no
509 if test "x$with_system_libvncserver" = "xyes"; then
510 AC_DEFINE(HAVE_SYSTEM_LIBVNCSERVER)
511 AC_SUBST(SYSTEM_LIBVNCSERVER_CFLAGS)
512 AC_SUBST(SYSTEM_LIBVNCSERVER_LIBS)
514 AM_CONDITIONAL(HAVE_SYSTEM_LIBVNCSERVER, test "x$with_system_libvncserver" = "xyes")
518 [ --without-jpeg disable support for jpeg]
519 [ --with-jpeg=DIR use jpeg include/library files in DIR],,)
522 # no jpeg on command line with_jpeg=""
523 # -with-jpeg with_jpeg="yes"
524 # -without-jpeg with_jpeg="no"
525 # -with-jpeg=/foo/dir with_jpeg="/foo/dir"
527 if test "x$with_jpeg" != "xno"; then
528 if test ! -z "$with_jpeg" -a "x$with_jpeg" != "xyes"; then
529 # add user supplied directory to flags:
530 saved_CPPFLAGS="$CPPFLAGS"
531 saved_LDFLAGS="$LDFLAGS"
532 CPPFLAGS="$CPPFLAGS -I$with_jpeg/include"
533 LDFLAGS="$LDFLAGS -L$with_jpeg/lib"
534 if test "x$ld_minus_R" = "xno"; then
536 elif test "x$GCC" = "xyes"; then
537 # this is not complete... in general a rat's nest.
538 LDFLAGS="$LDFLAGS -Xlinker -R$with_jpeg/lib"
540 LDFLAGS="$LDFLAGS -R$with_jpeg/lib"
543 AC_CHECK_HEADER(jpeglib.h, HAVE_JPEGLIB_H="true")
544 if test "x$HAVE_JPEGLIB_H" = "xtrue"; then
545 AC_CHECK_LIB(jpeg, jpeg_CreateCompress, , HAVE_JPEGLIB_H="")
547 if test ! -z "$with_jpeg" -a "x$with_jpeg" != "xyes"; then
548 if test "x$HAVE_JPEGLIB_H" != "xtrue"; then
549 # restore old flags on failure:
550 CPPFLAGS="$saved_CPPFLAGS"
551 LDFLAGS="$saved_LDFLAGS"
554 if test "$build_x11vnc" = "yes"; then
555 if test "x$HAVE_JPEGLIB_H" != "xtrue"; then
557 ==========================================================================
558 *** The libjpeg compression library was not found. ***
559 This may lead to reduced performance, especially over slow links.
560 If libjpeg is in a non-standard location use --with-jpeg=DIR to
561 indicate the header file is in DIR/include/jpeglib.h and the library
562 in DIR/lib/libjpeg.a. A copy of libjpeg may be obtained from:
563 ftp://ftp.uu.net/graphics/jpeg/
564 ==========================================================================
572 [ --without-libz disable support for deflate],,)
574 [ --without-zlib disable support for deflate]
575 [ --with-zlib=DIR use zlib include/library files in DIR],,)
577 if test "x$with_zlib" != "xno" -a "x$with_libz" != "xno"; then
578 if test ! -z "$with_zlib" -a "x$with_zlib" != "xyes"; then
579 saved_CPPFLAGS="$CPPFLAGS"
580 saved_LDFLAGS="$LDFLAGS"
581 CPPFLAGS="$CPPFLAGS -I$with_zlib/include"
582 LDFLAGS="$LDFLAGS -L$with_zlib/lib"
583 if test "x$ld_minus_R" = "xno"; then
585 elif test "x$GCC" = "xyes"; then
586 LDFLAGS="$LDFLAGS -Xlinker -R$with_zlib/lib"
588 LDFLAGS="$LDFLAGS -R$with_zlib/lib"
591 AC_CHECK_HEADER(zlib.h, HAVE_ZLIB_H="true")
592 if test "x$HAVE_ZLIB_H" = "xtrue"; then
593 AC_CHECK_LIB(z, deflate, , HAVE_ZLIB_H="")
595 if test ! -z "$with_zlib" -a "x$with_zlib" != "xyes"; then
596 if test "x$HAVE_ZLIB_H" != "xtrue"; then
597 CPPFLAGS="$saved_CPPFLAGS"
598 LDFLAGS="$saved_LDFLAGS"
601 if test "$build_x11vnc" = "yes"; then
602 if test "x$HAVE_ZLIB_H" != "xtrue"; then
604 ==========================================================================
605 *** The libz compression library was not found. ***
606 This may lead to reduced performance, especially over slow links.
607 If libz is in a non-standard location use --with-zlib=DIR to indicate the
608 header file is in DIR/include/zlib.h and the library in DIR/lib/libz.a.
609 A copy of libz may be obtained from: http://www.gzip.org/zlib/
610 ==========================================================================
618 [ --without-pthread disable support for libpthread],,)
620 if test "x$with_pthread" != "xno"; then
621 AC_CHECK_HEADER(pthread.h, HAVE_PTHREAD_H="true")
622 if test ! -z "$HAVE_PTHREAD_H"; then
623 AC_CHECK_LIB(pthread, pthread_mutex_lock)
624 AC_CHECK_LIB(pthread, pthread_mutex_lock, HAVE_LIBPTHREAD="true")
627 AM_CONDITIONAL(HAVE_LIBPTHREAD, test ! -z "$HAVE_LIBPTHREAD")
629 # tightvnc-filetransfer implemented using threads:
630 if test -z "$HAVE_LIBPTHREAD"; then
631 with_tightvnc_filetransfer=""
633 if test "x$with_tightvnc_filetransfer" = "xyes"; then
634 AC_DEFINE(WITH_TIGHTVNC_FILETRANSFER)
636 AM_CONDITIONAL(WITH_TIGHTVNC_FILETRANSFER, test "$with_tightvnc_filetransfer" = "yes")
638 AM_CONDITIONAL(HAVE_LIBZ, test ! -z "$HAVE_ZLIB_H")
639 AM_CONDITIONAL(HAVE_LIBJPEG, test ! -z "$HAVE_JPEGLIB_H")
641 if test -z "$with_sdl"; then
642 if sdl-config --version >/dev/null 2>&1; then
644 SDL_CFLAGS=`sdl-config --cflags`
645 SDL_LIBS=`sdl-config --libs`
650 AM_CONDITIONAL(HAVE_LIBSDL, test "x$with_sdl" = "xyes")
654 MINGW=`uname -s | grep MINGW 2>/dev/null`
655 AM_CONDITIONAL(MINGW, test ! -z "$MINGW" )
656 if test ! -z "$MINGW"; then
661 # Checks for header files.
663 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h])
666 if test "$build_x11vnc" = "yes"; then
667 AC_CHECK_HEADERS([pwd.h sys/wait.h utmpx.h termios.h sys/ioctl.h sys/stropts.h])
670 # Checks for typedefs, structures, and compiler characteristics.
678 if test ! -d ./rfb; then
679 echo "creating subdir ./rfb for rfbint.h"
682 AC_CREATE_STDINT_H(rfb/rfbint.h)
683 AC_CACHE_CHECK([for in_addr_t],
685 AC_TRY_COMPILE([#include <sys/types.h>
686 #include <netinet/in.h>],
687 [in_addr_t foo; return 0;],
691 AH_TEMPLATE(NEED_INADDR_T, [Need a typedef for in_addr_t])
692 if test $inaddrt = no ; then
693 AC_DEFINE(NEED_INADDR_T)
696 # Checks for library functions.
702 AC_CHECK_LIB(nsl,gethostbyname)
703 AC_CHECK_LIB(socket,socket)
705 uname_s=`(uname -s) 2>/dev/null`
706 if test "x$uname_s" = "xHP-UX"; then
707 # need -lsec for getspnam()
708 LDFLAGS="$LDFLAGS -lsec"
711 AC_CHECK_FUNCS([ftime gethostbyname gethostname gettimeofday inet_ntoa memmove memset mmap mkfifo select socket strchr strcspn strdup strerror strstr])
713 if test "$build_x11vnc" = "yes"; then
714 AC_CHECK_FUNCS([setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid initgroups waitpid setutxent grantpt shmat])
717 # check, if shmget is in cygipc.a
718 AC_CHECK_LIB(cygipc,shmget)
719 AM_CONDITIONAL(CYGIPC, test "$HAVE_CYGIPC" = "true")
721 # Check if /dev/vcsa1 exists, if so, define LINUX
722 AM_CONDITIONAL(LINUX, test -c /dev/vcsa1)
724 # Check for OS X specific header
725 AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h, HAVE_OSX="true")
726 AM_CONDITIONAL(OSX, test "$HAVE_OSX" = "true")
728 # On Solaris 2.7, write() returns ENOENT when it really means EAGAIN
729 AH_TEMPLATE(ENOENT_WORKAROUND, [work around when write() returns ENOENT but does not mean it])
730 case `(uname -sr) 2>/dev/null` in
732 AC_DEFINE(ENOENT_WORKAROUND)
736 # Check for rpm SOURCES path
737 printf "checking for rpm sources path... "
738 RPMSOURCEDIR="NOT-FOUND"
739 for directory in packages OpenLinux redhat RedHat rpm RPM "" ; do
740 if test -d /usr/src/${directory}/SOURCES; then
741 RPMSOURCEDIR="/usr/src/${directory}/SOURCES/"
745 AM_CONDITIONAL(HAVE_RPM, test "$RPMSOURCEDIR" != "NOT-FOUND")
746 AM_CONDITIONAL(WITH_X11VNC, test "$build_x11vnc" = "yes")
747 AC_SUBST(RPMSOURCEDIR)
749 AC_CONFIG_FILES([Makefile
750 libvncserver/Makefile
756 libvncclient/Makefile
757 client_examples/Makefile
764 if test "$build_x11vnc" = "yes"; then
766 # NOTE: if you are using the LibVNCServer-X.Y.Z.tar.gz source
767 # tarball and nevertheless want to run autoconf (i.e. aclocal,
768 # autoheader, automake, autoconf) AGAIN (perhaps you have a
769 # special target system, e.g. embedded) then you will need to
770 # comment out the following 'AC_CONFIG_FILES' line to avoid
771 # automake error messages like:
773 # configure.ac:690: required file `x11vnc/Makefile.in' not found
775 AC_CONFIG_FILES([x11vnc/Makefile x11vnc/misc/Makefile])
778 AC_CONFIG_COMMANDS([chmod-libvncserver-config],[chmod a+x libvncserver-config])
780 chmod a+x ./libvncserver-config