r600: include libelf headers only as needed
authorEmil Velikov <emil.velikov@collabora.com>
Sat, 17 Jun 2017 10:40:21 +0000 (11:40 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sat, 17 Jun 2017 15:57:18 +0000 (16:57 +0100)
Headers are required only when building with OpenCL. As we're building
w/o it libelf may be missing, hence we'll error out as below:

src/gallium/drivers/r600/evergreen_compute.c:27:10:
fatal error: 'gelf.h' file not found
         ^
1 error generated.

Fixes: d96a210842 ("r600g,compute: provide local copy of functions from
ac_binary.c")
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reported-by: Mauro Rossi <issor.oruam@gmail.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/gallium/drivers/r600/evergreen_compute.c

index 37cfed4497bcb343932a49ea00a155bbb028a479..6e87539cfe763a261169920a44cefcb9d309a85b 100644 (file)
  *      Adam Rak <adam.rak@streamnovation.com>
  */
 
+#ifdef HAVE_OPENCL
 #include <gelf.h>
 #include <libelf.h>
+#endif
 #include <stdio.h>
 #include <errno.h>
 #include "pipe/p_defines.h"