configure.in 19.6 KB
Newer Older
Behdad Esfahbod's avatar
Behdad Esfahbod committed
1
m4_define([version_major],0)
Christian Persch's avatar
Christian Persch committed
2
m4_define([version_minor],27)
Christian Persch's avatar
Christian Persch committed
3
m4_define([version_micro],3)
Behdad Esfahbod's avatar
Behdad Esfahbod committed
4
5
6
m4_define([version_triplet],version_major.version_minor.version_micro)

m4_define([so_major_adjust],9) dnl Don't change!
7

Christian Persch's avatar
Christian Persch committed
8
AC_PREREQ([2.59])
Behdad Esfahbod's avatar
Behdad Esfahbod committed
9
AC_INIT(vte, [version_triplet], [http://bugzilla.gnome.org/enter_bug.cgi?product=vte])
10
AC_CONFIG_SRCDIR([src/vte.c])
11
12
AC_CONFIG_HEADERS([config.h])

Christian Persch's avatar
Christian Persch committed
13
AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-bzip2])
14

15
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
Christian Persch's avatar
Christian Persch committed
16

17
18
19
20
21
if test -z "$enable_maintainer_mode"; then
  enable_maintainer_mode=yes
fi
AM_MAINTAINER_MODE([enable])

22
################################################################################
Behdad Esfahbod's avatar
Behdad Esfahbod committed
23
24
25
26
27
28
29
30
31
# Libtool versioning
################################################################################
m4_define([lt_revision], m4_if(m4_eval(version_minor%2),1,0,version_micro))
m4_define([lt_age], m4_eval(version_minor*100+version_micro-lt_revision))
m4_define([lt_current], m4_eval(so_major_adjust+version_major+lt_age))
m4_define([lt_triplet],lt_current:lt_revision:lt_age)

LT_VERSION_INFO="lt_triplet()"
AC_SUBST([LT_VERSION_INFO])
32

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
################################################################################
# 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) VTE_API_VERSION=0.0
       VTE_API_MAJOR_VERSION=0
       VTE_API_MINOR_VERSION=0
       VTE_PC_VERSION=
       VTE_LIBRARY_SUFFIX=
53
       VTE_SEAL_CFLAGS=
54
       GTK_API_VERSION=2.0
55
       GTK_REQUIRED=2.20.0
56
57
58
59
       ;;
  3.0) VTE_API_VERSION=2.90
       VTE_API_MAJOR_VERSION=2
       VTE_API_MINOR_VERSION=90
Christian Persch's avatar
Christian Persch committed
60
61
       VTE_PC_VERSION=-$VTE_API_VERSION
       VTE_LIBRARY_SUFFIX=$VTE_API_VERSION
62
       VTE_SEAL_CFLAGS="-DVTE_SEAL_ENABLE"
63
       GTK_API_VERSION=3.0
Christian Persch's avatar
Christian Persch committed
64
       GTK_REQUIRED=2.91.6
65
66
67
68
69
70
71
72
       ;;
esac

AC_SUBST([VTE_API_VERSION])
AC_SUBST([VTE_API_VERSION_U],[AS_TR_SH([$VTE_API_VERSION])])
AC_SUBST([VTE_API_MAJOR_VERSION])
AC_SUBST([VTE_API_MINOR_VERSION])
AC_SUBST([VTE_PC_VERSION])
73
AC_SUBST([VTE_SEAL_CFLAGS])
74
75
76
77
78
79
AC_SUBST([GTK_API_VERSION])
AC_SUBST([VTE_LIBRARY_SUFFIX_U],[AS_TR_SH([$VTE_LIBRARY_SUFFIX])])

AM_CONDITIONAL([HAVE_GTK_2],[test "$with_gtk" = "2.0"])
AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk" = "3.0"])

80
81
################################################################################

82
83
84
85
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AM_PROG_CC_STDC
86

87
AM_PROG_CC_C_O
88

