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