there was an #include directive missing
[openmpi-llc.git] / config / ompi_find_type.m4
blobcfe0d6d99b482b73b33ba05b7c04fe86956e7390
1 dnl -*- shell-script -*-
2 dnl
3 dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4 dnl                         University Research and Technology
5 dnl                         Corporation.  All rights reserved.
6 dnl Copyright (c) 2004-2005 The University of Tennessee and The University
7 dnl                         of Tennessee Research Foundation.  All rights
8 dnl                         reserved.
9 dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
10 dnl                         University of Stuttgart.  All rights reserved.
11 dnl Copyright (c) 2004-2005 The Regents of the University of California.
12 dnl                         All rights reserved.
13 dnl $COPYRIGHT$
14 dnl 
15 dnl Additional copyrights may follow
16 dnl 
17 dnl $HEADER$
18 dnl
20 # OMPI_FIND_TYPE(type, [list of c types], abort if not found,
21 #                target size, variable to set)
22 # -----------------------------------------------------------
23 AC_DEFUN([OMPI_FIND_TYPE],[
24     AS_VAR_PUSHDEF([type_var], [ompi_cv_find_type_$1])
26     oft_abort_on_fail="$3"
27     oft_target_size="$4"
29     AC_CACHE_CHECK([for C type corresponding to $1], type_var,
30         [ # Loop over all the types handed to us
31          oft_real_type=
32          AS_IF([test "$oft_target_size" != ""],
33              [m4_foreach(oft_type, [$2], 
34                   [if test -z "$oft_real_type"; then
35                        if test "[$ac_cv_sizeof_]m4_bpatsubst(oft_type, [[^a-zA-Z0-9_]], [_])" = "$oft_target_size" ; then
36                            oft_real_type="oft_type"
37                        fi
38                    fi
39 ])])
40          AS_IF([test -z "$oft_real_type"],
41                [AS_VAR_SET(type_var, "not found")],
42                [AS_VAR_SET(type_var, "$oft_real_type")])])
44     AS_IF([test "AS_VAR_GET(type_var)" == "not found"],
45           [AC_MSG_WARN([*** Did not find corresponding C type])
46            AS_IF([test "$oft_abort_on_fail" != "no"],
47                  [AC_MSG_ERROR([Cannot continue])])])
49     if test "AS_VAR_GET(type_var)" = "not found" ; then
50         $5=
51     else
52         $5=AS_VAR_GET(type_var)
53     fi
55     unset oft_real_type oft_target_size
57     AS_VAR_POPDEF([type_var])dnl
58 ])dnl