summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorM. Scot Breitenfeld <brtnfld@hdfgroup.org>2017-07-27 16:32:21 (GMT)
committerM. Scot Breitenfeld <brtnfld@hdfgroup.org>2017-07-27 16:32:21 (GMT)
commitbe5257f8766e5be1ceacee3260b4b52b499983f6 (patch)
tree67840b15627280d10ad7ae37ad7d79247c069693 /configure.ac
parent972beffb59f0f2ec15cd3829b5ae1cbfd8d0793f (diff)
downloadhdf5-be5257f8766e5be1ceacee3260b4b52b499983f6.zip
hdf5-be5257f8766e5be1ceacee3260b4b52b499983f6.tar.gz
hdf5-be5257f8766e5be1ceacee3260b4b52b499983f6.tar.bz2
libtool does not pass the correct argument linking (-WL,-WL,,) for the
NAG Fortran compiler on Linux (other OSs have not been tested). Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to wl="-Wl,-WL,," in the libtool file. (HDFFV-10037)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac44
1 files changed, 32 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 163f6d3..fe999ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3338,6 +3338,38 @@ else
STATIC_SHARED="none"
fi
+if test "X$HDF_FORTRAN" = "Xyes"; then
+ chmod 755 fortran/src/h5fc
+ ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler
+ ## on OS X, which is needed when building shared libraries on OS X. This script
+ ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772)
+ case "`uname`" in
+ Darwin*)
+ cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool
+ ;;
+ esac
+
+ ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler
+ ### on Linux (other OSs have not been tested).
+ ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to
+ ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037)
+ case "`uname`" in
+ Linux*)
+
+ fortran_linux_linker_option="-Wl,"
+
+ if (grep -i 'NAG_Fortran' libtool > /dev/null); then
+ cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool
+ fortran_linux_linker_option="-Wl,-Wl,,"
+ fi
+
+ ## Set the correct linker option for use in h5fc.in markup
+ AC_SUBST([fortran_linux_linker_option])
+ ;;
+ esac
+
+fi
+
## ----------------------------------------------------------------------
## Set a macro if shared library is enabled.
##
@@ -3474,18 +3506,6 @@ AC_OUTPUT
chmod 755 tools/src/misc/h5cc
-if test "X$HDF_FORTRAN" = "Xyes"; then
- chmod 755 fortran/src/h5fc
- ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler
- ## on OS X, which is needed when building shared libraries on OS X. This script
- ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772)
- case "`uname`" in
- Darwin*)
- cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool
- ;;
- esac
-fi
-
if test "X$HDF_CXX" = "Xyes"; then
chmod 755 c++/src/h5c++
fi