blob: 8ee4044b67816354436cafb99dde80fcde32fb2d [file] [log] [blame]
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +00001dnl Process this file with autoconf to produce a configure script.
2AC_INIT(rdr/InStream.h)
3
Peter Åstrand5a15f8c2005-01-23 20:44:20 +00004PACKAGE=tightvnc
5VERSION=1.5.0
6AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
7AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
8AC_SUBST(PACKAGE)
9AC_SUBST(VERSION)
10
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000011dnl dirty hack to prevent use of -g in CFLAGS and CXXFLAGS
12ac_cv_prog_cc_g=no
13ac_cv_prog_cxx_g=no
14
15dnl Checks for programs.
16AC_PROG_CC
17AC_PROG_CXX
18AC_PROG_RANLIB
19AC_PROG_MAKE_SET
20AC_LANG_CPLUSPLUS
21
22case "`(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 ;;
31esac
32
33if test "$USE_MITSHM" = yes; then
34 MITSHM_CPPFLAGS="-DMITSHM"
35fi
36AC_SUBST(MITSHM_CPPFLAGS)
37
38if 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
43fi
44if 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
49fi
50
51AC_PATH_XTRA
52
53AC_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
57if test "$with_installed_zlib" = yes; then
58 echo "using installed zlib"
59 ZLIB_LIB=-lz
60else
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"
67fi
68
69AC_SUBST(ZLIB_DIR)
70AC_SUBST(ZLIB_INCLUDE)
71AC_SUBST(ZLIB_LIB)
72
Peter Åstrandd29243d2004-11-16 13:36:36 +000073AC_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
77if test "$with_installed_jpeg" = yes; then
78 echo "using installed jpeg"
79 JPEG_LIB=-ljpeg
80else
Peter Åstrand5135eea2005-01-24 13:47:38 +000081 JPEG_DIR=jpeg/build
Peter Åstrandd29243d2004-11-16 13:36:36 +000082 JPEG_INCLUDE='-I$(top_srcdir)/jpeg'
83 JPEG_LIB='$(top_srcdir)/jpeg/libjpeg.a'
84 echo "configuring jpeg..."
Peter Åstrand5135eea2005-01-24 13:47:38 +000085 (mkdir jpeg/build; cd jpeg/build; ../configure)
Peter Åstrandd29243d2004-11-16 13:36:36 +000086 echo "...done configuring jpeg"
87fi
88
89AC_SUBST(JPEG_DIR)
90AC_SUBST(JPEG_INCLUDE)
91AC_SUBST(JPEG_LIB)
92
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000093AC_CHECK_FUNC(vsnprintf,VSNPRINTF_DEFINE='-DHAVE_VSNPRINTF',VSNPRINTF_DEFINE=)
94AC_SUBST(VSNPRINTF_DEFINE)
95
96AC_MSG_CHECKING(for socklen_t)
97AC_TRY_COMPILE(
98[#include <sys/types.h>
99 #include <sys/socket.h>],
100[socklen_t x;
101accept(0, 0, &x);],
102AC_MSG_RESULT(yes)
103SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=socklen_t',
104AC_MSG_RESULT(using int)
105SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=int')
106AC_SUBST(SOCKLEN_T_DEFINE)
107
Peter Åstrand5a15f8c2005-01-23 20:44:20 +0000108AM_GNU_GETTEXT
109
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +0000110BOILERPLATE=boilerplate.mk
111
112if (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
116fi
117
Peter Åstrand5a15f8c2005-01-23 20:44:20 +0000118AC_OUTPUT(Makefile:Makefile.in:$BOILERPLATE intl/Makefile po/Makefile.in \
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +0000119 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 Åstrandbeb8e202004-11-16 13:27:13 +0000125 vncviewer_unix/Makefile:vncviewer_unix/Makefile.in:$BOILERPLATE \
126 vncconfig_unix/Makefile:vncconfig_unix/Makefile.in:$BOILERPLATE \
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +0000127 vncpasswd/Makefile:vncpasswd/Makefile.in:$BOILERPLATE \
128)