configure.ac 27.2 KB
Newer Older
1 2 3
# *****************************************************************************
# Versioning
# *****************************************************************************
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
4

Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
5
m4_define([ev_major_version],[3])
Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
6 7
m4_define([ev_minor_version],[4])
m4_define([ev_micro_version],[0])
Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
8 9
m4_define([ev_extra_version],[])
m4_define([ev_version],[ev_major_version.ev_minor_version.ev_micro_version()ev_extra_version])
10 11

# The evince API version
12
m4_define([ev_api_version], [3.0])
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
13

14 15 16 17 18 19 20 21 22 23
# Libtool versioning. The backend and view libraries have separate versions.
# Before making a release, the libtool version should be modified.
# The string is of the form C:R:A.
# - If interfaces have been changed or added, but binary compatibility has
#   been preserved, change to C+1:0:A+1
# - If binary compatibility has been broken (eg removed or changed interfaces)
#   change to C+1:0:0
# - If the interface is the same as the previous version, change to C:R+1:A

# Libtool version of the backend library
Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
24
m4_define([ev_document_lt_current],[4])
25 26 27 28
m4_define([ev_document_lt_revision],[0])
m4_define([ev_document_lt_age],[0])
m4_define([ev_document_lt_version_info],[ev_document_lt_current:ev_document_lt_revision:ev_document_lt_age])
m4_define([ev_document_lt_current_minus_age],[m4_eval(ev_document_lt_current - ev_document_lt_age)])
29 30

# Libtool version of the view library
31
m4_define([ev_view_lt_current],[3])
32 33 34 35 36
m4_define([ev_view_lt_revision],[0])
m4_define([ev_view_lt_age],[0])
m4_define([ev_view_lt_version_info],[ev_view_lt_current:ev_view_lt_revision:ev_view_lt_age])
m4_define([ev_view_lt_current_minus_age],[m4_eval(ev_view_lt_current - ev_view_lt_age)])

37 38 39
# Binary version for the document backends
m4_define([ev_binary_version],[ev_document_lt_current])

40 41
# *****************************************************************************

42 43
AC_PREREQ([2.57])
AC_INIT([Evince],[ev_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=evince],[evince])
Christian Persch's avatar
Christian Persch committed
44
AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2 no-dist-gzip])
45

46 47
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
48

49 50 51 52
if test -z "$enable_maintainer_mode"; then
  enable_maintainer_mode=yes
fi
AM_MAINTAINER_MODE([enable])
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
53

54 55
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
56 57 58 59 60
AM_PROG_LIBTOOL

AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
61
AM_PROG_CC_C_O
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
62 63
AC_PROG_CXX
AC_STDC_HEADERS
64

65
AC_PROG_SED
66 67
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
68

69 70
GNOME_COMPILE_WARNINGS
GNOME_CXX_WARNINGS
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
71

72 73
IT_PROG_INTLTOOL([0.35.0])

74
GETTEXT_PACKAGE=evince
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
75
AC_SUBST(GETTEXT_PACKAGE)
76 77
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
AM_GLIB_GNU_GETTEXT
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
78

79 80 81 82
m4_pattern_allow([AM_V_GEN])dnl Make autoconf not complain about the rule below
EV_INTLTOOL_EVINCE_BACKEND_RULE='%.evince-backend:   %.evince-backend.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(AM_V_GEN) LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
AC_SUBST([EV_INTLTOOL_EVINCE_BACKEND_RULE])

83 84
GLIB_GSETTINGS

85 86 87 88
# Check which platform to use

AC_MSG_CHECKING([for which platform to build])
AC_ARG_WITH([platform],
89
  [AS_HELP_STRING([--with-platform=gnome|win32],
90
                  [Setting platform (default: gnome)])],
91
  [case "$withval" in
92
    gnome|win32) ;;
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
    *) AC_MSG_ERROR([invalid argument "$withval" for --with-platform]) ;;
   esac],
  [case "$host" in
     *-*-mingw*|*-*-cygwin*) with_platform="win32" ;;
     *) with_platform=gnome ;;
   esac])

AC_MSG_RESULT([$with_platform])

if test "$with_platform" = "win32"; then
  AC_CHECK_TOOL([WINDRES],[windres])
  AC_MSG_CHECKING([for native Win32])
  case "$host" in
    *-*-mingw*)
      os_win32=yes
      ;;
    *)
      os_win32=no
      ;;
  esac
  AC_MSG_RESULT([$os_win32])
fi

Hib Eris's avatar
Hib Eris committed
116
AM_CONDITIONAL([PLATFORM_WIN32],[test "$with_platform" = "win32"])
117

118
dnl Specify required versions of dependencies
Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
119
CAIRO_REQUIRED=1.10.0
120
GLIB_REQUIRED=2.25.11
Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
121
KEYRING_REQUIRED=2.22.0
122
GTK_REQUIRED=3.0.2
123
NAUTILUS_REQUIRED=2.91.4
124

