summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2017-07-28 18:33:01 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2017-07-28 18:33:01 (GMT)
commit823f6a133302f1d6ba904020ad092723d2657d02 (patch)
treeb79b6c63cac5e3636afd02138ee6020ed71cce92
parent6e03d114c2dd0e21b509034cbc02226639e6ede7 (diff)
parent668b90b96dcb237208dcedd63e0f2b7da8a0328c (diff)
downloadhdf5-823f6a133302f1d6ba904020ad092723d2657d02.zip
hdf5-823f6a133302f1d6ba904020ad092723d2657d02.tar.gz
hdf5-823f6a133302f1d6ba904020ad092723d2657d02.tar.bz2
Merge pull request #619 in HDFFV/hdf5 from ~BRTNFLD/hdf5_msb:develop to develop
* commit '668b90b96dcb237208dcedd63e0f2b7da8a0328c': Rearranged where the substitution occurs.
-rw-r--r--configure.ac37
1 files changed, 25 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 45bd4d1..47f5897 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3339,14 +3339,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).
@@ -3358,7 +3350,6 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
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
@@ -3504,13 +3495,35 @@ AC_CONFIG_COMMANDS([.classes], [], [$MKDIR_P java/src/.classes;
AC_OUTPUT
chmod 755 tools/src/misc/h5cc
-if test "X$HDF_FORTRAN" = "Xyes"; then
- chmod 755 fortran/src/h5fc
-fi
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.