2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([OpenCL ICD Loader], [2.1.3], [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=1])
12 # AM_PROG_AR must be called before LT_INIT...
14 LT_INIT([disable-static])
15 AC_CONFIG_TESTDIR([tests], [.])
18 AC_SUBST([OPENCL_VERSION])
20 # Checks for programs.
26 AC_PATH_PROG([ASCIIDOC], [asciidoc], [])
27 AC_PATH_PROG([A2X], [a2x], [])
28 AC_PATH_PROG([XMLTO], [xmlto], [])
29 AM_CONDITIONAL([GEN_DOC], [\
30 test x"$ASCIIDOC" != x && \
31 test x"$A2X" != x && \
32 test x"$XMLTO" != x ])
34 # Checks for libraries.
35 AC_CHECK_LIB([dl], [dlopen])
37 # Checks for header files.
38 AC_CHECK_HEADERS([stdlib.h string.h])
42 AC_CHECK_HEADER([OpenCL/opencl.h],[cl_h=yes])
45 AC_CHECK_HEADER([CL/opencl.h],[cl_h=yes])
48 if test $cl_h = no; then
49 AC_MSG_ERROR([OpenCL headers are required])
51 AC_MSG_CHECKING([whether OpenCL headers 1.2 are available])
54 #if defined(__APPLE__) || defined(__MACOSX)
55 # include <OpenCL/opencl.h>
57 # include <CL/opencl.h>
59 #ifndef CL_VERSION_1_2
60 # error Cannot find CL_VERSION_1_2 symbol
67 AC_MSG_FAILURE([OpenCL headers for OpenCL 1.2 are required])
70 # Checks for typedefs, structures, and compiler characteristics.
75 NO_DEPRECATED_DECLARATIONS_FLAGS=
76 AX_CHECK_COMPILER_FLAGS([-Wno-deprecated-declarations],
77 [NO_DEPRECATED_DECLARATIONS_FLAGS="-Wno-deprecated-declarations"])
78 AC_SUBST([NO_DEPRECATED_DECLARATIONS_FLAGS])
80 # Checks for library functions.
83 AC_CHECK_FUNCS([strstr])
85 # --enable-pthread-once
86 AC_ARG_ENABLE([pthread-once],
87 [AS_HELP_STRING([--enable-pthread-once],
88 [use pthread_once() to ensure correct initialisation without polling])],
89 [pthread_once=$enableval],
92 if test "$pthread_once" = yes ; then
94 AC_DEFINE([USE_PTHREAD], [1],
95 [pthreads are available])
97 AC_MSG_ERROR([No pthread detected on this platform!])
102 AC_ARG_ENABLE([debug],
103 [AS_HELP_STRING([--disable-debug],
104 [remove debug and additionnal checks (default is included)])],
105 [use_debug=$enableval],
107 if test "x$use_debug" != xno ; then
108 AC_DEFINE([DEBUG_OCL_ICD], [1],
109 [Add DEBUG additionnal code])
112 # --enable-update-database
113 AC_ARG_ENABLE([update-database],
114 [AS_HELP_STRING([--enable-update-database],
115 [update the YAML database from the currently installed ICD Loader and OpenCL headers (root access required)])],
116 [update_database=$enableval],
117 [update_database=no])
118 AM_CONDITIONAL([UPDATE_DATABASE], [test x"$update_database" != xno])
120 # always use versionned symbols (check required for MacOSX)
121 AM_CONDITIONAL([USE_MAP], [true])