Skip to content

Commit 25b088b

Browse files
committed
build: Default to building MCA components in the library
Default to building MCA components into the library, rather than as dso objects, since most users are not taking advantage of per-library packaging, and this results in less stat/open/etc. calls during application startup. Clean up the static/dso selection logic for componets at the same time. Before, it was relatively hard to describe what would happen if there was a mix of --enable-mca-dso and --enable-mca-static arguments. Now, the code will first look for a component-specific argument, then a framework-level argument, then a global argument. If there is a tie, static is preferred. Signed-off-by: Brian Barrett <[email protected]>
1 parent 4b4abad commit 25b088b

File tree

1 file changed

+37
-22
lines changed

1 file changed

+37
-22
lines changed

config/opal_mca.m4

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ AC_DEFUN([OPAL_MCA],[
6868
type-component pairs that will be built as
6969
run-time loadable components (as opposed to
7070
statically linked in), if supported on this
71-
platform. The default is to build all components
72-
as DSOs.]))
71+
platform.]))
7372
AC_ARG_ENABLE(mca-static,
7473
AC_HELP_STRING([--enable-mca-static=LIST],
7574
[Comma-separated list of types and/or
7675
type-component pairs that will be built statically
7776
linked into the library. The default (if DSOs are
7877
supported) is to build all components as DSOs.
7978
Enabling a component as static disables it
80-
building as a DSO.]))
79+
building as a DSO. The default is to build all
80+
components staticly.]))
8181
AC_ARG_ENABLE(mca-direct,
8282
AC_HELP_STRING([--enable-mca-direct=LIST],
8383
[Comma-separated list of type-component pairs that
@@ -166,15 +166,21 @@ AC_DEFUN([OPAL_MCA],[
166166
# resolution (prefer static) is done in the big loop below
167167
#
168168
AC_MSG_CHECKING([which components should be run-time loadable])
169-
if test "$enable_static" != "no" || test "$OPAL_ENABLE_DLOPEN_SUPPORT" = 0; then
169+
if test "$enable_static" != "no"; then
170170
DSO_all=0
171-
msg=none
172-
elif test -z "$enable_mca_dso" || test "$enable_mca_dso" = "yes"; then
173-
DSO_all=1
174-
msg=all
171+
msg="none (static libraries built)"
172+
elif test "$OPAL_ENABLE_DLOPEN_SUPPORT" = 0; then
173+
DSO_all=0
174+
msg="none (dlopen disabled)"
175+
elif test -z "$enable_mca_dso"; then
176+
DSO_all=0
177+
msg=default
175178
elif test "$enable_mca_dso" = "no"; then
176179
DSO_all=0
177180
msg=none
181+
elif test "$enable_mca_dso" = "yes"; then
182+
DSO_all=1
183+
msg=all
178184
else
179185
DSO_all=0
180186
ifs_save="$IFS"
@@ -195,12 +201,15 @@ AC_DEFUN([OPAL_MCA],[
195201
fi
196202

197203
AC_MSG_CHECKING([which components should be static])
198-
if test "$enable_mca_static" = "yes"; then
199-
STATIC_all=1
200-
msg=all
201-
elif test -z "$enable_mca_static" || test "$enable_mca_static" = "no"; then
204+
if test -z "$enable_mca_static" ; then
205+
STATIC_all=0
206+
msg=default
207+
elif test "$enable_mca_static" = "no"; then
202208
STATIC_all=0
203209
msg=none
210+
elif test "$enable_mca_static" = "yes"; then
211+
STATIC_all=1
212+
msg=all
204213
else
205214
STATIC_all=0
206215
ifs_save="$IFS"
@@ -705,17 +714,23 @@ AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
705714
[str="STATIC_COMPONENT=\$STATIC_$2_$3"
706715
eval $str])
707716
708-
# Setup for either shared or static
709-
if test "$STATIC_FRAMEWORK" = "1" || \
710-
test "$STATIC_COMPONENT" = "1" || \
711-
test "$STATIC_all" = "1" ; then
712-
$4="static"
713-
elif test "$SHARED_FRAMEWORK" = "1" || \
714-
test "$SHARED_COMPONENT" = "1" || \
715-
test "$DSO_all" = "1"; then
716-
$4="dso"
717+
# Look for the most specific specifier between static/dso. If
718+
# there is a tie (either none specified or eual specified), prefer
719+
# static.
720+
if test "$STATIC_COMPONENT" = "1"; then
721+
$4=static
722+
elif test "SHARED_COMPONENT" = "1"; then
723+
$4=dso
724+
elif test "$STATIC_FRAMEWORK" = "1"; then
725+
$4=static
726+
elif test "$SHARED_FRAMEWORK" = "1"; then
727+
$4=dso
728+
elif test "$STATIC_all" = "1"; then
729+
$4=static
730+
elif test "$DSO_all" = "1"; then
731+
$4=dso
717732
else
718-
$4="static"
733+
$4=static
719734
fi
720735
721736
AC_MSG_CHECKING([for MCA component $2:$3 compile mode])

0 commit comments

Comments
 (0)