2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([OpenCL ICD Loader], [2.0.2], [ocl-icd-devel@lists.forge.imag.fr], [ocl-icd])
6 AC_CONFIG_SRCDIR([ocl_icd_loader.c])
7 AC_CONFIG_AUX_DIR([build-aux])
8 AC_CONFIG_HEADERS([config.h])
9 AC_CONFIG_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.9 tar-pax check-news color-tests parallel-tests])
11 AMX_SILENT_RULES([AM_DEFAULT_VERBOSITY=0])
12 LT_INIT([disable-static])
13 AC_CONFIG_TESTDIR([tests], [.])
16 AC_SUBST([OPENCL_VERSION])
18 # Checks for programs.
23 AC_PATH_PROG([ASCIIDOC], [asciidoc], [])
24 AC_PATH_PROG([A2X], [a2x], [])
25 AC_PATH_PROG([XMLTO], [xmlto], [])
26 AM_CONDITIONAL([GEN_DOC], [\
27 test x"$ASCIIDOC" != x && \
28 test x"$A2X" != x && \
29 test x"$XMLTO" != x ])
31 # Checks for libraries.
32 AC_CHECK_LIB([dl], [dlopen])
34 # Checks for header files.
35 AC_CHECK_HEADERS([stdlib.h string.h])
39 AC_CHECK_HEADER([OpenCL/opencl.h],[cl_h=yes])
42 AC_CHECK_HEADER([CL/opencl.h],[cl_h=yes])
45 if test $cl_h = no; then
46 AC_MSG_ERROR([OpenCL headers are required])
48 AC_MSG_CHECKING([whether OpenCL headers 1.2 are available])
51 #if defined(__APPLE__) || defined(__MACOSX)
52 # include <OpenCL/opencl.h>
54 # include <CL/opencl.h>
56 #ifndef CL_VERSION_1_2
57 # error Cannot find CL_VERSION_1_2 symbol
64 AC_MSG_FAILURE([OpenCL headers for OpenCL 1.2 are required])
67 # Checks for typedefs, structures, and compiler characteristics.
72 NO_DEPRECATED_DECLARATIONS_FLAGS=
73 AX_CHECK_COMPILER_FLAGS([-Wno-deprecated-declarations],
74 [NO_DEPRECATED_DECLARATIONS_FLAGS="-Wno-deprecated-declarations"])
75 AC_SUBST([NO_DEPRECATED_DECLARATIONS_FLAGS])
77 # Checks for library functions.
80 AC_CHECK_FUNCS([strstr])
82 # --enable-pthread-once
83 AC_ARG_ENABLE([pthread-once],
84 [AS_HELP_STRING([--enable-pthread-once],
85 [use pthread_once() to ensure correct initialisation without polling])],
86 [pthread_once=$enableval],
89 if test "$pthread_once" = yes ; then
91 AC_DEFINE([USE_PTHREAD], [1],
92 [pthreads are available])
94 AC_MSG_ERROR([No pthread detected on this platform!])
99 AC_ARG_ENABLE([debug],
100 [AS_HELP_STRING([--disable-debug],
101 [remove debug and additionnal checks (default is included)])],
102 [use_debug=$enableval],
104 if test "x$use_debug" != xno ; then
105 AC_DEFINE([DEBUG_OCL_ICD], [1],
106 [Add DEBUG additionnal code])
109 # --enable-update-database
110 AC_ARG_ENABLE([update-database],
111 [AS_HELP_STRING([--enable-update-database],
112 [update the YAML database from the currently installed ICD Loader and OpenCL headers (root access required)])],
113 [update_database=$enableval],
114 [update_database=no])
115 AM_CONDITIONAL([UPDATE_DATABASE], [test x"$update_database" != xno])
117 # always use versionned symbols (check required for MacOSX)
118 AM_CONDITIONAL([USE_MAP], [true])