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 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470
|
# gtk-vnc autoconf
AC_PREREQ(2.63)
AC_INIT([gtk-vnc],[0.5.0],[https://bugzilla.gnome.org/enter_bug.cgi?product=gtk-vnc],[gtk-vnc],[http://live.gnome.org/gtk-vnc/])
AC_CONFIG_SRCDIR([src/vncconnection.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
dnl Make automake keep quiet about wildcards & other GNUmake-isms
AM_INIT_AUTOMAKE([1.10 -Wno-portability])
LT_PREREQ([2.2.6])
LT_INIT([win32-dll disable-static])
AC_CONFIG_MACRO_DIR([m4])
GNOME_MAINTAINER_MODE_DEFINES
AM_MAINTAINER_MODE([enable])
# Use the silent-rules feature when possible.
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_CANONICAL_HOST
dnl *******************************************************************************
dnl Declare required library versions
dnl *******************************************************************************
GOBJECT_REQUIRED=2.10.0
AC_SUBST(GOBJECT_REQUIRED)
GIO_REQUIRED=2.10.0
AC_SUBST(GIO_REQUIRED)
GDK_PIXBUF_REQUIRED=2.10.0
AC_SUBST(GDK_PIXBUF_REQUIRED)
GNUTLS_REQUIRED=1.4.0
AC_SUBST(GNUTLS_REQUIRED)
PYGTK_REQUIRED=2.0.0
VIEW_REQUIRED=0.6.0
GTHREAD_REQUIRED=2.0.0
PYTHON_REQUIRED=2.4
CAIRO_REQUIRED=1.2.0
FIREFOX_PLUGIN_REQUIRED=2.0.0
MOZILLA_PLUGIN_REQUIRED=1.8
GOBJECT_INTROSPECTION_REQUIRED=0.6.2
GOBJECT_INTROSPECTION_DESIRED=0.9.4
dnl *******************************************************************************
dnl Get the version information at compile-time
dnl *******************************************************************************
VERSION_MAJOR=`echo $VERSION | awk -F. '{print $1}'`
VERSION_MINOR=`echo $VERSION | awk -F. '{print $2}'`
VERSION_MICRO=`echo $VERSION | awk -F. '{print $3}'`
AC_DEFINE_UNQUOTED([VERSION_MAJOR], [$VERSION_MAJOR], [Major version number of package])
AC_DEFINE_UNQUOTED([VERSION_MINOR], [$VERSION_MINOR], [Minor version number of package])
AC_DEFINE_UNQUOTED([VERSION_MICRO], [$VERSION_MICRO], [Micro version number of package])
dnl *******************************************************************************
dnl Setup core compilers / build helpers
dnl *******************************************************************************
AC_PROG_CC_STDC
AM_PROG_CC_C_O
dnl *******************************************************************************
dnl Internationalization
dnl *******************************************************************************
GETTEXT_PACKAGE=gtk-vnc
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],"$GETTEXT_PACKAGE", [GETTEXT package name])
IT_PROG_INTLTOOL([0.40.0])
AM_GLIB_GNU_GETTEXT
dnl *******************************************************************************
################################################################################
# GTK+
################################################################################
AC_MSG_CHECKING([which gtk+ version to compile against])
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
[case "$with_gtk" in
2.0|3.0) ;;
*) AC_MSG_ERROR([invalid gtk version specified]) ;;
esac],
[with_gtk=2.0])
AC_MSG_RESULT([$with_gtk])
case "$with_gtk" in
2.0) GTK_API_VERSION=2.0
GTK_REQUIRED=2.18.0
GTK_VNC_API_VERSION=1.0
;;
3.0) GTK_API_VERSION=3.0
GTK_REQUIRED=3.0.0
GTK_VNC_API_VERSION=2.0
;;
esac
AC_SUBST([GTK_API_VERSION])
AC_SUBST([GTK_REQUIRED])
AC_SUBST([GTK_VNC_API_VERSION])
AM_CONDITIONAL([HAVE_GTK_2],[test "$with_gtk" = "2.0"])
AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk" = "3.0"])
AC_CHECK_HEADERS([pwd.h termios.h])
AC_ARG_WITH(python,
[ --with-python build python bindings],
[case "${withval}" in
yes|no) ;;
*) AC_MSG_ERROR([bad value ${withval} for python option]) ;;
esac],[withval=yes])
if test "$with_gtk" = "3.0"
then
WITH_PYTHON=no
else
WITH_PYTHON=$withval
fi
GTK_VNC_COMPILE_WARNINGS
AC_ARG_WITH(examples,
[ --with-examples install example programs],
[case "${withval}" in
yes|no) ;;
*) AC_MSG_ERROR([bad value ${withval} for examples option]) ;;
esac],[withval=no])
WITH_EXAMPLES=$withval
NO_UNDEFINED_LDFLAGS=
VERSION_SCRIPT_FLAGS=
USE_VERSION_DEFS=0
case "$host" in
*-*-mingw*)
VERSION_SCRIPT_FLAGS="-Wl,"
USE_VERSION_DEFS=1
NO_UNDEFINED_FLAGS="-no-undefined"
;;
*-*-cygwin*)
NO_UNDEFINED_LDFLAGS="-no-undefined"
;;
*)
NO_UNDEFINED_FLAGS="-Wl,--no-undefined"
VERSION_SCRIPT_FLAGS=-Wl,--version-script=
`ld --help 2>&1 | grep -- --version-script >/dev/null` || \
VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
;;
esac
AC_SUBST([NO_UNDEFINED_FLAGS])
AC_SUBST([VERSION_SCRIPT_FLAGS])
AM_CONDITIONAL([USE_VERSION_DEFS], [test "$USE_VERSION_DEFS" = "1"])
dnl check ld support --version-script
AC_SUBST(VERSION_SCRIPT_FLAGS)
PKG_CHECK_MODULES(GOBJECT, gobject-2.0 >= $GOBJECT_REQUIRED)
AC_SUBST(GOBJECT_CFLAGS)
AC_SUBST(GOBJECT_LIBS)
PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQUIRED)
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)
PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED)
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
PKG_CHECK_MODULES(X11, x11,,AC_MSG_NOTICE([Not building against X11]))
AC_SUBST(X11_CFLAGS)
AC_SUBST(X11_LIBS)
PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_REQUIRED)
AC_SUBST(CAIRO_CFLAGS)
AC_SUBST(CAIRO_LIBS)
AC_ARG_WITH(libview,
[ --with-libview enable libview support in gvncviewer],
[case "${withval}" in
yes|no) ;;
*) AC_MSG_ERROR([bad value ${withval} for libview option]) ;;
esac],[withval=yes])
WITH_LIBVIEW=0
if test "${withval}" = "yes"; then
PKG_CHECK_MODULES(VIEW, libview >= $VIEW_REQUIRED,
[WITH_LIBVIEW=1], [WITH_LIBVIEW=0])
fi
AC_DEFINE_UNQUOTED([WITH_LIBVIEW],[$WITH_LIBVIEW], [Whether to use libview])
AC_SUBST(VIEW_CFLAGS)
AC_SUBST(VIEW_LIBS)
PKG_CHECK_MODULES(PULSEAUDIO, libpulse-simple, WANT_PULSEAUDIO="yes", AC_MSG_NOTICE([Not building against libpulse]))
if test "x$WANT_PULSEAUDIO" = xyes; then
AC_DEFINE_UNQUOTED([HAVE_PULSEAUDIO], 1,[Define if we have and want pulseaudio.])
fi
AM_CONDITIONAL([HAVE_PULSEAUDIO], [test "x$WANT_PULSEAUDIO" = "xyes"])
AC_SUBST(PULSEAUDIO_CFLAGS)
AC_SUBST(PULSEAUDIO_LIBS)
PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_REQUIRED)
dnl Not all versions of gnutls include -lgcrypt and -lgpg-error, and we need it
dnl explicitly for building MS Logon extension which calls
dnl gcry_XXX APIs
GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt -lgpg-error"
AC_SUBST(GNUTLS_CFLAGS)
AC_SUBST(GNUTLS_LIBS)
dnl Cyrus SASL
AC_ARG_WITH([sasl],
[AS_HELP_STRING([--with-sasl],
[use cyrus SASL for authentication @<:@default=check@:>@])],
[],
[with_sasl=check])
SASL_CFLAGS=
SASL_LIBS=
enable_sasl=no
if test "x$with_sasl" != "xno"; then
if test "x$with_sasl" != "xyes" && test "x$with_sasl" != "xcheck"; then
SASL_CFLAGS="-I$with_sasl"
SASL_LIBS="-L$with_sasl"
fi
fail=0
old_cflags="$CFLAGS"
old_libs="$LIBS"
CFLAGS="$CFLAGS $SASL_CFLAGS"
LIBS="$LIBS $SASL_LIBS"
AC_CHECK_HEADER([sasl/sasl.h],[],[
if test "x$with_sasl" != "xcheck" ; then
with_sasl=no
else
fail=1
fi])
if test "x$with_sasl" != "xno" ; then
AC_CHECK_LIB([sasl2], [sasl_client_init],[with_sasl2=yes],[with_sasl2=no])
fi
if test "x$with_sasl2" = "xno" && test "x$with_sasl" != "xno" ; then
AC_CHECK_LIB([sasl], [sasl_client_init],[with_sasl=yes],[with_sasl=no])
fi
if test "x$with_sasl2" = "xyes"; then
SASL_LIBS="$SASL_LIBS -lsasl2"
elif test "x$with_sasl" = "xyes"; then
SASL_LIBS="$SASL_LIBS -lsasl"
else
AC_MSG_ERROR([You must install the Cyrus SASL development package in order to compile GTK-VNC])
fi
CFLAGS="$old_cflags"
LIBS="$old_libs"
if test "x$with_sasl2" = "xyes" || test "x$with_sasl" = "xyes" ; then
AC_DEFINE_UNQUOTED([HAVE_SASL], 1,
[whether Cyrus SASL is available for authentication])
enable_sasl=yes
fi
fi
AM_CONDITIONAL([HAVE_SASL], [test "x$with_sasl2" = "xyes" || test "x$with_sasl" = "xyes"])
AC_SUBST([SASL_CFLAGS])
AC_SUBST([SASL_LIBS])
GTHREAD_CFLAGS=
GTHREAD_LIBS=
AC_CHECK_LIB(z, inflate, [], [AC_MSG_ERROR([zlib not found])])
WITH_UCONTEXT=1
AC_ARG_WITH(coroutine,
[ --with-coroutine=ucontext/gthread use ucontext or GThread for coroutines],
[],[with_coroutine=ucontext])
case $with_coroutine in
ucontext)
;;
gthread)
;;
*)
AC_MSG_ERROR(Unsupported coroutine type)
esac
if test "$with_coroutine" = "ucontext"; then
AC_CHECK_FUNC(makecontext, [],[with_coroutine=gthread])
AC_CHECK_FUNC(swapcontext, [],[with_coroutine=gthread])
AC_CHECK_FUNC(getcontext, [],[with_coroutine=gthread])
fi
if test "$with_coroutine" = "gthread"; then
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 > $GTHREAD_REQUIRED)
WITH_UCONTEXT=0
fi
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
AC_DEFINE_UNQUOTED([WITH_UCONTEXT],[$WITH_UCONTEXT], [Whether to use ucontext coroutine impl])
AM_CONDITIONAL(WITH_UCONTEXT, [test "$WITH_UCONTEXT" != "0"])
if test "$WITH_PYTHON" = "yes"; then
PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= $PYGTK_REQUIRED)
AC_SUBST(PYGTK_CFLAGS)
AC_SUBST(PYGTK_LIBS)
AM_PATH_PYTHON
AC_MSG_CHECKING([whether $PYTHON version >= $PYTHON_REQUIRED])
HAVE_PYTHON_REQUIRED=no
AM_PYTHON_CHECK_VERSION([$PYTHON], [$PYTHON_REQUIRED],
[HAVE_PYTHON_REQUIRED="yes"],
[HAVE_PYTHON_REQUIRED="no"])
AC_MSG_RESULT($HAVE_PYTHON_REQUIRED)
if test "x$HAVE_PYTHON_REQUIRED" != "xyes"
then
AC_MSG_ERROR("No suitable python found")
fi
AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
if test "x$have_python_headers" != "xyes"
then
AC_MSG_ERROR("No python development headers found")
fi
fi
dnl --enable-plugin to enable the browser plugin.
AC_ARG_ENABLE(plugin,
[ --enable-plugin=[no/yes] enable browser plugin [default=no]],,
enable_plugin=no)
if test "x$enable_plugin" = "xyes"; then
dnl Check for Firefox plugin package (also includes NSPR cflags/libs).
PKG_CHECK_MODULES(FIREFOX_PLUGIN,
firefox-plugin >= $FIREFOX_PLUGIN_REQUIRED, ,[
PKG_CHECK_MODULES(MOZILLA_PLUGIN,
mozilla-plugin >= $MOZILLA_PLUGIN_REQUIRED)
FIREFOX_PLUGIN_CFLAGS="$MOZILLA_PLUGIN_CFLAGS"
FIREFOX_PLUGIN_LIBS="$MOZILLA_PLUGIN_LIBS"
])
AC_SUBST(FIREFOX_PLUGIN_CFLAGS)
AC_SUBST(FIREFOX_PLUGIN_LIBS)
fi
dnl define a MAINT-like variable REBUILD which is set
dnl if Perl, so autogenerated sources can be rebuilt
AC_PATH_PROGS(PERL, perl5 perl)
AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
REBUILD=\#
if test "x$enable_rebuilds" = "xyes" && \
test -n "$PERL" && \
$PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
REBUILD=
fi
AC_SUBST(REBUILD)
AM_CONDITIONAL(WITH_PYTHON, [test "$WITH_PYTHON" = "yes"])
AM_CONDITIONAL(WITH_EXAMPLES, [test "$WITH_EXAMPLES" = "yes"])
AM_CONDITIONAL(ENABLE_PLUGIN, [test "$enable_plugin" = "yes"])
AC_ARG_ENABLE([introspection],
AS_HELP_STRING([--enable-introspection], [enable GObject introspection]),
[], [enable_introspection=check])
has_symbol_prefix=no
if test "x$enable_introspection" != "xno" ; then
PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_DESIRED],
[
enable_introspection=yes
has_symbol_prefix=yes
],
[
PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED],
[
enable_introspection=yes
has_symbol_prefix=no
],
[
if test "x$enable_introspection" = "xcheck"; then
enable_introspection=no
else
AC_MSG_ERROR([gobject-introspection is not available])
fi
])
])
if test "x$enable_introspection" = "xyes" ; then
AC_DEFINE([WITH_GOBJECT_INTROSPECTION], [1], [enable GObject introspection support])
AC_SUBST(GOBJECT_INTROSPECTION_CFLAGS)
AC_SUBST(GOBJECT_INTROSPECTION_LIBS)
AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
fi
fi
AM_CONDITIONAL([WITH_GOBJECT_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
AM_CONDITIONAL([G_IR_SCANNER_SYMBOL_PREFIX], [test "x$has_symbol_prefix" = "xyes"])
if test "x$with_gtk" = "x3.0"; then
default_vala=check
else
default_vala=no
fi
AC_ARG_ENABLE([vala],
AS_HELP_STRING([--enable-vala], [enable Vala binding generation]),
[], [enable_vala="$default_vala"])
if test "x$enable_introspection" = "xyes" ; then
if test "x$enable_vala" != "xno" ; then
AC_PATH_PROG(VAPIGEN, vapigen, no)
if test "x$VAPIGEN" != "xno"; then
if test "x$enable_vala" == "xcheck" ; then
enable_vala=yes
AC_SUBST(VAPIGEN)
fi
else
AC_MSG_ERROR([Cannot find the "vapigen" binary in your PATH])
fi
fi
fi
AM_CONDITIONAL([WITH_VALA], [test "x$enable_vala" = "xyes"])
AC_CONFIG_FILES(
Makefile
src/Makefile
tools/Makefile
examples/Makefile
plugin/Makefile
po/Makefile.in
vapi/Makefile
gvnc-1.0.pc
gvncpulse-1.0.pc
gtk-vnc-1.0.pc
gtk-vnc-2.0.pc
gtk-vnc.spec
mingw32-gtk-vnc.spec
)
AC_OUTPUT
echo "
Configure summary:
Compiler ...................: ${CC}
Compiler Flags .............: ${CFLAGS}
Extra Link Flags ...........: ${VERSION_SCRIPT_FLAGS} ${NO_UNDEFINED_FLAGS}
Prefix......................: ${prefix}
Python binding .............: ${WITH_PYTHON}
Install example programs ...: ${WITH_EXAMPLES}
Browser plugin .............: ${enable_plugin}
SASL support................: ${enable_sasl}
GTK+ version................: ${GTK_API_VERSION}
"
|