125 126
AC_SUBST([GLIB_REQUIRED])
AC_SUBST([GTK_REQUIRED])
127

128
GNOME_ICON_THEME_REQUIRED=2.17.1
129
LIBXML_REQUIRED=2.5.0
130

131 132 133 134 135 136 137 138 139
dnl Check dependencies

# LIB_CFLAGS       for helpers and generic widgets. (libdocument, cut-and-paste)
# BACKEND_CFLAGS   for backend implementations.
# FRONTEND_CFLAGS  for frontend implementations. (properties, thumbnailer)
# FRONTEND_LIBS
# SHELL_CFLAGS     for shell implementation.
# SHELL_LIBS

140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
AC_CHECK_LIBM
AC_SUBST(LIBM)

have_zlib=yes
AC_CHECK_HEADERS([zlib.h],
	[AC_CHECK_LIB([z], [inflate],
		[AC_CHECK_LIB([z], [crc32], [have_zlib=yes], [have_zlib=no])],
		[have_zlib=no])],
	[have_zlib=no])

if test x$have_zlib = xno; then
	AC_MSG_ERROR([No sufficient zlib library found on your system.])
fi

ZLIB_LIBS=-lz
AC_SUBST(ZLIB_LIBS)
Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
156

157
PKG_CHECK_MODULES(LIBDOCUMENT, gtk+-3.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gmodule-no-export-2.0 >= $GLIB_REQUIRED gmodule-2.0)
Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
158 159
PKG_CHECK_MODULES(LIBVIEW, gtk+-3.0 >= $GTK_REQUIRED gail-3.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
PKG_CHECK_MODULES(BACKEND, cairo >= $CAIRO_REQUIRED gtk+-3.0 >= $GTK_REQUIRED)
160
PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-3.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED gmodule-no-export-2.0 >= $GLIB_REQUIRED)
161 162 163

SHELL_PLATFORM_PKGS=
case "$with_platform" in
Hib Eris's avatar
Hib Eris committed
164 165 166 167 168 169 170 171
  gnome)
        # Evince has a rather soft run-time dependency on hicolor-icon-theme.
        # If the hicolor theme is not available, Evince fails to display some
        # icons. Because we cannot check for it at run-time, we instead
        # would like to require the icon theme at compile-time. But, because
        # the hicolor-icon-theme does not have a pkgconfig file, on gnome we
        # require the gnome icon theme instead.
        SHELL_PLATFORM_PKGS="gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED"
172 173
        # The totem-screensaver and egg_smclient code use x11 directly.
        SHELL_PLATFORM_PKGS="$SHELL_PLATFORM_PKGS x11"
Hib Eris's avatar
Hib Eris committed
174 175 176 177 178 179 180
        ;;
  *)
        # On all other platforms we issue a warning about the runtime
        # dependency.
        AC_MSG_WARN([Evince has a soft run-time dependency on hicolor-icon-theme. You are advised to have this theme installed when running Evince.]);
        SHELL_PLATFORM_PKGS=""
        ;;
181 182
esac

183
PKG_CHECK_MODULES([SHELL_CORE],[libxml-2.0 >= $LIBXML_REQUIRED gtk+-3.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gmodule-no-export-2.0 >= $GLIB_REQUIRED gthread-2.0 $SHELL_PLATFORM_PKGS])
184

Christian Persch's avatar
Christian Persch committed
185 186 187 188
# *********
# SM client
# *********

189
GDK_TARGET="$($PKG_CONFIG --variable targets gdk-3.0)"
Christian Persch's avatar
Christian Persch committed
190 191 192

AC_MSG_CHECKING([which smclient backend to use])
AC_ARG_WITH([smclient],
193 194
  [AS_HELP_STRING([--with-smclient-backend=no|xsmp|win32|quartz],
		  [Setting smclient backend (default:auto)])],
Christian Persch's avatar
Christian Persch committed
195 196
  [],
  [case "$GDK_TARGET" in
197
    x11*) case "$with_platform" in
198
           gnome) with_smclient=xsmp ;;
Christian Persch's avatar
Christian Persch committed
199 200 201 202 203
           *) with_smclient=no ;;
         esac ;;
    win32|quartz) with_smclient=$GDK_TARGET ;;
    *) with_smclient=no ;;
   esac])
204
   
Christian Persch's avatar
Christian Persch committed
205 206 207 208 209
AC_MSG_RESULT([$with_smclient])

if test "$with_smclient" != "no"; then
  AC_DEFINE([WITH_SMCLIENT],[1],[Define if smclient is enabled])

210
  case "$with_smclient" in
211
    xsmp) SMCLIENT_PKGS="sm >= 1.0.0 ice" ;;
212 213 214
    *) SMCLIENT_PKGS="" ;;
  esac

Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
215
  PKG_CHECK_MODULES([SMCLIENT],[gtk+-3.0 gthread-2.0 $SMCLIENT_PKGS])
