Skip to content

Commit bbb5ddf

Browse files
committed
Add OPAL_3RDPARTY_PREP_CONFIGURE_ARGS to process configure options
* This macro will strip off the given prefix from configure options. * This is helpful when removing injected prefixes for the harvested options from 3rd party libraries Signed-off-by: Joshua Hursey <[email protected]>
1 parent f769bad commit bbb5ddf

5 files changed

+73
-0
lines changed

config/ompi_setup_prrte.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,18 @@ AC_DEFUN([OMPI_SETUP_PRRTE_INTERNAL], [
150150
OPAL_SUBDIR_ENV_CLEAN([opal_prrte_configure])
151151
AS_IF([test -n "$internal_prrte_CPPFLAGS"],
152152
[OPAL_SUBDIR_ENV_APPEND([CPPFLAGS], [$internal_prrte_CPPFLAGS])])
153+
154+
clean_ac_configure_args=$ac_configure_args
155+
OPAL_3RDPARTY_PREP_CONFIGURE_ARGS([prrte], [$ac_configure_args], [opal_prrte_configure_args])
156+
ac_configure_args=$opal_prrte_configure_args
153157
PAC_CONFIG_SUBDIR_ARGS([3rd-party/prrte], [$internal_prrte_args],
154158
[[--with-libevent=internal], [--with-hwloc=internal],
155159
[--with-libevent=external], [--with-hwloc=external],
156160
[--with-pmix=internal], [--with-pmix=external],
157161
[--with-platform=[[^ ]]*]],
158162
[], [internal_prrte_happy="no"])
163+
ac_configure_args=$clean_ac_configure_args
164+
159165
OPAL_SUBDIR_ENV_RESTORE([opal_prrte_configure])
160166
OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS prrte"
161167

config/opal_config_3rdparty.m4

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dnl Copyright (c) 2015-2018 Research Organization for Information Science
66
dnl and Technology (RIST). All rights reserved.
77
dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights
88
dnl reserved.
9+
dnl Copyright (c) 2021 IBM Corporation. All rights reserved.
910
dnl $COPYRIGHT$
1011
dnl
1112
dnl Additional copyrights may follow
@@ -81,3 +82,49 @@ AC_DEFUN([OPAL_3RDPARTY_WITH], [
8182
[AC_MSG_WARN([Invalid argument to --with-$1: internal.])
8283
AC_MSG_ERROR([Cannot continue])])])
8384
])
85+
86+
87+
88+
dnl OPAL_3RDPARTY_PREP_CONFIGURE_ARGS(3rd party prefix, configure arguments)
89+
dnl
90+
dnl $2 will contain a list of configure options to be processed. At the end of
91+
dnl this macro, $3 will contain a version of the list in $2 with all of the
92+
dnl options prefixed with the string in "-$1" having the "-$1" removed.
93+
dnl
94+
dnl For example, if $1=bar and $2 has '--with-bar-abc' then $3 will replace
95+
dnl that entry in the list with the string '--with-abc' in that sam location
96+
dnl in the list.
97+
dnl
98+
dnl This macro is helpful when the user facing configure argument has a
99+
dnl 3rd party prefix to the configure variable and we need to strip off that
100+
dnl prefix before passing it to the targeted 3rd party project.
101+
dnl
102+
dnl $1: 3rd party prefix
103+
dnl $2: configure arguments
104+
dnl $3: Output variable to set
105+
dnl
106+
AC_DEFUN([OPAL_3RDPARTY_PREP_CONFIGURE_ARGS], [
107+
$3=""
108+
eval "set x $2"
109+
shift
110+
for _conf_arg
111+
do
112+
case $_conf_arg in
113+
--with-$1-*)
114+
_conf_arg=`AS_ECHO(["$_conf_arg"]) | sed "s/--with-$1/--with/"`
115+
;;
116+
--without-$1-*)
117+
_conf_arg=`AS_ECHO(["$_conf_arg"]) | sed "s/--without-$1/--without/"`
118+
;;
119+
--enable-$1-*)
120+
_conf_arg=`AS_ECHO(["$_conf_arg"]) | sed "s/--enable-$1/--enable/"`
121+
;;
122+
--disable-$1-*)
123+
_conf_arg=`AS_ECHO(["$_conf_arg"]) | sed "s/--disable-$1/--disable/"`
124+
;;
125+
*)
126+
;;
127+
esac
128+
AS_VAR_APPEND([$3], [" '$_conf_arg'"])
129+
done
130+
])

