RoxTerm Code
Brought to you by:
realh
dnl Process this file with autoconf to produce a configure script.
AC_INIT(roxterm, @VERSION@)
AC_CONFIG_SRCDIR(src/roxterm.c)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
dnl Process this file with autoconf to produce a configure script.
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AH_TOP([
#ifndef CONFIG_H
#define CONFIG_H
])
AH_BOTTOM([
#endif /* CONFIG_H */
])
AC_SUBST(VERSION)
ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)
AC_USE_SYSTEM_EXTENSIONS
dnl Checks for programs.
AC_PROG_CC
AC_LANG(C)
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_CHECK_PROG(HAVE_SED, sed, yes, no)
AS_IF([test "x$HAVE_SED" != "xyes"],
[AC_MSG_ERROR([You need sed to build $PACKAGE])])
AC_CHECK_PROG(HAVE_DIFF, diff, yes, no)
AS_IF([test "x$HAVE_DIFF" != "xyes"],
[AC_MSG_ERROR([You need diff to build $PACKAGE])])
PKG_PROG_PKG_CONFIG
# Can we build the manpages?
AC_CHECK_PROG(HAVE_XMLTO, xmlto, yes, no)
AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, yes, no)
AS_IF([test "x$HAVE_XMLTO" = "xyes"],
[XMLTOMAN="xmlto man"
XMLTOMAN_OPTS=""],
[test "x$HAVE_XSLTPROC" = "xyes"],
[XMLTOMAN="xsltproc"
XMLTOMAN_OPTS="--nonet --novalid --param man.charmap.use.subset 0 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"],
[AC_MSG_WARN([Unable to build manpages without xmlto or xsltproc])
XMLTOMAN=""])
AM_CONDITIONAL(BUILD_MANPAGES, test "x$XMLTOMAN" != x)
AC_SUBST(XMLTOMAN)
AC_SUBST(XMLTOMAN_OPTS)
AM_GNU_GETTEXT
AM_GNU_GETTEXT_VERSION(0.17)
# Is po4a available?
AC_CHECK_PROG(HAVE_PO4A, po4a-translate, yes, no)
AM_CONDITIONAL(ENABLE_PO4A, [test $HAVE_PO4A = yes])
dnl Misc options
AC_ARG_ENABLE([gtk-native-tab-dragging],
AS_HELP_STRING([--disable-gtk-native-tab-dragging],
[Use ROXTerm's legacy code for dragging tabs instead of GTK+'s functions]),
[AS_IF([test x$enableval = xno],
[DO_OWN_TAB_DRAGGING=1],
[DO_OWN_TAB_DRAGGING=0])],
[DO_OWN_TAB_DRAGGING=0])
AC_ARG_WITH([gnome-default-applications],
AS_HELP_STRING([--with-gnome-default-applications],
[Directory for GNOME Default Applications files. Use --without-... to disable. Default behaviour is to check with pkg-config.]),
[AS_IF([test x$withval = xno],
[DEFAULTAPPS_DIR=""],
[DEFAULTAPPS_DIR="$withval"])],
[AC_MSG_CHECKING([Where to install GNOME Default Applications file])
AS_IF([$PKG_CONFIG --variable=defappsdir gnome-default-applications >/dev/null],
[DEFAULTAPPS_DIR="`$PKG_CONFIG --variable=defappsdir gnome-default-applications`"
AC_MSG_RESULT([$DEFAULTAPPS_DIR])],
[AC_MSG_RESULT([not found])
DEFAULTAPPS_DIR=""])])
AC_SUBST(DEFAULTAPPS_DIR)
AM_CONDITIONAL([INSTALL_DEFAULT_APPS], [test -n "$DEFAULTAPPS_DIR"])
AC_ARG_ENABLE([sm],
AS_HELP_STRING([--disable-sm], [Don't enable session management code]),
[],
[enable_sm="test"]
)
dnl Checks for libraries.
dnl Common to terminal and capplet
PKG_CHECK_MODULES(glib, [glib-2.0 >= 2.6.0])
PKG_CHECK_MODULES(gtk, [gtk+-2.0 >= 2.6.0])
PKG_CHECK_MODULES(dbus, [dbus-glib-1 >= 0.22])
CFLAGS="$CFLAGS $glib_CFLAGS $gtk_CFLAGS $dbus_CFLAGS"
LIBS="$LIBS $glib_LIBS $gtk_LIBS $dbus_LIBS"
dnl Terminal only
PKG_CHECK_MODULES(vte, [vte >= 0.11.11])
AS_IF([test $enable_sm = no],
[enable_sm=0],
[PKG_CHECK_MODULES(sm, [sm ice],
[enable_sm=1],
[AS_IF([test $enable_sm = yes],
[AC_MSG_ERROR([Missing or broken SM and/or ICE library or headers. Check config.log for more details.])],
[AC_MSG_WARN([Missing or broken SM and/or ICE library or headers; session management disabled. Check config.log for more details.])])
enable_sm=0
])])
AC_DEFINE_UNQUOTED(ENABLE_SM, [$enable_sm],
[Whether to support session management])
AM_CONDITIONAL(ENABLE_SM, [test $enable_sm = 1])
dnl Capplet only
PKG_CHECK_MODULES(glade2, [libglade-2.0])
AC_SUBST(roxterm_config_CFLAGS, [$glade2_CFLAGS])
AC_SUBST(roxterm_config_LIBS, [$glade2_LIBS])
AC_MSG_CHECKING([dbus version])
dbus_version=`pkg-config --modversion dbus-1`
AC_MSG_RESULT($dbus_version)
dbus_old_args=0
test "$dbus_version" \< "0.30" && dbus_old_args=1
AC_DEFINE_UNQUOTED(ROXTERM_DBUS_OLD_ARGS_SEMANTICS, [$dbus_old_args],
[Whether to use dbus 0.2x API for handling message arguments])
dnl Checks for header files.
AC_HEADER_STDC
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
dnl Checks for library functions.
TH_CHECK_ALTERNATIVE_FUNCS(dbus-1,
dbus_bus_request_name, HAVE_DBUS_BUS_REQUEST_NAME,
dbus_bus_acquire_service, HAVE_DBUS_BUS_ACQUIRE_SERVICE)
TH_CHECK_ALTERNATIVE_FUNCS(dbus-1,
dbus_message_iter_get_basic, HAVE_DBUS_MESSAGE_ITER_GET_BASIC,
dbus_message_iter_get_string, HAVE_DBUS_MESSAGE_ITER_GET_STRING)
AC_CHECK_FUNCS_ONCE(gtk_widget_get_realized g_mkdir_with_parents gtk_file_chooser_button_new g_file_set_contents get_current_dir_name)
tmp_CFLAGS="$CFLAGS"
tmp_LIBS="$LIBS"
CFLAGS="$vte_CFLAGS"
LIBS="$vte_LIBS"
AC_CHECK_FUNCS(vte_terminal_set_cursor_blink_mode vte_terminal_match_add_gregex vte_terminal_set_cursor_shape vte_terminal_fork_command_full)
CFLAGS="$tmp_CFLAGS"
LIBS="$tmp_LIBS"
AM_CONDITIONAL(HAVE_G_FILE_SET_CONTENTS, test x$HAVE_G_FILE_SET_CONTENTS = x1)
AC_DEFINE_UNQUOTED(DO_OWN_TAB_DRAGGING, [$DO_OWN_TAB_DRAGGING],
[Whether to use roxterm's legacy implementation of draggable tabs or GTK+'s version])
AM_CONDITIONAL(DO_OWN_TAB_DRAGGING, [test $DO_OWN_TAB_DRAGGING = 1])
dnl Output variables etc
AC_SUBST(roxterm_CFLAGS, ["$vte_CFLAGS $sm_CFLAGS"])
AC_SUBST(roxterm_LIBS, ["$vte_LIBS $sm_LIBS"])
AC_SUBST(APPINFO_STRING, "${VERSION} (${ISODATE})")
AC_SUBST(LDADD, [$LDADD])
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
dir=`eval echo ${sysconfdir}`
test "x$dir" = xNONE && dir=`eval echo ${prefix}/etc`
TH_EXPAND_VARS(dir)
AC_DEFINE_UNQUOTED(SYS_CONF_DIR, "$dir", [sysconfdir])
dir=`eval echo ${datadir}`
test "x$dir" = "x" && dir=NONE
test "x$dir" = xNONE && dir=`eval echo ${prefix}/share`
TH_EXPAND_VARS(dir)
AC_DEFINE_UNQUOTED(DATA_DIR, "$dir", [datadir])
m4_pattern_allow(PKG_DATA_DIR)
AC_DEFINE_UNQUOTED([PKG_DATA_DIR], "$dir/$PACKAGE", [pkgdatadir])
m4_pattern_allow(ICON_DIR)
pkgicondir="$dir/icons/hicolor/scalable/apps"
AC_DEFINE_UNQUOTED([ICON_DIR], "$pkgicondir", [Icon dir])
AC_SUBST(pkgicondir, ["$pkgicondir"])
AC_DEFINE_UNQUOTED([LOCALEDIR], "$dir/locale", [Locale dir])
TH_EXPAND_VARS(htmldir)
AC_DEFINE_UNQUOTED([HTML_DIR], "$htmldir", [htmldir])
test "x$exec_prefix" = "x" && exec_prefix=NONE
test "x$exec_prefix" = xNONE && exec_prefix="$prefix"
TH_EXPAND_VARS(exec_prefix)
AC_DEFINE_UNQUOTED([BIN_DIR], "$exec_prefix/bin", [bindir])
AC_OUTPUT(Makefile src/Makefile po4a/Makefile
roxterm.lsm roxterm.spec AppInfo.xml
intl/Makefile po/Makefile.in
roxterm.1.xml roxterm-config.1.xml)