(autoconf.info)Generic Compiler Characteristics


Next: C Compiler Prev: Specific Compiler Characteristics Up: Compilers and Preprocessors

5.10.2 Generic Compiler Characteristics
---------------------------------------

 -- Macro: AC_CHECK_SIZEOF (TYPE-OR-EXPR, [UNUSED], [INCLUDES =
          `AC_INCLUDES_DEFAULT'])
     Define `SIZEOF_TYPE-OR-EXPR' (Note: Standard Symbols) to be the
     size in bytes of TYPE-OR-EXPR, which may be either a type or an
     expression returning a value that has a size.  If the expression
     `sizeof (TYPE-OR-EXPR)' is invalid, the result is 0.  INCLUDES is
     a series of include directives, defaulting to
     `AC_INCLUDES_DEFAULT' (Note: Default Includes), which are used
     prior to the expression under test.

     This macro now works even when cross-compiling.  The UNUSED
     argument was used when cross-compiling.

     For example, the call

          AC_CHECK_SIZEOF([int *])

     defines `SIZEOF_INT_P' to be 8 on DEC Alpha AXP systems.

 -- Macro: AC_CHECK_ALIGNOF (TYPE, [INCLUDES = `AC_INCLUDES_DEFAULT'])
     Define `ALIGNOF_TYPE' (Note: Standard Symbols) to be the
     alignment in bytes of TYPE.  `TYPE y;' must be valid as a
     structure member declaration.  If `type' is unknown, the result is
     0.  If no INCLUDES are specified, the default includes are used
     (Note: Default Includes).

 -- Macro: AC_COMPUTE_INT (VAR, EXPRESSION, [INCLUDES =
          `AC_INCLUDES_DEFAULT'], [ACTION-IF-FAILS])
     Store into the shell variable VAR the value of the integer
     EXPRESSION.  The value should fit in an initializer in a C
     variable of type `signed long'.  To support cross compilation (in
     which case, the macro only works on hosts that use twos-complement
     arithmetic), it should be possible to evaluate the expression at
     compile-time.  If no INCLUDES are specified, the default includes
     are used (Note: Default Includes).

     Execute ACTION-IF-FAILS if the value cannot be determined
     correctly.

 -- Macro: AC_LANG_WERROR
     Normally Autoconf ignores warnings generated by the compiler,
     linker, and preprocessor.  If this macro is used, warnings count
     as fatal errors for the current language.  This macro is useful
     when the results of configuration are used where warnings are
     unacceptable; for instance, if parts of a program are built with
     the GCC `-Werror' option.  If the whole program is built using
     `-Werror' it is often simpler to put `-Werror' in the compiler
     flags (`CFLAGS', etc.).

 -- Macro: AC_OPENMP
     OpenMP (`http://www.openmp.org/') specifies extensions of C, C++,
     and Fortran that simplify optimization of shared memory
     parallelism, which is a common problem on multicore CPUs.

     If the current language is C, the macro `AC_OPENMP' sets the
     variable `OPENMP_CFLAGS' to the C compiler flags needed for
     supporting OpenMP.  `OPENMP_CFLAGS' is set to empty if the
     compiler already supports OpenMP, if it has no way to activate
     OpenMP support, or if the user rejects OpenMP support by invoking
     `configure' with the `--disable-openmp' option.

     `OPENMP_CFLAGS' needs to be used when compiling programs, when
     preprocessing program source, and when linking programs.
     Therefore you need to add `$(OPENMP_CFLAGS)' to the `CFLAGS' of C
     programs that use OpenMP.  If you preprocess OpenMP-specific C
     code, you also need to add `$(OPENMP_CFLAGS)' to `CPPFLAGS'.  The
     presence of OpenMP support is revealed at compile time by the
     preprocessor macro `_OPENMP'.

     Linking a program with `OPENMP_CFLAGS' typically adds one more
     shared library to the program's dependencies, so its use is
     recommended only on programs that actually require OpenMP.

     If the current language is C++, `AC_OPENMP' sets the variable
     `OPENMP_CXXFLAGS', suitably for the C++ compiler.  The same remarks
     hold as for C.

     If the current language is Fortran 77 or Fortran, `AC_OPENMP' sets
     the variable `OPENMP_FFLAGS' or `OPENMP_FCFLAGS', respectively.
     Similar remarks as for C hold, except that `CPPFLAGS' is not used
     for Fortran, and no preprocessor macro signals OpenMP support.


automatically generated by info2www