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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
|
# Process this file with autoconf to produce a configure script.
AC_INIT(LibVNCServer, 0.8pre, http://sourceforge.net/projects/libvncserver)
AM_INIT_AUTOMAKE(LibVNCServer, 0.8pre)
AM_CONFIG_HEADER(rfbconfig.h)
AX_PREFIX_CONFIG_H([rfb/rfbconfig.h])
# Checks for programs.
AC_PROG_CC
if test -z "$CC"; then
CCLD="\$(CC)"
else
CCLD="$CC"
fi
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Options
AH_TEMPLATE(BACKCHANNEL, [Enable BackChannel communication])
AC_ARG_WITH(backchannel,
[ --without-backchannel disable backchannel method],
, [ with_backchannel=yes ])
if test "x$with_backchannel" = "xyes"; then
AC_DEFINE(BACKCHANNEL)
fi
AH_TEMPLATE(ALLOW24BPP, [Enable 24 bit per pixel in native framebuffer])
AC_ARG_WITH(24bpp,
[ --without-24bpp disable 24 bpp framebuffers],
, [ with_24bpp=yes ])
if test "x$with_24bpp" = "xyes"; then
AC_DEFINE(ALLOW24BPP)
fi
AH_TEMPLATE(FFMPEG, [Use ffmpeg (for vnc2mpg)])
AC_ARG_WITH(ffmpeg,
[ --with-ffmpeg=dir set ffmpeg home directory],,)
AC_SUBST(with_ffmpeg)
AM_CONDITIONAL(WITH_FFMPEG, test ! -z "$with_ffmpeg")
# Seem to need this dummy here to induce the 'checking for egrep... grep -E', etc.
# before it seemed to be inside the with_jpeg conditional.
AC_CHECK_HEADER(thenonexistentheader.h, HAVE_THENONEXISTENTHEADER_H="true")
# Checks for X libraries
HAVE_X="false"
AC_PATH_XTRA
AH_TEMPLATE(HAVE_XSHM, [MIT-SHM extension build environment present])
AH_TEMPLATE(HAVE_XTEST, [XTEST extension build environment present])
AH_TEMPLATE(HAVE_XKEYBOARD, [XKEYBOARD extension build environment present])
AH_TEMPLATE(HAVE_LIBXINERAMA, [XINERAMA extension build environment present])
AH_TEMPLATE(HAVE_LIBXRANDR, [XRANDR extension build environment present])
AH_TEMPLATE(HAVE_LIBXFIXES, [XFIXES extension build environment present])
AH_TEMPLATE(HAVE_LIBXDAMAGE, [XDAMAGE extension build environment present])
if test "$X_CFLAGS" != "-DX_DISPLAY_MISSING"; then
AC_CHECK_LIB(X11, XGetImage, HAVE_X="true",
HAVE_X="false",
$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
if test $HAVE_X = "true"; then
X_PRELIBS="$X_PRELIBS -lXext"
AC_CHECK_LIB(Xext, XShmGetImage,
[AC_DEFINE(HAVE_XSHM)], ,
$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
X_PRELIBS="$X_PRELIBS -lXtst"
[AC_DEFINE(HAVE_XTEST)], ,
$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_CHECK_HEADER(X11/XKBlib.h, HAVE_XKBLIB_H="true",
HAVE_XKBLIB_H="false", [#include <X11/Xlib.h>])
CPPFLAGS="$saved_CPPFLAGS"
if test $HAVE_XKBLIB_H = "true"; then
AC_CHECK_LIB(X11, XkbSelectEvents,
[AC_DEFINE(HAVE_XKEYBOARD)], ,
$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
fi
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
X_PRELIBS="$X_PRELIBS -lXinerama"
[AC_DEFINE(HAVE_LIBXINERAMA)], ,
$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
AC_CHECK_LIB(Xrandr, XRRSelectInput,
X_PRELIBS="$X_PRELIBS -lXrandr"
[AC_DEFINE(HAVE_LIBXRANDR)], ,
$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
AC_CHECK_LIB(Xfixes, XFixesGetCursorImage,
X_PRELIBS="$X_PRELIBS -lXfixes"
[AC_DEFINE(HAVE_LIBXFIXES) HAVE_LIBXFIXES="true"], ,
$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
AC_CHECK_LIB(Xdamage, XDamageQueryExtension,
X_PRELIBS="$X_PRELIBS -lXdamage"
[AC_DEFINE(HAVE_LIBXDAMAGE) HAVE_LIBXDAMAGE="true"], ,
$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
if test ! -z "$HAVE_LIBXFIXES" -o ! -z "$HAVE_LIBXDAMAGE"; then
# need /usr/sfw/lib in RPATH for Solaris 10 and later
case `(uname -sr) 2>/dev/null` in
"SunOS 5"*) X_EXTRA_LIBS="$X_EXTRA_LIBS -R/usr/sfw/lib" ;;
esac
fi
X_LIBS="$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS"
fi
fi
AC_SUBST(X_LIBS)
AM_CONDITIONAL(HAVE_X, test $HAVE_X != "false")
# Checks for libraries.
AC_ARG_WITH(jpeg,
[ --without-jpeg disable support for jpeg]
[ --with-jpeg=DIR use jpeg include/library files in DIR],,)
# At this point:
# no jpeg on command line with_jpeg=""
# -with-jpeg with_jpeg="yes"
# -without-jpeg with_jpeg="no"
# -with-jpeg=/foo/dir with_jpeg="/foo/dir"
if test "x$with_jpeg" != "xno"; then
if test ! -z "$with_jpeg" -a "x$with_jpeg" != "xyes"; then
# add user supplied directory to flags:
saved_CPPFLAGS="$CPPFLAGS"
saved_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS -I$with_jpeg/include"
LDFLAGS="$LDFLAGS -L$with_jpeg/lib"
if test "x$GCC" = "xyes"; then
# this is not complete... in general a rat's nest.
LDFLAGS="$LDFLAGS -Xlinker -R$with_jpeg/lib"
else
LDFLAGS="$LDFLAGS -R$with_jpeg/lib"
fi
fi
AC_CHECK_HEADER(jpeglib.h, HAVE_JPEGLIB_H="true")
if test "x$HAVE_JPEGLIB_H" = "xtrue"; then
AC_CHECK_LIB(jpeg, jpeg_CreateCompress, , HAVE_JPEGLIB_H="")
fi
if test ! -z "$with_jpeg" -a "x$with_jpeg" != "xyes"; then
if test "x$HAVE_JPEGLIB_H" != "xtrue"; then
# restore old flags on failure:
CPPFLAGS="$saved_CPPFLAGS"
LDFLAGS="$saved_LDFLAGS"
fi
fi
fi
AC_ARG_WITH(libz,
[ --without-libz disable support for deflate],,)
AC_ARG_WITH(zlib,
[ --without-zlib disable support for deflate]
[ --with-zlib=DIR use zlib include/library files in DIR],,)
if test "x$with_zlib" != "xno" -a "x$with_libz" != "xno"; then
if test ! -z "$with_zlib" -a "x$with_zlib" != "xyes"; then
saved_CPPFLAGS="$CPPFLAGS"
saved_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS -I$with_zlib/include"
LDFLAGS="$LDFLAGS -L$with_zlib/lib"
if test "x$GCC" = "xyes"; then
LDFLAGS="$LDFLAGS -Xlinker -R$with_zlib/lib"
else
LDFLAGS="$LDFLAGS -R$with_zlib/lib"
fi
fi
AC_CHECK_HEADER(zlib.h, HAVE_ZLIB_H="true")
if test "x$HAVE_ZLIB_H" = "xtrue"; then
AC_CHECK_LIB(z, deflate, , HAVE_ZLIB_H="")
fi
if test ! -z "$with_zlib" -a "x$with_zlib" != "xyes"; then
if test "x$HAVE_ZLIB_H" != "xtrue"; then
CPPFLAGS="$saved_CPPFLAGS"
LDFLAGS="$saved_LDFLAGS"
fi
fi
fi
AC_CHECK_HEADER(pthread.h, HAVE_PTHREAD_H="true")
if test ! -z "$HAVE_PTHREAD_H"; then
# why twice?
AC_CHECK_LIB(pthread, pthread_mutex_lock)
AC_CHECK_LIB(pthread, pthread_mutex_lock, HAVE_LIBPTHREAD="true")
fi
AM_CONDITIONAL(HAVE_LIBPTHREAD, test ! -z "$HAVE_LIBPTHREAD")
AM_CONDITIONAL(HAVE_LIBZ, test ! -z "$HAVE_ZLIB_H")
AM_CONDITIONAL(HAVE_LIBJPEG, test ! -z "$HAVE_JPEGLIB_H")
if test -z "$with_sdl"; then
if sdl-config --version >/dev/null 2>&1; then
with_sdl=yes
SDL_CFLAGS=`sdl-config --cflags`
SDL_LIBS=`sdl-config --libs`
else
with_sdl=no
fi
fi
AM_CONDITIONAL(HAVE_LIBSDL, test "x$with_sdl" = "xyes")
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
MINGW=`uname -s | grep MINGW 2>/dev/null`
AM_CONDITIONAL(MINGW, test ! -z "$MINGW" )
if test ! -z "$MINGW"; then
WSOCKLIB="-lws2_32"
fi
AC_SUBST(WSOCKLIB)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h pwd.h sys/wait.h utmpx.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_TYPE_SOCKLEN_T
AC_CREATE_STDINT_H(rfb/rfbint.h)
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_FUNC_FORK
AC_CHECK_LIB(nsl,gethostbyname)
AC_CHECK_LIB(socket,socket)
AC_CHECK_FUNCS([ftime gethostbyname gethostname gettimeofday inet_ntoa memmove memset mkfifo select socket strchr strcspn strdup strerror strstr setsid getpwuid getpwnam getuid geteuid setuid waitpid setutxent])
# check, if shmget is in cygipc.a
AC_CHECK_LIB(cygipc,shmget)
AM_CONDITIONAL(CYGIPC, test "$HAVE_CYGIPC" = "true")
# Check if /dev/vcsa1 exists, if so, define LINUX
AM_CONDITIONAL(LINUX, test -c /dev/vcsa1)
# Check for OS X specific header
AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h, HAVE_OSX="true")
AM_CONDITIONAL(OSX, test "$HAVE_OSX" = "true")
# Check for rpm SOURCES path
echo -n "checking for rpm sources path... "
RPMSOURCEDIR="NOT-FOUND"
for directory in packages OpenLinux redhat RedHat rpm RPM "" ; do
if test -d /usr/src/${directory}/SOURCES; then
RPMSOURCEDIR="/usr/src/${directory}/SOURCES/"
fi
done
echo "$RPMSOURCEDIR"
AM_CONDITIONAL(HAVE_RPM, test "$RPMSOURCEDIR" != "NOT-FOUND")
AC_SUBST(RPMSOURCEDIR)
AC_CONFIG_FILES([Makefile
libvncserver/Makefile
contrib/Makefile
x11vnc/Makefile
examples/Makefile
vncterm/Makefile
classes/Makefile
libvncclient/Makefile
client_examples/Makefile
test/Makefile
LibVNCServer.spec
libvncserver-config])
AC_OUTPUT
chmod a+x ./libvncserver-config
|