Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | AC_INIT(rdr/InStream.h) |
| 3 | |
Peter Åstrand | 5a15f8c | 2005-01-23 20:44:20 +0000 | [diff] [blame] | 4 | PACKAGE=tightvnc |
| 5 | VERSION=1.5.0 |
| 6 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") |
| 7 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") |
| 8 | AC_SUBST(PACKAGE) |
| 9 | AC_SUBST(VERSION) |
| 10 | |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 11 | dnl dirty hack to prevent use of -g in CFLAGS and CXXFLAGS |
| 12 | ac_cv_prog_cc_g=no |
| 13 | ac_cv_prog_cxx_g=no |
| 14 | |
| 15 | dnl Checks for programs. |
| 16 | AC_PROG_CC |
| 17 | AC_PROG_CXX |
| 18 | AC_PROG_RANLIB |
| 19 | AC_PROG_MAKE_SET |
| 20 | AC_LANG_CPLUSPLUS |
| 21 | |
| 22 | case "`(uname -sr) 2>/dev/null`" in |
| 23 | "SunOS 5"*) |
| 24 | SOLARIS=yes |
| 25 | USE_MITSHM=yes |
| 26 | ;; |
| 27 | "Linux"*) |
| 28 | LINUX=yes |
| 29 | USE_MITSHM=yes |
| 30 | ;; |
| 31 | esac |
| 32 | |
| 33 | if test "$USE_MITSHM" = yes; then |
| 34 | MITSHM_CPPFLAGS="-DMITSHM" |
| 35 | fi |
| 36 | AC_SUBST(MITSHM_CPPFLAGS) |
| 37 | |
| 38 | if test "$GCC" = yes; then |
| 39 | CFLAGS="$CFLAGS -Wall" |
| 40 | if test "$SOLARIS" = yes; then |
| 41 | CFLAGS="$CFLAGS -Wno-unknown-pragmas -Wno-implicit-int" |
| 42 | fi |
| 43 | fi |
| 44 | if test "$GXX" = yes; then |
| 45 | CXXFLAGS="$CXXFLAGS -Wall" |
| 46 | if test "$SOLARIS" = yes; then |
| 47 | CXXFLAGS="$CXXFLAGS -Wno-unknown-pragmas -Wno-implicit-int -fpermissive" |
| 48 | fi |
| 49 | fi |
| 50 | |
| 51 | AC_PATH_XTRA |
| 52 | |
| 53 | AC_ARG_WITH(installed-zlib, |
| 54 | [ --with-installed-zlib use the version of zlib which is installed on the |
| 55 | system instead of the one distributed with VNC]) |
| 56 | |
| 57 | if test "$with_installed_zlib" = yes; then |
| 58 | echo "using installed zlib" |
| 59 | ZLIB_LIB=-lz |
| 60 | else |
| 61 | ZLIB_DIR=zlib |
| 62 | ZLIB_INCLUDE='-I$(top_srcdir)/zlib' |
| 63 | ZLIB_LIB='$(top_srcdir)/zlib/libz.a' |
| 64 | echo "configuring zlib..." |
| 65 | (cd zlib; ./configure) |
| 66 | echo "...done configuring zlib" |
| 67 | fi |
| 68 | |
| 69 | AC_SUBST(ZLIB_DIR) |
| 70 | AC_SUBST(ZLIB_INCLUDE) |
| 71 | AC_SUBST(ZLIB_LIB) |
| 72 | |
Peter Åstrand | d29243d | 2004-11-16 13:36:36 +0000 | [diff] [blame] | 73 | AC_ARG_WITH(installed-jpeg, |
| 74 | [ --with-installed-jpeg use the version of jpeg which is installed on the |
| 75 | system instead of the one distributed with VNC]) |
| 76 | |
| 77 | if test "$with_installed_jpeg" = yes; then |
| 78 | echo "using installed jpeg" |
| 79 | JPEG_LIB=-ljpeg |
| 80 | else |
Peter Åstrand | 5135eea | 2005-01-24 13:47:38 +0000 | [diff] [blame] | 81 | JPEG_DIR=jpeg/build |
Peter Åstrand | d29243d | 2004-11-16 13:36:36 +0000 | [diff] [blame] | 82 | JPEG_INCLUDE='-I$(top_srcdir)/jpeg' |
| 83 | JPEG_LIB='$(top_srcdir)/jpeg/libjpeg.a' |
| 84 | echo "configuring jpeg..." |
Peter Åstrand | 5135eea | 2005-01-24 13:47:38 +0000 | [diff] [blame] | 85 | (mkdir jpeg/build; cd jpeg/build; ../configure) |
Peter Åstrand | d29243d | 2004-11-16 13:36:36 +0000 | [diff] [blame] | 86 | echo "...done configuring jpeg" |
| 87 | fi |
| 88 | |
| 89 | AC_SUBST(JPEG_DIR) |
| 90 | AC_SUBST(JPEG_INCLUDE) |
| 91 | AC_SUBST(JPEG_LIB) |
| 92 | |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 93 | AC_CHECK_FUNC(vsnprintf,VSNPRINTF_DEFINE='-DHAVE_VSNPRINTF',VSNPRINTF_DEFINE=) |
| 94 | AC_SUBST(VSNPRINTF_DEFINE) |
| 95 | |
| 96 | AC_MSG_CHECKING(for socklen_t) |
| 97 | AC_TRY_COMPILE( |
| 98 | [#include <sys/types.h> |
| 99 | #include <sys/socket.h>], |
| 100 | [socklen_t x; |
| 101 | accept(0, 0, &x);], |
| 102 | AC_MSG_RESULT(yes) |
| 103 | SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=socklen_t', |
| 104 | AC_MSG_RESULT(using int) |
| 105 | SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=int') |
| 106 | AC_SUBST(SOCKLEN_T_DEFINE) |
| 107 | |
Peter Åstrand | 5a15f8c | 2005-01-23 20:44:20 +0000 | [diff] [blame] | 108 | AM_GNU_GETTEXT |
| 109 | |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 110 | BOILERPLATE=boilerplate.mk |
| 111 | |
| 112 | if (sh -c "make --version" 2>/dev/null | grep GNU 2>&1 >/dev/null); then |
| 113 | if sh -c "vncmkdepend" >/dev/null 2>&1; then |
| 114 | BOILERPLATE="$BOILERPLATE:depend.mk" |
| 115 | fi |
| 116 | fi |
| 117 | |
Peter Åstrand | 5a15f8c | 2005-01-23 20:44:20 +0000 | [diff] [blame] | 118 | AC_OUTPUT(Makefile:Makefile.in:$BOILERPLATE intl/Makefile po/Makefile.in \ |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 119 | rdr/Makefile:rdr/Makefile.in:$BOILERPLATE \ |
| 120 | network/Makefile:network/Makefile.in:$BOILERPLATE \ |
| 121 | Xregion/Makefile:Xregion/Makefile.in:$BOILERPLATE \ |
| 122 | rfb/Makefile:rfb/Makefile.in:$BOILERPLATE \ |
| 123 | tx/Makefile:tx/Makefile.in:$BOILERPLATE \ |
| 124 | x0vncserver/Makefile:x0vncserver/Makefile.in:$BOILERPLATE \ |
Peter Åstrand | beb8e20 | 2004-11-16 13:27:13 +0000 | [diff] [blame] | 125 | vncviewer_unix/Makefile:vncviewer_unix/Makefile.in:$BOILERPLATE \ |
| 126 | vncconfig_unix/Makefile:vncconfig_unix/Makefile.in:$BOILERPLATE \ |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 127 | vncpasswd/Makefile:vncpasswd/Makefile.in:$BOILERPLATE \ |
| 128 | ) |