diff -Naur mysql-5.1.38/dbug/Makefile.am mysql-5.1.38.patch/dbug/Makefile.am
--- mysql-5.1.38/dbug/Makefile.am	2009-08-21 14:09:22.000000000 +0200
+++ mysql-5.1.38.patch/dbug/Makefile.am	2009-09-10 02:57:59.000000000 +0200
@@ -44,19 +44,19 @@
 		-groff -mm user.r > $@
 
 output1.r:      factorial
-		./factorial 1 2 3 4 5 | cat > $@
+		mysql-factorial 1 2 3 4 5 | cat > $@
 
 output2.r:      factorial
-		./factorial -\#t:o 2 3 | cat >$@
+		mysql-factorial -\#t:o 2 3 | cat >$@
 
 output3.r:      factorial
-		./factorial -\#d:t:o 3 | cat >$@
+		mysql-factorial -\#d:t:o 3 | cat >$@
 
 output4.r:      factorial
-		./factorial -\#d,result:o 4 | cat >$@
+		mysql-factorial -\#d,result:o 4 | cat >$@
 
 output5.r:      factorial
-		./factorial -\#d:f,factorial:F:L:o 3 | cat >$@
+		mysql-factorial -\#d:f,factorial:F:L:o 3 | cat >$@
 .c.r:
 		@RM@ -f $@
 		@SED@ -e 's!\\!\\\\!g' $< > $@
diff -Naur mysql-5.1.38/dbug/Makefile.in mysql-5.1.38.patch/dbug/Makefile.in
--- mysql-5.1.38/dbug/Makefile.in	2009-08-21 14:17:15.000000000 +0200
+++ mysql-5.1.38.patch/dbug/Makefile.in	2009-09-10 02:58:14.000000000 +0200
@@ -746,19 +746,19 @@
 		-groff -mm user.r > $@
 
 output1.r:      factorial
-		./factorial 1 2 3 4 5 | cat > $@
+		mysql-factorial 1 2 3 4 5 | cat > $@
 
 output2.r:      factorial
-		./factorial -\#t:o 2 3 | cat >$@
+		mysql-factorial -\#t:o 2 3 | cat >$@
 
 output3.r:      factorial
-		./factorial -\#d:t:o 3 | cat >$@
+		mysql-factorial -\#d:t:o 3 | cat >$@
 
 output4.r:      factorial
-		./factorial -\#d,result:o 4 | cat >$@
+		mysql-factorial -\#d,result:o 4 | cat >$@
 
 output5.r:      factorial
-		./factorial -\#d:f,factorial:F:L:o 3 | cat >$@
+		mysql-factorial -\#d:f,factorial:F:L:o 3 | cat >$@
 .c.r:
 		@RM@ -f $@
 		@SED@ -e 's!\\!\\\\!g' $< > $@
diff -Naur mysql-5.1.38/extra/Makefile.am mysql-5.1.38.patch/extra/Makefile.am
--- mysql-5.1.38/extra/Makefile.am	2009-08-21 14:09:23.000000000 +0200
+++ mysql-5.1.38.patch/extra/Makefile.am	2009-09-10 02:53:50.000000000 +0200
@@ -32,7 +32,7 @@
 $(top_builddir)/include/mysqld_error.h: comp_err.c \
 			$(top_srcdir)/sql/share/errmsg.txt
 	$(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT)
-	$(top_builddir)/extra/comp_err$(EXEEXT) \
+	mysql-comp_err$(EXEEXT) \
 	--charset=$(top_srcdir)/sql/share/charsets \
 	--out-dir=$(top_builddir)/sql/share/ \
 	--header_file=$(top_builddir)/include/mysqld_error.h \
diff -Naur mysql-5.1.38/extra/Makefile.in mysql-5.1.38.patch/extra/Makefile.in
--- mysql-5.1.38/extra/Makefile.in	2009-08-21 14:17:16.000000000 +0200
+++ mysql-5.1.38.patch/extra/Makefile.in	2009-09-10 02:53:16.000000000 +0200
@@ -936,7 +936,7 @@
 $(top_builddir)/include/mysqld_error.h: comp_err.c \
 			$(top_srcdir)/sql/share/errmsg.txt
 	$(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT)
-	$(top_builddir)/extra/comp_err$(EXEEXT) \
+	mysql-comp_err$(EXEEXT) \
 	--charset=$(top_srcdir)/sql/share/charsets \
 	--out-dir=$(top_builddir)/sql/share/ \
 	--header_file=$(top_builddir)/include/mysqld_error.h \
diff -Naur mysql-5.1.38/scripts/Makefile.am mysql-5.1.38.patch/scripts/Makefile.am
--- mysql-5.1.38/scripts/Makefile.am	2009-08-21 14:11:26.000000000 +0200
+++ mysql-5.1.38.patch/scripts/Makefile.am	2009-09-10 02:57:01.000000000 +0200
@@ -121,7 +121,7 @@
 mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql
 	$(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT)
 	sleep 2
-	$(top_builddir)/scripts/comp_sql$(EXEEXT) \
+	mysql-comp_sql$(EXEEXT) \
 	  mysql_fix_privilege_tables \
 	    $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@
 
diff -Naur mysql-5.1.38/scripts/Makefile.in mysql-5.1.38.patch/scripts/Makefile.in
--- mysql-5.1.38/scripts/Makefile.in	2009-08-21 14:17:23.000000000 +0200
+++ mysql-5.1.38.patch/scripts/Makefile.in	2009-09-10 02:57:11.000000000 +0200
@@ -802,7 +802,7 @@
 mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql
 	$(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT)
 	sleep 2
-	$(top_builddir)/scripts/comp_sql$(EXEEXT) \
+	mysql-comp_sql$(EXEEXT) \
 	  mysql_fix_privilege_tables \
 	    $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@
 
diff -Naur mysql-5.1.38/sql/Makefile.am mysql-5.1.38.patch/sql/Makefile.am
--- mysql-5.1.38/sql/Makefile.am	2009-08-21 14:12:24.000000000 +0200
+++ mysql-5.1.38.patch/sql/Makefile.am	2009-09-10 02:55:09.000000000 +0200
@@ -174,7 +174,7 @@
 # this avoid the rebuild of the built files in a source dist
 lex_hash.h:	gen_lex_hash.cc lex.h
 		$(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
-		./gen_lex_hash$(EXEEXT) > $@-t
+		mysql-gen_lex_hash$(EXEEXT) > $@-t
 		$(MV) $@-t $@
 
 # For testing of udf_example.so
diff -Naur mysql-5.1.38/sql/Makefile.in mysql-5.1.38.patch/sql/Makefile.in
--- mysql-5.1.38/sql/Makefile.in	2009-08-21 14:17:25.000000000 +0200
+++ mysql-5.1.38.patch/sql/Makefile.in	2009-09-10 02:55:22.000000000 +0200
@@ -1302,7 +1302,7 @@
 # this avoid the rebuild of the built files in a source dist
 lex_hash.h:	gen_lex_hash.cc lex.h
 		$(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
-		./gen_lex_hash$(EXEEXT) > $@-t
+		mysql-gen_lex_hash$(EXEEXT) > $@-t
 		$(MV) $@-t $@
 
 # We might have some stuff not built in this build, but that we want to install
