2 dnl # check if were compiling with CLANG, autoconf GCC macro identifies CLANG as GCC
4 AC_DEFUN([AX_CC_IS_CLANG],[
5 AC_CACHE_CHECK([if compiler is clang], [ax_cv_cc_clang],[
8 [AC_LANG_PROGRAM([], [[
18 AC_DEFUN([AX_CC_QUNUSED_ARGUMENTS_FLAG],[
19 AC_CACHE_CHECK([for the compiler flag "-Qunused-arguments"], [ax_cv_cc_qunused_arguments_flag],[
22 CFLAGS="$CFLAGS -Werror -Qunused-arguments -foobar"
28 [ax_cv_cc_qunused_arguments_flag="yes"],
29 [ax_cv_cc_qunused_arguments_flag="no"])
32 CFLAGS="$CFLAGS_SAVED"
36 AC_DEFUN([AX_CC_WEVERYTHING_FLAG],[
37 AC_CACHE_CHECK([for the compiler flag "-Weverything"], [ax_cv_cc_weverything_flag],[
40 CFLAGS="$CFLAGS -Werror -Weverything -Wno-unused-macros -Wno-unreachable-code-return"
46 [ax_cv_cc_weverything_flag="yes"],
47 [ax_cv_cc_weverything_flag="no"])
50 CFLAGS="$CFLAGS_SAVED"
54 AC_DEFUN([AX_CC_WDOCUMENTATION_FLAG],[
55 AC_CACHE_CHECK([for the compiler flag "-Wdocumentation"], [ax_cv_cc_wdocumentation_flag],[
58 CFLAGS="$CFLAGS -Werror -Wdocumentation"
64 [ax_cv_cc_wdocumentation_flag="yes"],
65 [ax_cv_cc_wdocumentation_flag="no"])
68 CFLAGS="$CFLAGS_SAVED"
72 AC_DEFUN([AX_CC_PTHREAD_FLAG],[
73 AC_CACHE_CHECK([for the compiler flag "-pthread"], [ax_cv_cc_pthread_flag],[
76 CFLAGS="$CFLAGS -Werror -pthread"
82 [ax_cv_cc_pthread_flag="yes"],
83 [ax_cv_cc_pthread_flag="no"])
86 CFLAGS="$CFLAGS_SAVED"
91 dnl # Determine the number of system cores we have
93 AC_DEFUN([AX_SYSTEM_CORES],[
94 AC_CACHE_CHECK([number of system cores], [ax_cv_system_cores],
102 # include <windows.h>
104 # include <sys/param.h>
105 # include <sys/sysctl.h>
110 int main (int argc, char *argv[])
116 GetSystemInfo(&sysinfo);
118 count = sysinfo.dwNumberOfProcessors;
126 sysctl(nm, 2, &count, &len, NULL, 0);
130 sysctl(nm, 2, &count, &len, NULL, 0);
137 count = sysconf(_SC_NPROCESSORS_ONLN);
143 [ax_cv_system_cores=$?],
144 [ax_cv_system_cores=$?],
145 [ax_cv_system_cores=]