summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaetan Nadon <memsize@videotron.ca>2010-05-22 20:48:29 -0400
committerGaetan Nadon <memsize@videotron.ca>2010-05-31 12:49:39 -0400
commitf3e4c586037a5785f786ff74c89c87de7d4ac344 (patch)
tree74e78a5cb99c90b32ff2c846c13b595284b7897a
parent5d64210dc613278d0b8914393cbbc3baeb4e1b76 (diff)
config: fix warnings, m4 quoting and layout
Fix some m4 quoting Fix some autoconf warnings Regroup statements per section Add comments Regroup xtst and recordproto (a prereq) flags together Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
-rw-r--r--configure.ac146
-rw-r--r--tools/Makefile.am2
2 files changed, 82 insertions, 66 deletions
diff --git a/configure.ac b/configure.ac
index 2b008b6..5d6af1d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,31 +20,84 @@
#
# Process this file with autoconf to produce a configure script
-AC_PREREQ(2.60)
+# Initialize Autoconf
+AC_PREREQ([2.60])
AC_INIT([xf86-input-synaptics],
- 1.2.99,
+ [1.2.99],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
- xf86-input-synaptics)
-
+ [xf86-input-synaptics])
AC_CONFIG_SRCDIR([Makefile.am])
-AC_CONFIG_AUX_DIR(.)
AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_AUX_DIR(.)
+
+# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
-DRIVER_NAME=synaptics
-AC_SUBST([DRIVER_NAME])
+# Initialize libtool
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
-# Require xorg-macros: XORG_DEFAULT_OPTIONS
-m4_ifndef([XORG_MACROS_VERSION],
+# Initialize X.Org macros
+m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.4 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.4)
XORG_DEFAULT_OPTIONS
# Checks for programs.
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
+AC_PROG_INSTALL
+AC_PROG_SED
+
+# Obtain compiler/linker options for the Synaptics driver dependencies
+PKG_CHECK_MODULES(XORG, xorg-server xproto)
+
+# X Server SDK location is required to install Synaptics header files
+# This location is also relayed in the xorg-synaptics.pc file
+sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
+AC_SUBST([sdkdir])
+
+DRIVER_NAME=synaptics
+AC_SUBST([DRIVER_NAME])
+
+# -----------------------------------------------------------------------------
+# Configuration options
+# -----------------------------------------------------------------------------
+# Define a configure option for an alternate input module directory
+AC_ARG_WITH(xorg-module-dir,
+ AC_HELP_STRING([--with-xorg-module-dir=DIR],
+ [Default xorg module directory [[default=$libdir/xorg/modules]]]),
+ [moduledir="$withval"],
+ [moduledir="$libdir/xorg/modules"])
+inputdir=${moduledir}/input
+AC_SUBST(inputdir)
+
+# Define a configure option for an alternate configuration directory
+AC_ARG_WITH(xorg-conf-dir,
+ AC_HELP_STRING([--with-xorg-conf-dir=DIR],
+ [Default xorg.conf.d directory [[default=from $PKG_CONFIG xorg-server]]]),
+ [XORG_CONF_DIR="$withval"],
+ [XORG_CONF_DIR="`$PKG_CONFIG --variable=sysconfigdir xorg-server`"])
+AC_SUBST(XORG_CONF_DIR)
+AM_CONDITIONAL(HAS_XORG_CONF_DIR, [test "x$XORG_CONF_DIR" != "x" && test "x$XORG_CONF_DIR" != "xno"])
+
+# Define a configure option to enable code debugging
+AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
+ [Enable debugging (default: disabled)]),
+ [DEBUGGING=$enableval], [DEBUGGING=no])
+if test "x$DEBUGGING" = xyes; then
+ AC_DEFINE(DEBUG, 1, [Enable debugging code])
+fi
+AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
+# Define a configure option to disable building synclient and syndaemon
+AC_ARG_ENABLE([tools],
+ AS_HELP_STRING([--enable-tools], [Build synclient and syndaemon [[default=auto]]]),
+ [build_tools="$enableval"],
+ [build_tools="auto"])
+
+# -----------------------------------------------------------------------------
+# Determine which backend, if any, to build
+# -----------------------------------------------------------------------------
AC_MSG_CHECKING([which optional backends will be build])
case "${host}" in
*linux*)
@@ -64,48 +117,21 @@ esac
AM_CONDITIONAL([BUILD_EVENTCOMM], [test "x${BUILD_EVENTCOMM}" = "xyes"])
AM_CONDITIONAL([BUILD_PSMCOMM], [test "x${BUILD_PSMCOMM}" = "xyes"])
-AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
- [Enable debugging (default: disabled)]),
- [DEBUGGING=$enableval], [DEBUGGING=no])
-
-if test "x$DEBUGGING" = xyes; then
- AC_DEFINE(DEBUG, 1, [Enable debugging code])
-fi
-AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
-
-AC_ARG_WITH(xorg-module-dir,
- AC_HELP_STRING([--with-xorg-module-dir=DIR],
- [Default xorg module directory [[default=$libdir/xorg/modules]]]),
- [moduledir="$withval"],
- [moduledir="$libdir/xorg/modules"])
-inputdir=${moduledir}/input
-AC_SUBST(inputdir)
-
-
-# Obtain compiler/linker options for the Synaptics driver dependencies
-PKG_CHECK_MODULES(XORG, xorg-server xproto)
-
-# ----------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
# Dependencies for synclient and syndaemon
-# ----------------------------------------------------------------------------------
-AC_ARG_ENABLE([tools],
- AS_HELP_STRING([--enable-tools], [Build synclient and syndaemon [[default=auto]]]),
- [build_tools="$enableval"],
- [build_tools="auto"])
-
-# Obtain compiler/linker options common for both synclient and syndaemon dependencies
+# -----------------------------------------------------------------------------
+# If the tools dependencies are satisfied, look for XRecord impl and record.h headers
PKG_CHECK_MODULES(XI, x11 inputproto [xi >= 1.2], have_depends="yes", have_depends="no")
if test "x$have_depends" = "xyes"; then
if test "x$build_tools" != "xno"; then
# The syndaemon program uses an optional XRecord extension implementation
# If libxtst >= 1.0.99 is installed, Cflags contains the path to record.h
- PKG_CHECK_MODULES(XTST, xtst, have_libxtst="yes", have_libxtst="no")
+ # If recordproto < 1.13.99.1 is installed, Cflags contains the path to record.h
+ PKG_CHECK_MODULES(XTST, xtst recordproto, have_libxtst="yes", have_libxtst="no")
if test "x$have_libxtst" = "xyes" ; then
- # If recordproto < 1.13.99.1 is installed, Cflags contains the path to record.h
- PKG_CHECK_MODULES(RECORD_PROTO, recordproto, have_recordproto="yes", have_recordproto="no")
# Header record.h may come from the xtst or recordproto package, or may be missing
SAVE_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $XTST_CFLAGS $RECORD_PROTO_CFLAGS"
+ CPPFLAGS="$CPPFLAGS $XTST_CFLAGS"
AC_CHECK_HEADERS([X11/extensions/record.h],,,[#include <X11/Xlib.h>])
CPPFLAGS="$SAVE_CPPFLAGS"
fi
@@ -117,25 +143,15 @@ else
AC_MSG_WARN([Not building synclient and syndaemon.])
fi
fi
-AM_CONDITIONAL(BUILD_TOOLS, [test x$have_depends = xyes && test x$build_tools != xno])
-
-# ----------------------------------------------------------------------------------
-
-sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
-AC_SUBST([sdkdir])
-
-AC_ARG_WITH(xorg-conf-dir,
- AC_HELP_STRING([--with-xorg-conf-dir=DIR],
- [Default xorg.conf.d directory [[default=from $PKG_CONFIG xorg-server]]]),
- [XORG_CONF_DIR="$withval"],
- [XORG_CONF_DIR="`$PKG_CONFIG --variable=sysconfigdir xorg-server`"])
-AC_SUBST(XORG_CONF_DIR)
-AM_CONDITIONAL(HAS_XORG_CONF_DIR, [test "x$XORG_CONF_DIR" != "x" && test "x$XORG_CONF_DIR" != "xno"])
+AM_CONDITIONAL(BUILD_TOOLS, [test "x$have_depends" = xyes && test "x$build_tools" != xno])
+# -----------------------------------------------------------------------------
+
+AC_CONFIG_FILES([Makefile
+ src/Makefile
+ man/Makefile
+ tools/Makefile
+ conf/Makefile
+ include/Makefile
+ xorg-synaptics.pc])
+AC_OUTPUT
-AC_OUTPUT([Makefile
- src/Makefile
- man/Makefile
- tools/Makefile
- conf/Makefile
- include/Makefile
- xorg-synaptics.pc])
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 7f91a92..b7421fb 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -30,7 +30,7 @@ AM_LDFLAGS = -lm $(XI_LIBS)
synclient_SOURCES = synclient.c
syndaemon_SOURCES = syndaemon.c
-syndaemon_CFLAGS = $(AM_CFLAGS) $(XTST_CFLAGS) $(RECORD_PROTO_CFLAGS)
+syndaemon_CFLAGS = $(AM_CFLAGS) $(XTST_CFLAGS)
syndaemon_LDFLAGS = $(AM_LDFLAGS) $(XTST_LIBS)
else
all: