From e90fcc54809db2591dc083f43ef54c6ec8c60847 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:16:13 +0200 Subject: Adding upstream version 4.96. Signed-off-by: Daniel Baumann --- scripts/Configure-os.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 scripts/Configure-os.h (limited to 'scripts/Configure-os.h') diff --git a/scripts/Configure-os.h b/scripts/Configure-os.h new file mode 100755 index 0000000..ae1ecf9 --- /dev/null +++ b/scripts/Configure-os.h @@ -0,0 +1,51 @@ +#! /bin/sh + +# Shell script to create a link to the appropriate OS-specific header file. + +scripts=../scripts + +# Get the OS type, and check that there is a make file for it. + +os=`$scripts/os-type -generic` || exit 1 + +if test ! -r ../OS/Makefile-$os +then echo "" + echo "*** Sorry - operating system $os is not supported" + echo "*** See OS/Makefile-* for supported systems" 1>&2 + echo "" + exit 1; +fi + +# Ensure there is an OS-specific header file, and link it to os.h. There should +# always be one if there is a make file for the OS, so its absence is somewhat +# disastrous. + +if test ! -r ../OS/os.h-$os +then echo "" + echo "*** Build error: OS/os.h-$os file is missing" + echo "" + exit 1; +fi +rm -f os.h + +# In order to accommodate for the fudge below, copy the file instead of +# symlinking it. Otherwise we pollute the clean copy with the fudge. +cp -p ../OS/os.h-$os os.h || exit 1 + +# Special-purpose fudge for older versions of Linux (pre 2.1.15) that +# use the structure name "options" instead of "ip_options". + +if [ "$os" != "Linux" -a "$os" != "Linux-libc5" ] ; then exit 0; fi + +grep ip_options /usr/include/linux/ip.h >/dev/null +if [ $? = 0 ] ; then exit 0; fi + +cat >>os.h <