summaryrefslogtreecommitdiff
path: root/libbb/mk_loop_h.sh
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-02-17 00:42:47 +0000
committerEric Andersen <andersen@codepoet.org>2001-02-17 00:42:47 +0000
commit19f86207f5c9cdcd192295e3ac3130a40f180d39 (patch)
treed84d5ef8a6914a3a2b77c360471d195f0c32a8e2 /libbb/mk_loop_h.sh
parent69c8572f296380df78a20818ca9208b35b7dbd16 (diff)
downloadbusybox-w32-19f86207f5c9cdcd192295e3ac3130a40f180d39.tar.gz
busybox-w32-19f86207f5c9cdcd192295e3ac3130a40f180d39.tar.bz2
busybox-w32-19f86207f5c9cdcd192295e3ac3130a40f180d39.zip
Update the build system for pristine source directory builds. This
update is primarily work done by Larry Doolittle, but I did some touchups of my own to make it work for me, -Erik
Diffstat (limited to 'libbb/mk_loop_h.sh')
-rwxr-xr-xlibbb/mk_loop_h.sh23
1 files changed, 13 insertions, 10 deletions
diff --git a/libbb/mk_loop_h.sh b/libbb/mk_loop_h.sh
index c33c010ca..71c987376 100755
--- a/libbb/mk_loop_h.sh
+++ b/libbb/mk_loop_h.sh
@@ -2,8 +2,7 @@
2# 2#
3# Figure out (i) the type of dev_t (ii) the defines for loop stuff 3# Figure out (i) the type of dev_t (ii) the defines for loop stuff
4# 4#
5 5# Output of this script is normally redirected to "loop.h".
6rm -f loop.h
7 6
8# Since 1.3.79 there is an include file <asm/posix_types.h> 7# Since 1.3.79 there is an include file <asm/posix_types.h>
9# that defines __kernel_dev_t. 8# that defines __kernel_dev_t.
@@ -12,23 +11,27 @@ rm -f loop.h
12# avoids namespace pollution. Otherwise we guess that __kernel_dev_t 11# avoids namespace pollution. Otherwise we guess that __kernel_dev_t
13# is an unsigned short (which is true on i386, but false on alpha). 12# is an unsigned short (which is true on i386, but false on alpha).
14 13
14# BUG: This test is actually broken if your gcc is not configured to
15# search /usr/include, as may well happen with cross-compilers.
16# It would be better to ask $(CC) if these files can be found.
17
15if [ -f /usr/include/linux/posix_types.h ]; then 18if [ -f /usr/include/linux/posix_types.h ]; then
16 echo '#include <linux/posix_types.h>' >> loop.h 19 echo '#include <linux/posix_types.h>'
17 echo '#undef dev_t' >> loop.h 20 echo '#undef dev_t'
18 echo '#define dev_t __kernel_dev_t' >> loop.h 21 echo '#define dev_t __kernel_dev_t'
19else 22else
20 echo '#undef dev_t' >> loop.h 23 echo '#undef dev_t'
21 echo '#define dev_t unsigned short' >> loop.h 24 echo '#define dev_t unsigned short'
22fi 25fi
23 26
24# Next we have to find the loop stuff itself. 27# Next we have to find the loop stuff itself.
25# First try kernel source, then a private version. 28# First try kernel source, then a private version.
26 29
27if [ -f /usr/include/linux/loop.h ]; then 30if [ -f /usr/include/linux/loop.h ]; then
28 echo '#include <linux/loop.h>' >> loop.h 31 echo '#include <linux/loop.h>'
29else 32else
30 echo '#include "real_loop.h"' >> loop.h 33 echo '#include "real_loop.h"'
31fi 34fi
32 35
33echo '#undef dev_t' >> loop.h 36echo '#undef dev_t'
34 37