Christian Persch's avatar
Christian Persch committed
216 217
  AC_SUBST([SMCLIENT_CFLAGS])
  AC_SUBST([SMCLIENT_LIBS])
218 219
fi

Christian Persch's avatar
Christian Persch committed
220 221 222 223 224 225
AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
AM_CONDITIONAL([WITH_SMCLIENT_QUARTZ],[test "$with_smclient" = "quartz"])

# ***
226

227
BACKEND_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -export-symbols \$(top_srcdir)/backend/backend.symbols"
228 229
AC_SUBST(BACKEND_LIBTOOL_FLAGS)

230 231 232 233 234 235
dnl ===== Check special functions
evince_save_LIBS=$LIBS
LIBS="$LIBS $BACKEND_LIBS"
AC_CHECK_FUNCS(cairo_format_stride_for_width)
LIBS=$evince_save_LIBS

236 237 238
# ******************
# GKT+ Unix Printing
# ******************
239 240 241

AC_MSG_CHECKING([whether gtk+-unix-print support is requested])
AC_ARG_WITH([gtk-unix-print],
242 243
  [AS_HELP_STRING([--without-gtk-unix-print],
		  [Disable the use of gtk-unix-print])],
244 245 246 247
  [],[case "$os_win32" in
        yes) with_gtk_unix_print=no ;;
        *) with_gtk_unix_print=yes ;;
      esac])
248
      
249 250 251
AC_MSG_RESULT([$with_gtk_unix_print])

if test "$with_gtk_unix_print" = "yes"; then
Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
252
   PKG_CHECK_MODULES(GTKUNIXPRINT, [gtk+-unix-print-3.0 >= $GTK_REQUIRED])
253 254 255
   AC_DEFINE([GTKUNIXPRINT_ENABLED], [1], [Define if gtk+-unix-print is enabled.])
fi

256 257 258
# *********************
# GNOME Keyring support
# *********************
259

260
AC_ARG_WITH(keyring,
261 262
        [AS_HELP_STRING([--without-keyring],
			[Disable the use of gnome-keyring])],
263 264 265
        [],
        [case "$with_platform" in
           gnome) with_keyring=yes ;;
266
           win32) with_keyring=no ;;
267 268 269 270 271
         esac])

AM_CONDITIONAL([WITH_KEYRING],[test "$with_keyring" = "yes"])

if test "$with_keyring" = "yes"; then
272
        PKG_CHECK_MODULES(KEYRING, gnome-keyring-1 >= $KEYRING_REQUIRED)
273 274 275
        AC_DEFINE([WITH_KEYRING],[1],[Define if KEYRING support is enabled])
fi

276 277 278 279 280
# ****
# DBUS
# ****

AC_ARG_ENABLE([dbus],
281
  [AS_HELP_STRING([--disable-dbus], [Disable support for dbus])],
282 283 284 285 286 287 288
  [],
  [case "$with_platform" in
      gnome) enable_dbus=yes ;;
    esac])

if test "$enable_dbus" = "yes"; then
  AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
289

290 291
   PKG_CHECK_MODULES([EV_DAEMON], [gio-2.0 >= $GLIB_REQUIRED])
fi
292

293
AM_CONDITIONAL([ENABLE_DBUS], [test "$enable_dbus" = "yes"])
294

295 296 297 298 299 300 301
dnl ========= Check for Desktop Schemas
PKG_CHECK_MODULES([DESKTOP_SCHEMAS], [gsettings-desktop-schemas],
                  has_desktop_schemas=yes, has_desktop_schemas=no)
if test x$has_desktop_schemas = xyes; then
   AC_DEFINE([HAVE_DESKTOP_SCHEMAS], [1], [Whether GSettings Desktop Schemas are available])
fi

302
dnl Debug mode
303

304
AC_ARG_ENABLE([debug],
305 306 307 308 309
	AS_HELP_STRING([--enable-debug],
		       [Turn on evince debug mode]),
	[enable_debug=$enableval],
	[enable_debug=no])

310 311 312 313
if test "x$enable_debug" = "xyes"; then
   DEBUG_FLAGS="-DEV_ENABLE_DEBUG"
fi

314
AC_ARG_ENABLE([tests],
315 316 317
	AS_HELP_STRING([--enable-tests], [Enable the tests]),
	[enable_tests=$enableval],
	[enable_tests=yes])
318 319

AM_CONDITIONAL(ENABLE_TESTS, test x$enable_tests = xyes)
320

321 322 323 324
LIBDOCUMENT_CFLAGS="$LIBDOCUMENT_CFLAGS $DEBUG_FLAGS"
LIBDOCUMENT_LIBS="$LIBDOCUMENT_LIBS"
AC_SUBST(LIBDOCUMENT_CFLAGS)
AC_SUBST(LIBDOCUMENT_LIBS)
325

