|
| 1 | +# -*- shell-script -*- |
| 2 | +# |
| 3 | +# Copyright (c) 2011-2015 The University of Tennessee and The University |
| 4 | +# of Tennessee Research Foundation. All rights |
| 5 | +# reserved. |
| 6 | +# Copyright (c) 2011-2015 INRIA. All rights reserved. |
| 7 | +# Copyright (c) 2011-2015 Universite Bordeaux 1 |
| 8 | +# $COPYRIGHT$ |
| 9 | +# |
| 10 | +# Additional copyrights may follow |
| 11 | +# |
| 12 | +# $HEADER$ |
| 13 | +# |
| 14 | + |
| 15 | +# MCA_ompi_topo_treematch_CONFIG([action-if-can-compile], |
| 16 | +# [action-if-cant-compile]) |
| 17 | +# ------------------------------------------- |
| 18 | +AC_DEFUN([MCA_ompi_topo_treematch_CONFIG], [ |
| 19 | + AC_REQUIRE([MCA_opal_hwloc_CONFIG_REQUIRE]) |
| 20 | + |
| 21 | + AC_ARG_WITH([treematch], |
| 22 | + [AC_HELP_STRING([--with-treematch(=DIR)], |
| 23 | + [Build TreeMatch topology support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])], |
| 24 | + [], |
| 25 | + [with_treematch=yes]) |
| 26 | + AC_ARG_WITH([treematch-include], |
| 27 | + [AC_HELP_STRING([--with-treematch-include(=DIR)], |
| 28 | + ["Search for TreeMatch headers in DIR"])]) |
| 29 | + AC_ARG_WITH([treematch-libdir], |
| 30 | + [AC_HELP_STRING([--with-treematch-libdir(=DIR)], |
| 31 | + ["Search for TreeMatch libraries in DIR"])]) |
| 32 | + |
| 33 | + treematch_files_local="no" |
| 34 | + ompi_check_treematch_dir=$srcdir |
| 35 | + ompi_check_treematch_libdir="" |
| 36 | + ompi_check_treematch_happy="no" |
| 37 | + |
| 38 | + AS_IF([test "x$with_treematch" != xno], |
| 39 | + [AC_MSG_CHECKING([TreeMatch headers]) |
| 40 | + AS_IF([test "x$with_treematch_include" = x], |
| 41 | + [AS_IF([test "x$with_treematch" = xyes], |
| 42 | + [treematch_files_local="yes" |
| 43 | + with_treematch_include=$OMPI_TOP_SRCDIR/ompi/mca/topo/treematch/treematch], |
| 44 | + [with_treematch_include=$with_treematch/include])]) |
| 45 | + AS_IF([test -f $with_treematch_include/tm_tree.h], |
| 46 | + [AS_IF([test "x$with_treematch" = xyes], |
| 47 | + [AC_MSG_RESULT([in the source])], |
| 48 | + [AC_MSG_RESULT([user provided])]) |
| 49 | + opal_check_treematch_dir=$with_treematch_include |
| 50 | + ompi_check_treematch_happy="yes"], |
| 51 | + [AC_MSG_ERROR([missing tm_tree.h (${with_treematch}:${with_treematch_include})])])]) |
| 52 | + |
| 53 | + AS_IF([test "$ompi_check_treematch_happy" = "yes"], |
| 54 | + [AC_MSG_CHECKING([TreeMatch library]) |
| 55 | + OPAL_CHECK_WITHDIR([treematch], [$with_treematch_include], [tm_tree.h]) |
| 56 | + AS_IF([test "x$with_treematch_libdir" = x], |
| 57 | + [AS_IF([test "x$with_treematch" != xyes], |
| 58 | + [with_treematch_libdir=$with_treematch/lib] |
| 59 | + [with_treematch_libdir=$OMPI_TOP_SRCDIR/ompi/mca/topo/treematch/treematch])]) |
| 60 | + AS_IF([test "x$treematch_files_local" = xno], |
| 61 | + [OPAL_CHECK_WITHDIR([treematch-libdir], [$with_treematch_libdir], [libtreematch.*]) |
| 62 | + AS_IF([test "x$with_treematch" != xno -a "x$with_treematch" != xyes], |
| 63 | + [AS_IF([test ! -z "$with_treematch" -a "$with_treematch" != "yes"], |
| 64 | + [ompi_check_treematch_dir="$with_treematch"]) |
| 65 | + AS_IF([test ! -z "$with_treematch_libdir" -a "$with_treematch_libdir" != "yes"], |
| 66 | + [ompi_check_treematch_libdir="$with_treematch_libdir"]) |
| 67 | + OPAL_CHECK_PACKAGE([topo_treematch], |
| 68 | + [tm_tree.h], |
| 69 | + [treematch], |
| 70 | + [build_tree], |
| 71 | + [], |
| 72 | + [$with_treematch_include], |
| 73 | + [$with_treematch_libdir], |
| 74 | + [ompi_check_treematch_happy="yes"], |
| 75 | + [ompi_check_treematch_happy="no"])], |
| 76 | + [ompi_check_treematch_happy="no"])])]) |
| 77 | + |
| 78 | + AS_IF([test "$ompi_check_treematch_happy" = "yes"], |
| 79 | + [$1], |
| 80 | + [AS_IF([test ! -z "$with_treematch" -a "$with_treematch" != "no"], |
| 81 | + [AC_MSG_ERROR([TreeMatch support requested but not found. Aborting])]) |
| 82 | + $2]) |
| 83 | + |
| 84 | + AC_CONFIG_FILES([ompi/mca/topo/treematch/Makefile]) |
| 85 | + AM_CONDITIONAL(topo_treematch_local, |
| 86 | + [test "x$treematch_files_local" = "xyes"]) |
| 87 | +]) |
0 commit comments