config/opal_config_hwloc.m4

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dnl and Technology (RIST). All rights reserved.
66
dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights
77
dnl reserved.
88
dnl Copyright (c) 2020 Intel, Inc. All rights reserved.
9+
dnl Copyright (c) 2021 IBM Corporation. All rights reserved.
910
dnl $COPYRIGHT$
1011
dnl
1112
dnl Additional copyrights may follow
@@ -156,8 +157,14 @@ AC_DEFUN([_OPAL_CONFIG_HWLOC_INTERNAL], [
156157
# constant in autogen.pl.
157158
OPAL_EXPAND_TARBALL([3rd-party/hwloc_tarball], [3rd-party/hwloc_directory], [configure])
158159
OPAL_SUBDIR_ENV_CLEAN([opal_hwloc_configure])
160+
161+
clean_ac_configure_args=$ac_configure_args
162+
OPAL_3RDPARTY_PREP_CONFIGURE_ARGS([hwloc], [$ac_configure_args], [opal_hwloc_configure_args])
163+
ac_configure_args=$opal_hwloc_configure_args
159164
PAC_CONFIG_SUBDIR_ARGS([3rd-party/hwloc_directory], [], [[--enable-debug]],
160165
[subconfig_happy=1], [subconfig_happy=0])
166+
ac_configure_args=$clean_ac_configure_args
167+
161168
OPAL_SUBDIR_ENV_RESTORE([opal_hwloc_configure])
162169
163170
AS_IF([test "$subconfig_happy" = "1"],

config/opal_config_libevent.m4

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dnl Copyright (c) 2015-2018 Research Organization for Information Science
66
dnl and Technology (RIST). All rights reserved.
77
dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights
88
dnl reserved.
9+
dnl Copyright (c) 2021 IBM Corporation. All rights reserved.
910
dnl $COPYRIGHT$
1011
dnl
1112
dnl Additional copyrights may follow
@@ -184,9 +185,15 @@ AC_DEFUN([_OPAL_CONFIG_LIBEVENT_INTERNAL], [
184185
# some of the warning options cause failures with compilers that
185186
# fake being GCC (I'm looking at you, PGI).
186187
OPAL_SUBDIR_ENV_CLEAN([opal_libevent_configure])
188+
189+
clean_ac_configure_args=$ac_configure_args
190+
OPAL_3RDPARTY_PREP_CONFIGURE_ARGS([libevent], [$ac_configure_args], [opal_libevent_configure_args])
191+
ac_configure_args=$opal_libevent_configure_args
187192
PAC_CONFIG_SUBDIR_ARGS([3rd-party/libevent_directory],
188193
[--disable-dns --disable-http --disable-rpc --disable-openssl --enable-thread-support --disable-evport --disable-gcc-warnings --disable-libevent-regress],
189194
[], [subconfig_happy=1], [subconfig_happy=0])
195+
ac_configure_args=$clean_ac_configure_args
196+
190197
OPAL_SUBDIR_ENV_RESTORE([opal_libevent_configure])
191198
192199
AS_IF([test "$subconfig_happy" = "1"],

config/opal_config_pmix.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,17 @@ AC_DEFUN([OPAL_CONFIG_PMIX], [
9595
OPAL_SUBDIR_ENV_CLEAN([opal_pmix_configure])
9696
AS_IF([test -n "$internal_pmix_CPPFLAGS"],
9797
[OPAL_SUBDIR_ENV_APPEND([CPPFLAGS], [$internal_pmix_CPPFLAGS])])
98+
99+
clean_ac_configure_args=$ac_configure_args
100+
OPAL_3RDPARTY_PREP_CONFIGURE_ARGS([pmix], [$ac_configure_args], [opal_pmix_configure_args])
101+
ac_configure_args=$opal_pmix_configure_args
98102
PAC_CONFIG_SUBDIR_ARGS([3rd-party/openpmix], [$internal_pmix_args],
99103
[[--with-libevent=internal], [--with-hwloc=internal],
100104
[--with-libevent=external], [--with-hwloc=external],
101105
[--with-pmix=[[^ ]]*], [--with-platform=[[^ ]]*]],
102106
[internal_pmix_happy=1])
107+
ac_configure_args=$clean_ac_configure_args
108+
103109
OPAL_SUBDIR_ENV_RESTORE([opal_pmix_configure])
104110
OPAL_3RDPARTY_DIST_SUBDIRS="$OPAL_3RDPARTY_DIST_SUBDIRS openpmix"])
105111

0 commit comments

Comments
 (0)