diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2024-01-30 18:20:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-30 18:20:58 (GMT) |
commit | 3a3501df2d35babb508fa4944690c564a43c22f5 (patch) | |
tree | 493a2480190f3019f9c359c8aa3b12f2615380d7 /bin | |
parent | 791915e92a291704393cd2e740d658f4e46a8683 (diff) | |
download | hdf5-3a3501df2d35babb508fa4944690c564a43c22f5.zip hdf5-3a3501df2d35babb508fa4944690c564a43c22f5.tar.gz hdf5-3a3501df2d35babb508fa4944690c564a43c22f5.tar.bz2 |
h5 compiler wrappers now pass all arguments passed to it to the compile line (#3954)
* The issue was that the "allargs" variable was not being used in the final command of the compiler wrapper. Any entries containing an escaped quote (\", \') or other non-matching argument (*) would not be passed to the compile line. I have fixed this problem by ensuring all arguments passed to the compiler wrapper are now included in the compile line.
* added testing for compiler wrappers
Diffstat (limited to 'bin')
-rw-r--r-- | bin/h5cc.in | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/bin/h5cc.in b/bin/h5cc.in index e3dc988..e4d4368 100644 --- a/bin/h5cc.in +++ b/bin/h5cc.in @@ -62,7 +62,7 @@ host_os="@host_os@" prog_name="`basename $0`" -allargs="" +misc_args="" compile_args="" libraries="" link_args="" @@ -202,7 +202,6 @@ for arg in $@ ; do case "$arg" in -c) - allargs="$allargs $arg" compile_args="$compile_args $arg" if test "x$do_link" = "xyes" -a -n "$output_file"; then @@ -213,7 +212,6 @@ for arg in $@ ; do dash_c="yes" ;; -o) - allargs="$allargs $arg" dash_o="yes" if test "x$dash_c" = "xyes"; then @@ -225,14 +223,12 @@ for arg in $@ ; do fi ;; -E|-M|-MT) - allargs="$allargs $arg" compile_args="$compile_args $arg" dash_c="yes" do_link="no" ;; -l*) libraries=" $libraries $arg " - allargs="$allargs $arg" ;; -prefix=*) prefix="`expr "$arg" : '-prefix=\(.*\)'`" @@ -264,14 +260,14 @@ for arg in $@ ; do ;; *\"*) qarg="'"$arg"'" - allargs="$allargs $qarg" + misc_args="$misc_args $qarg" ;; *\'*) - qarg='\"'"$arg"'\"' - allargs="$allargs $qarg" + qarg='"'"$arg"'"' + misc_args="$misc_args $qarg" ;; *) - allargs="$allargs $qarg" + misc_args="$misc_args $qarg" if test -s "$arg"; then ext=`expr "$arg" : '.*\(\..*\)'` @@ -313,7 +309,7 @@ if test "x$do_compile" = "xyes"; then compile_args="-c $compile_args" fi - $SHOW $CC -I$includedir $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $compile_args + $SHOW $CC -I$includedir $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CFLAGS $CFLAGS $misc_args $compile_args status=$? if test "$status" != "0"; then |