326
LIBVIEW_CFLAGS="$LIBVIEW_CFLAGS $GTKUNIXPRINT_CFLAGS $DEBUG_FLAGS"
327
LIBVIEW_LIBS="$LIBVIEW_LIBS $GTKUNIXPRINT_LIBS -lm"
328 329 330
AC_SUBST(LIBVIEW_CFLAGS)
AC_SUBST(LIBVIEW_LIBS)

331
BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
332
BACKEND_LIBS="$BACKEND_LIBS -lm"
333 334 335
AC_SUBST(BACKEND_CFLAGS)
AC_SUBST(BACKEND_LIBS)

336 337
SHELL_CFLAGS="$SHELL_CORE_CFLAGS $KEYRING_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
SHELL_LIBS="$SHELL_CORE_LIBS $KEYRING_LIBS -lz -lm"
338 339 340
AC_SUBST(SHELL_CFLAGS)
AC_SUBST(SHELL_LIBS)

341 342
FRONTEND_CFLAGS="$FRONTEND_CORE_CFLAGS $DEBUG_FLAGS"
FRONTEND_LIBS="$FRONTEND_CORE_LIBS -lz"
343 344 345
AC_SUBST(FRONTEND_CFLAGS)
AC_SUBST(FRONTEND_LIBS)

346 347 348 349
EV_DAEMON_CFLAGS="$EV_DAEMON_CFLAGS $DEBUG_FLAGS"
AC_SUBST([EV_DAEMON_CFLAGS])
AC_SUBST([EV_DAEMON_LIBS])

350
# Check for Nautilus property page build
351
AC_ARG_ENABLE([nautilus],
352 353
  [AS_HELP_STRING([--disable-nautilus],
		  [Disable build of nautilus extensions])],
354 355 356 357 358 359 360
  [],
  [case "$with_platform" in
     gnome) enable_nautilus=yes ;;
     *) enable_nautilus=no ;;
    esac])

if test "$enable_nautilus" = "yes" ; then
361
  PKG_CHECK_MODULES([NAUTILUS],[gtk+-x11-3.0 $MM gthread-2.0 libnautilus-extension >= $NAUTILUS_REQUIRED],
362
                    [],[AC_MSG_ERROR([libnautilus-extension not found; use --disable-nautilus to disable the nautilus extensions])])
363
  NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
364 365 366
  NAUTILUS_EXTENSION_DIR=${NAUTILUS_EXTENSION_DIR#`$PKG_CONFIG --variable=libdir libnautilus-extension`}
  NAUTILUS_EXTENSION_DIR=${NAUTILUS_EXTENSION_DIR#/}
  AC_SUBST(NAUTILUS_EXTENSION_DIR)
367 368 369 370
  AC_SUBST(NAUTILUS_CFLAGS)
  AC_SUBST(NAUTILUS_LIBS)

  AC_DEFINE([HAVE_NAUTILUS],[1], [defined if you build the nautilus plugin])
371 372
fi

373
AM_CONDITIONAL([ENABLE_NAUTILUS],[test "$enable_nautilus" = "yes"])
374

375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
# ***************
# Document Viewer
# ***************

AC_ARG_ENABLE(
  [viewer],
  [AS_HELP_STRING([--disable-viewer], [Disable GNOME Document viewer])],
  [],
  [enable_viewer=yes]
)
AM_CONDITIONAL([ENABLE_VIEWER],[test "$enable_viewer" = "yes"])

# ***************
# Thumbnailer
# ***************
390

391
AC_ARG_ENABLE([thumbnailer],
392 393
  [AS_HELP_STRING([--disable-thumbnailer],
		  [Disable GNOME thumbnailer])],
394
  [],
395
  [enable_thumbnailer=yes])
396

397 398 399 400 401
AM_CONDITIONAL([ENABLE_THUMBNAILER],[test "$enable_thumbnailer" = "yes"])

# ***************
# Print Previewer
# ***************
402

403
AC_ARG_ENABLE([previewer],
404 405
  [AS_HELP_STRING([--disable-previewer],
		  [Disable the GNOME Document Previewer])],
406
  [],
407
  [enable_previewer=yes])
408

409
if test x$enable_previewer = "xyes" ; then
410
  PKG_CHECK_MODULES([PREVIEWER],[gtk+-3.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED gmodule-no-export-2.0 >= $GLIB_REQUIRED])
411
fi
412

413
AM_CONDITIONAL([ENABLE_PREVIEWER],[test "$enable_previewer" = "yes"])
414 415
PREVIEWER_CFLAGS="$PREVIEWER_CFLAGS $GTKUNIXPRINT_CFLAGS $DEBUG_FLAGS"
PREVIEWER_LIBS="$PREVIEWER_LIBS $GTKUNIXPRINT_LIBS -lz"
416 417 418
AC_SUBST(PREVIEWER_CFLAGS)
AC_SUBST(PREVIEWER_LIBS)

419 420 421 422 423 424
# ***
# GIR
# ***

AC_MSG_CHECKING([whether GObject introspection is requested])
AC_ARG_ENABLE([introspection],
425 426 427 428
        AS_HELP_STRING([--enable-introspection],
		       [Enable GObject introspection]),
       	[enable_introspection=$enableval],
	[enable_introspection=no])
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
AC_MSG_RESULT([$enable_introspection])

G_IR_SCANNER=
G_IR_COMPILER=
G_IR_GENERATE=
GIRDIR=
GIRTYPELIBDIR=

if test "$enable_introspection" = "yes"; then
  GOBJECT_INTROSPECTION_REQUIRED=0.6
  PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])

  G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
  G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
  G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
  GIRDIR="$($PKG_CONFIG --variable=girdir gobject-introspection-1.0)"
  GIRTYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
