1From 231a35e99fee8aba23f18cce21dfb5fa8bef0c36 Mon Sep 17 00:00:00 2001
2From: "Yann E. MORIN" <yann.morin.1998@free.fr>
3Date: Sun, 23 Oct 2016 23:07:33 +0200
4Subject: [PATCH] build: get rid of sdkdir
5
6Use of sdkdir causes problems during cross-compilation, where the full
7path is then appended to the DESTDIR, leading to host paths being
8appended in the target:
9    https://bugs.busybox.net/show_bug.cgi?id=8696
10
11Other drivers (e.g. keyboard) got rid of sdkdir. Do the same.
12
13Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
14---
15 Makefile.am          | 1 -
16 configure.ac         | 9 ---------
17 include/Makefile.am  | 4 +++-
18 xorg-synaptics.pc.in | 5 +++--
19 4 files changed, 6 insertions(+), 13 deletions(-)
20
21diff --git a/Makefile.am b/Makefile.am
22index 678124c..c48c5c8 100644
23--- a/Makefile.am
24+++ b/Makefile.am
25@@ -21,7 +21,6 @@
26 # During distcheck, system locations (as provided by pkg-config) may
27 # not be writable; provide instead relative locations.
28 DISTCHECK_CONFIGURE_FLAGS = \
29-	--with-sdkdir='$${includedir}/xorg' \
30 	--with-xorg-conf-dir='$${datadir}/X11/xorg.conf.d'
31
32 SUBDIRS = include src man tools conf
33diff --git a/configure.ac b/configure.ac
34index 970dd5f..574353b 100644
35--- a/configure.ac
36+++ b/configure.ac
37@@ -55,11 +55,6 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
38 # Obtain compiler/linker options for the Synaptics driver dependencies
39 PKG_CHECK_MODULES(XORG, [inputproto >= 2.1.99.3] [xorg-server >= 1.12] xproto inputproto $REQUIRED_MODULES)
40
41-# X Server SDK location is required to install Synaptics header files
42-# This location is also relayed in the xorg-synaptics.pc file
43-sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
44-AC_SUBST([sdkdir])
45-
46 # -----------------------------------------------------------------------------
47 #			Configuration options
48 # -----------------------------------------------------------------------------
49@@ -154,10 +149,6 @@ if test "x$have_libxtst" = "xyes" ; then
50 fi
51 # -----------------------------------------------------------------------------
52
53-# Workaround overriding sdkdir to be able to create a tarball when user has no
54-# write permission in sdkdir. See DISTCHECK_CONFIGURE_FLAGS in Makefile.am
55-AC_ARG_WITH([sdkdir], [], [sdkdir="$withval"])
56-
57 AC_CONFIG_FILES([Makefile
58                 src/Makefile
59                 man/Makefile
60diff --git a/include/Makefile.am b/include/Makefile.am
61index 8234020..565868b 100644
62--- a/include/Makefile.am
63+++ b/include/Makefile.am
64@@ -18,4 +18,6 @@
65 #  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
66 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
67
68-sdk_HEADERS = synaptics-properties.h
69+# Location formerly known as 'sdkdir'
70+xorgincludedir = $(includedir)/xorg
71+xorginclude_HEADERS = synaptics-properties.h
72diff --git a/xorg-synaptics.pc.in b/xorg-synaptics.pc.in
73index 159cfbf..68e0fbe 100644
74--- a/xorg-synaptics.pc.in
75+++ b/xorg-synaptics.pc.in
76@@ -1,6 +1,7 @@
77-sdkdir=@sdkdir@
78+prefix=@prefix@
79+includedir=@includedir@
80
81 Name: synaptics
82 Description: X.Org synaptics input driver.
83 Version: @PACKAGE_VERSION@
84-Cflags: -I${sdkdir}
85+Cflags: -I${includedir}/xorg
86--
872.7.4
88
89