OpenSSL: fix bulid on older library versions
[exim.git] / src / scripts / Configure-os.h
... / ...
CommitLineData
1#! /bin/sh
2
3# Shell script to create a link to the appropriate OS-specific header file.
4
5scripts=../scripts
6
7# Get the OS type, and check that there is a make file for it.
8
9os=`$scripts/os-type -generic` || exit 1
10
11if test ! -r ../OS/Makefile-$os
12then 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;
17fi
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
23if test ! -r ../OS/os.h-$os
24then echo ""
25 echo "*** Build error: OS/os.h-$os file is missing"
26 echo ""
27 exit 1;
28fi
29rm -f os.h
30
31# In order to accommodate for the fudge below, copy the file instead of
32# symlinking it. Otherwise we pollute the clean copy with the fudge.
33cp -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
38if [ "$os" != "Linux" -a "$os" != "Linux-libc5" ] ; then exit 0; fi
39
40grep ip_options /usr/include/linux/ip.h >/dev/null
41if [ $? = 0 ] ; then exit 0; fi
42
43cat >>os.h <<End
44
45/* Fudge added because this Linux doesn't appear to have a definition
46for ip_options in /usr/include/linux/ip.h. */
47
48#define ip_options options
49End
50
51# End of Configure-os.h