fi

AC_SUBST([G_IR_SCANNER])
AC_SUBST([G_IR_COMPILER])
AC_SUBST([G_IR_GENERATE])
AC_SUBST([GIRDIR])
AC_SUBST([GIRTYPELIBDIR])

AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])

456 457 458 459 460
dnl ================== portability checks ===========================================

dnl for backtrace()
AC_CHECK_HEADERS([execinfo.h])

461 462 463 464
AC_CHECK_DECL([_NL_MEASUREMENT_MEASUREMENT],[
  AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT],[1],[Define if _NL_MEASUREMENT_MEASUREMENT is available])
  ],[],[#include <langinfo.h>])

465
dnl ================== pdf checks ===================================================
466 467 468 469 470
AC_ARG_ENABLE([pdf],
  [AS_HELP_STRING([--disable-pdf],
		  [Disable the PDF support])],
  [enable_pdf=$enableval],
  [enable_pdf=yes])
471 472

if test "x$enable_pdf" = "xyes"; then
473
    POPPLER_REQUIRED=0.18.0
474
    PKG_CHECK_MODULES(POPPLER, poppler-glib >= $POPPLER_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED,enable_pdf=yes,enable_pdf=no)
475 476

    if test "x$enable_pdf" = "xyes"; then
477
	    PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
478
	    if test x$enable_cairo_pdf = xyes; then
479 480
	            AC_DEFINE([HAVE_CAIRO_PDF], [1], [defined if cairo-pdf is available])
            fi
481 482

	    PKG_CHECK_MODULES(CAIRO_PS, cairo-ps, enable_cairo_ps=yes, enable_cairo_ps=no)
483
	    if test x$enable_cairo_ps = xyes; then
484 485
	            AC_DEFINE([HAVE_CAIRO_PS], [1], [defined if cairo-ps is available])
            fi
486
    else
487
	    AC_MSG_ERROR("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found")
488 489 490 491 492 493
    fi 
fi

AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
dnl ================== end of pdf checks ============================================

494
dnl libspectre (used by ps and dvi backends)
495
SPECTRE_REQUIRED=0.2.0 
496
PKG_CHECK_MODULES(SPECTRE, libspectre >= $SPECTRE_REQUIRED,have_spectre=yes,have_spectre=no)
497 498
AM_CONDITIONAL(HAVE_SPECTRE, test x$have_spectre = xyes)
if test "x$have_spectre" = "xyes"; then
499
   AC_DEFINE([HAVE_SPECTRE], [1], [Have libspectre])
500 501 502
fi

dnl ================== ps checks ====================================================
503
AC_ARG_ENABLE(ps,
504 505 506 507
  	[AS_HELP_STRING([--disable-ps],
			[Disable the PostScript backend])],
	[enable_ps=$enableval],
	[enable_ps=yes])
508

509
if test "x$enable_ps" = "xyes"; then
510
   if test "x$have_spectre" = "xyes"; then
511
      AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.])
512
   else
513 514
      enable_ps="no"
      AC_MSG_WARN([PS support is disabled since libspectre (version >= $SPECTRE_REQUIRED) is needed])
515
   fi
516
fi
517 518
AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes)
dnl ======================== End of ps checks ===================================
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
519

Jonathan Blandford's avatar
Jonathan Blandford committed
520
dnl ================== tiff checks ===================================================
521
AC_ARG_ENABLE(tiff,
522 523 524 525
            [AS_HELP_STRING([--disable-tiff],
			    [Disable the support of multipage tiff])],
	    [enable_tiff=$enableval],
	    [enable_tiff=yes])
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540

if test "x$enable_tiff" = "xyes"; then
    AC_CHECK_HEADERS([tiff.h],enable_tiff=yes,enable_tiff=no,)
    if test "x$enable_tiff" = "xyes"; then
	AC_CHECK_LIB([tiff],TIFFOpen,enable_tiff=yes,enable_tiff=no,"-lz")
        AC_CHECK_LIB([tiff],TIFFReadRGBAImageOriented,enable_tiff=yes,enable_tiff=no,"-lz")
    fi
    if test "x$enable_tiff" = "xyes"; then
	    AC_DEFINE([ENABLE_TIFF], [1], [Enable multipage tiff support.])
    else
	    AC_MSG_WARN("Tiff support is disabled since tiff library version 3.6 or newer not found")
    fi 
