From 8bac19a89f338e7fd0b3304c88e2544df0a1a3e8 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 13 May 2003 11:54:44 -0500 Subject: [svn-r6858] Purpose: Bug Fix Description: Some compilers aren't happy if you specify the same library multiple times when linking. This caused HDF5 Lite to crash during tests on Kelgia Solution: Modified the script so that the shared libraries are specified only once for the commandline. Platforms tested: Kelgia (small fix). Misc. update: --- tools/misc/h5cc.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in index fc7d1fc..f0c1282 100755 --- a/tools/misc/h5cc.in +++ b/tools/misc/h5cc.in @@ -40,6 +40,7 @@ prog_name="`basename $0`" allargs="" compile_args="" +libraries="" link_args="" link_objs="" clibpath="" @@ -154,7 +155,7 @@ for arg in $@ ; do do_link="no" ;; -l*) - link_args="$link_args $arg" + libraries="$libraries $arg" allargs="$allargs $arg" ;; -prefix=*) @@ -243,7 +244,18 @@ if test "x$do_link" = "xyes"; then shared_link="${flag}${libdir}" fi - link_args="$link_args -L${libdir} -lhdf5" + libraries="-lhdf5 $libraries" + link_args="$link_args -L${libdir}" + + for l in $libraries; do + case "$link_args" in + *$l*) + ;; + *) + link_args="$link_args $l" + ;; + esac + done else link_args="$link_args ${libdir}/libhdf5.a" fi -- cgit v0.12