Commit | Line | Data |
---|---|---|
61ec970d PH |
1 | #! /bin/sh |
2 | # $Cambridge: exim/src/scripts/Configure-os.h,v 1.1 2004/10/06 15:07:40 ph10 Exp $ | |
3 | ||
4 | # Shell script to create a link to the appropriate OS-specific header file. | |
5 | ||
6 | scripts=../scripts | |
7 | ||
8 | # Get the OS type, and check that there is a make file for it. | |
9 | ||
10 | os=`$scripts/os-type -generic` || exit 1 | |
11 | ||
12 | if test ! -r ../OS/Makefile-$os | |
13 | then echo "" | |
14 | echo "*** Sorry - operating system $os is not supported" | |
15 | echo "*** See OS/Makefile-* for supported systems" 1>&2 | |
16 | echo "" | |
17 | exit 1; | |
18 | fi | |
19 | ||
20 | # Ensure there is an OS-specific header file, and link it to os.h. There should | |
21 | # always be one if there is a make file for the OS, so its absence is somewhat | |
22 | # disastrous. | |
23 | ||
24 | if test ! -r ../OS/os.h-$os | |
25 | then echo "" | |
26 | echo "*** Build error: OS/os.h-$os file is missing" | |
27 | echo "" | |
28 | exit 1; | |
29 | fi | |
30 | rm -f os.h | |
31 | ln -s ../OS/os.h-$os os.h || exit 1 | |
32 | ||
33 | # Special-purpose fudge for older versions of Linux (pre 2.1.15) that | |
34 | # use the structure name "options" instead of "ip_options". | |
35 | ||
36 | if [ "$os" != "Linux" -a "$os" != "Linux-libc5" ] ; then exit 0; fi | |
37 | ||
38 | grep ip_options /usr/include/linux/ip.h >/dev/null | |
39 | if [ $? = 0 ] ; then exit 0; fi | |
40 | ||
41 | cat >>os.h <<End | |
42 | ||
43 | /* Fudge added because this Linux doesn't appear to have a definition | |
44 | for ip_options in /usr/include/linux/ip.h. */ | |
45 | ||
46 | #define ip_options options | |
47 | End | |
48 | ||
49 | # End of Configure-os.h |