2008-10-28 20:22:29 +03:00
|
|
|
dnl -*- shell-script -*-
|
|
|
|
dnl
|
|
|
|
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
dnl University Research and Technology
|
|
|
|
dnl Corporation. All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
dnl of Tennessee Research Foundation. All rights
|
|
|
|
dnl reserved.
|
2015-06-24 06:59:57 +03:00
|
|
|
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl University of Stuttgart. All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
dnl All rights reserved.
|
2010-08-28 02:48:57 +04:00
|
|
|
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
2014-05-07 05:00:06 +04:00
|
|
|
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
dnl
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
dnl
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl $HEADER$
|
|
|
|
dnl
|
|
|
|
|
2014-05-07 03:34:33 +04:00
|
|
|
# OPAL_FIND_TYPE(type, [list of c types], abort if not found,
|
2008-10-28 20:22:29 +03:00
|
|
|
# target size, variable to set)
|
|
|
|
# -----------------------------------------------------------
|
2014-05-07 03:34:33 +04:00
|
|
|
AC_DEFUN([OPAL_FIND_TYPE],[
|
2014-05-07 05:00:06 +04:00
|
|
|
AS_VAR_PUSHDEF([type_var], [opal_cv_find_type_$1])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
oft_abort_on_fail="$3"
|
|
|
|
oft_target_size="$4"
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([for C type corresponding to $1], type_var,
|
|
|
|
[ # Loop over all the types handed to us
|
|
|
|
oft_real_type=
|
|
|
|
AS_IF([test "$oft_target_size" != ""],
|
2015-06-24 06:59:57 +03:00
|
|
|
[m4_foreach(oft_type, [$2],
|
2008-10-28 20:22:29 +03:00
|
|
|
[if test -z "$oft_real_type"; then
|
|
|
|
if test "[$ac_cv_sizeof_]m4_bpatsubst(oft_type, [[^a-zA-Z0-9_]], [_])" = "$oft_target_size" ; then
|
|
|
|
oft_real_type="oft_type"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])])
|
|
|
|
AS_IF([test -z "$oft_real_type"],
|
|
|
|
[AS_VAR_SET(type_var, "not found")],
|
|
|
|
[AS_VAR_SET(type_var, "$oft_real_type")])])
|
|
|
|
|
2010-08-28 02:48:57 +04:00
|
|
|
AS_VAR_IF(type_var, ["not found"],
|
2008-10-28 20:22:29 +03:00
|
|
|
[AC_MSG_WARN([*** Did not find corresponding C type])
|
|
|
|
AS_IF([test "$oft_abort_on_fail" != "no"],
|
|
|
|
[AC_MSG_ERROR([Cannot continue])])])
|
|
|
|
|
2010-08-28 02:48:57 +04:00
|
|
|
AS_VAR_IF(type_var, ["not found"], [$5=], [AS_VAR_COPY([$5], [type_var])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
unset oft_real_type oft_target_size
|
|
|
|
|
|
|
|
AS_VAR_POPDEF([type_var])dnl
|
|
|
|
])dnl
|