1 m4_define([version_major],0)
2 m4_define([version_minor],25)
3 m4_define([version_micro],91)
4 m4_define([version_triplet],version_major.version_minor.version_micro)
6 m4_define([so_major_adjust],9) dnl Don't change!
9 AC_INIT(vte, [version_triplet], [http://bugzilla.gnome.org/enter_bug.cgi?product=vte])
10 AC_CONFIG_SRCDIR([src/vte.c])
11 AC_CONFIG_HEADERS([config.h])
13 AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-bzip2])
15 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
17 if test -z "$enable_maintainer_mode"; then
18 enable_maintainer_mode=yes
20 AM_MAINTAINER_MODE([enable])
22 ################################################################################
24 ################################################################################
25 m4_define([lt_revision], m4_if(m4_eval(version_minor%2),1,0,version_micro))
26 m4_define([lt_age], m4_eval(version_minor*100+version_micro-lt_revision))
27 m4_define([lt_current], m4_eval(so_major_adjust+version_major+lt_age))
28 m4_define([lt_triplet],lt_current:lt_revision:lt_age)
30 LT_VERSION_INFO="lt_triplet()"
31 AC_SUBST([LT_VERSION_INFO])
33 ################################################################################
35 ################################################################################
37 AC_MSG_CHECKING([which gtk+ version to compile against])
39 [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
42 *) AC_MSG_ERROR([invalid gtk version specified]) ;;
45 AC_MSG_RESULT([$with_gtk])
48 2.0) VTE_API_VERSION=0.0
49 VTE_API_MAJOR_VERSION=0
50 VTE_API_MINOR_VERSION=0
56 3.0) VTE_API_VERSION=2.90
57 VTE_API_MAJOR_VERSION=2
58 VTE_API_MINOR_VERSION=90
59 VTE_PC_VERSION=-$VTE_API_VERSION
60 VTE_LIBRARY_SUFFIX=$VTE_API_VERSION
66 AC_SUBST([VTE_API_VERSION])
67 AC_SUBST([VTE_API_VERSION_U],[AS_TR_SH([$VTE_API_VERSION])])
68 AC_SUBST([VTE_API_MAJOR_VERSION])
69 AC_SUBST([VTE_API_MINOR_VERSION])
70 AC_SUBST([VTE_PC_VERSION])
71 AC_SUBST([GTK_API_VERSION])
72 AC_SUBST([VTE_LIBRARY_SUFFIX_U],[AS_TR_SH([$VTE_LIBRARY_SUFFIX])])
74 AM_CONDITIONAL([HAVE_GTK_2],[test "$with_gtk" = "2.0"])
75 AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk" = "3.0"])
77 ################################################################################
90 ################################################################################
92 ################################################################################
94 IT_PROG_INTLTOOL([0.35.0])
96 GETTEXT_PACKAGE=vte-$VTE_API_VERSION
97 AC_SUBST(GETTEXT_PACKAGE)
98 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
99 [Package translatable messages domain name.])
101 AC_CHECK_DECLS(bind_textdomain_codeset,,,[#include "libintl.h"])
104 ################################################################################
106 ################################################################################
108 AC_MSG_CHECKING([for a win32 platform])
111 *-*-mingw*|*-*-cygwin*)
115 AC_MSG_RESULT([$platform_win32])
116 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
119 if test "x$platform_win32" = "xyes"; then
120 AC_MSG_CHECKING([for native win32])
126 AC_MSG_RESULT([$os_win32])
128 AM_CONDITIONAL(OS_WIN32, test "x$os_win32" = "xyes")
131 if test "x$platform_win32" != "xyes"; then
132 LIBTOOL_EXPORT_OPTIONS=
134 LIBTOOL_EXPORT_OPTIONS='-no-undefined'
136 AC_SUBST([LIBTOOL_EXPORT_OPTIONS])
137 LIBTOOL_FLAGS='-as-needed'
138 AC_SUBST([LIBTOOL_FLAGS])
141 ################################################################################
143 ################################################################################
145 dnl Use lots of warning flags with with gcc and compatible compilers
146 dnl Copied from cairo
147 AC_DEFUN([VTE_CC_TRY_FLAG], [
148 AC_MSG_CHECKING([whether $CC supports $1])
150 vte_save_CFLAGS="$CFLAGS"
153 AC_COMPILE_IFELSE([ ], [vte_cc_flag=yes], [vte_cc_flag=no])
154 CFLAGS="$vte_save_CFLAGS"
156 if test "x$vte_cc_flag" = "xyes"; then
157 ifelse([$2], , :, [$2])
159 ifelse([$3], , :, [$3])
161 AC_MSG_RESULT([$vte_cc_flag])
163 AC_DEFUN([VTE_LD_TRY_FLAG], [
164 AC_MSG_CHECKING([whether $CC supports $1 when linking])
166 vte_save_LDFLAGS="$LDFLAGS"
167 LDFLAGS="$LDFLAGS $1"
169 AC_LINK_IFELSE([int main(void) {return 0;}],
170 [vte_ld_flag=yes], [vte_ld_flag=no])
171 LDFLAGS="$vte_save_LDFLAGS"
173 if test "x$vte_ld_flag" = "xyes"; then
174 ifelse([$2], , :, [$2])
176 ifelse([$3], , :, [$3])
178 AC_MSG_RESULT([$vte_ld_flag])
182 dnl Note: if you change the following variable, the cache is automatically
183 dnl skipped and all flags rechecked. So there's no need to do anything
184 dnl else. If for any reason you need to force a recheck, just change
185 dnl MAYBE_WARN in an ignorable way (like adding whitespace)
187 MAYBE_WARN="-Wall -Wextra \
188 -Wsign-compare -Werror-implicit-function-declaration \
189 -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
190 -Waggregate-return -Wcast-align -Wimplicit -Wuninitialised \
191 -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
192 -Wpacked -Wmissing-format-attribute -Wshadow \
193 -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
194 -Wdeclaration-after-statement -Wold-style-definition \
195 -Wno-missing-field-initializers -Wno-unused-parameter \
196 -fno-common -Wno-switch-enum"
198 # invalidate cached value if MAYBE_WARN has changed
199 if test "x$vte_cv_warn_maybe" != "x$MAYBE_WARN"; then
200 unset vte_cv_warn_cflags
202 AC_CACHE_CHECK([for supported warning flags], vte_cv_warn_cflags, [
206 # Some warning options are not supported by all versions of
207 # gcc, so test all desired options against the current
210 # Note that there are some order dependencies
211 # here. Specifically, an option that disables a warning will
212 # have no net effect if a later option then enables that
213 # warnings, (perhaps implicitly). So we put some grouped
214 # options (-Wall and -Wextra) up front and the -Wno options
217 for W in $MAYBE_WARN; do
218 VTE_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
221 vte_cv_warn_cflags=$WARN_CFLAGS
222 vte_cv_warn_maybe=$MAYBE_WARN
224 AC_MSG_CHECKING([which warning flags were supported])])
225 WARN_CFLAGS=$vte_cv_warn_cflags
226 AC_SUBST(WARN_CFLAGS)
227 CFLAGS="$CFLAGS $WARN_CFLAGS"
230 for W in "-Wl,--warn-unresolved-symbols"; do
231 VTE_LD_TRY_FLAG([$W], [PYTHON_LDFLAGS="$PYTHON_LDFLAGS $W"])
233 AC_SUBST(PYTHON_LDFLAGS)
235 # Enable debugging messages and additional run-time checks.
237 [AS_HELP_STRING([--enable-debug],
238 [enable extra debugging checks and logging messages]
240 DEBUG=$enableval, DEBUG=no)
241 if test "x$DEBUG" != "xno" ; then
242 AC_MSG_RESULT([enabling debug checks and messages])
243 AC_DEFINE(VTE_DEBUG,1,[Enable debugging messages.])
246 ################################################################################
250 # Disable deprecations and single includes
251 # We don't use GNOME_MAINTAINER_MODE_DEFINES here since it's too much and
252 # it also defines VTE's own defines.
253 dnl AC_ARG_ENABLE([deprecation],
254 dnl [AS_HELP_STRING([--disable-deprecation],
255 dnl [prohibit VTE from using deprecated GLib/Pango/ATK/GDK/GTK+ features])],
256 dnl [],[enable_deprecation=$enable_maintainer_mode])
257 dnl if test "x$enable_deprecation" = xyes; then
258 dnl AC_MSG_NOTICE([disabling deprecated GLIB/PANGO/GDK/ATK/GTK+ features])
260 dnl AC_DEFINE([ATK_DISABLE_DEPRECATED],[1],[Disable deprecated features])
261 dnl AC_DEFINE([ATK_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
262 dnl AC_DEFINE([G_DISABLE_DEPRECATED],[1],[Disable deprecated features])
263 dnl AC_DEFINE([G_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
264 dnl AC_DEFINE([GDK_DISABLE_DEPRECATED],[1],[Disable deprecated features])
265 dnl AC_DEFINE([GDK_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
266 dnl AC_DEFINE([GDK_PIXBUF_DISABLE_DEPRECATED],[1],[Disable deprecated features])
267 dnl AC_DEFINE([GDK_PIXBUF_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
268 dnl AC_DEFINE([GTK_DISABLE_DEPRECATED],[1],[Disable deprecated features])
269 dnl AC_DEFINE([GTK_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
270 dnl AC_DEFINE([PANGO_DISABLE_DEPRECATED],[1],[Disable deprecated features])
271 dnl AC_DEFINE([PANGO_DISABLE_SINGLE_INCLUDES],[1],[Disable single includes])
274 ################################################################################
276 ################################################################################
278 # Use all available features under glibc, and disable accidental use of
279 # deprecated functionality.
287 AC_DEFINE(_GNU_SOURCE,1,[Use all glibc features.]))
291 AC_DEFINE(_XOPEN_SOURCE_EXTENDED,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
292 AC_DEFINE(_XOPEN_SOURCE,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
293 AC_DEFINE(__EXTENSIONS__,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
298 PANGO_REQUIRED=1.22.0
299 AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK's multihead-safe APIs.])
300 PKG_CHECK_MODULES(GLIB,[glib-2.0 > $GLIB_REQUIRED gobject-2.0])
301 PKG_CHECK_MODULES(GTK,[glib-2.0 >= $GLIB_REQUIRED gobject-2.0 gtk+-$GTK_API_VERSION >= $GTK_REQUIRED])
303 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
304 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
306 # Let the user specify the default terminal emulation.
307 AC_ARG_WITH(default-emulation,
308 AS_HELP_STRING(--with-default-emulation=xterm,default terminal type to be emulated),
309 emulation=$withval,emulation=xterm)
310 AC_DEFINE_UNQUOTED(VTE_DEFAULT_EMULATION,"$emulation",[The default terminal type to be emulated.])
311 VTE_DEFAULT_EMULATION=$emulation
312 AC_SUBST(VTE_DEFAULT_EMULATION)
313 AM_CONDITIONAL(VTE_DEFAULT_EMULATION, [test "$emulation" != xterm])
316 AC_CHECK_HEADERS(sys/select.h sys/syslimits.h sys/termios.h sys/un.h sys/wait.h stropts.h termios.h wchar.h)
319 # Check for PTY handling functions.
320 AC_CHECK_FUNCS([cfmakeraw fork setsid setpgid getpgid getpt grantpt unlockpt ptsname ptsname_r tcgetattr tcsetattr])
322 # Pull in the right libraries for various functions which might not be
323 # bundled into an exploded libc.
324 AC_CHECK_FUNC(socket,[have_socket=1],AC_CHECK_LIB(socket,socket,[have_socket=1; LIBS="$LIBS -lsocket"]))
325 AC_CHECK_FUNC(socketpair,[have_socketpair=1],AC_CHECK_LIB(socket,socketpair,[have_socketpair=1; LIBS="$LIBS -lsocket"]))
326 AC_CHECK_FUNC(recvmsg,[have_recvmsg=1],AC_CHECK_LIB(socket,recvmsg,[have_recvmsg=1; LIBS="$LIBS -lsocket -lnsl"]))
327 if test x$have_socket = x1 ; then
328 AC_DEFINE(HAVE_SOCKET,1,[Define if you have the socket function.])
330 if test x$have_socketpair = x1 ; then
331 AC_DEFINE(HAVE_SOCKETPAIR,1,[Define if you have the socketpair function.])
333 if test x$have_recvmsg = x1 ; then
334 AC_DEFINE(HAVE_RECVMSG,1,[Define if you have the recvmsg function.])
336 AC_CHECK_FUNC(floor,,AC_CHECK_LIB(m,floor,LIBS=["$LIBS -lm"]))
337 AC_CHECK_FUNCS([ceil floor])
341 AC_CHECK_FUNC([tgetent],[vte_cv_termcap_lib=libc],
342 [AC_CHECK_LIB([ncurses],[tgetent],[vte_cv_termcap_lib=libncurses],
343 [AC_CHECK_LIB([tinfo],[tgetent],[vte_cv_termcap_lib=libtinfo],
344 [AC_CHECK_LIB([curses],[tgetent],[vte_cv_termcap_lib=libcurses],
345 [AC_CHECK_LIB([termcap],[tgetent],[vte_cv_termcap_lib=libtermcap],
346 [vte_cv_termcap_lib=])])])])])
348 case "$vte_cv_termcap_lib" in
349 libc) # FIXME: which headers to include here?
351 libncurses) # We need ncurses.h and term.h, or ncurses/curses.h and ncurses/term.h
352 AC_CHECK_HEADERS([ncurses.h term.h],[],
353 [AC_CHECK_HEADERS([ncurses/curses.h ncurses/term.h],[],
354 [AC_MSG_ERROR([ncurses headers not found])])])
355 LIBS="-lncurses $LIBS"
357 libtinfo) # Need ncurses/curses.h and ncurses/term.h
358 AC_CHECK_HEADERS([ncurses.h term.h],[],
359 [AC_CHECK_HEADERS([ncurses/curses.h ncurses/term.h],[],
360 [AC_MSG_ERROR([ncurses headers not found])])])
363 libcurses) # Need curses.h and term.h
364 AC_CHECK_HEADERS([curses.h term.h],[],
365 [AC_MSG_ERROR([curses headers not found])],
366 [[#ifdef HAVE_CURSES_H
369 LIBS="-lcurses $LIBS"
371 libtermcap) # Need termcap.h
372 AC_CHECK_HEADERS([termcap.h],[],
373 [AC_MSG_ERROR([termcap headers not found])])
374 LIBS="-ltermcap $LIBS"
376 *) AC_MSG_ERROR([tgetent not found in any library]) ;;
379 # Search for the required modules.
381 # We have a direct dependency on X11 on gdk-x11, see bug #613525
382 AC_MSG_CHECKING([for GDK target])
383 GDK_TARGET="$($PKG_CONFIG --variable target gdk-$GTK_API_VERSION)"
384 AC_MSG_RESULT([$GDK_TARGET])
385 case "$GDK_TARGET" in
386 x11) PLATFORM_PKGS="x11 cairo-xlib" ;;
387 *) PLATFORM_PKGS="" ;;
390 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"
391 PKG_CHECK_MODULES([VTE],[$VTE_PKGS])
396 # if !STDC_HEADERS && HAVE_MEMORY_H
401 # ifdef HAVE_STRINGS_H
402 # include <strings.h>
410 AC_CHECK_TYPES(wint_t, AC_DEFINE(HAVE_WINT_T, , [Defined when the wint_t type is supported]), ,$wcs_funcs_includes)
413 ################################################################################
415 ################################################################################
417 if test "$with_gtk" = "2.0"; then
421 AC_ARG_ENABLE(python, [AS_HELP_STRING(--enable-python,Build python bindings [default=yes])],[
422 if test x"$enableval" != xno ; then
426 fi],BUILD_PYTHON=true)
428 if $BUILD_PYTHON ; then
430 if test -z "$PYTHON" ; then
435 if $BUILD_PYTHON ; then
436 AC_MSG_CHECKING(for python >= 2.2)
439 minver = (2,2,0,'final',0)
440 if sys.version_info < minver:
444 if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
446 AC_MSG_RESULT([okay])
449 AC_MSG_RESULT([too old])
453 if $BUILD_PYTHON ; then
454 AM_CHECK_PYTHON_HEADERS(,BUILD_PYTHON=false)
457 if $BUILD_PYTHON ; then
458 AC_MSG_CHECKING([for pygtk-2.0])
459 if pkg-config --exists pygtk-2.0 ; then
460 AC_MSG_RESULT([found])
461 PKG_CHECK_MODULES(PYGTK,[pygtk-2.0])
463 AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
464 if test "x$PYGTK_CODEGEN" = xno; then
465 AC_MSG_ERROR(could not find pygtk-codegen-2.0 script)
468 AC_MSG_CHECKING(for pygtk defs)
469 PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
470 AC_SUBST(PYGTK_DEFSDIR)
471 AC_MSG_RESULT($PYGTK_DEFSDIR)
473 AC_MSG_RESULT([not found])
478 if ! $BUILD_PYTHON ; then
479 AC_MSG_RESULT([Python bindings disabled.])
483 AC_SUBST(PYTHONMODULES)
485 else # with_gtk = 3.0
489 AM_CONDITIONAL(BUILD_PYTHON_MODULES, $BUILD_PYTHON)
491 ################################################################################
493 ################################################################################
495 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)
496 if test "$enable_gnome_pty_helper" != no; then
497 AC_DEFINE(VTE_USE_GNOME_PTY_HELPER,1,[Define if you intend to use gnome-pty-helper.])
498 AC_CONFIG_SUBDIRS(gnome-pty-helper)
500 AM_CONDITIONAL(BUILD_GNOME_PTY_HELPER,[test "$enable_gnome_pty_helper" != no])
502 ################################################################################
504 ################################################################################
506 AC_MSG_CHECKING([whether to install the glade catalogue])
507 AC_ARG_ENABLE([glade-catalogue],
508 [AS_HELP_STRING([--disable-glade],[Disable installing the glade catalogue])],
509 [],[enable_glade_catalogue=no])
510 AC_MSG_RESULT([$enable_glade_catalogue])
512 if test "$enable_glade_catalogue" = "yes"; then
513 GLADE_CATALOGUE_DIR="$($PKG_CONFIG --variable=catalogdir gladeui-1.0)"
514 GLADE_ICON_DIR="$($PKG_CONFIG --variable=pixmapdir gladeui-1.0)"
515 GLADE_MODULE_DIR="$($PKG_CONFIG --variable=moduledir gladeui-1.0)"
517 if test -z "$GLADE_CATALOGUE_DIR" -o -z "$GLADE_MODULE_DIR"; then
518 AC_MSG_ERROR([gladeui-1.0 not found])
521 AC_SUBST([GLADE_CATALOGUE_DIR])
522 AC_SUBST([GLADE_ICON_DIR])
523 AC_SUBST([GLADE_MODULE_DIR])
526 AM_CONDITIONAL([ENABLE_GLADE_CATALOGUE],[test "$enable_glade_catalogue" = "yes"])
532 # No automagic please!
533 if test -z "$enable_introspection"; then
534 enable_introspection=no
537 GOBJECT_INTROSPECTION_CHECK([0.6.7])
539 ################################################################################
541 GTK_DOC_CHECK([1.13],[--flavour no-tmpl])
543 AC_SUBST([GLIB_PREFIX],[$($PKG_CONFIG --variable=prefix glib-2.0)])
544 AC_SUBST([GTK_PREFIX],[$($PKG_CONFIG --variable=prefix gtk+-$GTK_API_VERSION)])
546 ################################################################################
548 AC_SUBST([VTE_MAJOR_VERSION],[version_major])
549 AC_SUBST([VTE_MINOR_VERSION],[version_minor])
550 AC_SUBST([VTE_MICRO_VERSION],[version_micro])
552 ################################################################################
564 doc/openi18n/Makefile
565 doc/reference/Makefile
566 doc/reference/version.xml
570 AC_CONFIG_FILES([vte${VTE_PC_VERSION}.pc:vte.pc.in],[VTE_PC_VERSION=${VTE_PC_VERSION}])
571 AC_CONFIG_FILES([vte${VTE_PC_VERSION}-uninstalled.pc:vte-uninstalled.pc.in],[VTE_PC_VERSION=${VTE_PC_VERSION}])
575 #####################
576 # Print configuration
577 #####################
578 cat <<EOF | tee -a config.log
584 Configuration for libvte $VERSION for gtk+-$GTK_API_VERSION
585 Installing Glade catalogue: $enable_glade_catalogue
587 Disallow deprecated features: $enable_deprecation