autoconf: Generic Compiler Characteristics
1
1 5.10.2 Generic Compiler Characteristics
1 ---------------------------------------
1
1 -- Macro: AC_CHECK_SIZEOF (TYPE-OR-EXPR, [UNUSED], [INCLUDES =
1 `AC_INCLUDES_DEFAULT'])
1 Define `SIZEOF_TYPE-OR-EXPR' (⇒Standard Symbols) to be the
1 size in bytes of TYPE-OR-EXPR, which may be either a type or an
1 expression returning a value that has a size. If the expression
1 `sizeof (TYPE-OR-EXPR)' is invalid, the result is 0. INCLUDES is
1 a series of include directives, defaulting to
1 `AC_INCLUDES_DEFAULT' (⇒Default Includes), which are used
1 prior to the expression under test.
1
1 This macro now works even when cross-compiling. The UNUSED
1 argument was used when cross-compiling.
1
1 For example, the call
1
1 AC_CHECK_SIZEOF([int *])
1
1 defines `SIZEOF_INT_P' to be 8 on DEC Alpha AXP systems.
1
1 This macro caches its result in the `ac_cv_sizeof_TYPE-OR-EXPR'
1 variable, with `*' mapped to `p' and other characters not suitable
1 for a variable name mapped to underscores.
1
1 -- Macro: AC_CHECK_ALIGNOF (TYPE, [INCLUDES = `AC_INCLUDES_DEFAULT'])
1 Define `ALIGNOF_TYPE' (⇒Standard Symbols) to be the
1 alignment in bytes of TYPE. `TYPE y;' must be valid as a
1 structure member declaration. If `type' is unknown, the result is
1 0. If no INCLUDES are specified, the default includes are used
1 (⇒Default Includes).
1
1 This macro caches its result in the `ac_cv_alignof_TYPE-OR-EXPR'
1 variable, with `*' mapped to `p' and other characters not suitable
1 for a variable name mapped to underscores.
1
1 -- Macro: AC_COMPUTE_INT (VAR, EXPRESSION, [INCLUDES =
1 `AC_INCLUDES_DEFAULT'], [ACTION-IF-FAILS])
1 Store into the shell variable VAR the value of the integer
1 EXPRESSION. The value should fit in an initializer in a C
1 variable of type `signed long'. To support cross compilation (in
1 which case, the macro only works on hosts that use twos-complement
1 arithmetic), it should be possible to evaluate the expression at
1 compile-time. If no INCLUDES are specified, the default includes
1 are used (⇒Default Includes).
1
1 Execute ACTION-IF-FAILS if the value cannot be determined
1 correctly.
1
1 -- Macro: AC_LANG_WERROR
1 Normally Autoconf ignores warnings generated by the compiler,
1 linker, and preprocessor. If this macro is used, warnings count
1 as fatal errors for the current language. This macro is useful
1 when the results of configuration are used where warnings are
1 unacceptable; for instance, if parts of a program are built with
1 the GCC `-Werror' option. If the whole program is built using
1 `-Werror' it is often simpler to put `-Werror' in the compiler
1 flags (`CFLAGS', etc.).
1
1 -- Macro: AC_OPENMP
1 OpenMP (http://www.openmp.org/) specifies extensions of C, C++,
1 and Fortran that simplify optimization of shared memory
1 parallelism, which is a common problem on multicore CPUs.
1
1 If the current language is C, the macro `AC_OPENMP' sets the
1 variable `OPENMP_CFLAGS' to the C compiler flags needed for
1 supporting OpenMP. `OPENMP_CFLAGS' is set to empty if the
1 compiler already supports OpenMP, if it has no way to activate
1 OpenMP support, or if the user rejects OpenMP support by invoking
1 `configure' with the `--disable-openmp' option.
1
1 `OPENMP_CFLAGS' needs to be used when compiling programs, when
1 preprocessing program source, and when linking programs.
1 Therefore you need to add `$(OPENMP_CFLAGS)' to the `CFLAGS' of C
1 programs that use OpenMP. If you preprocess OpenMP-specific C
1 code, you also need to add `$(OPENMP_CFLAGS)' to `CPPFLAGS'. The
1 presence of OpenMP support is revealed at compile time by the
1 preprocessor macro `_OPENMP'.
1
1 Linking a program with `OPENMP_CFLAGS' typically adds one more
1 shared library to the program's dependencies, so its use is
1 recommended only on programs that actually require OpenMP.
1
1 If the current language is C++, `AC_OPENMP' sets the variable
1 `OPENMP_CXXFLAGS', suitably for the C++ compiler. The same remarks
1 hold as for C.
1
1 If the current language is Fortran 77 or Fortran, `AC_OPENMP' sets
1 the variable `OPENMP_FFLAGS' or `OPENMP_FCFLAGS', respectively.
1 Similar remarks as for C hold, except that `CPPFLAGS' is not used
1 for Fortran, and no preprocessor macro signals OpenMP support.
1
1 For portability, it is best to avoid spaces between `#' and
1 `pragma omp'. That is, write `#pragma omp', not `# pragma omp'.
1 The Sun WorkShop 6.2 C compiler chokes on the latter.
1
1 This macro caches its result in the `ac_cv_prog_c_openmp',
1 `ac_cv_prog_cxx_openmp', `ac_cv_prog_f77_openmp', or
1 `ac_cv_prog_fc_openmp' variable, depending on the current language.
1