diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 413 |
1 files changed, 413 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..87b0c97b --- /dev/null +++ b/configure.ac @@ -0,0 +1,413 @@ +m4_define([version_major],0) +m4_define([version_minor],37) +m4_define([version_micro],0) +m4_define([version_triplet],version_major.version_minor.version_micro) + +AC_PREREQ([2.63]) +AC_INIT([vte], + [version_triplet], + [http://bugzilla.gnome.org/enter_bug.cgi?product=vte], + [vte]) + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([src/vte.c]) +AC_CONFIG_HEADERS([config.h]) + +AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-bzip2 -Wno-portability]) + +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) + +if test -z "$enable_maintainer_mode"; then + enable_maintainer_mode=yes +fi +AM_MAINTAINER_MODE([enable]) + +################################################################################ +# 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(version_major+lt_age)) +m4_define([lt_triplet],lt_current:lt_revision:lt_age) + +LT_VERSION_INFO="lt_triplet()" +AC_SUBST([LT_VERSION_INFO]) + +################################################################################ +# GTK+ +################################################################################ + +VTE_API_MAJOR_VERSION=2 +VTE_API_MINOR_VERSION=91 +VTE_API_VERSION=$VTE_API_MAJOR_VERSION.$VTE_API_MINOR_VERSION +GTK_API_VERSION=3.0 +GTK_REQUIRED=3.8.0 +GLADE_API_VERSION=2.0 + +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([GTK_API_VERSION]) + +################################################################################ + +# Check for programs +AC_PROG_CC +AC_HEADER_STDC +AM_PROG_CC_C_O +AC_PROG_SED + +# Initialize libtool +LT_PREREQ([2.2]) +LT_INIT + +################################################################################ +# Enable debugging messages and additional run-time checks. +################################################################################ + +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [enable extra debugging checks and logging messages])], + [],[enable_debug=no]) +if test "x$enable_debug" = "xyes" ; then + AC_MSG_RESULT([enabling debug checks and messages]) + AC_DEFINE(VTE_DEBUG,1,[Enable debugging messages.]) +fi + +################################################################################ +# i18n +################################################################################ + +IT_PROG_INTLTOOL([0.35.0]) + +GETTEXT_PACKAGE=vte-$VTE_API_VERSION +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", + [Package translatable messages domain name.]) +AM_GLIB_GNU_GETTEXT +AC_CHECK_DECLS(bind_textdomain_codeset,,,[#include "libintl.h"]) + +################################################################################ +# 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]) + +################################################################################ +# Compilation +################################################################################ + +CC_CHECK_CFLAGS_APPEND([ \ + -Wall -Wextra \ + -Wformat-nonliteral -Werror=format-security \ + -Wsign-compare -Werror=implicit-function-declaration \ + -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \ + -Waggregate-return -Wcast-align -Wimplicit -Wuninitialized \ + -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 \ + -fno-common -Wno-switch-enum]) + +########################################################## +# 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 + CC_CHECK_LDFLAGS(["-Wl,-Bsymbolic-functions"], + [VTE_LDFLAGS="$VTE_LDFLAGS -Wl,-Bsymbolic-functions"], + [if test "$enable_Bsymbolic" = "auto"; then + AC_MSG_WARN([-Bsymbolic not supported by ld; disabling]) + enable_Bsymbolic=no + else + AC_MSG_ERROR([-Bsymbolic requested but not supported by ld. Use --disable-Bsymbolic to disable]) + fi]) +fi + +AC_SUBST([VTE_LDFLAGS]) + +################################################################################ +# Core +################################################################################ + +# 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 + +GLIB_REQUIRED=2.31.13 +GIO_REQUIRED=2.31.13 +PANGO_REQUIRED=1.22.0 +AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK multihead-safe APIs.]) +PKG_CHECK_MODULES(GLIB,[glib-2.0 >= $GLIB_REQUIRED gobject-2.0 gio-2.0 >= $GIO_REQUIRED]) +PKG_CHECK_MODULES(GTK,[glib-2.0 >= $GLIB_REQUIRED gobject-2.0 gio-2.0 >= $GIO_REQUIRED gtk+-$GTK_API_VERSION >= $GTK_REQUIRED]) + +AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal]) +AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums]) + +AC_ARG_VAR([GLIB_COMPILE_RESOURCES],[the glib-compile-resources programme]) +AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources],[]) +if test -z "$GLIB_COMPILE_RESOURCES"; then + AC_MSG_ERROR([glib-compile-resources not found]) +fi + +VTE_DEFAULT_EMULATION=xterm +AC_DEFINE_UNQUOTED(VTE_DEFAULT_EMULATION,"$VTE_DEFAULT_EMULATION",[The default terminal type to be emulated.]) + +# 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 util.h wchar.h) +AC_HEADER_TIOCGWINSZ + +# Check for PTY handling functions. +AC_CHECK_FUNCS([cfmakeraw fork setsid setpgid getpgid getpt grantpt unlockpt posix_openpt ptsname ptsname_r tcgetattr tcsetattr]) + +# Misc I/O routines. +AC_CHECK_FUNCS([pread pwrite fwrite_unlocked]) + +# 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"])) +AC_CHECK_FUNC(openpty,[have_openpty=1],AC_CHECK_LIB(util,openpty,[have_openpty=1; LIBS="$LIBS -lutil"])) +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 +if test x$have_openpty = x1 ; then + AC_DEFINE(HAVE_OPENPTY,1,[Define if you have the openpty function.]) +fi +AC_CHECK_FUNC(floor,,AC_CHECK_LIB(m,floor,LIBS=["$LIBS -lm"])) +AC_CHECK_FUNCS([ceil floor round]) + +# 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],[], + [AC_CHECK_HEADERS([ncurses/curses.h ncurses/term.h],[], + [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],[], + [AC_CHECK_HEADERS([ncurses/curses.h ncurses/term.h],[], + [AC_MSG_ERROR([ncurses headers not found])])]) + LIBS="-ltinfo $LIBS" + ;; + libcurses) # Need curses.h and term.h + AC_CHECK_HEADERS([curses.h term.h],[], + [AC_MSG_ERROR([curses headers not found])], + [[#ifdef HAVE_CURSES_H + #include <curses.h> + #endif]]) + LIBS="-lcurses $LIBS" + ;; + 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 + +# Search for the required modules. + +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" +PKG_CHECK_MODULES([VTE],[$VTE_PKGS]) +AC_SUBST([VTE_PKGS]) + +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 +" + +AC_CHECK_TYPES(wint_t, AC_DEFINE(HAVE_WINT_T, , [Defined when the wint_t type is supported]), ,$wcs_funcs_includes) + +################################################################################ +# GNOME PTY Helper +################################################################################ + +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) +if test "$enable_gnome_pty_helper" != no; then + AC_DEFINE(VTE_USE_GNOME_PTY_HELPER,1,[Define if you intend to use gnome-pty-helper.]) + AC_CONFIG_SUBDIRS(gnome-pty-helper) +fi +AM_CONDITIONAL(BUILD_GNOME_PTY_HELPER,[test "$enable_gnome_pty_helper" != no]) + +################################################################################ +# 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])], + [],[enable_glade_catalogue=no]) +AC_MSG_RESULT([$enable_glade_catalogue]) + +if test "$enable_glade_catalogue" = "yes"; then + GLADE_CATALOGUE_DIR="$($PKG_CONFIG --variable=catalogdir gladeui-$GLADE_API_VERSION)" + GLADE_ICON_DIR="$($PKG_CONFIG --variable=pixmapdir gladeui-$GLADE_API_VERSION)" + GLADE_MODULE_DIR="$($PKG_CONFIG --variable=moduledir gladeui-$GLADE_API_VERSION)" + + if test -z "$GLADE_CATALOGUE_DIR" -o -z "$GLADE_MODULE_DIR"; then + AC_MSG_ERROR([gladeui-$GLADE_API_VERSION 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"]) + +# ******** +# Bindings +# ******** + +# No automagic please! +if test -z "$enable_introspection"; then + enable_introspection=no +fi + +GOBJECT_INTROSPECTION_CHECK([0.9.0]) + +# No automagic please! +if test -z "$enable_vala"; then + enable_vala=no +fi + +VAPIGEN_CHECK([0.16]) + +################################################################################ + +GTK_DOC_CHECK([1.13],[--flavour no-tmpl]) + +AC_SUBST([GLIB_PREFIX],[$($PKG_CONFIG --variable=prefix glib-2.0)]) +AC_SUBST([GTK_PREFIX],[$($PKG_CONFIG --variable=prefix gtk+-$GTK_API_VERSION)]) + +################################################################################ + +AC_SUBST([VTE_MAJOR_VERSION],[version_major]) +AC_SUBST([VTE_MINOR_VERSION],[version_minor]) +AC_SUBST([VTE_MICRO_VERSION],[version_micro]) + +AC_SUBST([AM_CPPFLAGS],["$AM_CPPFLAGS -DGLIB_DISABLE_DEPRECATION_WARNINGS"]) +AC_SUBST([AM_CFLAGS]) +AC_SUBST([AM_LDFLAGS]) + +################################################################################ + +AC_CONFIG_FILES([ +Makefile +src/Makefile +src/vteversion.h +src/vte.gresource.xml +termcaps/Makefile +perf/Makefile +po/Makefile.in +doc/Makefile +doc/openi18n/Makefile +doc/reference/Makefile +doc/reference/version.xml +glade/Makefile +glade/vte.xml.in +]) + +AC_CONFIG_FILES([vte-${VTE_API_VERSION}.pc:vte.pc.in],[VTE_API_VERSION=${VTE_API_VERSION}]) + +AC_OUTPUT + +##################### +# Print configuration +##################### +cat <<EOF | tee -a config.log + +## -------------- ## +## Configuration. ## +## -------------- ## + +Configuration for libvte $VERSION for gtk+-$GTK_API_VERSION + Installing Glade catalogue: $enable_glade_catalogue + Debugging: $enable_debug + Introspection: $enable_introspection + Vala bindings: $enable_vala +EOF |