Nalin Dahyabhai's avatar
Nalin Dahyabhai committed
89
AM_PROG_LIBTOOL
90

Christian Persch's avatar
Christian Persch committed
91
92
AC_PROG_SED

93
94
95
96
################################################################################
# i18n
################################################################################

97
IT_PROG_INTLTOOL([0.35.0])
Behdad Esfahbod's avatar
Behdad Esfahbod committed
98

99
GETTEXT_PACKAGE=vte-$VTE_API_VERSION
Behdad Esfahbod's avatar
Behdad Esfahbod committed
100
101
102
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
                   [Package translatable messages domain name.])
103
AM_GLIB_GNU_GETTEXT
104
AC_CHECK_DECLS(bind_textdomain_codeset,,,[#include "libintl.h"])
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

################################################################################
# Platform checks
################################################################################

AC_MSG_CHECKING([for a win32 platform])
platform_win32=no
case "$host" in
	*-*-mingw*|*-*-cygwin*)
		platform_win32=yes
		;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")

os_win32=no
if test "x$platform_win32" = "xyes"; then
	AC_MSG_CHECKING([for native win32])
	case "$host" in
		*-*-mingw*)
			os_win32=yes
			;;
	esac
	AC_MSG_RESULT([$os_win32])
fi
AM_CONDITIONAL(OS_WIN32, test "x$os_win32" = "xyes")


if test "x$platform_win32" != "xyes"; then
	LIBTOOL_EXPORT_OPTIONS=
else
	LIBTOOL_EXPORT_OPTIONS='-no-undefined'
fi
AC_SUBST([LIBTOOL_EXPORT_OPTIONS])
LIBTOOL_FLAGS='-as-needed'
AC_SUBST([LIBTOOL_FLAGS])


144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
################################################################################
# Compilation
################################################################################

dnl Use lots of warning flags with with gcc and compatible compilers
dnl Copied from cairo
AC_DEFUN([VTE_CC_TRY_FLAG], [
  AC_MSG_CHECKING([whether $CC supports $1])

  vte_save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS $1"

  AC_COMPILE_IFELSE([ ], [vte_cc_flag=yes], [vte_cc_flag=no])
  CFLAGS="$vte_save_CFLAGS"

  if test "x$vte_cc_flag" = "xyes"; then
    ifelse([$2], , :, [$2])
  else
    ifelse([$3], , :, [$3])
  fi
  AC_MSG_RESULT([$vte_cc_flag])
])
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
AC_DEFUN([VTE_LD_TRY_FLAG], [
  AC_MSG_CHECKING([whether $CC supports $1 when linking])

  vte_save_LDFLAGS="$LDFLAGS"
  LDFLAGS="$LDFLAGS $1"

  AC_LINK_IFELSE([int main(void) {return 0;}],
		[vte_ld_flag=yes], [vte_ld_flag=no])
  LDFLAGS="$vte_save_LDFLAGS"

  if test "x$vte_ld_flag" = "xyes"; then
    ifelse([$2], , :, [$2])
  else
    ifelse([$3], , :, [$3])
  fi
  AC_MSG_RESULT([$vte_ld_flag])
])
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198


dnl Note: if you change the following variable, the cache is automatically
dnl skipped and all flags rechecked.  So there's no need to do anything
dnl else.  If for any reason you need to force a recheck, just change
dnl MAYBE_WARN in an ignorable way (like adding whitespace)

MAYBE_WARN="-Wall -Wextra \
-Wsign-compare -Werror-implicit-function-declaration \
-Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
-Waggregate-return -Wcast-align -Wimplicit -Wuninitialised \
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
-Wpacked -Wmissing-format-attribute -Wshadow \
-Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
-Wdeclaration-after-statement -Wold-style-definition \
-Wno-missing-field-initializers -Wno-unused-parameter \
199
-fno-common -Wno-switch-enum"
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

# invalidate cached value if MAYBE_WARN has changed
if test "x$vte_cv_warn_maybe" != "x$MAYBE_WARN"; then
	unset vte_cv_warn_cflags
