aboutsummaryrefslogtreecommitdiffstats
path: root/common/configure.ac
blob: ab7829b0fcaf23fa27fc148c65e2ef2009d59550 (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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
AC_INIT([librfb], [1.5.0a1], [http://www.tightvnc.com/bugs.html])

AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_LANG([C++])

AC_CONFIG_HEADERS([common-config.h])
CPPFLAGS="-DHAVE_COMMON_CONFIG_H $CPPFLAGS"

case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
  SOLARIS=yes
  ;;
"IRIX 6"*)
  LDFLAGS="-L/usr/lib32 $LDFLAGS"
  ;;
"LynxOS 2"*)
  SJLJ_EXCEPTIONS=yes
  ;;
esac

case "$host_os" in
    mingw*)
        CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_IE=0x0500"
        CXXFLAGS="$CXXFLAGS -mthreads"
        ;;
esac

dnl FIXME: Remove duplication between this script and ../unix/configure.in
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 -fpermissive"
  fi
  if test "$SJLJ_EXCEPTIONS" = yes; then
    CXXFLAGS="$CXXFLAGS -fsjlj-exceptions"
  fi
fi

dnl Checks for IRIX-specific Compression Library.
AC_SEARCH_LIBS([clQuerySchemeFromName])
AC_CHECK_LIB(cl, clQuerySchemeFromName,
  [AC_DEFINE([HAVE_CL], 1, [Define if you have IRIX compression library])
  IRIX_COMPRESS=yes])
AM_CONDITIONAL([IRIX_COMPRESS], [ test "x$IRIX_COMPRESS" = xyes ])

dnl Checks for IRIX-specific Digital Media libraries.
AC_CHECK_LIB(dmedia, dmICCreate,
  [AC_DEFINE(HAVE_DMEDIA, 1, [Define if you have IRIX Digital Media library])
  IRIX_MEDIA=yes])
AM_CONDITIONAL([IRIX_MEDIA], [ test "x$IRIX_MEDIA" = xyes ])

dnl Check for zlib library
INCLUDED_ZLIB=no
AC_ARG_WITH([included-zlib],
	AS_HELP_STRING([--with-included-zlib],
		       [use libz which is distributed with VNC]),
	[INCLUDED_ZLIB=yes],
	[AC_SEARCH_LIBS([inflateEnd], [z], [], [INCLUDED_ZLIB=yes])])

AM_CONDITIONAL([INCLUDED_ZLIB], [ test "x$INCLUDED_ZLIB" = xyes ])
AC_CONFIG_SUBDIRS([zlib])

dnl Check for libjpeg library
INCLUDED_JPEG=no
AC_ARG_WITH([included-jpeg],
	AS_HELP_STRING([--with-included-jpeg], 
		       [use libjpeg which is distributed with VNC]),
	[INCLUDED_JPEG=yes],
	[AC_SEARCH_LIBS([jpeg_destroy_compress], [jpeg], [],
			[INCLUDED_JPEG=yes])])

AM_CONDITIONAL([INCLUDED_JPEG], [ test "x$INCLUDED_JPEG" = xyes ])
AC_CONFIG_SUBDIRS([jpeg])

AC_CHECK_FUNCS_ONCE([vsnprintf snprintf strcasecmp strncasecmp])

# IPv6 related functions
AC_CHECK_FUNCS_ONCE([inet_ntop getaddrinfo])

AC_CHECK_TYPES([socklen_t])

AC_CHECK_HEADERS([sys/select.h])

AC_OUTPUT([Makefile
	   os/Makefile
	   rdr/Makefile
	   network/Makefile
	   Xregion/Makefile
	   rfb/Makefile])