diff --git a/src/Makefile.in b/src/Makefile.in
index 922f7249a3..f3e3820bd8 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -107,6 +107,13 @@ build_triplet = @build@
 host_triplet = @host@
 noinst_PROGRAMS = H5detect$(EXEEXT) H5make_libsettings$(EXEEXT)
 
+cross_compiling = @cross_compiling@
+ifeq ($(cross_compiling),yes)
+  src_run = 
+else
+  src_run = ./
+endif
+
 # Only compile parallel sources if necessary
 @BUILD_PARALLEL_CONDITIONAL_TRUE@am__append_1 = H5mpi.c H5ACmpio.c H5Cmpio.c H5Dmpio.c H5Fmpi.c H5FDmpi.c H5FDmpio.c H5Smpio.c
 
@@ -2179,7 +2186,7 @@ H5Tinit.c: H5detect$(EXEEXT)
 	@if $(AM_V_P); then set -x; else echo "  GEN      H5Tinit.c"; fi;       \
 	LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) |                    \
 	    sed -e 's/-L/:/g' -e 's/ //g'`"                                     \
-	$(RUNSERIAL) ./H5detect$(EXEEXT)  $@  ||                               	\
+	$(RUNSERIAL) $(src_run)H5detect$(EXEEXT)  $@  ||                               \
 	    (test $$HDF5_Make_Ignore && echo "*** Error ignored") ||            \
 	    ($(RM) $@ ; exit 1)
 
@@ -2192,7 +2199,7 @@ H5lib_settings.c: H5make_libsettings$(EXEEXT) libhdf5.settings
 	@if $(AM_V_P); then set -x; else echo "  GEN      H5lib_settings.c"; fi;    \
 	LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) |                        \
 	    sed -e 's/-L/:/g' -e 's/ //g'`"                                         \
-	$(RUNSERIAL) ./H5make_libsettings$(EXEEXT)  $@  ||                          \
+	$(RUNSERIAL) $(src_run)H5make_libsettings$(EXEEXT)  $@  ||                               \
 	    (test $$HDF5_Make_Ignore && echo "*** Error ignored") ||                \
 	    ($(RM) $@ ; exit 1)
 
