2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([OpenCL ICD Loader], [1.5], [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])
15 AC_SUBST([OPENCL_VERSION])
17 # Checks for programs.
22 # Checks for libraries.
23 AC_CHECK_LIB([dl], [dlopen])
25 # Checks for header files.
26 AC_CHECK_HEADERS([stdlib.h string.h])
28 # Checks for typedefs, structures, and compiler characteristics.
33 NO_DEPRECATED_DECLARATIONS_FLAGS=
34 AX_CHECK_COMPILER_FLAGS([-Wno-deprecated-declarations],
35 [NO_DEPRECATED_DECLARATIONS_FLAGS="-Wno-deprecated-declarations"])
36 AC_SUBST([NO_DEPRECATED_DECLARATIONS_FLAGS])
38 # Checks for library functions.
41 AC_CHECK_FUNCS([strstr])
43 # --enable-pthread-once
44 AC_ARG_ENABLE([pthread-once],
45 [AS_HELP_STRING([--enable-pthread-once],
46 [use pthread_once() to ensure correct initialisation without polling])],
47 [pthread_once=$enableval],
50 if test "$pthread_once" = yes ; then
52 AC_DEFINE([USE_PTHREAD], [1],
53 [pthreads are available])
55 AC_MSG_ERROR([No pthread detected on this platform!])
60 AC_ARG_ENABLE([debug],
61 [AS_HELP_STRING([--disable-debug],
62 [remove debug and additionnal checks (default is included)])],
63 [use_debug=$enableval],
65 if test "x$use_debug" != xno ; then
66 AC_DEFINE([DEBUG_OCL_ICD], [1],
67 [Add DEBUG additionnal code])
70 # --enable-update-database
71 AC_ARG_ENABLE([update-database],
72 [AS_HELP_STRING([--enable-update-database],
73 [update the YAML database from the currently installed ICD Loader and OpenCL headers (root access required)])],
74 [update_database=$enableval],
76 AM_CONDITIONAL([UPDATE_DATABASE], [test x"$update_database" != xno])
78 # always use versionned symbols (check required for MacOSX)
79 AM_CONDITIONAL([USE_MAP], [true])