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"
73 dnl # Determine the number of system cores we have
75 AC_DEFUN([AX_SYSTEM_CORES],[
76 AC_CACHE_CHECK([number of system cores], [ax_cv_system_cores],
86 # include <sys/param.h>
87 # include <sys/sysctl.h>
92 int main (int argc, char *argv[])
98 GetSystemInfo(&sysinfo);
100 count = sysinfo.dwNumberOfProcessors;
108 sysctl(nm, 2, &count, &len, NULL, 0);
112 sysctl(nm, 2, &count, &len, NULL, 0);
119 count = sysconf(_SC_NPROCESSORS_ONLN);
125 [ax_cv_system_cores=$?],
126 [ax_cv_system_cores=$?],
127 [ax_cv_system_cores=]