there was an #include directive missing
[openmpi-llc.git] / config / ompi_check_xcpu.m4
blob7d757d1f3bc8ac9bc87b66851e3ab22af7224b3f
1 # -*- shell-script -*-
3 # Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4 #                         University Research and Technology
5 #                         Corporation.  All rights reserved.
6 # Copyright (c) 2004-2005 The University of Tennessee and The University
7 #                         of Tennessee Research Foundation.  All rights
8 #                         reserved.
9 # Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
10 #                         University of Stuttgart.  All rights reserved.
11 # Copyright (c) 2004-2005 The Regents of the University of California.
12 #                         All rights reserved.
13 # $COPYRIGHT$
14
15 # Additional copyrights may follow
16
17 # $HEADER$
20 # OMPI_CHECK_XCPU(prefix, [action-if-found], [action-if-not-found])
21 # --------------------------------------------------------
22 AC_DEFUN([OMPI_CHECK_XCPU],[
23     AC_ARG_WITH([xcpu],
24                 [AC_HELP_STRING([--with-xcpu],
25                                 [Path to xcpu installation])])
27     AS_IF([test "$with_xcpu" = "no"],[$3], [ 
28         ompi_check_xcpu_save_CPPFLAGS="$CPPFLAGS"
29         ompi_check_xcpu_save_LDFLAGS="$LDFLAGS"
30         ompi_check_xcpu_save_LIBS="$LIBS"
32         AS_IF([test ! -z "$with_xcpu" -a "$with_xcpu" != "yes"], 
33               [CPPFLAGS="$CPPFLAGS -I$with_xcpu/include"
34                LDFLAGS="$LDFLAGS -L$with_xcpu/lib"])
35         AC_CHECK_HEADERS([sys/xcpu.h],
36                          [AC_CHECK_LIB([xcpu], 
37                                        [check_for_xcpu],
38                                        [ompi_check_xcpu_works="yes"],
39                                        [ompi_check_xcpu_works="no"])],
40                          [AC_CHECK_LIB([xcpu], 
41                                        [check_for_xcpu],
42                                        [ompi_check_xcpu_works="yes"],
43                                        [ompi_check_xcpu_works="no"])])
44                          # check for library irrespective of if xcpu.h is there or not
45                          # 'cause  I am not sure 
46                          # if we need to check for xcpu.h
48         CPPFLAGS="$ompi_check_xcpu_save_CPPFLAGS"
49         LDFLAGS="$ompi_check_xcpu_save_LDFLAGS"
50         LIBS="$ompi_check_xcpu_save_LIBS"
52         AS_IF([test "$ompi_check_xcpu_works" = "yes"], 
53               [AS_IF([test ! -z "$with_xcpu" -a "$with_xcpu" != "yes"], 
54                      [$1_CPPFLAGS="$$1_CPPFLAGS -I$with_xcpu/include"
55                       $1_LDFLAGS="$$1_LDFLAGS -L$with_xcpu/lib"])
56                $1_LIBS="$$1_LIBS -lxcpu"
57                $2],
58               [AS_IF([test ! -z "$with_xcpu"],
59                      [AC_MSG_ERROR([xcpu support requested but not found.  Perhaps you need to specify the location of the xcpu libraries.])])
60                $3])
61     ])