1# -*- shell-script -*-
2#
3# Copyright (c) 2009-2017 Cisco Systems, Inc.  All rights reserved
4#
5# $COPYRIGHT$
6#
7# Additional copyrights may follow
8#
9# $HEADER$
10#
11
12AC_DEFUN([MCA_opal_dl_dlopen_PRIORITY], [80])
13
14#
15# Force this component to compile in static-only mode
16#
17AC_DEFUN([MCA_opal_dl_dlopen_COMPILE_MODE], [
18    AC_MSG_CHECKING([for MCA component $2:$3 compile mode])
19    $4="static"
20    AC_MSG_RESULT([$$4])
21])
22
23# MCA_dl_dlopen_CONFIG([action-if-can-compile],
24#                      [action-if-cant-compile])
25# ------------------------------------------------
26AC_DEFUN([MCA_opal_dl_dlopen_CONFIG],[
27    AC_CONFIG_FILES([opal/mca/dl/dlopen/Makefile])
28
29    dnl This is effectively a back-door for Open MPI developers to
30    dnl force the use of the libltdl dl component.
31    AC_ARG_ENABLE([dl-dlopen],
32        [AS_HELP_STRING([--disable-dl-dlopen],
33            [Disable the "dlopen" DL component (and probably force the use of the "libltdl" DL component).  This option should really only be used by Open MPI developers.  You are probably actually looking for the "--disable-dlopen" option, which disables all dlopen-like functionality from Open MPI.])
34        ])
35
36    opal_dl_dlopen_happy=no
37    AS_IF([test "$enable_dl_dlopen" != "no"],
38          [OPAL_CHECK_PACKAGE([opal_dl_dlopen],
39              [dlfcn.h],
40              [dl],
41              [dlopen],
42              [],
43              [],
44              [],
45              [opal_dl_dlopen_happy=yes],
46              [opal_dl_dlopen_happy=no])
47          ])
48
49    AS_IF([test "$opal_dl_dlopen_happy" = "yes"],
50          [dl_dlopen_ADD_LIBS=$opal_dl_dlopen_LIBS
51           dl_dlopen_WRAPPER_EXTRA_LIBS=$opal_dl_dlopen_LIBS
52           $1],
53          [$2])
54
55    AC_SUBST(opal_dl_dlopen_LIBS)
56])
57