110-cross_compile.patch 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. --- a/storage/innodb_plugin/plug.in
  2. +++ b/storage/innodb_plugin/plug.in
  3. @@ -56,10 +56,8 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [
  4. esac
  5. AC_SUBST(INNODB_DYNAMIC_CFLAGS)
  6. - AC_MSG_CHECKING(whether GCC atomic builtins are available)
  7. - # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
  8. - AC_TRY_RUN(
  9. - [
  10. + AC_CACHE_CHECK([whether GCC atomic builtins are available],
  11. + [mysql_cv_gcc_atomic_builtins], [AC_TRY_RUN([
  12. int main()
  13. {
  14. long x;
  15. @@ -96,21 +94,18 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [
  16. return(0);
  17. }
  18. - ],
  19. - [
  20. - AC_DEFINE([HAVE_IB_GCC_ATOMIC_BUILTINS], [1],
  21. - [GCC atomic builtins are available])
  22. - AC_MSG_RESULT(yes)
  23. - ],
  24. - [
  25. - AC_MSG_RESULT(no)
  26. - ]
  27. - )
  28. + ], [mysql_cv_gcc_atomic_builtins=yes],
  29. + [mysql_cv_gcc_atomic_builtins=no],
  30. + [mysql_cv_gcc_atomic_builtins=no])])
  31. +
  32. + if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then
  33. + AC_DEFINE(HAVE_IB_GCC_ATOMIC_BUILTINS, 1,
  34. + [Define to 1 if compiler provides atomic builtins.])
  35. + fi
  36. - AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
  37. - # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
  38. - AC_TRY_RUN(
  39. - [
  40. +
  41. + AC_CACHE_CHECK([whether pthread_t can be used by GCC atomic builtins],
  42. + [mysql_cv_gcc_atomic_builtins_pthread_t], [AC_TRY_RUN([
  43. #include <pthread.h>
  44. #include <string.h>
  45. @@ -127,16 +122,14 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [
  46. return(0);
  47. }
  48. - ],
  49. - [
  50. - AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_GCC], [1],
  51. - [pthread_t can be used by GCC atomic builtins])
  52. - AC_MSG_RESULT(yes)
  53. - ],
  54. - [
  55. - AC_MSG_RESULT(no)
  56. - ]
  57. - )
  58. + ], [mysql_cv_gcc_atomic_builtins_pthread_t=yes],
  59. + [mysql_cv_gcc_atomic_builtins_pthread_t=no],
  60. + [mysql_cv_gcc_atomic_builtins_pthread_t=no])])
  61. +
  62. + if test "x$mysql_cv_gcc_atomic_builtins_pthread_t" = xyes; then
  63. + AC_DEFINE(HAVE_IB_ATOMIC_PTHREAD_T_GCC, 1,
  64. + [Define to 1 if pthread_t can be used by GCC atomic builtins])
  65. + fi
  66. AC_MSG_CHECKING(whether Solaris libc atomic functions are available)
  67. # Define HAVE_IB_SOLARIS_ATOMICS if _all_ of the following
  68. @@ -156,7 +149,6 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [
  69. AC_DEFINE([HAVE_IB_SOLARIS_ATOMICS], [1],
  70. [Define to 1 if Solaris libc atomic functions are available]
  71. )
  72. - fi
  73. AC_MSG_CHECKING(whether pthread_t can be used by Solaris libc atomic functions)
  74. # either define HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS or not
  75. @@ -230,6 +222,8 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [
  76. AC_MSG_RESULT(no)
  77. ]
  78. )
  79. + fi
  80. +
  81. ])
  82. # vim: set ft=config:
  83. --- a/sql/gen_lex_hash.cc
  84. +++ b/sql/gen_lex_hash.cc
  85. @@ -344,55 +344,6 @@ void print_find_structs()
  86. }
  87. -static void usage(int version)
  88. -{
  89. - printf("%s Ver 3.6 Distrib %s, for %s (%s)\n",
  90. - my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
  91. - if (version)
  92. - return;
  93. - puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
  94. - puts("This program generates a perfect hashing function for the sql_lex.cc");
  95. - printf("Usage: %s [OPTIONS]\n\n", my_progname);
  96. - my_print_help(my_long_options);
  97. -}
  98. -
  99. -
  100. -extern "C" my_bool
  101. -get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
  102. - char *argument __attribute__((unused)))
  103. -{
  104. - switch(optid) {
  105. - case 'V':
  106. - usage(1);
  107. - exit(0);
  108. - case 'I':
  109. - case '?':
  110. - usage(0);
  111. - exit(0);
  112. - case '#':
  113. - DBUG_PUSH(argument ? argument : default_dbug_option);
  114. - break;
  115. - }
  116. - return 0;
  117. -}
  118. -
  119. -
  120. -static int get_options(int argc, char **argv)
  121. -{
  122. - int ho_error;
  123. -
  124. - if ((ho_error= handle_options(&argc, &argv, my_long_options, get_one_option)))
  125. - exit(ho_error);
  126. -
  127. - if (argc >= 1)
  128. - {
  129. - usage(0);
  130. - exit(1);
  131. - }
  132. - return(0);
  133. -}
  134. -
  135. -
  136. int check_dup_symbols(SYMBOL *s1, SYMBOL *s2)
  137. {
  138. if (s1->length!=s2->length || strncmp(s1->name,s2->name,s1->length))
  139. @@ -443,12 +394,6 @@ int check_duplicates()
  140. int main(int argc,char **argv)
  141. {
  142. - MY_INIT(argv[0]);
  143. - DBUG_PROCESS(argv[0]);
  144. -
  145. - if (get_options(argc,(char **) argv))
  146. - exit(1);
  147. -
  148. /* Broken up to indicate that it's not advice to you, gentle reader. */
  149. printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
  150. @@ -549,7 +494,6 @@ static SYMBOL *get_hash_symbol(const cha
  151. }\n\
  152. }\n"
  153. );
  154. - my_end(0);
  155. exit(0);
  156. }
  157. --- a/sql/Makefile.am
  158. +++ b/sql/Makefile.am
  159. @@ -26,7 +26,6 @@ INCLUDES = @ZLIB_INCLUDES@ \
  160. WRAPLIBS= @WRAPLIBS@
  161. SUBDIRS = share
  162. libexec_PROGRAMS = mysqld
  163. -EXTRA_PROGRAMS = gen_lex_hash
  164. bin_PROGRAMS = mysql_tzinfo_to_sql
  165. noinst_LTLIBRARIES= libndb.la \