-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·115 lines (104 loc) · 2.66 KB
/
configure
File metadata and controls
executable file
·115 lines (104 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#! /bin/sh -
#
# configure script for wak (awk implementation)
#
# This script writes a Makefile for wak, allowing
# a little control over 'prefix', 'CC', 'CFLAGS'
# For security
IFS='
'
OLDPATH="$PATH"
PATH=/bin:/usr/bin
export PATH
version='wak configure 25.12 20251223'
# Default values
prefix=${prefix-/usr/local}
CC=${CC-gcc}
CFLAGS=${CFLAGS-'-O3 -funsigned-char -std=c99 -Wall -Wextra -W -Wpointer-arith -Wstrict-prototypes -D_POSIX_C_SOURCE=200809L'}
help() {
echo "'configure' configures $version"
echo
echo Usage: ./configure [OPTION]... [VAR=VALUE]...
echo
echo 'To assign environment variables (CC, CFLAGS), specify them as'
echo VAR=VALUE, e.g. \'CC=clang\'
echo
echo Option defaults are shown in brackets.
echo
echo Configuration:
echo ' -h, --help display this help and exit'
echo ' -V, --version display version information and exit'
echo
echo Installation directory:
echo ' --prefix=PREFIX install architecture-independent files in PREFIX'
echo ' [/usr/local]'
echo \'make install\' will install to /usr/local/bin etc. by default.
echo Use e.g. \'--prefix=\$HOME\' to change this.
echo
echo with no options, configure these defaults:
show_defaults
exit 0
}
show_defaults() {
echo Using this config:
echo prefix=${prefix}
echo CC=${CC}
echo CFLAGS=${CFLAGS}
}
error() {
echo "$@" 1>&2
exit 1
}
make_makefile() {
show_defaults
sed -e "s?@prefix@?${prefix}?g" \
-e "s?@CC@?${CC}?g" \
-e "s?@CFLAGS@?${CFLAGS}?g" \
< Makefile.in > Makefile
}
if [ $# = 0 ]
then
echo 'No args; use defaults (--help to show options):'
#show_defaults
make_makefile
exit 0
fi
while [ $# != 0 ]
do
arg=$1
option=${arg%%=*} # arg up to an = (if any)
optval=${arg#*=} # arg following = (if any)
#echo option:${option}:
#echo optval:${optval}:
if [ -z $option ]
then
error 'Bad arg:' $1
fi
case $option in
'--?' | '-?' | --h | --he | --hel | --help | -h | -he | -hel | -help)
help
;;
--v | --ve | --ver | --vers | --versi | --versio | --version | -v | -ve | -ver | -vers | -versi | -versio | -version | -V)
echo $version
exit 0
;;
'--prefix')
prefix=$optval
;;
'CC')
CC=$optval
;;
'CFLAGS')
CFLAGS=$optval
;;
-*)
error Bad option arg: $1
;;
*)
error Bad arg: $1
;;
esac
shift
done
make_makefile
exit 0