FreeCalypso > hg > themwi-interim
annotate configure @ 1:b161dbfffdaa
include, libutil: port from old ThemWi
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 08 Jun 2024 23:06:53 +0000 |
parents | 214716b13c61 |
children |
rev | line source |
---|---|
0
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #!/bin/sh |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 # This configure script is custom and hand-coded; |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 # it is NOT a product of GNU Autoconf or any other such tools! |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 set -e |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 if [ ! -f configure ] |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 then |
214716b13c61
starting project with configure script
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 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 exit 1 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 fi |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 # defaults that can be overridden |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 CC=gcc |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 CFLAGS=-O2 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 prefix=/usr/local |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 exec_prefix= |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 bindir= |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 includedir= |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 libdir= |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 while [ $# != 0 ] |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 do |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 case "$1" in |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 --prefix=*) |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 prefix=`echo $1 | cut -c 10-` |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 ;; |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 --exec-prefix=*) |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 exec_prefix=`echo $1 | cut -c 15-` |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 ;; |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 --bindir=*) |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 bindir=`echo $1 | cut -c 10-` |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 ;; |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 --includedir=*) |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 includedir=`echo $1 | cut -c 14-` |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 ;; |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 --libdir=*) |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 libdir=`echo $1 | cut -c 10-` |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 ;; |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 CC=*) |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 CC=`echo $1 | cut -c 4-` |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 ;; |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 CFLAGS=*) |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 CFLAGS=`echo $1 | cut -c 8-` |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 ;; |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 *) |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 echo "error: non-understood option $1" 1>&2 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 exit 1; |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 ;; |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 esac |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 shift |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 done |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 # inheritance rules for install directories |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 if [ -z "$exec_prefix" ] |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 then |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 exec_prefix="$prefix" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 fi |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 if [ -z "$bindir" ] |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 then |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 bindir="$exec_prefix/bin" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 fi |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 if [ -z "$includedir" ] |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 then |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 includedir="$prefix/include" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 fi |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 if [ -z "$libdir" ] |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 then |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 libdir="$exec_prefix/lib" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 fi |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 # report the final configuration |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 echo "C code will be compiled with:" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 echo " CC=$CC" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 echo " CFLAGS=$CFLAGS" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 echo "Installation directories:" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 echo " bindir=$bindir" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 echo " includedir=$includedir" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 echo " libdir=$libdir" |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 # emit the Makefile include fragment |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 echo "CC=$CC" > config.defs |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 echo "CFLAGS=$CFLAGS" >> config.defs |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 echo "bindir=$bindir" >> config.defs |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 echo "includedir=$includedir" >> config.defs |
214716b13c61
starting project with configure script
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 echo "libdir=$libdir" >> config.defs |