Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | |
| 3 | AC_INIT([tightvnc], [1.5.0a1], [http://www.tightvnc.com/bugs.html]) |
| 4 | AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2]) |
| 5 | |
| 6 | dnl Checks for programs. |
Adam Tkac | 214522e | 2008-03-20 13:30:22 +0000 | [diff] [blame] | 7 | AM_GNU_GETTEXT([external]) |
| 8 | AM_GNU_GETTEXT_VERSION([0.17]) |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 9 | AC_PROG_CC |
| 10 | AC_PROG_CXX |
| 11 | AC_PROG_LIBTOOL |
| 12 | AC_PROG_MAKE_SET |
| 13 | AC_LANG([C++]) |
| 14 | |
| 15 | saved_cflags="$CFLAGS" |
| 16 | saved_cxxflags="$CXXFLAGS" |
| 17 | CFLAGS="$CFLAGS -Wall -Wextra" |
| 18 | CXXFLAGS="$CXXFLAGS -Wall -Wextra" |
| 19 | |
| 20 | AC_MSG_CHECKING([if compiler supports -Wall and -Werror flags]) |
| 21 | AC_COMPILE_IFELSE( |
| 22 | [AC_LANG_PROGRAM([])], |
| 23 | [AC_MSG_RESULT([yes])], |
| 24 | [AC_MSG_RESULT([no]) |
| 25 | CFLAGS="$saved_cflags" |
| 26 | CXXFLAGS="$saved_cxxflags"]) |
| 27 | |
| 28 | AC_SUBST([COMMON_DIR], ['$(top_srcdir)/common']) |
| 29 | AC_SUBST([UNIX_DIR], ['$(top_srcdir)/unix']) |
| 30 | AC_SUBST([TX_DIR], ['$(UNIX_DIR)/tx']) |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 31 | AC_SUBST([RFB_LIBS], ['$(COMMON_DIR)/rfb/librfb.la']) |
| 32 | AC_SUBST([RDR_LIBS], ['$(COMMON_DIR)/rdr/librdr.la']) |
| 33 | AC_SUBST([NETWORK_LIBS], ['$(COMMON_DIR)/network/libnetwork.la']) |
| 34 | AC_SUBST([TX_LIBS], ['$(TX_DIR)/libtx.la']) |
| 35 | |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 36 | dnl XXX this statement really bother me |
| 37 | case "`(uname -sr) 2>/dev/null`" in |
| 38 | "SunOS 5"*) |
| 39 | SOLARIS=yes |
| 40 | USE_MITSHM=yes |
| 41 | USE_SUN_OVL=yes |
| 42 | ;; |
| 43 | "Linux"*) |
| 44 | LINUX=yes |
| 45 | USE_MITSHM=yes |
| 46 | ;; |
| 47 | "IRIX 6"*) |
| 48 | X_LIBS="-L/usr/lib32" |
| 49 | USE_MITSHM=yes |
| 50 | USE_READDISPLAY=yes |
| 51 | ;; |
| 52 | "LynxOS 2"*) |
| 53 | SJLJ_EXCEPTIONS=yes |
| 54 | ;; |
| 55 | esac |
| 56 | |
| 57 | dnl FIXME: Check for MIT-SHM properly, add a corresponding --with option. |
| 58 | if test "$USE_MITSHM" = yes; then |
Adam Tkac | 214522e | 2008-03-20 13:30:22 +0000 | [diff] [blame] | 59 | AC_DEFINE([HAVE_MITSHM], 1, [Define if you have MIT-SHM extension]) |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 60 | fi |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 61 | |
| 62 | if test "$GCC" = yes; then |
| 63 | if test "$SOLARIS" = yes; then |
| 64 | CFLAGS="$CFLAGS -Wno-unknown-pragmas -Wno-implicit-int" |
| 65 | fi |
| 66 | fi |
| 67 | if test "$GXX" = yes; then |
| 68 | if test "$SOLARIS" = yes; then |
| 69 | CXXFLAGS="$CXXFLAGS -Wno-unknown-pragmas -fpermissive" |
| 70 | fi |
| 71 | if test "$SJLJ_EXCEPTIONS" = yes; then |
| 72 | CXXFLAGS="$CXXFLAGS -fsjlj-exceptions" |
| 73 | fi |
| 74 | fi |
| 75 | |
| 76 | AC_PATH_XTRA |
| 77 | |
| 78 | AC_ARG_ENABLE([vncconfig], |
| 79 | AS_HELP_STRING([--enable-vncconfig], |
| 80 | [build the vncconfig utility(default yes)]), |
| 81 | [BUILD_VNCCONFIG="$enableval"], [BUILD_VNCCONFIG="yes"]) |
| 82 | AM_CONDITIONAL([VNCCONFIG], [test "x$BUILD_VNCCONFIG" = xyes]) |
| 83 | |
| 84 | dnl Check for the XTest X11 extension library. |
| 85 | AC_SEARCH_LIBS([XTestGrabControl], [Xtst], |
| 86 | [AC_DEFINE([HAVE_XTEST], [], [Define if you have Xtst library])], |
Adam Tkac | bee114a | 2008-03-21 15:22:30 +0000 | [diff] [blame] | 87 | [AC_MSG_WARN([No XTest extension, building x0vncserver view-only])], |
| 88 | [-lXext -lX11]) |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 89 | |
| 90 | dnl Support for READDISPLAY (Irix) and SUN_OVL (Solaris) extensions |
| 91 | dnl FIXME: Implement corresponding --with options. |
| 92 | if test "$USE_READDISPLAY" = yes; then |
| 93 | AC_DEFINE([HAVE_READDISPLAY], [], [Define if you have READDISPLAY extension]) |
| 94 | elif test "$USE_SUN_OVL" = yes; then |
| 95 | AC_DEFINE([HAVE_SUN_OVL], [], [Define if you have SUN_OVL extension]) |
| 96 | fi |
| 97 | |
| 98 | dnl Under Lynx/OS 2.3, we have to link with -lbsd to resolve |
| 99 | dnl gethostbyname, inet_addr, htons etc. Check if it's necessary. |
| 100 | AC_SEARCH_LIBS([gethostbyname], [c bsd]) |
| 101 | |
| 102 | |
| 103 | dnl Checks for IRIX-specific Compression Library. |
| 104 | AC_SEARCH_LIBS([clQuerySchemeFromName], [cl], |
| 105 | [AC_DEFINE([HAVE_CL], [], [Define if you have cl library]) |
| 106 | USE_CL=yes]) |
| 107 | AM_CONDITIONAL([CL], [test "x$USE_CL" = xyes]) |
| 108 | |
| 109 | dnl Checks for IRIX-specific Digital Media libraries. |
| 110 | AC_SEARCH_LIBS([dmICCreate], [dmedia], |
| 111 | [AC_DEFINE([HAVE_DMEDIA], [], [Define if you have dmedia library]) |
| 112 | USE_DMEDIA=yes]) |
| 113 | AM_CONDITIONAL([DMEDIA], [test "x$USE_DMEDIA" = xyes]) |
| 114 | |
Adam Tkac | 62a5eb3 | 2008-03-21 12:13:13 +0000 | [diff] [blame] | 115 | |
| 116 | AC_CONFIG_SUBDIRS([common/zlib]) |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 117 | AC_SEARCH_LIBS([inflate], [z], [], |
Adam Tkac | 62a5eb3 | 2008-03-21 12:13:13 +0000 | [diff] [blame] | 118 | [ZLIB_LIBS='$(COMMON_DIR)/zlib/libz.la' |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 119 | VNC_ZLIB=yes]) |
| 120 | AM_CONDITIONAL([ZLIB], [test "x$VNC_ZLIB" = xyes]) |
| 121 | AC_SUBST(ZLIB_LIBS) |
| 122 | |
Adam Tkac | 62a5eb3 | 2008-03-21 12:13:13 +0000 | [diff] [blame] | 123 | dnl AC_CONFIG_SUBDIRS([common/jpeg]) |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 124 | AC_SEARCH_LIBS([jpeg_destroy_compress], [jpeg], [], |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 125 | [JPEG_LIBS='$(COMMON_DIR)/jpeg/libjpeg.a' |
| 126 | VNC_JPEG=yes]) |
| 127 | AM_CONDITIONAL([JPEG], [test "x$VNC_JPEG" = xyes]) |
| 128 | AC_SUBST(JPEG_LIBS) |
| 129 | |
| 130 | AC_CHECK_FUNCS_ONCE([vsnprintf strcasecmp strncasecmp]) |
| 131 | |
| 132 | AC_MSG_CHECKING([for socklen_t]) |
| 133 | AC_COMPILE_IFELSE( |
| 134 | [AC_LANG_PROGRAM( |
| 135 | [[#include <sys/types.h> |
| 136 | #include <sys/socket.h>]], |
| 137 | [[socklen_t x; |
| 138 | accept(0, 0, &x);]])], |
| 139 | [AC_MSG_RESULT([yes]) |
| 140 | AC_DEFINE([VNC_SOCKLEN_T], [socklen_t], [Define to socklen_t or int])], |
| 141 | [AC_MSG_RESULT([using int]) |
| 142 | AC_DEFINE([VNC_SOCKLEN_T], [int], [Define to socklen_t or int])]) |
| 143 | |
Adam Tkac | 214522e | 2008-03-20 13:30:22 +0000 | [diff] [blame] | 144 | AC_CONFIG_HEADER([config.h]) |
| 145 | |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 146 | AC_CONFIG_FILES([Makefile |
Adam Tkac | 214522e | 2008-03-20 13:30:22 +0000 | [diff] [blame] | 147 | po/Makefile.in |
Adam Tkac | ae2c645 | 2008-03-20 11:48:41 +0000 | [diff] [blame] | 148 | common/Makefile |
| 149 | common/rdr/Makefile |
| 150 | common/network/Makefile |
| 151 | common/Xregion/Makefile |
| 152 | common/rfb/Makefile |
| 153 | unix/Makefile |
| 154 | unix/tx/Makefile |
| 155 | unix/x0vncserver/Makefile |
| 156 | unix/vncviewer/Makefile |
| 157 | unix/vncconfig/Makefile |
| 158 | unix/vncpasswd/Makefile]) |
| 159 | AC_OUTPUT |