summaryrefslogtreecommitdiffstats
path: root/patches/mysql-5.1.14-beta/mysql-5.0.26_comp_err_gen_lex_hash.diff
blob: c58d257161be634a8e4803e0b34063eb90a31bd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Index: extra/Makefile.am
===================================================================
--- extra/Makefile.am.orig
+++ extra/Makefile.am
@@ -25,6 +25,19 @@ pkginclude_HEADERS=	$(BUILT_SOURCES)
 DISTCLEANFILES =	$(BUILT_SOURCES)
 SUBDIRS =		@yassl_dir@
 
+# FIXME: RSC: build for host
+#
+# if CROSS_COMPILING
+# comp_err=$(COMP_ERR)
+# else
+# comp_err=$(top_builddir)/extra/comp_err$(EXEEXT)
+# endif
+# ...
+# $(top_builddir)/include/mysqld_error.h: comp_err$(EXEEXT)
+#       $(comp_err) \
+#       --charset=$(top_srcdir)/sql/share/charsets \
+#
+
 # This will build mysqld_error.h, mysqld_ername.h and sql_state.h
 # NOTE Built files should depend on their sources to avoid
 # the built files being rebuilt in source dist
Index: configure.in
===================================================================
--- configure.in.orig
+++ configure.in
@@ -756,6 +756,26 @@ then
   )
 fi
 
+dnl ******************************************************************
+dnl *** Look for comp_err & gen_lex_hash if we are cross-compiling ***
+dnl ******************************************************************
+
+AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
+
+if test $cross_compiling = yes; then
+  AC_PATH_PROG(COMP_ERR, comp_err, no)
+  if test x$COMP_ERR = xno; then
+    AC_MSG_ERROR(Could not find comp_err in your PATH)
+  fi
+fi
+
+if test $cross_compiling = yes; then
+  AC_PATH_PROG(GEN_LEX_HASH, gen_lex_hash, no)
+  if test x$GEN_LEX_HASH = xno; then
+    AC_MSG_ERROR(Could not find gen_lex_hash in your PATH)
+  fi
+fi
+
 #--------------------------------------------------------------------
 # Check for TCP wrapper support
 #--------------------------------------------------------------------
Index: sql/Makefile.am
===================================================================
--- sql/Makefile.am.orig
+++ sql/Makefile.am
@@ -168,8 +168,13 @@ sql_yacc.o:	sql_yacc.cc sql_yacc.h $(HEA
 # FIXME seems like now "lex_hash.h" differs depending on configure
 # flags, so can't pregenerate and include in source TAR. Revert to
 # dist pregenerated if this changes, so the file doesn't differ.
+if CROSS_COMPILING
+gen_lex_hash=$(GEN_LEX_HASH)
+else
+gen_lex_hash=$(top_builddir)/sql/gen_lex_hash$(EXEEXT)
+endif
 lex_hash.h:	gen_lex_hash$(EXEEXT)
-		./gen_lex_hash$(EXEEXT) > $@
+		$(gen_lex_hash) > $@
 
 # the following three should eventually be moved out of this directory
 ha_ndbcluster.o:ha_ndbcluster.cc ha_ndbcluster.h