summaryrefslogtreecommitdiffstats
path: root/configure.in
blob: e232c1823e7843f4928d39ea4a712de8ee0ec9ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
dnl Process this file with autoconf to produce a configure script.
AC_INIT(rdr/InStream.h)

PACKAGE=tightvnc
VERSION=1.5.0
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)

dnl dirty hack to prevent use of -g in CFLAGS and CXXFLAGS
ac_cv_prog_cc_g=no
ac_cv_prog_cxx_g=no

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_MAKE_SET
AC_LANG_CPLUSPLUS

case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
  SOLARIS=yes
  USE_MITSHM=yes
  ;;
"Linux"*)
  LINUX=yes
  USE_MITSHM=yes
  ;;
esac

if test "$USE_MITSHM" = yes; then
  MITSHM_CPPFLAGS="-DMITSHM"
fi
AC_SUBST(MITSHM_CPPFLAGS)

if test "$GCC" = yes; then
  CFLAGS="$CFLAGS -Wall"
  if test "$SOLARIS" = yes; then
    CFLAGS="$CFLAGS -Wno-unknown-pragmas -Wno-implicit-int"
  fi
fi
if test "$GXX" = yes; then
  CXXFLAGS="$CXXFLAGS -Wall"
  if test "$SOLARIS" = yes; then
    CXXFLAGS="$CXXFLAGS -Wno-unknown-pragmas -Wno-implicit-int -fpermissive"
  fi
fi

AC_PATH_XTRA

AC_ARG_WITH(installed-zlib,
[  --with-installed-zlib   use the version of zlib which is installed on the
                          system instead of the one distributed with VNC])

if test "$with_installed_zlib" = yes; then
  echo "using installed zlib"
  ZLIB_LIB=-lz
else
  ZLIB_DIR=zlib
  ZLIB_INCLUDE='-I$(top_srcdir)/zlib'
  ZLIB_LIB='$(top_srcdir)/zlib/libz.a'
  echo "configuring zlib..."
  (cd zlib; ./configure)
  echo "...done configuring zlib"
fi

AC_SUBST(ZLIB_DIR)
AC_SUBST(ZLIB_INCLUDE)
AC_SUBST(ZLIB_LIB)

AC_ARG_WITH(installed-jpeg,
[  --with-installed-jpeg   use the version of jpeg which is installed on the
                          system instead of the one distributed with VNC])

if test "$with_installed_jpeg" = yes; then
  echo "using installed jpeg"
  JPEG_LIB=-ljpeg
else
  JPEG_DIR=jpeg/build
  JPEG_INCLUDE='-I$(top_srcdir)/jpeg'
  JPEG_LIB='$(top_srcdir)/jpeg/build/libjpeg.a'
  echo "configuring jpeg..."
  (mkdir jpeg/build; cd jpeg/build; ../configure)
  echo "...done configuring jpeg"
fi

AC_SUBST(JPEG_DIR)
AC_SUBST(JPEG_INCLUDE)
AC_SUBST(JPEG_LIB)

AC_CHECK_FUNC(vsnprintf,VSNPRINTF_DEFINE='-DHAVE_VSNPRINTF',VSNPRINTF_DEFINE=)
AC_SUBST(VSNPRINTF_DEFINE)

AC_MSG_CHECKING(for socklen_t)
AC_TRY_COMPILE(
[#include <sys/types.h>
 #include <sys/socket.h>],
[socklen_t x;
accept(0, 0, &x);],
AC_MSG_RESULT(yes)
SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=socklen_t',
AC_MSG_RESULT(using int)
SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=int')
AC_SUBST(SOCKLEN_T_DEFINE)

AM_GNU_GETTEXT

BOILERPLATE=boilerplate.mk

if (sh -c "make --version" 2>/dev/null | grep GNU 2>&1 >/dev/null); then
  if sh -c "vncmkdepend" >/dev/null 2>&1; then
    BOILERPLATE="$BOILERPLATE:depend.mk"
  fi
fi

AC_OUTPUT(Makefile:Makefile.in:$BOILERPLATE  intl/Makefile po/Makefile.in \
         rdr/Makefile:rdr/Makefile.in:$BOILERPLATE \
         network/Makefile:network/Makefile.in:$BOILERPLATE \
         Xregion/Makefile:Xregion/Makefile.in:$BOILERPLATE \
         rfb/Makefile:rfb/Makefile.in:$BOILERPLATE \
         tx/Makefile:tx/Makefile.in:$BOILERPLATE \
         x0vncserver/Makefile:x0vncserver/Makefile.in:$BOILERPLATE \
         vncviewer_unix/Makefile:vncviewer_unix/Makefile.in:$BOILERPLATE \
         vncconfig_unix/Makefile:vncconfig_unix/Makefile.in:$BOILERPLATE \
         vncpasswd/Makefile:vncpasswd/Makefile.in:$BOILERPLATE \
)