fi
AC_CACHE_CHECK([for supported warning flags], vte_cv_warn_cflags, [
	echo
	WARN_CFLAGS=""

	# Some warning options are not supported by all versions of
	# gcc, so test all desired options against the current
	# compiler.
	#
	# Note that there are some order dependencies
	# here. Specifically, an option that disables a warning will
	# have no net effect if a later option then enables that
	# warnings, (perhaps implicitly). So we put some grouped
	# options (-Wall and -Wextra) up front and the -Wno options
	# last.

	for W in $MAYBE_WARN; do
		VTE_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
	done

	vte_cv_warn_cflags=$WARN_CFLAGS
	vte_cv_warn_maybe=$MAYBE_WARN

	AC_MSG_CHECKING([which warning flags were supported])])
WARN_CFLAGS=$vte_cv_warn_cflags
AC_SUBST(WARN_CFLAGS)
CFLAGS="$CFLAGS $WARN_CFLAGS"

232
233
234
235
236
237
PYTHON_LDFLAGS=""
for W in "-Wl,--warn-unresolved-symbols"; do
	VTE_LD_TRY_FLAG([$W], [PYTHON_LDFLAGS="$PYTHON_LDFLAGS $W"])
done
AC_SUBST(PYTHON_LDFLAGS)

238
# Enable debugging messages and additional run-time checks.
239
240
AC_ARG_ENABLE(debug,
	      [AS_HELP_STRING([--enable-debug],
241
242
243
244
245
246
247
248
			      [enable extra debugging checks and logging messages]
			      )],
	      DEBUG=$enableval, DEBUG=no)
if test "x$DEBUG" != "xno" ; then
	AC_MSG_RESULT([enabling debug checks and messages])
	AC_DEFINE(VTE_DEBUG,1,[Enable debugging messages.])
fi

249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
##########################################################
# Check for -Bsymbolic-functions linker flag used to avoid
# intra-library PLT jumps, if available.
##########################################################

AC_ARG_ENABLE([Bsymbolic],
  [AS_HELP_STRING([--disable-Bsymbolic],
                  [disable linking with -Bsymbolic])],
  [],[enable_Bsymbolic=yes])

VTE_LDFLAGS=
if test "$enable_Bsymbolic" != "no"; then
  FLAG="-Wl,-Bsymbolic-functions"
  VTE_LD_TRY_FLAG([$FLAG],
    [VTE_LDFLAGS="$VTE_LDFLAGS $FLAG"],
    [if test "$enable_Bsymbolic" = "auto"; then
       AC_MSG_WARN([-Bsymbolic not supported by ld; disabling])
       enable_Bsymbolic=no
     else
Christian Persch's avatar
Christian Persch committed
268
       AC_MSG_ERROR([-Bsymbolic requested but not supported by ld. Use --disable-Bsymbolic to disable])
269
270
271
272
273
     fi])
fi

AC_SUBST([VTE_LDFLAGS])

274
################################################################################
275

276
277
278
279
280
GNOME_COMMON_INIT

