Skip to content

Commit 3f45ced

Browse files
ggouaillardetjsquyres
authored andcommitted
autogen.pl: patch libtool.m4 for OSX Big Sur
Thanks FX Coudert for reporting this issue and pointing to a solution. Refs. #8218 Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp> Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 159856f commit 3f45ced

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

autogen.pl

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Copyright (c) 2013 Mellanox Technologies, Inc.
66
# All rights reserved.
77
# Copyright (c) 2013-2020 Intel, Inc. All rights reserved.
8-
# Copyright (c) 2015-2019 Research Organization for Information Science
8+
# Copyright (c) 2015-2020 Research Organization for Information Science
99
# and Technology (RIST). All rights reserved.
1010
# Copyright (c) 2015-2020 IBM Corporation. All rights reserved.
1111
# Copyright (c) 2020 Amazon.com, Inc. or its affiliates.
@@ -1080,12 +1080,41 @@ sub patch_autotools_output {
10801080
# Fix consequence of broken libtool.m4
10811081
# see http://lists.gnu.org/archive/html/bug-libtool/2015-07/msg00002.html and
10821082
# https://github.com/open-mpi/ompi/issues/751
1083-
push(@verbose_out, $indent_str . "Patching configure for libtool.m4 bug\n");
1083+
push(@verbose_out, $indent_str . "Patching configure for -L/-R libtool.m4 bug\n");
10841084
# patch for libtool < 2.4.3
10851085
$c =~ s/# Some compilers place space between "-\{L,R\}" and the path.\n # Remove the space.\n if test \$p = \"-L\" \|\|/# Some compilers place space between "-\{L,-l,R\}" and the path.\n # Remove the spaces.\n if test \$p = \"-L\" \|\|\n test \$p = \"-l\" \|\|/g;
10861086
# patch for libtool >= 2.4.3
10871087
$c =~ s/# Some compilers place space between "-\{L,R\}" and the path.\n # Remove the space.\n if test x-L = \"\$p\" \|\|\n test x-R = \"\$p\"\; then/# Some compilers place space between "-\{L,-l,R\}" and the path.\n # Remove the spaces.\n if test x-L = \"x\$p\" \|\|\n test x-l = \"x\$p\" \|\|\n test x-R = \"x\$p\"\; then/g;
10881088

1089+
# Fix OS X Big Sur (11.0.x) support
1090+
# From https://lists.gnu.org/archive/html/libtool-patches/2020-06/msg00001.html
1091+
push(@verbose_out, $indent_str . "Patching configure for MacOS Big Sur libtool.m4 bug\n");
1092+
# Some versions of Libtool use ${wl} consistently, but others did
1093+
# not (e.g., they used $wl). Make the regexp be able to handle
1094+
# both. Additionally, the case string searching for 10.[012]*
1095+
# changed over time. So make sure it can handle both of the case
1096+
# strings that we're aware of.
1097+
my $WL = '(\$\{wl\}|\$wl)';
1098+
my $SOMETIMES = '(\[,.\])*';
1099+
my $search_string = 'darwin\*\) # darwin 5.x on
1100+
# if running on 10.5 or later, the deployment target defaults
1101+
# to the OS version, if on x86, and 10.4, the deployment
1102+
# target defaults to 10.4. Don\'t you love it\?
1103+
case \$\{MACOSX_DEPLOYMENT_TARGET-10.0\},\$host in
1104+
10.0,\*86\*-darwin8\*\|10.0,\*-darwin\[91\]\*\)
1105+
_lt_dar_allow_undefined=\'' . $WL . '-undefined ' . $WL . 'dynamic_lookup\' ;;
1106+
10.\[012\]' . $SOMETIMES . '\*\)
1107+
_lt_dar_allow_undefined=\'' . $WL . '-flat_namespace ' . $WL . '-undefined ' . $WL . 'suppress\' ;;
1108+
10.\*\)';
1109+
my $replace_string = 'darwin*)
1110+
# Open MPI patched for Darwin / MacOS Big Sur. See
1111+
# http://lists.gnu.org/archive/html/bug-libtool/2015-07/msg00001.html
1112+
case ${MACOSX_DEPLOYMENT_TARGET},$host in
1113+
10.[012],*|,*powerpc*)
1114+
_lt_dar_allow_undefined=\'${wl}-flat_namespace ${wl}-undefined ${wl}suppress\' ;;
1115+
*)';
1116+
$c =~ s/$search_string/$replace_string/g;
1117+
10891118
# Only write out verbose statements and a new configure if the
10901119
# configure content actually changed
10911120
return

0 commit comments

Comments
 (0)