summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorM. Scot Breitenfeld <brtnfld@hdfgroup.org>2017-07-28 14:29:11 (GMT)
committerM. Scot Breitenfeld <brtnfld@hdfgroup.org>2017-07-28 14:29:11 (GMT)
commit3558c82af4127a8b72acdae0177ce0ed5b2aeea6 (patch)
treefbd5d985b0563f88f6c7750e1937588c6504f333 /configure.ac
parentcc7badac5ea8204bf0d8f2c343c4b48810d969c0 (diff)
downloadhdf5-3558c82af4127a8b72acdae0177ce0ed5b2aeea6.zip
hdf5-3558c82af4127a8b72acdae0177ce0ed5b2aeea6.tar.gz
hdf5-3558c82af4127a8b72acdae0177ce0ed5b2aeea6.tar.bz2
Rearranged where the substitution occurs.
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.ac36
1 files changed, 26 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 5ec7210..c7bdef6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2910,14 +2910,6 @@ else
fi
if test "X$HDF_FORTRAN" = "Xyes"; then
- ## 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).
@@ -2927,9 +2919,8 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
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
@@ -3035,6 +3026,31 @@ if test "X$HDF_CXX" = "Xyes"; then
chmod 755 c++/src/h5c++
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*)
+ 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
+ fi
+ ;;
+ esac
+fi
+
## HDF5 configure code created by autotools with gcc 4.9.2 is adding problematic
## linker flags: -l with no library name; -l <libname>, specifically gfortran or m.
## This sed script corrects "-l <libname>" first and then "-l " with no library name.