summaryrefslogtreecommitdiffstats
path: root/fortran/src/h5fc.in
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2005-01-18 23:52:17 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2005-01-18 23:52:17 (GMT)
commitf94c6a56ec3ff618480d2a3a891e5dc28366ffb1 (patch)
tree1d5516d181592e5d1e3e8a5d6f52b1eab0a21059 /fortran/src/h5fc.in
parentfe1fe98f622febb584cd2270763ede1240d63e8a (diff)
downloadhdf5-f94c6a56ec3ff618480d2a3a891e5dc28366ffb1.zip
hdf5-f94c6a56ec3ff618480d2a3a891e5dc28366ffb1.tar.gz
hdf5-f94c6a56ec3ff618480d2a3a891e5dc28366ffb1.tar.bz2
[svn-r9833] Purpose: Bug fix
Description: h5fc couldn't create object files Solution: Brought fixes from 1.6 to 1.7 Platforms tested: arabica Misc. update:
Diffstat (limited to 'fortran/src/h5fc.in')
-rwxr-xr-xfortran/src/h5fc.in69
1 files changed, 37 insertions, 32 deletions
diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in
index 145ae57..0d24a92 100755
--- a/fortran/src/h5fc.in
+++ b/fortran/src/h5fc.in
@@ -169,42 +169,51 @@ for arg in $@ ; do
qarg='\"'"$arg"'\"'
allargs="$allargs $qarg"
;;
- *)
- allargs="$allargs $qarg"
- if test -s "$arg"; then
- ext=`expr "$arg" : '.*\(\..*\)'`
-
- if test "x$ext" = "x.c"; then
- do_compile="yes"
- compile_args="$compile_args $arg"
- fname=`basename $arg .c`
- link_objs="$link_objs $fname.o"
- elif test "x$ext" = "x.o"; then
- if test "x$dash_c" = "xyes"; then
- compile_args="$compile_args $arg"
- else
- do_link="yes"
- link_objs="$link_objs $arg"
- fi
- else
- compile_args="$compile_args $arg"
- link_args="$link_args $arg"
- fi
- else
- compile_args="$compile_args $arg"
- link_args="$link_args $arg"
- fi
- ;;
+ *) allargs="$allargs $arg"
+ if [ -s "$arg" ] ; then
+ ext=`expr "$arg" : '.*\(\..*\)'`
+ if [ "$ext" = ".f" -o "$ext" = ".F" -o "$ext" = ".f90" -o \
+ "$ext" = ".for" -o "$ext" = ".FOR" -o "$ext" = ".F90" ] ; then
+ do_compile="yes"
+ compile_args="$compile_args $arg"
+ fname=`basename $arg $ext`
+ link_objs="$link_objs $fname.o"
+ elif [ "$ext" = ".o" ] ; then
+ if test "x$dash_c" = "xyes" ; then
+ compile_args="$compile_args $arg"
+ else
+ do_link="yes"
+ link_objs="$link_objs $arg"
+ fi
+ elif test "x$ext" = "x.a"; then
+ # This is an archive that we're linking in
+ libraries=" $libraries $arg "
+ else
+ compile_args="$compile_args $arg"
+ link_args="$link_args $arg"
+ fi
+ else
+ compile_args="$compile_args $arg"
+ link_args="$link_args $arg"
+ fi
+ ;;
esac
done
+# It's possible that there isn't a modules flag...
+ fmodules=""
+ if test -n "$F9XMODFLAG"; then
+ fmodules="${F9XMODFLAG}${libdir}"
+ fi
+
if test "x$do_compile" = "xyes"; then
if test "x$dash_c" != "xyes"; then
compile_args="-c $compile_args"
fi
- $SHOW $FC $FFLAGS ${F9XSUFFIXFLAG} $compile_args
+
+ $SHOW $FC $FFLAGS ${F9XSUFFIXFLAG} ${fmodules} $compile_args
status=$?
if test "$status" != "0"; then
@@ -212,12 +221,8 @@ if test "x$do_compile" = "xyes"; then
fi
fi
+
if test "x$do_link" = "xyes"; then
- # It's possible that there isn't a modules flag...
- fmodules=""
- if test -n "$F9XMODFLAG"; then
- fmodules="${F9XMODFLAG}${libdir}"
- fi
# conditionnaly link with the hl library
if test "X$HL" = "Xhl"; then