fi

AM_CONDITIONAL(ENABLE_TIFF, test x$enable_tiff = xyes)
Jonathan Blandford's avatar
Jonathan Blandford committed
541 542
dnl ================== end of tiff checks ============================================

Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
543 544 545
dnl ================== djvu checks ===================================================

AC_ARG_ENABLE(djvu,
546 547 548 549
            [AS_HELP_STRING([--disable-djvu],
			    [Disable the support of djvu viewer])],
	    [enable_djvu=$enableval],
	    [enable_djvu=yes])
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
550 551

if test "x$enable_djvu" = "xyes"; then
552 553
    DJVULIBRE_REQUIRED=3.5.17
    PKG_CHECK_MODULES(DJVU, ddjvuapi >= $DJVULIBRE_REQUIRED, enable_djvu=yes, enable_djvu=no)
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
554

555 556 557
    if test "x$enable_djvu" = "xyes"; then
        AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.])
    else
558
	AC_MSG_WARN([	
559
** Djvu support is disabled since a recent version of the djvulibre 
560
** library was not found. You need at least djvulibre-3.5.17 which 
561
** can be found on http://djvulibre.djvuzone.org 
562
])
563
    fi 
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
564 565 566 567 568 569 570
fi

AM_CONDITIONAL(ENABLE_DJVU, test x$enable_djvu = xyes)

dnl ================== End of djvu checks ===================================================

dnl ================== dvi checks ===================================================
571

Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
572
AC_ARG_ENABLE(dvi,
573 574 575 576
            [AS_HELP_STRING([--disable-dvi],
	    [Disable the support of dvi viewer])],
	    [enable_dvi=$enableval],
	    [enable_dvi=yes])
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
577 578

AC_ARG_ENABLE(t1lib,
579 580 581 582
            [AS_HELP_STRING([--enable-t1lib],
	                    [Compile with support of t1lib for type1 fonts in dvi])],
	    [enable_type1_fonts=$enableval],
	    [enable_type1_fonts=no])
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
583 584 585 586 587 588 589 590

if test "x$enable_dvi" = "xyes"; then
    AC_C_CONST
    AC_C_INLINE
    AC_TYPE_SIZE_T
    AC_CHECK_SIZEOF(long, 4)
    AC_CHECK_SIZEOF(int, 4)
    AC_CHECK_SIZEOF(short, 2)
Hib Eris's avatar
Hib Eris committed
591
    AC_CHECK_SIZEOF(long long, 4)
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
592 593 594 595 596
    AC_CHECK_SIZEOF(void *, 4)
    AC_CHECK_LIB([kpathsea],[kpse_init_prog],[enable_dvi=yes],[enable_dvi=no])

    if test "x$enable_dvi" = "xyes"; then
	AC_DEFINE([ENABLE_DVI], [1], [Enable dvi viewer support.])
597 598
    else
        AC_MSG_WARN("Dvi support is disabled since kpathsea library is not found. Check your TeX installation.")
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
599 600 601 602 603 604
    fi
fi
AM_CONDITIONAL(ENABLE_DVI, test x$enable_dvi = xyes)

if test "x$enable_dvi" = "xyes"; then
    if test "x$enable_type1_fonts" = "xyes"; then
605
	AC_CHECK_LIB([t1],T1_InitLib,enable_type1_fonts=yes,enable_type1_fonts=no,[-lm])
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
606 607 608 609 610
    fi

    if test "x$enable_type1_fonts" = xyes; then
        AC_DEFINE([WITH_TYPE1_FONTS], [1], [Enable t1lib support in dvi.])
    fi
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
611 612
else 
    enable_type1_fonts=no
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
613 614 615 616
fi
AM_CONDITIONAL(WITH_TYPE1_FONTS, test x$enable_type1_fonts = xyes)

dnl ================== End of dvi checks ===================================================
617

618 619 620
dnl ================== comic book checks ===================================================
 
AC_ARG_ENABLE(comics,
621 622 623 624 625
 	[AS_HELP_STRING([--enable-comics],
	                [Compile with support for comic book archives])],
	[enable_comics=$enableval],
	[enable_comics=yes])
	
626
if test "x$enable_comics" = "xyes"; then
627 628
	AC_DEFINE([ENABLE_COMICS], [1], [Enable support for comics.])
fi
629 630 631
AM_CONDITIONAL(ENABLE_COMICS, test x$enable_comics = xyes)

dnl ================== End of comic book checks ============================================
632

633 634 635 636 637 638 639 640 641
dnl ================== XPS checks ===================================================

