annotate configure @ 25:2a19b44c272e

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