Skip to content

Commit 122eae5

Browse files
committed
configury: remove whitespace from "conftestval"-style tests
Several configure tests write integer result values to files and then do something like foo=$(cat conftestval). However, if the conftestval file contains whitespace around the integer value (e.g., if conftestval was written by a Fortran test code), then $foo will still contain that whitespace, too -- which then propagates throughout the configury and elsewhere. This commit uses xargs to strip off the whitespace. There's really only one place where this is happening that is a problem, but let's do it in all places where we foo=$(cat conftestval) with integer results, just as a matter of consistency and defensive programming. Thanks to Lisandro Dalcin for raising the issue. Signed-off-by: Jeff Squyres <jeff@squyres.com>
1 parent 77728ef commit 122eae5

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

config/ompi_fortran_check_logical_array.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ EOF
101101
[ # assume we're ok
102102
value=yes],
103103
[OPAL_LOG_COMMAND([./conftest],
104-
[if test "`cat conftestval`" = "1" ; then
104+
[if test "`cat conftestval | xargs`" = "1" ; then
105105
value=yes
106106
else
107107
value=no

config/ompi_fortran_check_real16_c_equiv.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ EOF
141141
[AC_MSG_RESULT([Error!])
142142
AC_MSG_ERROR([Can not determine if REAL*16 bit-matches C if cross compiling])],
143143
[OPAL_LOG_COMMAND([./conftest],
144-
[fortran_real16_happy=`cat conftestval`],
144+
[fortran_real16_happy=`cat conftestval | xargs`],
145145
[AC_MSG_RESULT([Error!])
146146
AC_MSG_ERROR([Could not determine if REAL*16 bit-matches C type])
147147
])

config/ompi_fortran_get_alignment.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ end program]])],
203203
[AS_IF([test "$cross_compiling" = "yes"],
204204
[AC_MSG_ERROR([Can not determine common alignment when cross-compiling])],
205205
[OPAL_LOG_COMMAND([./conftest],
206-
[AS_VAR_SET(ompi_cv_fortran_common_alignment, [`cat conftestval`])],
206+
[AS_VAR_SET(ompi_cv_fortran_common_alignment, [`cat conftestval | xargs`])],
207207
[AC_MSG_ERROR([Could not determine common alignment])])])],
208208

209209
[AC_MSG_WARN([Could not determine common alignment])

config/ompi_fortran_get_sizeof.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ EOF
7979
AS_IF([test "$cross_compiling" = "yes"],
8080
[AC_MSG_ERROR([Can not determine size of $2 when cross-compiling])],
8181
[OPAL_LOG_COMMAND([./conftest],
82-
[AS_VAR_SET(type_var, [`cat conftestval`])],
82+
[AS_VAR_SET(type_var, [`cat conftestval | xargs`])],
8383
[AC_MSG_ERROR([Could not determine size of $2])])])
8484

8585
unset happy ompi_conftest_h

0 commit comments

Comments
 (0)