The following patch fixes the build of certain parts of
busybox that need to be run in the host environment.
Tested with 1.13.4 but this is a long standing problem and
should work also for previous versions of busybox.
I am trying to submit a similar patch upstream to the
busybox author.
cheers
luigi
--- /dev/null 2009-07-08 18:22:00.000000000 +0200
+++ package/busybox/patches/902-freebsd.patch 2009-07-08 18:00:13.000000000
+0200
@@ -0,0 +1,48 @@
+--- busybox-1.13.4/include/libbb.h 2009-04-15 02:09:42.000000000 +0200
++++ busybox-1.13.4/include/libbb.h 2009-06-26 13:48:43.000000000 +0200
+@@ -29,6 +29,10 @@
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+ #include <sys/socket.h>
++#if defined __FreeBSD__
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#endif
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+--- busybox-1.13.4/include/platform.h 2008-11-09 18:28:17.000000000 +0100
++++ busybox-1.13.4/include/platform.h 2009-06-26 13:50:26.000000000 +0200
+@@ -116,6 +116,14 @@
+ # include <sex.h>
+ # define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN)
+ # define __BYTE_ORDER BYTE_ORDER
++#elif defined __FreeBSD__
++char *strchrnul(const char *s, int c);
++# include <sys/resource.h> // rlimit
++# include <machine/endian.h>
++# define bswap_64 __bswap64
++# define bswap_32 __bswap32
++# define bswap_16 __bswap16
++# define __BIG_ENDIAN__ (_BYTE_ORDER == _BIG_ENDIAN)
+ #elif !defined __APPLE__
+ # include <byteswap.h>
+ # include <endian.h>
+@@ -162,7 +170,7 @@
+
+ /* ---- Networking ------------------------------------------ */
+
+-#ifndef __APPLE__
++#if !defined(__APPLE__) && !defined(__FreeBSD__)
+ # include <arpa/inet.h>
+ # ifndef __socklen_t_defined
+ typedef int socklen_t;
+@@ -173,7 +181,7 @@
+
+ /* ---- Compiler dependent settings ------------------------- */
+
+-#if (defined __digital__ && defined __unix__) || defined __APPLE__
++#if (defined __digital__ && defined __unix__) || defined __APPLE__ || defined
__FreeBSD__
+ # undef HAVE_MNTENT_H
+ # undef HAVE_SYS_STATFS_H
+ #else
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel