Skip to content
Snippets Groups Projects
Commit ae5d81bd authored by Sergey Kosukhin's avatar Sergey Kosukhin Committed by Thomas Jahns
Browse files

configure: Add NAG patches for libtool 2.4.2.

parent 64742cf8
No related branches found
No related tags found
No related merge requests found
......@@ -97,8 +97,10 @@ EXTRA_DIST = util/sunf95preproc-wrapper \
contrib/03ltmain-ld-groups-patch/ltmain-ld-groups-libtool-2.4.2.patch \
contrib/04ltmain-xlinker-patch/README \
contrib/04ltmain-xlinker-patch/ltmain-xlinker-patch.patch \
contrib/05macos-nagfor-patch/macos-nagfor-libtool-2.4.2.patch \
contrib/05macos-nagfor-patch/macos-nagfor.patch \
contrib/06ltmain_nag_pthread-patch/ltmain_nag_pthread.patch \
contrib/06ltmain_nag_pthread-patch/ltmain_nag_pthread-libtool-2.4.2.patch \
contrib/07ltmain-early-xcompile-patch/README \
contrib/07ltmain-early-xcompile-patch/ltmain-early-xcompile-libtool-2.4.6.patch \
contrib/08ltmain-parallel-printf-patch/ltmain-parallel-printf-libtool-2.4.2.patch \
......
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -7480,6 +7480,15 @@ func_mode_link ()
minor_current=$func_arith_result
xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ # On Darwin other compilers
+ case $with_nagfor in
+ yes)
+ verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+ ;;
+ *)
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+ esac
;;
freebsd-aout)
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -6490,6 +6490,12 @@ func_mode_link ()
# Convert "-framework foo" to "foo.ltframework"
if test -n "$inherited_linker_flags"; then
tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+
+ # Additionally convert " -pthread" to " -Wl,-pthread" for nagfor
+ if test yes = "$with_nagfor" ; then
+ tmp_inherited_linker_flags=`$ECHO " $tmp_inherited_linker_flags " | $SED 's/ -pthread[[:blank:]]/ -Wl,-pthread /g'`
+ fi
+
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
@@ -8084,6 +8090,20 @@ EOF
;;
esac
+ # Time to revert the changes made for nagfor. This might be required if
+ # we need to make the output '*.la' file to be correctly interpreted for
+ # gcc (e.g. the output library that we are linking now with nagfor needs
+ # to be linked by gcc later). In this case, the libtool script of a
+ # package that will try to link our library will have to make similar
+ # non-standard nagfor-specific modifications of the '-pthread' flag.
+ # Thus, if we are creating a Fortran library for nagfor only, it is
+ # better not to revert the changes, otherwise, uncomment the following
+ # lines.
+
+ if test yes = "$with_nagfor" ; then
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags " | $SED 's/ -Wl,-pthread / -pthread /g;s/^ *//;s/ *$//'`
+ fi
+
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=
......@@ -92,8 +92,8 @@ case "$libtoolversion" in
contrib/02nagfor53-shared-patch/nagfor53-shared.patch \
contrib/03ltmain-ld-groups-patch/ltmain-ld-groups-libtool-2.4.2.patch \
contrib/04ltmain-xlinker-patch/ltmain-xlinker-patch.patch \
contrib/05macos-nagfor-patch/macos-nagfor.patch \
contrib/06ltmain_nag_pthread-patch/ltmain_nag_pthread.patch \
contrib/05macos-nagfor-patch/macos-nagfor-libtool-2.4.2.patch \
contrib/06ltmain_nag_pthread-patch/ltmain_nag_pthread-libtool-2.4.2.patch \
contrib/08ltmain-parallel-printf-patch/ltmain-parallel-printf-libtool-2.4.2.patch)
;;
esac
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment