comparison configure @ 460:cb1d1ea7f2c5

new build system: accept more directory options
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 10 May 2024 23:04:44 +0000
parents 19f1aa01ea10
children a53225b44ea5
comparison
equal deleted inserted replaced
459:b094bc07051a 460:cb1d1ea7f2c5
11 fi 11 fi
12 12
13 # defaults that can be overridden 13 # defaults that can be overridden
14 CC=gcc 14 CC=gcc
15 CFLAGS=-O2 15 CFLAGS=-O2
16 PREFIX=/opt/themwi 16 prefix=/opt/themwi
17 exec_prefix=
18 bindir=
19 includedir=
20 libdir=
17 21
18 while [ $# != 0 ] 22 while [ $# != 0 ]
19 do 23 do
20 case "$1" in 24 case "$1" in
21 --prefix=*) 25 --prefix=*)
22 PREFIX=`echo $1 | cut -c 10-` 26 prefix=`echo $1 | cut -c 10-`
27 ;;
28 --exec-prefix=*)
29 exec_prefix=`echo $1 | cut -c 15-`
30 ;;
31 --bindir=*)
32 bindir=`echo $1 | cut -c 10-`
33 ;;
34 --includedir=*)
35 includedir=`echo $1 | cut -c 14-`
36 ;;
37 --libdir=*)
38 libdir=`echo $1 | cut -c 10-`
23 ;; 39 ;;
24 CC=*) 40 CC=*)
25 CC=`echo $1 | cut -c 4-` 41 CC=`echo $1 | cut -c 4-`
26 ;; 42 ;;
27 CFLAGS=*) 43 CFLAGS=*)
33 ;; 49 ;;
34 esac 50 esac
35 shift 51 shift
36 done 52 done
37 53
54 # inheritance rules for install directories
55
56 if [ -z "$exec_prefix" ]
57 then
58 exec_prefix="$prefix"
59 fi
60 if [ -z "$bindir" ]
61 then
62 bindir="$exec_prefix/bin"
63 fi
64 if [ -z "$includedir" ]
65 then
66 includedir="$prefix/include"
67 fi
68 if [ -z "$libdir" ]
69 then
70 libdir="$exec_prefix/lib"
71 fi
72
73 # report the final configuration
74
75 echo "C code will be compiled with:"
76 echo " CC=$CC"
77 echo " CFLAGS=$CFLAGS"
78 echo "Installation directories:"
79 echo " bindir=$bindir"
80 echo " includedir=$includedir"
81 echo " libdir=$libdir"
82
38 # emit the Makefile include fragment 83 # emit the Makefile include fragment
39 echo "CC=$CC" > config.defs 84 echo "CC=$CC" > config.defs
40 echo "CFLAGS=$CFLAGS" >> config.defs 85 echo "CFLAGS=$CFLAGS" >> config.defs
41 echo "PREFIX=$PREFIX" >> config.defs 86 echo "bindir=$bindir" >> config.defs
87 echo "includedir=$includedir" >> config.defs
88 echo "libdir=$libdir" >> config.defs