annotate configure @ 10:2c022e0334c4

convert to new ThemWi configure and build system
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 21 May 2024 01:03:40 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #!/bin/sh
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 # This configure script is custom and hand-coded;
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 # it is NOT a product of GNU Autoconf or any other such tools!
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 set -e
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 if [ ! -f configure ]
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 then
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 echo "This script needs to be run from the top of the source tree" 1>&2
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 exit 1
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 fi
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 # defaults that can be overridden
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 CC=gcc
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 CFLAGS=-O2
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 prefix=/usr/local
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 exec_prefix=
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 bindir=
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 while [ $# != 0 ]
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 do
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 case "$1" in
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 --prefix=*)
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 prefix=`echo $1 | cut -c 10-`
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 ;;
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 --exec-prefix=*)
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 exec_prefix=`echo $1 | cut -c 15-`
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 ;;
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 --bindir=*)
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 bindir=`echo $1 | cut -c 10-`
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 ;;
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 CC=*)
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 CC=`echo $1 | cut -c 4-`
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 ;;
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 CFLAGS=*)
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 CFLAGS=`echo $1 | cut -c 8-`
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 ;;
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 *)
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 echo "error: non-understood option $1" 1>&2
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 exit 1;
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 ;;
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 esac
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 shift
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 done
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 # inheritance rules for install directories
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 if [ -z "$exec_prefix" ]
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 then
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 exec_prefix="$prefix"
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 fi
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 if [ -z "$bindir" ]
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 then
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 bindir="$exec_prefix/bin"
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 fi
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 # report the final configuration
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 echo "C code will be compiled with:"
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 echo " CC=$CC"
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 echo " CFLAGS=$CFLAGS"
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 echo "Installation directory:"
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 echo " bindir=$bindir"
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 # emit the Makefile include fragment
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 echo "CC=$CC" > config.defs
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 echo "CFLAGS=$CFLAGS" >> config.defs
2c022e0334c4 convert to new ThemWi configure and build system
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 echo "bindir=$bindir" >> config.defs