diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-02-07 22:41:33 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-02-07 22:41:33 +0000 |
commit | 9412ec755543a1ddd5f4b39e1fe5a5dd319fa06c (patch) | |
tree | 850e90d64948a6c73dabeb95b903c0d6eb701319 | |
parent | 22876c797cdd848b42f98da7c2ae886cc07ca00d (diff) | |
download | busybox-w32-9412ec755543a1ddd5f4b39e1fe5a5dd319fa06c.tar.gz busybox-w32-9412ec755543a1ddd5f4b39e1fe5a5dd319fa06c.tar.bz2 busybox-w32-9412ec755543a1ddd5f4b39e1fe5a5dd319fa06c.zip |
some more fixes for cross-compiling on an OS X host: apple provides core types so dont redefine them, sys/statfs.h is not available, and only use some newer AF_* defines if they are actually available
-rw-r--r-- | include/libbb.h | 11 | ||||
-rw-r--r-- | include/platform.h | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/include/libbb.h b/include/libbb.h index ccfe1b705..3ef03d6c9 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <sys/mman.h> | 30 | #include <sys/mman.h> |
31 | #include <sys/socket.h> | 31 | #include <sys/socket.h> |
32 | #include <sys/stat.h> | 32 | #include <sys/stat.h> |
33 | #include <sys/statfs.h> | ||
34 | #include <sys/time.h> | 33 | #include <sys/time.h> |
35 | #include <sys/types.h> | 34 | #include <sys/types.h> |
36 | #include <sys/wait.h> | 35 | #include <sys/wait.h> |
@@ -49,6 +48,10 @@ | |||
49 | #include <mntent.h> | 48 | #include <mntent.h> |
50 | #endif | 49 | #endif |
51 | 50 | ||
51 | #ifdef HAVE_SYS_STATFS_H | ||
52 | #include <sys/statfs.h> | ||
53 | #endif | ||
54 | |||
52 | #if ENABLE_SELINUX | 55 | #if ENABLE_SELINUX |
53 | #include <selinux/selinux.h> | 56 | #include <selinux/selinux.h> |
54 | #include <selinux/context.h> | 57 | #include <selinux/context.h> |
@@ -311,8 +314,12 @@ struct BUG_too_small { | |||
311 | | AF_INET | 314 | | AF_INET |
312 | | AF_INET6 | 315 | | AF_INET6 |
313 | | AF_UNIX | 316 | | AF_UNIX |
317 | #ifdef AF_PACKET | ||
314 | | AF_PACKET | 318 | | AF_PACKET |
319 | #endif | ||
320 | #ifdef AF_NETLINK | ||
315 | | AF_NETLINK | 321 | | AF_NETLINK |
322 | #endif | ||
316 | /* | AF_DECnet */ | 323 | /* | AF_DECnet */ |
317 | /* | AF_IPX */ | 324 | /* | AF_IPX */ |
318 | ) <= 127 ? 1 : -1]; | 325 | ) <= 127 ? 1 : -1]; |
@@ -807,8 +814,10 @@ extern void run_applet_and_exit(const char *name, char **argv); | |||
807 | extern void run_applet_no_and_exit(int a, char **argv) ATTRIBUTE_NORETURN; | 814 | extern void run_applet_no_and_exit(int a, char **argv) ATTRIBUTE_NORETURN; |
808 | #endif | 815 | #endif |
809 | 816 | ||
817 | #ifdef HAVE_MNTENT_H | ||
810 | extern int match_fstype(const struct mntent *mt, const char *fstypes); | 818 | extern int match_fstype(const struct mntent *mt, const char *fstypes); |
811 | extern struct mntent *find_mount_point(const char *name, const char *table); | 819 | extern struct mntent *find_mount_point(const char *name, const char *table); |
820 | #endif | ||
812 | extern void erase_mtab(const char * name); | 821 | extern void erase_mtab(const char * name); |
813 | extern unsigned int tty_baud_to_value(speed_t speed); | 822 | extern unsigned int tty_baud_to_value(speed_t speed); |
814 | extern speed_t tty_value_to_baud(unsigned int value); | 823 | extern speed_t tty_value_to_baud(unsigned int value); |
diff --git a/include/platform.h b/include/platform.h index 050338cf3..9acba63e0 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -137,19 +137,20 @@ | |||
137 | /* ---- Networking ------------------------------------------ */ | 137 | /* ---- Networking ------------------------------------------ */ |
138 | #ifndef __APPLE__ | 138 | #ifndef __APPLE__ |
139 | # include <arpa/inet.h> | 139 | # include <arpa/inet.h> |
140 | # ifndef __socklen_t_defined | ||
141 | typedef int socklen_t; | ||
142 | # endif | ||
140 | #else | 143 | #else |
141 | # include <netinet/in.h> | 144 | # include <netinet/in.h> |
142 | #endif | 145 | #endif |
143 | 146 | ||
144 | #ifndef __socklen_t_defined | ||
145 | typedef int socklen_t; | ||
146 | #endif | ||
147 | |||
148 | /* ---- Compiler dependent settings ------------------------- */ | 147 | /* ---- Compiler dependent settings ------------------------- */ |
149 | #if (defined __digital__ && defined __unix__) || defined __APPLE__ | 148 | #if (defined __digital__ && defined __unix__) || defined __APPLE__ |
150 | # undef HAVE_MNTENT_H | 149 | # undef HAVE_MNTENT_H |
150 | # undef HAVE_SYS_STATFS_H | ||
151 | #else | 151 | #else |
152 | # define HAVE_MNTENT_H 1 | 152 | # define HAVE_MNTENT_H 1 |
153 | # define HAVE_SYS_STATFS_H 1 | ||
153 | #endif /* ___digital__ && __unix__ */ | 154 | #endif /* ___digital__ && __unix__ */ |
154 | 155 | ||
155 | /* linux/loop.h relies on __u64. Make sure we have that as a proper type | 156 | /* linux/loop.h relies on __u64. Make sure we have that as a proper type |
@@ -180,7 +181,7 @@ __extension__ typedef unsigned long long __u64; | |||
180 | #define HAVE_FEATURES_H | 181 | #define HAVE_FEATURES_H |
181 | #include <stdint.h> | 182 | #include <stdint.h> |
182 | #define HAVE_STDINT_H | 183 | #define HAVE_STDINT_H |
183 | #else | 184 | #elif !defined __APPLE__ |
184 | /* Largest integral types. */ | 185 | /* Largest integral types. */ |
185 | #if __BIG_ENDIAN__ | 186 | #if __BIG_ENDIAN__ |
186 | typedef long intmax_t; | 187 | typedef long intmax_t; |