AC_ARG_ENABLE(xps,
	[AS_HELP_STRING([--enable-xps],
			[Compile with support for XPS documents.])],
	[enable_xps=$enableval],
	[enable_xps=yes])

if test "x$enable_xps" = "xyes"; then
642
   GXPS_REQUIRED=0.2.1
643 644 645 646 647 648 649 650 651 652 653 654 655 656
   PKG_CHECK_MODULES(GXPS, libgxps >= $GXPS_REQUIRED,enable_xps=yes,enable_xps=no)

   if test "x$enable_xps" = "xyes"; then
      AC_DEFINE([ENABLE_XPS], [1], [Enable support for XPS documents.])
   else
      enable_xps="no"
      AC_MSG_WARN(["XPS support is disabled since libgxps (version >= $GXPS_REQUIRED) is needed])
   fi
fi

AM_CONDITIONAL(ENABLE_XPS, test x$enable_xps = xyes)

dnl ================== End of XPS checks ===================================================

657 658
dnl =================== Mime types list ====================================================

659
if test "x$enable_pdf" = "xyes" ; then
660
	EVINCE_MIME_TYPES="application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;"
661
fi
662
if test "x$enable_ps" = "xyes" ; then
663
	EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;"
664
fi
665
if test "x$enable_dvi" = "xyes"; then
666
	EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-dvi;application/x-bzdvi;application/x-gzdvi;"
667 668
fi
if test "x$enable_djvu" = "xyes"; then
669
	EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/vnd.djvu;"
670
fi
671
if test "x$enable_tiff" = "xyes"; then
672
	EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/tiff;"
673
fi
674
if test "x$enable_comics" = "xyes"; then
675
	EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;"
676
fi
677
if test "x$enable_xps" = "xyes"; then
678
   	EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/oxps;application/vnd.ms-xpsdocument;"
679
fi
680 681
AC_SUBST(EVINCE_MIME_TYPES)

682 683
AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))

Hib Eris's avatar
Hib Eris committed
684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711
# *****************
# Help files
# *****************

GNOME_DOC_INIT([], gnome_doc_utils=yes, gnome_doc_utils=no)

AC_ARG_ENABLE(help,
    [AS_HELP_STRING([--disable-help], [Disable offline help files])],
    [enable_help=$enableval],
    [enable_help=yes])

if test "x$enable_help" = "xyes" && test "x$os_win32" = "xyes" ; then
    AC_MSG_WARN([Offline help is disabled (not implemented on Windows).])
    enable_help=no
fi

if test "x$enable_help" = "xyes" && test "x$gnome_doc_utils" == "xno"; then
    AC_MSG_ERROR(
       [gnome-doc-utils not found; use --disable-help to disable help files]
    )
fi

if test "x$enable_help" = "xyes"; then
    AC_DEFINE([OFFLINE_HELP_ENABLED], [1], [Enable offline help])
fi

AM_CONDITIONAL(ENABLE_HELP, test "x$enable_help" = "xyes")

Christian Persch's avatar
Christian Persch committed
712 713 714 715 716 717 718
# *****************
# API documentation
# *****************

GTK_DOC_CHECK([1.13],[--flavour no-tmpl])

AC_SUBST([GLIB_PREFIX],[$($PKG_CONFIG --variable=prefix glib-2.0)])
Carlos Garcia Campos's avatar
Carlos Garcia Campos committed
719
AC_SUBST([GTK_PREFIX],[$($PKG_CONFIG --variable=prefix gtk+-3.0)])
Christian Persch's avatar
Christian Persch committed
720 721

# ******************
722
# Backends directory
Christian Persch's avatar
Christian Persch committed
723
# ******************
724 725

AC_SUBST([backenddir],"\$(libdir)/evince/ev_binary_version/backends")
726
AC_SUBST([backend_binary_version],"ev_binary_version")
727

Christian Persch's avatar
Christian Persch committed
728
# **********
729
# Versioning
Christian Persch's avatar
Christian Persch committed
730
# **********
731 732 733 734 735 736

AC_SUBST([EV_MAJOR_VERSION],[ev_major_version])
AC_SUBST([EV_MINOR_VERSION],[ev_minor_version])
AC_SUBST([EV_MICRO_VERSION],[ev_micro_version])

AC_SUBST([EV_API_VERSION],[ev_api_version])
737
AC_SUBST([EV_API_VERSION_U],[AS_TR_SH([ev_api_version])])
738
AC_SUBST([EV_BINARY_VERSION],[ev_binary_version])
739

740 741
AC_SUBST([EV_DOCUMENT_LT_VERSION_INFO],[ev_document_lt_version_info])
AC_SUBST([EV_DOCUMENT_LT_CURRENT_MINUS_AGE],[ev_document_lt_current_minus_age])
742 743 744
AC_SUBST([EV_VIEW_LT_VERSION_INFO],[ev_view_lt_version_info])
AC_SUBST([EV_VIEW_LT_CURRENT_MINUS_AGE],[ev_view_lt_current_minus_age])

