]> granicus.if.org Git - strace/commitdiff
Makefile.am: look for ioctl definitions in the kernel build tree by default
authorLubomir Rintel <lkundrak@v3.sk>
Thu, 16 Oct 2014 10:05:43 +0000 (12:05 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 11 Nov 2014 15:10:22 +0000 (15:10 +0000)
While most of ioctl-related kernel headers are now exported by kernel's
headers_install, some are still modules_install only.  The kernel's
headers installed into /usr/include/ are usually headers_install'ed and
therefore don't contain some internal headers we need.  The solution is
to look for modules_install'ed headers for the running kernel, and fall
back to old behavior if they aren't found.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Makefile.am

index fd363656ce9d4f4f967eefcd7d483e1d441d750d..5f98cd6398c89ae198d1fbd0316b74caa9f8f091 100644 (file)
@@ -288,9 +288,16 @@ $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
 
 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX
 
-IOCTLDIR = /usr/include
-IOCTLASM = asm
-IOCTLSORT_INCLUDEDIR = $(IOCTLDIR)
+INCLUDEDIR = /usr/include
+KERNEL_RELEASE = $(shell uname -r)
+# Candidates for the kernel headers tree.
+KERNEL_INCLUDE = \
+       /lib/modules/$(KERNEL_RELEASE)/build/include \
+       /usr/src/linux-$(KERNEL_RELEASE)/include \
+       $(INCLUDEDIR)
+IOCTLDIR = $(shell find $(KERNEL_INCLUDE) -maxdepth 0 -type d -print -quit 2>/dev/null)
+IOCTLASM = $(INCLUDEDIR)/asm
+IOCTLSORT_INCLUDEDIR = $(INCLUDEDIR)
 
 ioctlent_h_in = linux/ioctlent.h.in