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