perf: Fix compilation without libelf for post-3.10 kernels
authorPeter Meerwald <pmeerw@pmeerw.net>
Sat, 5 Apr 2014 12:51:02 +0000 (14:51 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 5 May 2014 19:53:19 +0000 (21:53 +0200)
kernel commit cf4cca10 (perf tools: Move libelf check config into config/Makefile)
removes the NO_LIBELF check from the top-level Makefile

for newer kernels, if config/Makefile exists, we can assume that NO_LIBELF is
also there

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Tested-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/perf/perf.mk

index d7898d0bc392bd93fe8c09b19dc396e69447b7e1..7610f3d1d6db3c789a81b074650436c14dbdc013 100644 (file)
@@ -36,9 +36,11 @@ define PERF_BUILD_CMDS
        fi
        $(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
                if ! grep -q NO_LIBELF $(LINUX_DIR)/tools/perf/Makefile ; then \
-                       echo "The perf tool in your kernel cannot be built without libelf." ; \
-                       echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
-                       exit 1 ; \
+                       if ! test -r $(LINUX_DIR)/tools/perf/config/Makefile ; then \
+                               echo "The perf tool in your kernel cannot be built without libelf." ; \
+                               echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
+                               exit 1 ; \
+                       fi \
                fi \
        fi
        $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/perf \