From 344db0911e1e2447abe210b5684269a2a0daf04c Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Mon, 5 Apr 2010 17:19:46 -0700 Subject: Allow a configure option to build without xtrans (--disable-xtrans) Signed-off-by: Jeremy Huddleston --- configure.ac | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index f9a8a1d..61a7d27 100644 --- a/configure.ac +++ b/configure.ac @@ -38,21 +38,32 @@ AC_PROG_CC XORG_DEFAULT_OPTIONS AC_PROG_INSTALL -dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro -dnl was not expanded, since xscope with no transport types is rather useless. -dnl -dnl If you're seeing an error here, be sure you installed the lib/xtrans module -dnl first and if it's not in the default location, that you set the ACLOCAL -dnl environment variable to find it, such as: -dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal" -m4_pattern_forbid([XTRANS_CONNECTION_FLAGS]) +AC_ARG_ENABLE(xtrans, AS_HELP_STRING([--enable-xtrans], + [Use xtrans for socket connections (default: auto)]), + [XTRANS=$enableval], [XTRANS=auto]) + +if test "x$XTRANS" = xauto ; then + PKG_CHECK_EXISTS(xtrans, [XTRANS=yes], [XTRANS=no]) +fi + +if test "x$XTRANS" = xyes ; then + dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro + dnl was not expanded, since xscope with no transport types is rather useless. + dnl + dnl If you're seeing an error here, be sure you installed the lib/xtrans module + dnl first and if it's not in the default location, that you set the ACLOCAL + dnl environment variable to find it, such as: + dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal" + m4_pattern_forbid([XTRANS_CONNECTION_FLAGS]) + + # Transport selection macro from xtrans.m4 + XTRANS_CONNECTION_FLAGS -# Transport selection macro from xtrans.m4 -XTRANS_CONNECTION_FLAGS + # Checks for pkg-config packages + PKG_CHECK_MODULES(XSCOPE, xtrans) + XSCOPE_CFLAGS="$XSCOPE_CFLAGS -DUSE_XTRANS" +fi -# Checks for pkg-config packages -PKG_CHECK_MODULES(XSCOPE, xtrans) -XSCOPE_CFLAGS="$XSCOPE_CFLAGS -DUSE_XTRANS" AC_SUBST(XSCOPE_CFLAGS) AC_SUBST(XSCOPE_LIBS) -- cgit v1.2.1