1 dnl -*- shell-script -*-
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
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.
15 dnl Additional copyrights may follow
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"
29 AC_CACHE_CHECK([for C type corresponding to $1], type_var,
30 [ # Loop over all the types handed to us
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"
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
52 $5=AS_VAR_GET(type_var)
55 unset oft_real_type oft_target_size
57 AS_VAR_POPDEF([type_var])dnl