005-bsd-compat.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. diff -Nur busybox-1.17.1.orig/include/libbb.h busybox-1.17.1/include/libbb.h
  2. --- busybox-1.17.1.orig/include/libbb.h Sun Jul 25 00:12:43 2010
  3. +++ busybox-1.17.1/include/libbb.h Thu Jul 29 20:27:07 2010
  4. @@ -40,6 +40,7 @@
  5. /* Try to pull in PATH_MAX */
  6. #include <limits.h>
  7. #include <sys/param.h>
  8. +#if !(defined __APPLE__ || defined BSD )
  9. #ifdef HAVE_MNTENT_H
  10. #include <mntent.h>
  11. #endif
  12. @@ -51,6 +52,7 @@
  13. #include <selinux/context.h>
  14. #include <selinux/flask.h>
  15. #include <selinux/av_permissions.h>
  16. +#endif
  17. #endif
  18. #if ENABLE_LOCALE_SUPPORT
  19. # include <locale.h>
  20. diff -Nur busybox-1.17.1.orig/include/platform.h busybox-1.17.1/include/platform.h
  21. --- busybox-1.17.1.orig/include/platform.h Tue Jul 6 04:25:54 2010
  22. +++ busybox-1.17.1/include/platform.h Thu Jul 29 20:28:50 2010
  23. @@ -150,18 +150,19 @@
  24. /* ---- Endian Detection ------------------------------------ */
  25. +# include <sys/param.h>
  26. #if defined(__digital__) && defined(__unix__)
  27. # include <sex.h>
  28. # define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN)
  29. # define __BYTE_ORDER BYTE_ORDER
  30. -#elif defined __FreeBSD__
  31. +#elif defined __FreeBSD__ || defined __APPLE__
  32. # include <sys/resource.h> /* rlimit */
  33. # include <machine/endian.h>
  34. # define bswap_64 __bswap64
  35. # define bswap_32 __bswap32
  36. # define bswap_16 __bswap16
  37. # define __BIG_ENDIAN__ (_BYTE_ORDER == _BIG_ENDIAN)
  38. -#elif !defined __APPLE__
  39. +#elif !defined BSD
  40. # include <byteswap.h>
  41. # include <endian.h>
  42. #endif
  43. @@ -172,9 +173,15 @@
  44. #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN
  45. # define BB_BIG_ENDIAN 1
  46. # define BB_LITTLE_ENDIAN 0
  47. +#elif defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN
  48. +# define BB_BIG_ENDIAN 1
  49. +# define BB_LITTLE_ENDIAN 0
  50. #elif (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || defined(__386__)
  51. # define BB_BIG_ENDIAN 0
  52. # define BB_LITTLE_ENDIAN 1
  53. +#elif (defined(_BYTE_ORDER) && _BYTE_ORDER == _LITTLE_ENDIAN) || defined(__386__)
  54. +# define BB_BIG_ENDIAN 0
  55. +# define BB_LITTLE_ENDIAN 1
  56. #else
  57. # error "Can't determine endianness"
  58. #endif
  59. @@ -230,12 +237,19 @@
  60. /* ---- Compiler dependent settings ------------------------- */
  61. #if (defined __digital__ && defined __unix__) \
  62. - || defined __APPLE__ || defined __FreeBSD__
  63. + || defined __APPLE__ || defined __FreeBSD__ || defined BSD
  64. # undef HAVE_MNTENT_H
  65. # undef HAVE_SYS_STATFS_H
  66. #else
  67. # define HAVE_MNTENT_H 1
  68. # define HAVE_SYS_STATFS_H 1
  69. +#endif
  70. +
  71. +/* ---- Networking ------------------------------------------ */
  72. +
  73. +#if defined __OpenBSD__
  74. +#include <netinet/in.h>
  75. +#include <arpa/inet.h>
  76. #endif
  77. /*----- Kernel versioning ------------------------------------*/
  78. diff -Nur busybox-1.17.1.orig/scripts/gen_build_files.sh busybox-1.17.1/scripts/gen_build_files.sh
  79. --- busybox-1.17.1.orig/scripts/gen_build_files.sh Sun Jul 25 00:12:56 2010
  80. +++ busybox-1.17.1/scripts/gen_build_files.sh Thu Jul 29 20:27:07 2010
  81. @@ -48,7 +48,7 @@
  82. fi
  83. # (Re)generate */Kbuild and */Config.in
  84. -{ cd -- "$srctree" && find -type d; } | while read -r d; do
  85. +{ cd -- "$srctree" && find . -type d; } | while read -r d; do
  86. d="${d#./}"
  87. src="$srctree/$d/Kbuild.src"