[PATCH input-synaptics 6/7] Add distcheck support for header files when sdk is not writable
Gaetan Nadon
memsize at videotron.ca
Thu Jun 30 10:02:00 PDT 2011
Done in the same way as other input drivers with one additional challenge.
The synclient and daemon require the real sdk location as they need
xserver_properties.h. Tools cannot use XORG_CFLAGS as it
contains locations it should not use or even compiler options
such as the visibility flag.
The solution is to provide a separate variable for the sdk location
that is not changed during distcheck.
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
Makefile.am | 4 ++++
configure.ac | 10 ++++++++++
tools/Makefile.am | 2 +-
3 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index edd28a6..b6e15cd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,6 +18,10 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+# During distcheck, system locations (as provided by pkg-config) may
+# not be writable; provide instead relative locations.
+DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
+
SUBDIRS = include src man tools conf test
MAINTAINERCLEANFILES = ChangeLog INSTALL
diff --git a/configure.ac b/configure.ac
index 2fe5289..1743179 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,12 @@ PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6] xproto inputproto $REQUIRED_MODULES
sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
AC_SUBST([sdkdir])
+# The sdkdir value is changed to a local empty writable location during distcheck
+# The synclient/daemon tools require the real sdkdir location which is
+# provided by XORG_CFLAGS along with other locations which cannot be used by tools
+xserver_sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
+AC_SUBST([xserver_sdkdir])
+
DRIVER_NAME=synaptics
AC_SUBST([DRIVER_NAME])
@@ -146,6 +152,10 @@ if test "x$have_libxtst" = "xyes" ; then
fi
# -----------------------------------------------------------------------------
+# Workaround overriding sdkdir to be able to create a tarball when user has no
+# write permission in sdkdir. See DISTCHECK_CONFIGURE_FLAGS in Makefile.am
+AC_ARG_WITH([sdkdir], [], [sdkdir="$withval"])
+
AC_CONFIG_FILES([Makefile
src/Makefile
man/Makefile
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 5abdecf..6a49abe 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -20,7 +20,7 @@
bin_PROGRAMS = synclient syndaemon
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(sdkdir)
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(xserver_sdkdir)
AM_CFLAGS = $(XI_CFLAGS)
AM_LDFLAGS = $(XI_LIBS)
--
1.7.4.1
More information about the xorg-devel
mailing list