annotate configure @ 14:78319ed870dc

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