Christian Persch's avatar
Christian Persch committed
745
# *****************************************************************************
746 747
# *****************************************************************************

Christian Persch's avatar
Christian Persch committed
748
AC_CONFIG_FILES([
749
backend/Makefile
750 751 752 753 754 755 756
backend/comics/Makefile
backend/djvu/Makefile
backend/dvi/Makefile
backend/dvi/mdvi-lib/Makefile
backend/pdf/Makefile
backend/ps/Makefile
backend/tiff/Makefile
757
backend/xps/Makefile
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
758
cut-n-paste/Makefile
759
cut-n-paste/gimpcellrenderertoggle/Makefile
760
cut-n-paste/smclient/Makefile
761
cut-n-paste/toolbar-editor/Makefile
762
cut-n-paste/zoom-control/Makefile
763
cut-n-paste/totem-screensaver/Makefile
764
cut-n-paste/synctex/Makefile
765
data/evince.desktop.in
766 767
data/Makefile
data/icons/Makefile
768
data/icons/16x16/Makefile
769 770
data/icons/16x16/apps/Makefile
data/icons/16x16/actions/Makefile
Hib Eris's avatar
Hib Eris committed
771
data/icons/16x16/mimetypes/Makefile
772
data/icons/22x22/Makefile
773 774
data/icons/22x22/apps/Makefile
data/icons/22x22/actions/Makefile
Hib Eris's avatar
Hib Eris committed
775
data/icons/22x22/mimetypes/Makefile
776
data/icons/24x24/Makefile
777
data/icons/24x24/apps/Makefile
778
data/icons/24x24/actions/Makefile
Hib Eris's avatar
Hib Eris committed
779
data/icons/24x24/mimetypes/Makefile
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
780
data/icons/32x32/Makefile
781
data/icons/32x32/actions/Makefile
Hib Eris's avatar
Hib Eris committed
782
data/icons/32x32/mimetypes/Makefile
Nickolay V. Shmyrev's avatar
Nickolay V. Shmyrev committed
783
data/icons/48x48/Makefile
784
data/icons/48x48/apps/Makefile
785
data/icons/48x48/actions/Makefile
William Jon McCann's avatar
William Jon McCann committed
786 787
data/icons/256x256/Makefile
data/icons/256x256/apps/Makefile
788
data/icons/scalable/Makefile
Hib Eris's avatar
Hib Eris committed
789 790
data/icons/scalable/actions/Makefile
data/icons/scalable/mimetypes/Makefile
791
help/Makefile
792
help/reference/Makefile
793 794 795 796 797 798
help/reference/libdocument/Makefile
help/reference/libdocument/version.xml
help/reference/libview/Makefile
help/reference/libview/version.xml
help/reference/shell/Makefile
help/reference/shell/version.xml
799
libdocument/Makefile
800
libdocument/ev-version.h
801
libmisc/Makefile
802
libview/Makefile
803
Makefile
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
804
po/Makefile.in
805
previewer/Makefile
806
properties/Makefile
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
807
shell/Makefile
808
test/Makefile
809
thumbnailer/Makefile
Marco Pesenti Gritti's avatar
Marco Pesenti Gritti committed
810
])
Christian Persch's avatar
Christian Persch committed
811

812
AC_CONFIG_FILES(evince-document-[]ev_api_version[].pc:evince-document.pc.in)
813 814
AC_CONFIG_FILES(evince-view-[]ev_api_version[].pc:evince-view.pc.in)

Christian Persch's avatar
Christian Persch committed
815
AC_OUTPUT
816

Hib Eris's avatar
Hib Eris committed
817 818 819 820 821 822 823 824 825 826 827 828
AC_MSG_NOTICE([

Evince configure summary
========================

Platform .................:  $with_platform
Debug mode ...............:  $enable_debug
Tests ....................:  $enable_tests


FRONTENDS

829
Viewer ...................:  $enable_viewer
Hib Eris's avatar
Hib Eris committed
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847
Previewer ................:  $enable_previewer
Thumbnailer ..............:  $enable_thumbnailer
Nautilus Extensions.......:  $enable_nautilus


BACKENDS

PDF ......................:  $enable_pdf
PostScript ...............:  $enable_ps
TIFF .....................:  $enable_tiff
DJVU .....................:  $enable_djvu
DVI ......................:  $enable_dvi
Comics ...................:  $enable_comics
XPS ......................:  $enable_xps


FEATURES

848 849
Help .....................:  $enable_help
GTK Doc reference ........:  $enable_gtk_doc
Hib Eris's avatar
Hib Eris committed
850 851 852 853 854 855 856
GObject Introspection ....:  $enable_introspection
DBUS communication .......:  $enable_dbus
Keyring integration ......:  $with_keyring
Session Manager client ...:  $with_smclient
GTK+ Unix Print ..........:  $with_gtk_unix_print

])