# Disable deprecations and single includes
# We don't use GNOME_MAINTAINER_MODE_DEFINES here since it's too much and
# it also defines VTE's own defines.
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
dnl AC_ARG_ENABLE([deprecation],
dnl   [AS_HELP_STRING([--disable-deprecation],
dnl                   [prohibit VTE from using deprecated GLib/Pango/ATK/GDK/GTK+ features])],
dnl   [],[enable_deprecation=$enable_maintainer_mode])
dnl if test "x$enable_deprecation" = xyes; then
dnl   AC_MSG_NOTICE([disabling deprecated GLIB/PANGO/GDK/ATK/GTK+ features])
dnl 
dnl   AC_DEFINE([ATK_DISABLE_DEPRECATED],[1],[Disable deprecated features])
dnl   AC_DEFINE([ATK_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
dnl   AC_DEFINE([G_DISABLE_DEPRECATED],[1],[Disable deprecated features])
dnl   AC_DEFINE([G_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
dnl   AC_DEFINE([GDK_DISABLE_DEPRECATED],[1],[Disable deprecated features])
dnl   AC_DEFINE([GDK_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
dnl   AC_DEFINE([GDK_PIXBUF_DISABLE_DEPRECATED],[1],[Disable deprecated features])
dnl   AC_DEFINE([GDK_PIXBUF_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
dnl   AC_DEFINE([GTK_DISABLE_DEPRECATED],[1],[Disable deprecated features])
dnl   AC_DEFINE([GTK_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
dnl   AC_DEFINE([PANGO_DISABLE_DEPRECATED],[1],[Disable deprecated features])
dnl   AC_DEFINE([PANGO_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
dnl fi
301
302
303
304
305

################################################################################
# Core
################################################################################

306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# Use all available features under glibc, and disable accidental use of
# deprecated functionality.
AC_EGREP_CPP(glibc,
		[
		 #include <stdio.h>
		 #ifdef __GLIBC__
		 glibc
		 #endif
		],
		AC_DEFINE(_GNU_SOURCE,1,[Use all glibc features.]))

case $host in
*-*-solaris*)
	AC_DEFINE(_XOPEN_SOURCE_EXTENDED,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
	AC_DEFINE(_XOPEN_SOURCE,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
	AC_DEFINE(__EXTENSIONS__,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
	;;
esac

325
GLIB_REQUIRED=2.26.0
326
PANGO_REQUIRED=1.22.0
327
AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK's multihead-safe APIs.])
328
PKG_CHECK_MODULES(GLIB,[glib-2.0 > $GLIB_REQUIRED gobject-2.0])
329
330
331
332
PKG_CHECK_MODULES(GTK,[glib-2.0 >= $GLIB_REQUIRED gobject-2.0 gtk+-$GTK_API_VERSION >= $GTK_REQUIRED])

AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
333

334
335
336
337
338
339
340
# Let the user specify the default terminal emulation.
AC_ARG_WITH(default-emulation,
AS_HELP_STRING(--with-default-emulation=xterm,default terminal type to be emulated),
emulation=$withval,emulation=xterm)
AC_DEFINE_UNQUOTED(VTE_DEFAULT_EMULATION,"$emulation",[The default terminal type to be emulated.])
VTE_DEFAULT_EMULATION=$emulation
AC_SUBST(VTE_DEFAULT_EMULATION)
341
AM_CONDITIONAL(VTE_DEFAULT_EMULATION, [test "$emulation" != xterm])
342

343
344
345
346
347
# Check for headers.
AC_CHECK_HEADERS(sys/select.h sys/syslimits.h sys/termios.h sys/un.h sys/wait.h stropts.h termios.h wchar.h)
AC_HEADER_TIOCGWINSZ

# Check for PTY handling functions.
Chris Wilson's avatar
Chris Wilson committed
348
AC_CHECK_FUNCS([cfmakeraw fork setsid setpgid getpgid getpt grantpt unlockpt ptsname ptsname_r tcgetattr tcsetattr])
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364

# Pull in the right libraries for various functions which might not be
# bundled into an exploded libc.
AC_CHECK_FUNC(socket,[have_socket=1],AC_CHECK_LIB(socket,socket,[have_socket=1; LIBS="$LIBS -lsocket"]))
AC_CHECK_FUNC(socketpair,[have_socketpair=1],AC_CHECK_LIB(socket,socketpair,[have_socketpair=1; LIBS="$LIBS -lsocket"]))
AC_CHECK_FUNC(recvmsg,[have_recvmsg=1],AC_CHECK_LIB(socket,recvmsg,[have_recvmsg=1; LIBS="$LIBS -lsocket -lnsl"]))
if test x$have_socket = x1 ; then
	AC_DEFINE(HAVE_SOCKET,1,[Define if you have the socket function.])
fi
if test x$have_socketpair = x1 ; then
	AC_DEFINE(HAVE_SOCKETPAIR,1,[Define if you have the socketpair function.])
fi
if test x$have_recvmsg = x1 ; then
	AC_DEFINE(HAVE_RECVMSG,1,[Define if you have the recvmsg function.])
fi
AC_CHECK_FUNC(floor,,AC_CHECK_LIB(m,floor,LIBS=["$LIBS -lm"]))
365
AC_CHECK_FUNCS([ceil floor])
366

367
368
369
370
371
372
373
374
375
376
377
378
379
380
# Look for tgetent

AC_CHECK_FUNC([tgetent],[vte_cv_termcap_lib=libc],
  [AC_CHECK_LIB([ncurses],[tgetent],[vte_cv_termcap_lib=libncurses],
    [AC_CHECK_LIB([tinfo],[tgetent],[vte_cv_termcap_lib=libtinfo],
      [AC_CHECK_LIB([curses],[tgetent],[vte_cv_termcap_lib=libcurses],
        [AC_CHECK_LIB([termcap],[tgetent],[vte_cv_termcap_lib=libtermcap],
          [vte_cv_termcap_lib=])])])])])

case "$vte_cv_termcap_lib" in
  libc)       # FIXME: which headers to include here?
              ;;
  libncurses) # We need ncurses.h and term.h, or ncurses/curses.h and ncurses/term.h
              AC_CHECK_HEADERS([ncurses.h term.h],[],
381
                [AC_CHECK_HEADERS([ncurses/curses.h ncurses/term.h],[],
382
383
384
385
386
                  [AC_MSG_ERROR([ncurses headers not found])])])
              LIBS="-lncurses $LIBS"
              ;;
  libtinfo)   # Need ncurses/curses.h and ncurses/term.h
              AC_CHECK_HEADERS([ncurses.h term.h],[],
387
                [AC_CHECK_HEADERS([ncurses/curses.h ncurses/term.h],[],
388
389
390
391
392
                  [AC_MSG_ERROR([ncurses headers not found])])])
              LIBS="-ltinfo $LIBS"
              ;;
  libcurses)  # Need curses.h and term.h
              AC_CHECK_HEADERS([curses.h term.h],[],
393
394
395
396
397
                [AC_MSG_ERROR([curses headers not found])],
                [[#ifdef HAVE_CURSES_H
                  #include <curses.h>
                  #endif]])
              LIBS="-lcurses $LIBS"
398
399
400
401
402
403
404
405
              ;;
  libtermcap) # Need termcap.h
              AC_CHECK_HEADERS([termcap.h],[],
                [AC_MSG_ERROR([termcap headers not found])])
              LIBS="-ltermcap $LIBS"
              ;;
  *)          AC_MSG_ERROR([tgetent not found in any library]) ;;
esac
406

407
# Search for the required modules.
408
409

# We have a direct dependency on X11 on gdk-x11, see bug #613525
410
AC_MSG_CHECKING([for GDK target])
411
GDK_TARGET="$($PKG_CONFIG --variable target gdk-$GTK_API_VERSION)"
412
AC_MSG_RESULT([$GDK_TARGET])
413
case "$GDK_TARGET" in
414
  x11) PLATFORM_PKGS="x11 cairo-xlib" ;;
415
416
417
  *) PLATFORM_PKGS="" ;;
esac

418
VTE_PKGS="glib-2.0 >= $GLIB_REQUIRED gobject-2.0 pango >= $PANGO_REQUIRED gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gobject-2.0 gio-2.0 gio-unix-2.0 $PLATFORM_PKGS"
419
420
PKG_CHECK_MODULES([VTE],[$VTE_PKGS])
AC_SUBST([VTE_PKGS])
421

422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
wcs_funcs_includes="
#ifdef HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
#  include <memory.h>
# endif
# include <string.h>
#else
# ifdef HAVE_STRINGS_H
#  include <strings.h>
# endif
#endif
#ifdef HAVE_WCHAR_H
# include <wchar.h>
#endif
"

438
AC_CHECK_TYPES(wint_t, AC_DEFINE(HAVE_WINT_T, , [Defined when the wint_t type is supported]), ,$wcs_funcs_includes)
439

440
441
442
443
444

################################################################################
# Auxillary modules
################################################################################

445
446
if test "$with_gtk" = "2.0"; then

447
# Search for Python.
448
BUILD_PYTHON=true
449
AC_ARG_ENABLE(python, [AS_HELP_STRING(--enable-python,Build python bindings [default=yes])],[
450
if test x"$enableval" != xno ; then
451
	BUILD_PYTHON=true
452
else
453
	BUILD_PYTHON=false
454
455
456
457
458
459
460
fi],BUILD_PYTHON=true)

if $BUILD_PYTHON ; then
	AM_PATH_PYTHON
	if test -z "$PYTHON" ; then
		BUILD_PYTHON=false
	fi
461
fi
462

463
if $BUILD_PYTHON ; then
464
465
	AC_MSG_CHECKING(for python >= 2.2)
	prog="
466
467
468
import sys, string
minver = (2,2,0,'final',0)
if sys.version_info < minver:
469
470
471
	sys.exit(1)
sys.exit(0)
"
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
	if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
	then
		AC_MSG_RESULT([okay])
	else
		BUILD_PYTHON=false
		AC_MSG_RESULT([too old])
	fi
fi

if $BUILD_PYTHON ; then
	AM_CHECK_PYTHON_HEADERS(,BUILD_PYTHON=false)
fi

if $BUILD_PYTHON ; then
	AC_MSG_CHECKING([for pygtk-2.0])
	if pkg-config --exists pygtk-2.0 ; then
		AC_MSG_RESULT([found])
		PKG_CHECK_MODULES(PYGTK,[pygtk-2.0])
Kjartan Maraas's avatar
Update.    
Kjartan Maraas committed
490
491
492
493
494
495
496
497
498
499

		AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
		if test "x$PYGTK_CODEGEN" = xno; then
		  AC_MSG_ERROR(could not find pygtk-codegen-2.0 script)
		fi

		AC_MSG_CHECKING(for pygtk defs)
		PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
		AC_SUBST(PYGTK_DEFSDIR)
		AC_MSG_RESULT($PYGTK_DEFSDIR)
500
	else
501
		AC_MSG_RESULT([not found])
502
		BUILD_PYTHON=false
503
	fi
504
505
506
fi

if ! $BUILD_PYTHON ; then
507
	AC_MSG_RESULT([Python bindings disabled.])
508
fi
509

510
511
AC_SUBST(PYTHONREV)
AC_SUBST(PYTHONMODULES)
512
513
514
515
516

else # with_gtk = 3.0
  BUILD_PYTHON=false
fi # with_gtk = 2.0

517
AM_CONDITIONAL(BUILD_PYTHON_MODULES, $BUILD_PYTHON)
518

519
520
521
522
################################################################################
# GNOME PTY Helper
################################################################################

523
AC_ARG_ENABLE(gnome-pty-helper, [AS_HELP_STRING(--enable-gnome-pty-helper,Build a setuid helper for opening ptys [default=yes])], enable_gnome_pty_helper="$enableval", enable_gnome_pty_helper=yes)
524
if test "$enable_gnome_pty_helper" != no; then
525
	AC_DEFINE(VTE_USE_GNOME_PTY_HELPER,1,[Define if you intend to use gnome-pty-helper.])
526
527
	AC_CONFIG_SUBDIRS(gnome-pty-helper)
fi
528
AM_CONDITIONAL(BUILD_GNOME_PTY_HELPER,[test "$enable_gnome_pty_helper" != no])
529

530
531
532
533
534
535
536
################################################################################
# Glade catalogue
################################################################################

AC_MSG_CHECKING([whether to install the glade catalogue])
AC_ARG_ENABLE([glade-catalogue],
  [AS_HELP_STRING([--disable-glade],[Disable installing the glade catalogue])],
537
  [],[enable_glade_catalogue=no])
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
AC_MSG_RESULT([$enable_glade_catalogue])

if test "$enable_glade_catalogue" = "yes"; then
  GLADE_CATALOGUE_DIR="$($PKG_CONFIG --variable=catalogdir gladeui-1.0)"
  GLADE_ICON_DIR="$($PKG_CONFIG --variable=pixmapdir gladeui-1.0)"
  GLADE_MODULE_DIR="$($PKG_CONFIG --variable=moduledir gladeui-1.0)"

  if test -z "$GLADE_CATALOGUE_DIR" -o -z "$GLADE_MODULE_DIR"; then
    AC_MSG_ERROR([gladeui-1.0 not found])
  fi

  AC_SUBST([GLADE_CATALOGUE_DIR])
  AC_SUBST([GLADE_ICON_DIR])
  AC_SUBST([GLADE_MODULE_DIR])
fi
  
AM_CONDITIONAL([ENABLE_GLADE_CATALOGUE],[test "$enable_glade_catalogue" = "yes"])

Christian Persch's avatar
Christian Persch committed
556
557
558
559
560
561
562
563
564
# *************
# Introspection
# *************

# No automagic please!
if test -z "$enable_introspection"; then
  enable_introspection=no
fi

565
GOBJECT_INTROSPECTION_CHECK([0.9.0])
Christian Persch's avatar
Christian Persch committed
566

567
568
569
570
571
572
# *********
# GSettings
# *********

GLIB_GSETTINGS

573
574
################################################################################

Christian Persch's avatar
Christian Persch committed
575
576
577
GTK_DOC_CHECK([1.13],[--flavour no-tmpl])

AC_SUBST([GLIB_PREFIX],[$($PKG_CONFIG --variable=prefix glib-2.0)])
578
AC_SUBST([GTK_PREFIX],[$($PKG_CONFIG --variable=prefix gtk+-$GTK_API_VERSION)])
579
580
581

################################################################################

Behdad Esfahbod's avatar
Behdad Esfahbod committed
582
583
584
AC_SUBST([VTE_MAJOR_VERSION],[version_major])
AC_SUBST([VTE_MINOR_VERSION],[version_minor])
AC_SUBST([VTE_MICRO_VERSION],[version_micro])
585
586
587

################################################################################

588
AC_CONFIG_FILES([
589
590
Makefile
src/Makefile
591
src/vteversion.h
592
termcaps/Makefile
Behdad Esfahbod's avatar
Behdad Esfahbod committed
593
perf/Makefile
594
python/Makefile
595
python/pyvte.pc
596
po/Makefile.in
597
doc/Makefile
598
doc/openi18n/Makefile
599
doc/reference/Makefile
Christian Persch's avatar
Christian Persch committed
600
doc/reference/version.xml
601
glade/Makefile
602
])
603

604
605
606
607
AC_CONFIG_FILES([vte${VTE_PC_VERSION}.pc:vte.pc.in],[VTE_PC_VERSION=${VTE_PC_VERSION}])
AC_CONFIG_FILES([vte${VTE_PC_VERSION}-uninstalled.pc:vte-uninstalled.pc.in],[VTE_PC_VERSION=${VTE_PC_VERSION}])

AC_OUTPUT
608
609
610
611

#####################
# Print configuration
#####################
612
613
614
615
616
617
cat <<EOF | tee -a config.log

## -------------- ##
## Configuration. ##
## -------------- ##

618
Configuration for libvte $VERSION for gtk+-$GTK_API_VERSION
619
	Installing Glade catalogue: $enable_glade_catalogue
620
	Debugging: $DEBUG
621
	Disallow deprecated features: $enable_deprecation
622
EOF