Skip to content

Commit 20bfc6b

Browse files
committed
autogen: patch config/ltmain.sh in order to make NAG compiler pass the -pthread option to the linker
1 parent 544a2f1 commit 20bfc6b

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

autogen.pl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,10 +901,15 @@ sub patch_autotools_output {
901901
# enough Libtool that dosn't need this patch. But don't alarm the
902902
# user and make them think that autogen failed if this patch fails --
903903
# make the errors be silent.
904+
# Also patch ltmain.sh for NAG compiler
904905
if (-f "config/ltmain.sh") {
905906
verbose "$indent_str"."Patching PGI compiler version numbers in ltmain.sh\n";
906907
system("$patch_prog -N -p0 < $topdir/config/ltmain_pgi_tp.diff >/dev/null 2>&1");
907908
unlink("config/ltmain.sh.rej");
909+
910+
verbose "$indent_str"."Patching \"-pthread\" option for NAG compiler in ltmain.sh\n";
911+
system("$patch_prog -N -p0 < $topdir/config/ltmain_nag_pthread.diff >/dev/null 2>&1");
912+
unlink("config/ltmain.sh.rej");
908913
}
909914

910915
# If there's no configure script, there's nothing else to do.

config/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# Copyright (c) 2010 Oracle and/or its affiliates. All rights
1414
# reserved.
1515
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
16+
# Copyright (c) 2016 Research Organization for Information Science
17+
# and Technology (RIST). All rights reserved.
1618
# $COPYRIGHT$
1719
#
1820
# Additional copyrights may follow
@@ -23,6 +25,7 @@
2325
EXTRA_DIST = \
2426
distscript.sh \
2527
opal_get_version.m4sh \
28+
ltmain_nag_pthread.diff \
2629
ltmain_pgi_tp.diff \
2730
opal_mca_priority_sort.pl \
2831
find_common_syms

config/ltmain_nag_pthread.diff

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- config/ltmain.sh
2+
+++ config/ltmain.sh
3+
@@ -6417,8 +6417,14 @@
4+
func_source "$lib"
5+
6+
# Convert "-framework foo" to "foo.ltframework"
7+
+ # and "-pthread" to "-Wl,-pthread" if NAG compiler
8+
if test -n "$inherited_linker_flags"; then
9+
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
10+
+ case "$CC" in
11+
+ nagfor*)
12+
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g' | $SED 's/-pthread/-Wl,-pthread'`;;
13+
+ *)
14+
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`;;
15+
+ esac
16+
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
17+
case " $new_inherited_linker_flags " in
18+
*" $tmp_inherited_linker_flag "*) ;;

0 commit comments

Comments
 (0)