Commit fe5f93f6 authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

update/replace a subset of m4 macros and Libtool patches (copy from the YAXT project)

parent 8f7bccf9
#!/bin/sh
autoreconf -fvi || exit $?
patch -p 1 --no-backup-if-mismatch --forward -r - -i patch/libtool.m4.arg_spaces.patch -d .
# The program 'patch' exits with exitcode=1 if the patch has already been applied.
# Consider this a normal scenario:
exitcode=$?; if test $exitcode -ne 0 && test $exitcode -ne 1; then exit $exitcode; fi
patch -p 1 --no-backup-if-mismatch --forward -r - -i patch/libtool.m4.nag_wrapper.patch -d .
exitcode=$?; if test $exitcode -ne 0 && test $exitcode -ne 1; then exit $exitcode; fi
# Patch libtool.m4:
for patch in \
; do
echo "applying $patch"
patch -p 1 --no-backup-if-mismatch --forward -r - -i $patch -d .
# The program 'patch' exits with exitcode=1 if the patch has already been applied.
# Consider this a normal scenario:
exitcode=$?; if test $exitcode -ne 0 && test $exitcode -ne 1; then exit $exitcode; fi
done
autoconf -f || exit $?
# Reset libtool.m4 timestamps to avoid confusing make
touch -r m4/ltversion.m4 m4/libtool.m4 || exit $?
# The following is not needed as long as we do not patch libtool.m4:
# autoconf -f || exit $?
# # Reset libtool.m4 timestamps to avoid confusing make:
# touch -r m4/ltversion.m4 m4/libtool.m4 || exit $?
patch -p 1 --no-backup-if-mismatch --forward -r - -i patch/ltmain.sh.nag_pthread.patch -d .
exitcode=$?; if test $exitcode -ne 0 && test $exitcode -ne 1; then exit $exitcode; fi
# Patch the rest of the files:
for patch in \
contrib/00nagfor-libtool-patch/nagfor-libtool-2.4.6.patch \
contrib/05macos-nagfor-patch/macos-nagfor.patch \
contrib/06ltmain_nag_pthread-patch/ltmain_nag_pthread.patch \
; do
echo "applying $patch"
patch -p 1 --no-backup-if-mismatch --forward -r - -i $patch -d .
exitcode=$?; if test $exitcode -ne 0 && test $exitcode -ne 1; then exit $exitcode; fi
done
This patch is needed so that -Wl,-rpath option arguments make it into
the dependent libraries of a library and also ensures that -Wl,-Wl,,
options are passed to the compiler unaltered.
It is intended for libtool 2.4.2 and can be applied after
e.g. autoreconf by
$ patch -p1 <contrib/nagfor-libtool-patch/nagfor-libtool.patch
--- a/config/ltmain.sh 2012-06-12 00:20:43.000000000 +0200
+++ b/config/ltmain.sh 2014-08-19 16:34:48.161235251 +0200
@@ -3229,6 +3229,25 @@
test "$opt_mode" = install && func_mode_install ${1+"$@"}
+func_add2xrpath ()
+{
+ dir="$1"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+}
# func_generate_dlsyms outputname originator pic_p
# Extract symbols from dlprefiles and create ${outputname}S.o with
@@ -5727,20 +5746,7 @@
func_stripname '-R' '' "$arg"
dir=$func_stripname_result
# We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
+ func_add2xrpath "$dir"
continue
;;
@@ -5801,18 +5807,58 @@
;;
-Wl,*)
+ wlprefix=`expr x"$wl" : '.*' - 1`
+ wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
+ if test x"$wlprefix" = x"$wl" -a x"$wl" != x"-Wl,"; then
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ if expr "x$arg" : '^x'"$wl"'-rpath,,' >/dev/null ; then
+ func_stripname "$wl"'-rpath,,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ elif expr "x$arg" : '^x'"$wl"'-rpath$' >/dev/null ; then
+ func_stripname "$wl" '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x'"$wl" >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error "$wl"'-rpath must be followed by '"$wl"'-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ else
+ func_stripname "$wl" '' "$arg"
+ func_append new_inherited_linker_flags " -Wl,$func_stripname_result"
+ fi
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath,' >/dev/null ; then
+ func_stripname '-Wl,-rpath,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath$' >/dev/null ; then
+ func_stripname '-Wl,' '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x-Wl,' >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error '-Wl,-rpath must be followed by -Wl-escaped directory'
+ fi
+ func_quote_for_eval "$1"
+ func_append libtool_args " $func_quote_for_eval_result"
+ shift
+ func_add2xrpath "$dir"
+ continue
+ fi
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for flag in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_quote_for_eval "$flag"
func_append arg " $wl$func_quote_for_eval_result"
func_append compiler_flags " $wl$func_quote_for_eval_result"
func_append linker_flags " $func_quote_for_eval_result"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
@@ -9515,6 +9562,10 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,*)
+ func_stripname -Wl, '' "$deplib"
+ func_append new_libs " $wl$func_stripname_result"
+ ;;
*) func_append new_libs " $deplib" ;;
esac
done
@@ -10247,6 +10298,10 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,*)
+ func_stripname -Wl, '' "$deplib"
+ func_append new_libs " $wl$func_stripname_result"
+ ;;
*) func_append new_libs " $deplib" ;;
esac
done
--- a/config/ltmain.sh 2012-06-12 00:20:43.000000000 +0200
+++ b/config/ltmain.sh 2014-08-19 16:34:48.161235251 +0200
@@ -3217,6 +3217,25 @@
}
# end func_convert_path_msys_to_cygwin
+func_add2xrpath ()
+{
+ dir="$1"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+}
# func_convert_path_nix_to_cygwin ARG
# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
@@ -7147,20 +7166,7 @@
func_stripname '-R' '' "$arg"
dir=$func_stripname_result
# We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
+ func_add2xrpath "$dir"
continue
;;
@@ -7221,6 +7227,49 @@
;;
-Wl,*)
+ wlprefix=`expr x"$wl" : '.*' - 1`
+ wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
+ if test x"$wlprefix" = x"$wl" -a x"$wl" != x"-Wl,"; then
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ if expr "x$arg" : '^x'"$wl"'-rpath,,' >/dev/null ; then
+ func_stripname "$wl"'-rpath,,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ elif expr "x$arg" : '^x'"$wl"'-rpath$' >/dev/null ; then
+ func_stripname "$wl" '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x'"$wl" >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error "$wl"'-rpath must be followed by '"$wl"'-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ else
+ func_stripname "$wl" '' "$arg"
+ func_append new_inherited_linker_flags " -Wl,$func_stripname_result"
+ fi
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath,' >/dev/null ; then
+ func_stripname '-Wl,-rpath,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath$' >/dev/null ; then
+ func_stripname '-Wl,' '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x-Wl,' >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error '-Wl,-rpath must be followed by -Wl-escaped directory'
+ fi
+ func_quote_for_eval "$1"
+ func_append libtool_args " $func_quote_for_eval_result"
+ shift
+ func_add2xrpath "$dir"
+ continue
+ fi
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
@@ -9515,6 +9562,10 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,*)
+ func_stripname -Wl, '' "$deplib"
+ func_append new_libs " $wl$func_stripname_result"
+ ;;
*) func_append new_libs " $deplib" ;;
esac
done
@@ -10247,6 +10298,10 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,*)
+ func_stripname -Wl, '' "$deplib"
+ func_append new_libs " $wl$func_stripname_result"
+ ;;
*) func_append new_libs " $deplib" ;;
esac
done
--- a/config/ltmain.sh 2012-06-12 00:20:43.000000000 +0200
+++ b/config/ltmain.sh 2014-08-19 16:34:48.161235251 +0200
@@ -3229,6 +3229,25 @@
test "$opt_mode" = install && func_mode_install ${1+"$@"}
+func_add2xrpath ()
+{
+ dir="$1"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+}
# func_generate_dlsyms outputname originator pic_p
# Extract symbols from dlprefiles and create ${outputname}S.o with
@@ -5727,20 +5746,7 @@
func_stripname '-R' '' "$arg"
dir=$func_stripname_result
# We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
+ func_add2xrpath "$dir"
continue
;;
@@ -5801,18 +5807,58 @@
;;
-Wl,*)
+ wlprefix=`expr x"$wl" : '.*' - 1`
+ wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
+ if test x"$wlprefix" = x"$wl" -a x"$wl" != x"-Wl,"; then
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ if expr "x$arg" : '^x'"$wl"'-rpath,,' >/dev/null ; then
+ func_stripname "$wl"'-rpath,,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ elif expr "x$arg" : '^x'"$wl"'-rpath$' >/dev/null ; then
+ func_stripname "$wl" '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x'"$wl" >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error "$wl"'-rpath must be followed by '"$wl"'-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ else
+ func_append new_inherited_linker_flags " $arg"
+ fi
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath,' >/dev/null ; then
+ func_stripname '-Wl,-rpath,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath$' >/dev/null ; then
+ func_stripname '-Wl,' '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x-Wl,' >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error '-Wl,-rpath must be followed by -Wl-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ fi
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for flag in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_quote_for_eval "$flag"
func_append arg " $wl$func_quote_for_eval_result"
func_append compiler_flags " $wl$func_quote_for_eval_result"
func_append linker_flags " $func_quote_for_eval_result"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -8903,7 +8903,8 @@ func_mode_link ()
--- a/config/ltmain.sh 2019-10-18 09:59:55.967567005 +0200
+++ b/config/ltmain.sh 2019-10-18 10:00:11.403887362 +0200
@@ -8958,8 +8958,8 @@
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 $CC in
+ func_cc_basename $CC
+ case $func_cc_basename_result in
nagfor*)
- nagfor*)
+ case $with_nagfor in
+ yes)
verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
;;
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -118,6 +118,12 @@ func_cc_basename ()
esac
done
func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+ # Set result to 'nagfor-wrapper' when NAG compiler is called via a wrapper (e.g. mpif90).
+ case $func_cc_basename_result in
+ nagfor*) ;;
+ *) $cc_temp -V 2>&1 | $GREP '^NAG Fortran Compiler Release' >/dev/null 2>&1 && func_cc_basename_result='nagfor-wrapper' ;;
+ esac
}
])# _LT_PREPARE_CC_BASENAME
*)
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -7862,6 +7862,13 @@ func_mode_link ()
@@ -7936,6 +7936,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
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*) tmp_inherited_linker_flags=`$ECHO "$tmp_inherited_linker_flags" | $SED 's/ -pthread/ -Wl,-pthread/g'` ;;
+ esac
+ if test yes = $with_nagfor ; then
+ tmp_inherited_linker_flags=`$ECHO " $tmp_inherited_linker_flags" | $SED 's/ -pthread\b/ -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 "*) ;;
@@ -9493,6 +9500,22 @@ EOF
@@ -9570,6 +9577,20 @@ EOF
;;
esac
......@@ -28,12 +27,19 @@
+ # better not to revert the changes, otherwise, uncomment the following
+ # lines.
+
+ func_cc_basename $CC
+ case $func_cc_basename_result in
+ nagfor*)
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% -Wl,-pthread% -pthread%g'` ;;
+ esac
+ if test yes = $with_nagfor ; then
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's/ -Wl,-pthread\b/ -pthread/g;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=
@@ -10328,6 +10348,8 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,-pthread)
+ func_append new_libs " $deplib" ;;
-Wl,*)
func_stripname -Wl, '' "$deplib"
func_append new_libs " $wl$func_stripname_result"
......@@ -38,7 +38,9 @@ dnl _ACX_LT_FLAGS_MANGLE
m4_define([nag_filter_flag_var],
[AS_IF([test x${$1+set} = xset],
[$1=`echo "$][$1" | tr ' ' '\n' | sed -e '/^-W@<:@lc@:>@/{' \
-e 's/^\(-Wl\)/-XCClinker \1/;s/^\(-Wc\)/-Xcompiler \1/' -e '}' | tr '\n' ' '`])])
-e 's/^\(-Wl\)/-XCClinker \1/;s/^\(-Wc,\)/-Xcompiler \1/' \
-e 's/^\(-Wc=.*\)/-Xcompiler \1 -XCClinker \1/' -e '}' \
| tr '\n' ' ' | sed -e 's/ $//'`])])
AC_DEFUN([_ACX_LT_FORT_FLAGS_MANGLE],
[_AC_FORTRAN_ASSERT
AC_LANG_CASE([Fortran],
......@@ -49,7 +51,7 @@ AC_DEFUN([_ACX_LT_FORT_FLAGS_MANGLE],
[AS_VAR_PUSHDEF([acx_FC],[F77])dnl
AS_VAR_PUSHDEF([acx_FCFLAGS],[FFLAGS])dnl
AS_VAR_PUSHDEF([acx_LDFLAGS],[F77LDFLAGS])])
acx_temp=`$acx_FC -V 2>&1 | sed 5q`
acx_temp=`$acx_FC -V 2>&1 | sed -n 1,5p`
dnl fix problems from NAG compiler
AS_CASE(["$acx_temp"],
[*NAG\ Fortran\ Compiler\ Release*],
......@@ -74,16 +76,19 @@ AC_DEFUN([ACX_USE_LIBTOOL_CONFIGURATION],
dnl add some monkey patching for older libtool versions that don't handle
dnl newer PGI or NAG configurations particularly well
m4_if(m4_cmp(m4_version_compare(LT_PACKAGE_VERSION,[2.4.6]),1),-1,
[m4_pushdef([_LT_COMPILER_PIC],m4_bpatsubst(m4_dquote(m4_defn([_LT_COMPILER_PIC])),[;;
[m4_pushdef([_LT_COMPILER_PIC],m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(m4_defn([_LT_COMPILER_PIC])),[;;
\*Portland\\ ],[;; @%:@(
*NAG\\ Fortran\\ Compiler*)
_LT_TAGVAR(lt_prog_compiler_wl, $][1)='-Wl,-Wl,,'
_LT_TAGVAR(lt_prog_compiler_pic, $][1)='-PIC'
_LT_TAGVAR(lt_prog_compiler_static, $][1)='-Bstatic'
;;
*PGI\\ Compilers\\ and\\ Tools*|*Port][land\\ ]))dnl
m4_pushdef([_LT_LINKER_SHLIBS],m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(
m4_bpatsubst(m4_dquote(m4_defn(
*PGI\\ Compilers\\ and\\ Tools*|*NVIDIA\\ Compilers\\ and\\ Tools*|*Port][land\\ ])),[sed 5q`],[sed -n 1,5p`]))dnl
m4_pushdef([_LT_LANG_CXX_CONFIG],m4_bpatsubst(m4_dquote(m4_defn([_LT_LANG_CXX_CONFIG])),
[sed 5q`],[sed -n 1,5p`]))dnl
m4_pushdef([_LT_LINKER_SHLIBS],m4_bpatsubst(m4_dquote(
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(m4_defn(
[_LT_LINKER_SHLIBS])),[tmp_sharedflag='-shared'],
[tmp_sharedflag='-shared'
tmp_compiler_flags='$compiler_flags'])),
......@@ -91,36 +96,72 @@ dnl newer PGI or NAG configurations particularly well
[$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs '"$tmp_compiler_flags"' $wl-soname])),
[ tmp_sharedflag='-Wl,-shared'],
[ tmp_sharedflag='-Wl,-shared'
tmp_compiler_flags='`echo \$compiler_flags | sed -e '"'"'s/ -W@<:@cl@:>@,-no-pie\\b//g'"'"'`']))dnl
tmp_compiler_flags='`echo \$compiler_flags | sed -e '"'"'s/ -W@<:@cl@:>@,-no-pie\\b//g'"'"'`'])),
[\*Sun\\ F\*\(.\)[ ]*# Sun Fortran 8\.3
[ ]*tmp_sharedflag='-G' ;;
],[\& *NAG\\ Fortran\\ Compiler*\1
tmp_sharedflag='-Wl,-shared'
tmp_compiler_flags='`echo \$compiler_flags | sed -e '"'"'s/ -W@<:@cl@:>@,-no-pie\\b//g'"'"'`' ;;
])),[sed 5q`],[sed -n 1,5p`]))dnl
m4_pushdef([_LT_SYS_HIDDEN_LIBDEPS],[AS_UNSET([output_verbose_link_cmd])]
m4_bpatsubst(m4_dquote(
m4_defn([_LT_SYS_HIDDEN_LIBDEPS])),[test x-\([LR]\) = "\$p"],
[test x-\1 = x"$p"]))])dnl
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(
m4_defn([_LT_SYS_HIDDEN_LIBDEPS])),[test x-\([LR]\) = "\$p"],
[test x-\1 = x"$p"])),
[test x-R = x"\$p"],[\& ||
test x-l = x"$p"]))])dnl
m4_foreach([acx_ltconfig],[[[_LT_LANG_C_CONFIG]],[[_LT_LANG_F77_CONFIG]],[[_LT_LANG_FC_CONFIG]]],
[m4_pushdef(acx_ltconfig,m4_bpatsubst(m4_dquote(
m4_bpatsubst(m4_dquote(m4_defn(acx_ltconfig)),[_LT_TAG_COMPILER
],
[\& _LT_TAGDECL([with_nagfor], [acx_is_nagfor], [0], [Is the compiler the NAG Fortran compiler?])])),
[_LT_CONFIG],
[AC_MSG_CHECKING([whether this is the NAG Fortran compiler])
$CC -V 2>&1 | grep '^NAG Fortran Compiler Release' >/dev/null 2>&1
_lt_result=$?
AS_IF([test $_lt_result -eq 0],[_lt_result=yes],[_lt_result=no])
AC_MSG_RESULT([$_lt_result])
_LT_TAGVAR([acx_is_nagfor], $][1)=$_lt_result
\&]))])dnl
LT_INIT([$1])
m4_popdef([_LT_LANG_F77_CONFIG])dnl
m4_popdef([_LT_LANG_FC_CONFIG])dnl
m4_popdef([_LT_LANG_C_CONFIG])dnl
m4_if(m4_cmp(m4_version_compare(LT_PACKAGE_VERSION,[2.4.6]),1),-1,
[m4_popdef([_LT_COMPILER_PIC])m4_popdef([_LT_LINKER_SHLIBS])dnl
m4_popdef([_LT_SYS_HIDDEN_LIBDEPS])])dnl
dnl _KPSE_USE_LIBTOOL ensures libtool is also used for configure-time tests,
dnl which deduces dependent libraries automatically
_KPSE_USE_LIBTOOL
dnl substitute -shared-intel if present
AS_FOR([acx_flag_var],[acx_flag_var_],[CFLAGS CXXFLAGS FCFLAGS F77FLAGS LDFLAGS FCLDFLAGS],
[AS_IF([eval test x\$\{acx_flag_var+set\} = xset],
[eval acx_temp="\" \$$acx_flag_var_ \""
AS_CASE([$acx_temp],[*\ -shared-intel\ *|*\ -static-intel\ *],
[acx_temp=`echo "$acx_temp" | sed -e 's/ \(-\(shared\|static\)-intel\)\b/ -Xcompiler \1 -XCClinker \1/'`])
dnl take care of ifort/icc/icpc two-part options
eval acx_flag_var=\"`echo "$acx_temp" | sed -e 's/ -\(align\|allow\|assume\|ccdefault\|check\|convert\|debug\|debug-parameters\|diag-type\|diag-enable\|diag-disable\|double-size\|dynamic-linker\|dyncom\|export-dir\|extend-source\|fp-model\|fpscomp\|gen-interfaces\|heap-arrays\|imacros\|integer-size\|iprefix\|iquote\|iwithprefixbefore\|module\|names\|opt-report\|opt-streaming-stores\|pch-dir\|pch-use\|prof-dir\|prof-file\|real-size\|reentrancy\|stand\|tcollect-filter\|tune\|warn\|watch\) \(@<:@^-@:>@@<:@^ @:>@*\)\b/ -Xcompiler -\1 -Xcompiler \2/g' -e 's/^ //;s/ $//'`\"])])
AC_PROVIDE_IFELSE([AC_PROG_CC],
[AS_IF([test -n "$CC" -a X"$CC" != Xno],
[AC_LANG_PUSH([C])
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([C])])])
AC_PROVIDE_IFELSE([AC_PROG_FC],
[AS_IF([test -n "$FC" -a X"$FC" != Xno],
[AC_LANG_PUSH([Fortran])
_ACX_LT_FORT_FLAGS_MANGLE
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([Fortran])])])
AC_PROVIDE_IFELSE([AC_PROG_F77],
[AS_IF([test -n "$F77" -a X"$F77" != Xno],
[AC_LANG_PUSH([Fortran 77])
_ACX_LT_FORT_FLAGS_MANGLE
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([Fortran 77])])])
dnl substitute -shared-intel if present
AS_FOR([acx_flag_var],[acx_flag_var_],[CFLAGS CXXFLAGS FCFLAGS F77FLAGS LDFLAGS FCLDFLAGS],
[AS_IF([eval test x\$\{acx_flag_var+set\} = xset],
[eval acx_temp="\" \$$acx_flag_var_ \""
AS_CASE([$acx_temp],[*\ -shared-intel\ *|*\ -static-intel\ *],