902-darwin_scripts_include.patch 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. diff -urN linux-2.6.19.1/scripts/mod/file2alias.c linux-2.6.19.1.new/scripts/mod/file2alias.c
  2. --- linux-2.6.19.1/scripts/mod/file2alias.c 2006-12-11 20:32:53.000000000 +0100
  3. +++ linux-2.6.19.1.new/scripts/mod/file2alias.c 2007-01-02 15:28:47.000000000 +0100
  4. @@ -37,7 +37,21 @@
  5. * even potentially has different endianness and word sizes, since
  6. * we handle those differences explicitly below */
  7. #include "../../include/linux/mod_devicetable.h"
  8. +#ifndef __APPLE__
  9. #include "../../include/linux/input.h"
  10. +#else
  11. +#define EV_MAX 0x1f
  12. +#define KEY_MUTE 113
  13. +#define KEY_MIN_INTERESTING KEY_MUTE
  14. +#define KEY_MAX 0x1ff
  15. +#define REL_MAX 0x0f
  16. +#define ABS_MAX 0x3f
  17. +#define MSC_MAX 0x07
  18. +#define LED_MAX 0x0f
  19. +#define SND_MAX 0x07
  20. +#define FF_MAX 0x7f
  21. +#define SW_MAX 0x0f
  22. +#endif
  23. #define ADD(str, sep, cond, field) \
  24. do { \
  25. diff -urN linux-2.6.19.1/scripts/mod/mk_elfconfig.c linux-2.6.19.1.new/scripts/mod/mk_elfconfig.c
  26. --- linux-2.6.19.1/scripts/mod/mk_elfconfig.c 2006-12-11 20:32:53.000000000 +0100
  27. +++ linux-2.6.19.1.new/scripts/mod/mk_elfconfig.c 2007-01-02 15:43:57.000000000 +0100
  28. @@ -1,7 +1,11 @@
  29. #include <stdio.h>
  30. #include <stdlib.h>
  31. #include <string.h>
  32. +#ifndef __APPLE__
  33. #include <elf.h>
  34. +#else
  35. +#include "../../../../../tools/sstrip/include/elf.h"
  36. +#endif
  37. int
  38. main(int argc, char **argv)
  39. diff -urN linux-2.6.19.1/scripts/mod/modpost.h linux-2.6.19.1.new/scripts/mod/modpost.h
  40. --- linux-2.6.19.1/scripts/mod/modpost.h 2006-12-11 20:32:53.000000000 +0100
  41. +++ linux-2.6.19.1.new/scripts/mod/modpost.h 2007-01-02 15:40:55.000000000 +0100
  42. @@ -7,7 +7,11 @@
  43. #include <sys/mman.h>
  44. #include <fcntl.h>
  45. #include <unistd.h>
  46. +#ifndef __APPLE__
  47. #include <elf.h>
  48. +#else
  49. +#include "../../../../../tools/sstrip/include/elf.h"
  50. +#endif
  51. #include "elfconfig.h"
  52. diff -urN linux-2.6.19.1/scripts/mod/sumversion.c linux-2.6.19.1.new/scripts/mod/sumversion.c
  53. --- linux-2.6.19.1/scripts/mod/sumversion.c 2006-12-11 20:32:53.000000000 +0100
  54. +++ linux-2.6.19.1.new/scripts/mod/sumversion.c 2007-01-02 15:30:23.000000000 +0100
  55. @@ -8,6 +8,9 @@
  56. #include <errno.h>
  57. #include <string.h>
  58. #include "modpost.h"
  59. +#ifdef __APPLE__
  60. +#include <limits.h>
  61. +#endif
  62. /*
  63. * Stolen form Cryptographic API.
  64. diff -urN linux-2.6.19.1/scripts/kconfig linux-2.6.19.1.new/scripts/kconfig/Makefile
  65. --- linux-2.6.19.1/scripts/kconfig/Makefile 2007-01-04 17:49:35.000000000 +0100
  66. +++ linux-2.6.19.1.new/scripts/kconfig/Makefile 2007-01-04 17:50:37.000000000 +0100
  67. @@ -87,6 +87,9 @@
  68. # we really need to do so. (Do not call gcc as part of make mrproper)
  69. HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
  70. HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
  71. +ifeq ($(shell uname -s),Darwin)
  72. +HOST_LOADLIBES += -lncurses
  73. +endif
  74. HOST_EXTRACFLAGS += -DLOCALE
  75. diff -urN linux-2.6.19.1/scripts/genksyms/parse.y linux-2.6.19.1.new/scripts/genksyms/parse.y
  76. --- linux-2.6.19.1/scripts/genksyms/parse.y 2006-12-11 20:32:53.000000000 +0100
  77. +++ linux-2.6.19.1.new/scripts/genksyms/parse.y 2007-01-04 19:20:55.000000000 +0100
  78. @@ -24,7 +24,9 @@
  79. %{
  80. #include <assert.h>
  81. +#ifndef __APPLE__
  82. #include <malloc.h>
  83. +#endif
  84. #include "genksyms.h"
  85. static int is_typedef;
  86. diff -urN linux-2.6.19.1/scripts/genksyms/parse.c_shipped linux-2.6.19.1.new/scripts/genksyms/parse.c_shipped
  87. --- linux-2.6.19.1/scripts/genksyms/parse.c_shipped 2007-01-04 19:34:09.000000000 +0100
  88. +++ linux-2.6.19.1.new/scripts/genksyms/parse.c_shipped 2007-01-04 19:34:02.000000000 +0100
  89. @@ -144,7 +144,9 @@
  90. #include <assert.h>
  91. +#ifndef __APPLE__
  92. #include <malloc.h>
  93. +#endif
  94. #include "genksyms.h"
  95. static int is_typedef;
  96. --- linux-2.6.19.1/scripts/kallsyms.c 2006-12-11 20:32:53.000000000 +0100
  97. +++ linux-2.6.19.1.new/scripts/kallsyms.c 2007-01-04 19:46:38.000000000 +0100
  98. @@ -30,6 +30,35 @@
  99. #include <stdlib.h>
  100. #include <string.h>
  101. #include <ctype.h>
  102. +#ifdef __APPLE__
  103. +/* Darwin has no memmem implementation, this one is ripped of the uClibc-0.9.28 source */
  104. +void *memmem (const void *haystack, size_t haystack_len,
  105. + const void *needle, size_t needle_len)
  106. +{
  107. + const char *begin;
  108. + const char *const last_possible
  109. + = (const char *) haystack + haystack_len - needle_len;
  110. +
  111. + if (needle_len == 0)
  112. + /* The first occurrence of the empty string is deemed to occur at
  113. + the beginning of the string. */
  114. + return (void *) haystack;
  115. +
  116. + /* Sanity check, otherwise the loop might search through the whole
  117. + memory. */
  118. + if (__builtin_expect (haystack_len < needle_len, 0))
  119. + return NULL;
  120. +
  121. + for (begin = (const char *) haystack; begin <= last_possible; ++begin)
  122. + if (begin[0] == ((const char *) needle)[0] &&
  123. + !memcmp ((const void *) &begin[1],
  124. + (const void *) ((const char *) needle + 1),
  125. + needle_len - 1))
  126. + return (void *) begin;
  127. +
  128. + return NULL;
  129. +}
  130. +#endif
  131. #define KSYM_NAME_LEN 127