3 [http://bugzilla.gnome.org/enter_bug.cgi?product=vte])
4 AC_CONFIG_SRCDIR([src/vte.c])
6 AM_CONFIG_HEADER([config.h])
8 ################################################################################
9 # Libtool shared library versioning stuffs.
10 # REVISION gets incremented whenever the source code changes without adding
11 # an API or ABI change.
13 # CURRENT must be incremented when an API or ABI change (addition or removal)
14 # is made, and REVISION must be reset to 0 when this happens.
16 # AGE must be incremented when an API or ABI addition is made, and REVISION
17 # must be reset to 0 when this happens.
20 LIBVTE_LTVERSION=${LTVERSION_CURRENT}:${LTVERSION_REVISION}:${LTVERSION_AGE}
21 AC_SUBST([LIBVTE_LTVERSION])
23 ################################################################################
32 IT_PROG_INTLTOOL([0.35.0])
35 AC_SUBST(GETTEXT_PACKAGE)
36 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
37 [Package translatable messages domain name.])
39 AC_CHECK_DECLS(bind_textdomain_codeset,,,[#include "libintl.h"])
42 ################################################################################
44 ################################################################################
46 AC_MSG_CHECKING([for a win32 platform])
49 *-*-mingw*|*-*-cygwin*)
53 AC_MSG_RESULT([$platform_win32])
54 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
57 if test "x$platform_win32" = "xyes"; then
58 AC_MSG_CHECKING([for native win32])
64 AC_MSG_RESULT([$os_win32])
66 AM_CONDITIONAL(OS_WIN32, test "x$os_win32" = "xyes")
69 if test "x$platform_win32" != "xyes"; then
70 LIBTOOL_EXPORT_OPTIONS=
72 LIBTOOL_EXPORT_OPTIONS='-no-undefined'
74 AC_SUBST([LIBTOOL_EXPORT_OPTIONS])
75 LIBTOOL_FLAGS='-as-needed'
76 AC_SUBST([LIBTOOL_FLAGS])
79 ################################################################################
81 ################################################################################
83 # Save the names of these other libraries.
84 OTHERCFLAGS="$X_CFLAGS"
89 dnl Use lots of warning flags with with gcc and compatible compilers
91 AC_DEFUN([VTE_CC_TRY_FLAG], [
92 AC_MSG_CHECKING([whether $CC supports $1])
94 vte_save_CFLAGS="$CFLAGS"
97 AC_COMPILE_IFELSE([ ], [vte_cc_flag=yes], [vte_cc_flag=no])
98 CFLAGS="$vte_save_CFLAGS"
100 if test "x$vte_cc_flag" = "xyes"; then
101 ifelse([$2], , :, [$2])
103 ifelse([$3], , :, [$3])
105 AC_MSG_RESULT([$vte_cc_flag])
107 AC_DEFUN([VTE_LD_TRY_FLAG], [
108 AC_MSG_CHECKING([whether $CC supports $1 when linking])
110 vte_save_LDFLAGS="$LDFLAGS"
111 LDFLAGS="$LDFLAGS $1"
113 AC_LINK_IFELSE([int main(void) {return 0;}],
114 [vte_ld_flag=yes], [vte_ld_flag=no])
115 LDFLAGS="$vte_save_LDFLAGS"
117 if test "x$vte_ld_flag" = "xyes"; then
118 ifelse([$2], , :, [$2])
120 ifelse([$3], , :, [$3])
122 AC_MSG_RESULT([$vte_ld_flag])
126 dnl Note: if you change the following variable, the cache is automatically
127 dnl skipped and all flags rechecked. So there's no need to do anything
128 dnl else. If for any reason you need to force a recheck, just change
129 dnl MAYBE_WARN in an ignorable way (like adding whitespace)
131 MAYBE_WARN="-Wall -Wextra \
132 -Wsign-compare -Werror-implicit-function-declaration \
133 -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
134 -Waggregate-return -Wcast-align -Wimplicit -Wuninitialised \
135 -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
136 -Wpacked -Wmissing-format-attribute -Wshadow \
137 -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
138 -Wdeclaration-after-statement -Wold-style-definition \
139 -Wno-missing-field-initializers -Wno-unused-parameter \
142 dnl Other flags you may wish to try: -Wswitch-enum
145 # invalidate cached value if MAYBE_WARN has changed
146 if test "x$vte_cv_warn_maybe" != "x$MAYBE_WARN"; then
147 unset vte_cv_warn_cflags
149 AC_CACHE_CHECK([for supported warning flags], vte_cv_warn_cflags, [
153 # Some warning options are not supported by all versions of
154 # gcc, so test all desired options against the current
157 # Note that there are some order dependencies
158 # here. Specifically, an option that disables a warning will
159 # have no net effect if a later option then enables that
160 # warnings, (perhaps implicitly). So we put some grouped
161 # options (-Wall and -Wextra) up front and the -Wno options
164 for W in $MAYBE_WARN; do
165 VTE_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
168 vte_cv_warn_cflags=$WARN_CFLAGS
169 vte_cv_warn_maybe=$MAYBE_WARN
171 AC_MSG_CHECKING([which warning flags were supported])])
172 WARN_CFLAGS=$vte_cv_warn_cflags
173 AC_SUBST(WARN_CFLAGS)
174 CFLAGS="$CFLAGS $WARN_CFLAGS"
177 for W in "-Wl,--warn-unresolved-symbols"; do
178 VTE_LD_TRY_FLAG([$W], [PYTHON_LDFLAGS="$PYTHON_LDFLAGS $W"])
180 AC_SUBST(PYTHON_LDFLAGS)
182 # Enable debugging messages and additional run-time checks.
184 [AS_HELP_STRING([--enable-debug],
185 [enable extra debugging checks and logging messages]
187 DEBUG=$enableval, DEBUG=no)
188 if test "x$DEBUG" != "xno" ; then
189 AC_MSG_RESULT([enabling debug checks and messages])
190 AC_DEFINE(VTE_DEBUG,1,[Enable debugging messages.])
195 ################################################################################
197 ################################################################################
200 # On some OSs, AC_PATH_XTRA doesn't work right(?), so let the user specify
201 # X_PRE_LIBS and X_EXTRA_LIBS to add even more libraries, and add -lX11 to
202 # the list of libraries for grins.
203 AC_PATH_XTRA([X11], [X11/Xlib.h], [XFlush(NULL)])
204 if test "$have_x" = yes ; then
205 if test -d "$x_includes" ; then
206 X_CFLAGS="-I$x_includes $X_CFLAGS"
207 elif test -d "$ac_x_includes" ; then
208 X_CFLAGS="-I$ac_x_includes $X_CFLAGS"
210 X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
211 if test -d "$ac_x_libraries" ; then
212 X_LIBS="-L$x_libraries $X_LIBS"
213 elif test -d "$ac_x_libraries" ; then
214 X_LIBS="-L$ac_x_libraries $X_LIBS"
217 AC_SUBST([X_CFLAGS X_LIBS])
221 # Use all available features under glibc, and disable accidental use of
222 # deprecated functionality.
230 AC_DEFINE(_GNU_SOURCE,1,[Use all glibc features.]))
234 AC_DEFINE(_XOPEN_SOURCE_EXTENDED,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
235 AC_DEFINE(_XOPEN_SOURCE,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
236 AC_DEFINE(__EXTENSIONS__,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
241 AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK's multihead-safe APIs.])
242 PKG_CHECK_MODULES(GLIB,glib-2.0 > 2.9.0)
243 PKG_CHECK_MODULES(GOBJECT,[glib-2.0 gobject-2.0])
244 PKG_CHECK_MODULES(GTK,[glib-2.0 gobject-2.0 gtk+-2.0 >= 2.6.0])
246 wantedmodules="glib-2.0 gobject-2.0 gtk+-2.0 fontconfig"
248 AC_ARG_ENABLE(deprecation,
249 [AS_HELP_STRING([--enable-deprecation],
250 [prohibit VTE from using deprecated GLib/Pango/GDK/GTK+ features])
252 usedeprecation=$enableval, usedeprecation=no)
253 if test "x$usedeprecation" = "xyes" ; then
254 AC_DEFINE(G_DISABLE_DEPRECATED, 1, [Disable deprecated GLib features.])
255 AC_DEFINE(GDK_DISABLE_DEPRECATED, 1, [Disable deprecated GDK features.])
256 AC_DEFINE(GDK_PIXBUF_DISABLE_DEPRECATED, 1, [Disable deprecated gdk-pixbuf features.])
257 AC_DEFINE(GTK_DISABLE_DEPRECATED, 1, [Disable deprecated GTK+ features.])
258 AC_DEFINE(PANGO_DISABLE_DEPRECATED, 1, [Disable deprecated Pango features.])
261 # Let the user specify the default terminal emulation.
262 AC_ARG_WITH(default-emulation,
263 AS_HELP_STRING(--with-default-emulation=xterm,default terminal type to be emulated),
264 emulation=$withval,emulation=xterm)
265 AC_DEFINE_UNQUOTED(VTE_DEFAULT_EMULATION,"$emulation",[The default terminal type to be emulated.])
266 VTE_DEFAULT_EMULATION=$emulation
267 AC_SUBST(VTE_DEFAULT_EMULATION)
269 # Miscellaneous definitions.
270 AC_DEFINE(VTE_UTF8_BPC,6,[Maximum number of bytes used per UTF-8 character.])
271 AC_DEFINE(VTE_INVALID_SOURCE,(guint)-1,[A number which can never be a valid source ID.])
272 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE",[Package name.])
275 AC_CHECK_HEADERS(sys/select.h sys/syslimits.h sys/termios.h sys/un.h sys/wait.h stropts.h termios.h wchar.h)
278 # Check for PTY handling functions.
279 AC_CHECK_FUNCS([cfmakeraw fork setsid setpgid getpgid getpt grantpt unlockpt ptsname ptsname_r tcgetattr tcsetattr])
281 # Pull in the right libraries for various functions which might not be
282 # bundled into an exploded libc.
283 AC_CHECK_FUNC(socket,[have_socket=1],AC_CHECK_LIB(socket,socket,[have_socket=1; LIBS="$LIBS -lsocket"]))
284 AC_CHECK_FUNC(socketpair,[have_socketpair=1],AC_CHECK_LIB(socket,socketpair,[have_socketpair=1; LIBS="$LIBS -lsocket"]))
285 AC_CHECK_FUNC(recvmsg,[have_recvmsg=1],AC_CHECK_LIB(socket,recvmsg,[have_recvmsg=1; LIBS="$LIBS -lsocket -lnsl"]))
286 if test x$have_socket = x1 ; then
287 AC_DEFINE(HAVE_SOCKET,1,[Define if you have the socket function.])
289 if test x$have_socketpair = x1 ; then
290 AC_DEFINE(HAVE_SOCKETPAIR,1,[Define if you have the socketpair function.])
292 if test x$have_recvmsg = x1 ; then
293 AC_DEFINE(HAVE_RECVMSG,1,[Define if you have the recvmsg function.])
295 AC_CHECK_FUNC(floor,,AC_CHECK_LIB(m,floor,LIBS=["$LIBS -lm"]))
296 AC_CHECK_FUNCS([ceil floor])
298 # Look for ncurses or curses or termcap.
299 AC_CHECK_HEADER(ncurses.h,[AC_CHECK_HEADER(term.h,[AC_CHECK_LIB(ncurses,tgetent,[LIBS="-lncurses $LIBS";AC_DEFINE(HAVE_NCURSES,1,[Define if you have ncurses.h and libncurses])])])])
300 if test x$ac_cv_lib_ncurses_tgetent != xyes ; then
301 AC_CHECK_HEADER(ncurses/curses.h,[AC_CHECK_HEADER(ncurses/term.h,[AC_CHECK_LIB(ncurses,tgetent,[LIBS="-lncurses $LIBS";AC_DEFINE(HAVE_NCURSES_CURSES,1,[Define if you have ncurses/curses.h and libncurses])])])])
302 if test x$ac_cv_lib_ncurses_tgetent != xyes ; then
303 AC_CHECK_HEADER(curses.h,[AC_CHECK_HEADER(term.h,[AC_CHECK_LIB(curses,tgetent,[LIBS="-lcurses $LIBS";AC_DEFINE(HAVE_CURSES,1,[Define if you have curses.h and libcurses])])])])
304 if test x$ac_cv_lib_curses_tgetent != xyes ; then
305 AC_CHECK_HEADER(termcap.h,[AC_CHECK_LIB(termcap,tgetent,[LIBS="-ltermcap $LIBS";AC_DEFINE(HAVE_TERMCAP,1,[Define if you have termcap.h and libtermcap])])])
306 if test x$ac_cv_header_termcap_h != xyes ; then
307 AC_MSG_ERROR([You must have at least one of ncurses, curses, or libtermcap installed to build vte.])
314 ################################################################################
316 ################################################################################
318 # Use Xft2 if Pango has Xft2 support and it isn't disabled.
319 if test "x$have_x" = "xyes" ; then
321 [AS_HELP_STRING([--with-xft2],
322 [enable drawing using Xft2])
323 ], with_xft2=$withval, with_xft2=yes)
324 if test "x$with_xft2" = "xyes" ; then
325 PKG_CHECK_EXISTS([pangoxft >= 1.1.0], [
326 AC_DEFINE(HAVE_XFT2,1,[Whether we have Xft2])
327 wantedmodules="xft >= 2.0 $wantedmodules pangoxft >= 1.1.0"
329 AC_MSG_WARN([Xft2 not detected])
330 with_xft2="no - not detected"
334 with_xft2="no - missing X Window System"
336 AM_CONDITIONAL(BUILD_XFT, test "x$with_xft2" = "xyes")
338 # Use PangoX if we have it and it isn't disabled.
339 if test "x$usedeprecation" != "xyes" ; then
340 if test "x$have_x" = "xyes" ; then
342 [AS_HELP_STRING([--with-pangox],
343 [enable drawing using PangoX])
344 ], with_pangox=$withval, with_pangox=yes)
345 if test "x$with_pangox" = "xyes" ; then
346 PKG_CHECK_EXISTS(pangox, [
347 AC_DEFINE(HAVE_PANGOX, 1,
348 [Whether we have PangoX])
349 wantedmodules="$wantedmodules pangox"
351 AC_MSG_WARN([PangoX not detected])
352 with_pangox="no - not detected"
356 with_pangox="no - missing X Window System"
359 with_pangox="no - deprecated"
361 AM_CONDITIONAL(BUILD_PANGOX, test "x$with_pangox" = "xyes")
363 # Use glX if we have it and it isn't disabled.
364 if test "$have_x" = yes ; then
365 AC_ARG_WITH(glX,[AS_HELP_STRING(--with-glX,enable drawing using glX)],with_glx=$withval,with_glx=no)
366 if test $with_glx = yes ; then
369 AC_CHECK_HEADERS(GL/glx.h)
370 if test $ac_cv_header_GL_glx_h = yes ; then
371 AC_CHECK_FUNC(glXQueryExtension,[have_gl=1],AC_CHECK_LIB(GL,glXQueryExtension,[have_gl=1;have_libgl=1]))
373 if test $have_gl = 1 ; then
374 AC_DEFINE(HAVE_GL,1,[Whether we have GL and glX.])
376 if test $have_libgl = 1 ; then
382 # Search for the required modules.
383 PKG_CHECK_MODULES(VTE,[$wantedmodules])
384 NEEDEDPACKAGES="$wantedmodules"
385 AC_SUBST(NEEDEDPACKAGES)
387 # Check for various optional functions within those modules
388 save_CFLAGS="$CFLAGS"
390 CFLAGS="$CFLAGS $VTE_CFLAGS"
391 LIBS="$VTE_LIBS $LIBS"
392 # Workaround a broken fontconfig-dev on Edgy
394 #include <fontconfig/fontconfig.h>
397 FcStrFree (FcNameUnparse (0));
400 ], [AC_CHECK_FUNCS([FcNameUnparse FcStrFree])],)
402 CFLAGS="$save_CFLAGS"
404 # Require Freetype2. First see if there is suitable pkgconfig file...
405 PKG_CHECK_EXISTS(freetype2 >= 6.1.0,
406 [PKG_CHECK_MODULES(FT2, freetype2)], [
407 # We use our local copy of the macro because packages of
408 # freetype's development files don't always include the proper macro.
409 VTE_CHECK_FT2(6.1.0,,
410 [AC_MSG_ERROR([You must have freetype 2.0.2 or later to build vte.])])])
412 # Temporarily pull in the Freetype cflags and libs for checking what's
413 # available in this version.
415 CFLAGS="$CFLAGS $FT2_CFLAGS"
416 savecppflags="$CPPFLAGS"
417 CPPFLAGS="$CPPFLAGS $FT2_CFLAGS"
418 if test -d "$ac_x_includes" ; then
419 CFLAGS="$CFLAGS -I$ac_x_includes"
420 CPPFLAGS="$CPPFLAGS -I$ac_x_includes"
422 AC_CHECK_HEADERS(ft2build.h)
423 if test x$ac_cv_header_ft2build_h != xyes ; then
424 AC_MSG_ERROR([You must have freetype 2.0.2 or later to build vte.])
427 AC_CHECK_DECL(ft_render_mode_mono,[AC_DEFINE(HAVE_DECL_ft_render_mode_mono,1,Define if your freetype2 installation defines ft_render_mode_mono.)],,[
428 #ifdef HAVE_FT2BUILD_H
429 #include <ft2build.h>
430 #include FT_FREETYPE_H
434 AC_CHECK_DECL(FT_RENDER_MODE_MONO,[AC_DEFINE(HAVE_DECL_FT_RENDER_MODE_MONO,1,Define if your freetype2 installation defines FT_RENDER_MODE_MONO.)],,[
435 #ifdef HAVE_FT2BUILD_H
436 #include <ft2build.h>
437 #include FT_FREETYPE_H
441 AC_CHECK_DECLS(FT_LOAD_NO_HINTING,,,[
442 #ifdef HAVE_FT2BUILD_H
443 #include <ft2build.h>
444 #include FT_FREETYPE_H
448 AC_CHECK_DECLS(FT_RENDER_MODE_LIGHT,,,[
449 #ifdef HAVE_FT2BUILD_H
450 #include <ft2build.h>
451 #include FT_FREETYPE_H
455 AC_CHECK_DECLS(FT_RENDER_MODE_NORMAL,,,[
456 #ifdef HAVE_FT2BUILD_H
457 #include <ft2build.h>
458 #include FT_FREETYPE_H
462 AC_CHECK_DECL(FT_PIXEL_MODE_MONO,[AC_DEFINE(HAVE_DECL_FT_PIXEL_MODE_MONO,1,Define if your freetype2 build declares FT_PIXEL_MODE_MONO.)],,[
463 #ifdef HAVE_FT2BUILD_H
464 #include <ft2build.h>
465 #include FT_FREETYPE_H
468 AC_CHECK_DECL(ft_pixel_mode_mono,[AC_DEFINE(HAVE_DECL_ft_pixel_mode_mono,1,Define if your freetype2 build declares ft_pixel_mode_mono.)],,[
469 #ifdef HAVE_FT2BUILD_H
470 #include <ft2build.h>
471 #include FT_FREETYPE_H
475 AC_CHECK_DECLS(FT_PIXEL_MODE_GRAY2,,,[
476 #ifdef HAVE_FT2BUILD_H
477 #include <ft2build.h>
478 #include FT_FREETYPE_H
481 AC_CHECK_DECLS(FT_PIXEL_MODE_GRAY4,,,[
482 #ifdef HAVE_FT2BUILD_H
483 #include <ft2build.h>
484 #include FT_FREETYPE_H
488 AC_CHECK_DECL(FT_PIXEL_MODE_GRAY,[AC_DEFINE(HAVE_DECL_FT_PIXEL_MODE_GRAY,1,Define if your freetype2 build declares FT_PIXEL_MODE_GRAY.)],,[
489 #ifdef HAVE_FT2BUILD_H
490 #include <ft2build.h>
491 #include FT_FREETYPE_H
494 AC_CHECK_DECL(ft_pixel_mode_grays,[AC_DEFINE(HAVE_DECL_ft_pixel_mode_grays,1,Define if your freetype2 build declares ft_pixel_mode_grays.)],,[
495 #ifdef HAVE_FT2BUILD_H
496 #include <ft2build.h>
497 #include FT_FREETYPE_H
501 AC_CHECK_DECLS(FT_PIXEL_MODE_LCD,,,[
502 #ifdef HAVE_FT2BUILD_H
503 #include <ft2build.h>
504 #include FT_FREETYPE_H
509 CPPFLAGS="$savecppflags"
514 # if !STDC_HEADERS && HAVE_MEMORY_H
519 # ifdef HAVE_STRINGS_H
520 # include <strings.h>
528 AC_CHECK_TYPES(wint_t, AC_DEFINE(HAVE_WINT_T, , [Defined when the wint_t type is supported]), ,$wcs_funcs_includes)
531 ################################################################################
533 ################################################################################
537 AC_ARG_ENABLE(python, [AS_HELP_STRING(--enable-python,Build python bindings [default=yes])],[
538 if test x"$enableval" != xno ; then
542 fi],BUILD_PYTHON=true)
544 if $BUILD_PYTHON ; then
546 if test -z "$PYTHON" ; then
551 if $BUILD_PYTHON ; then
552 AC_MSG_CHECKING(for python >= 2.2)
555 minver = (2,2,0,'final',0)
556 if sys.version_info < minver:
560 if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
562 AC_MSG_RESULT([okay])
565 AC_MSG_RESULT([too old])
569 if $BUILD_PYTHON ; then
570 AM_CHECK_PYTHON_HEADERS(,BUILD_PYTHON=false)
573 if $BUILD_PYTHON ; then
574 AC_MSG_CHECKING([for pygtk-2.0])
575 if pkg-config --exists pygtk-2.0 ; then
576 AC_MSG_RESULT([found])
577 PKG_CHECK_MODULES(PYGTK,[pygtk-2.0])
579 AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
580 if test "x$PYGTK_CODEGEN" = xno; then
581 AC_MSG_ERROR(could not find pygtk-codegen-2.0 script)
584 AC_MSG_CHECKING(for pygtk defs)
585 PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
586 AC_SUBST(PYGTK_DEFSDIR)
587 AC_MSG_RESULT($PYGTK_DEFSDIR)
589 AC_MSG_RESULT([not found])
594 if ! $BUILD_PYTHON ; then
595 AC_MSG_RESULT([Python bindings disabled.])
599 AC_SUBST(PYTHONMODULES)
600 AM_CONDITIONAL(BUILD_PYTHON_MODULES, $BUILD_PYTHON)
602 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)
603 if test "$enable_gnome_pty_helper" != no; then
604 AC_DEFINE(VTE_USE_GNOME_PTY_HELPER,1,[Define if you intend to use gnome-pty-helper.])
605 AC_CONFIG_SUBDIRS(gnome-pty-helper)
607 AM_CONDITIONAL(BUILD_GNOME_PTY_HELPER,[test "$enable_gnome_pty_helper" != no])
609 ################################################################################
613 ################################################################################
622 doc/openi18n/Makefile
623 doc/reference/Makefile
630 #####################
631 # Print configuration
632 #####################
633 cat <<EOF | tee -a config.log
639 Configuration for libvte $VERSION
641 With PangoX: $with_pangox
644 Disable deprecated features: $usedeprecation