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_WDOCUMENTATION_FLAG],[
37 AC_CACHE_CHECK([for the compiler flag "-Wdocumentation"], [ax_cv_cc_wdocumentation_flag],[
40 CFLAGS="$CFLAGS -Werror -Wdocumentation"
46 [ax_cv_cc_wdocumentation_flag="yes"],
47 [ax_cv_cc_wdocumentation_flag="no"])
50 CFLAGS="$CFLAGS_SAVED"
55 dnl # Determine the number of system cores we have
57 AC_DEFUN([AX_SYSTEM_CORES],[
58 AC_CACHE_CHECK([number of system cores], [ax_cv_system_cores],
68 # include <sys/param.h>
69 # include <sys/sysctl.h>
74 int main (int argc, char *argv[])
80 GetSystemInfo(&sysinfo);
82 count = sysinfo.dwNumberOfProcessors;
90 sysctl(nm, 2, &count, &len, NULL, 0);
94 sysctl(nm, 2, &count, &len, NULL, 0);
101 count = sysconf(_SC_NPROCESSORS_ONLN);
107 [ax_cv_system_cores=$?],
108 [ax_cv_system_cores=$?],
109 [ax_cv_system_cores=]