SPDX: Mass-update to GPL-2.0-or-later
[exim.git] / src / scripts / Configure-os.c
1 #! /bin/sh
2 # Copyright (c) The Exim Maintainters 2022
3 # SPDX-License-Identifier: GPL-2.0-or-later
4
5
6 # Shell script to build os.c. There doesn't have to be an OS-specific os.c
7 # file, but if there is, it gets copied at the start of os.c. The basic src
8 # copy of os.c contains generic functions, controlled in some cases by
9 # macro switches so that where they are common to a number of OS, they can
10 # just be switched in.
11
12 scripts=../scripts
13
14 # First off, get the OS type, and check that there is a make file for it.
15
16 os=`$scripts/os-type -generic` || exit 1
17
18 if      test ! -r ../OS/Makefile-$os
19 then    echo ""
20         echo "*** Sorry - operating system $os is not supported"
21         echo "*** See OS/Makefile-* for supported systems" 1>&2
22         echo ""
23         exit 1;
24 fi
25
26 # Now build the file
27
28 rm -f os.c
29 echo '#include "exim.h"' > os.c || exit 1
30 test -r ../OS/os.c-$os && cat ../OS/os.c-$os >> os.c
31 echo '#include "../src/os.c"' >> os.c || exit 1
32
33 # End of Configure-os.c