-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·93 lines (77 loc) · 2.65 KB
/
configure
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
#!/bin/sh
# Copyright (C) 2011-2013 Przemyslaw Pawelczyk <[email protected]>
#
# This software is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2.
# See <http://www.gnu.org/licenses/gpl-2.0.txt>.
#
# This software is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
# minimalistic configure-like script
set -e
SRCDIR="$(dirname $0)"
help() {
echo \
"Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--srcdir=DIR find the sources in DIR [configure dir]
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/vidma]
System types:
--host=HOST cross-compile to build programs to run on HOST
Some influential environment variables:
CFLAGS C compiler flags
LDFLAGS linker flags
CPPFLAGS C/C++/Objective C preprocessor flags
TARGET_ARCH Compiler and linker flags regarding target arch, like: -m32
"
exit 0
}
modify() {
if [ -n "$OPTARG" ]; then
CMDS="$CMDS/^$1 /"'s#\([^ ]\?\)= .*#\1= '"$OPTARG#;"
fi
}
for OPT in "$@"; do
case "$OPT" in
*=*)
OPTARG="$(expr "$OPT" : '[^=]*=\(.*\)' || true)"
;;
*)
OPTARG=""
;;
esac
case "$OPT" in
-h | --help) help ;;
--srcdir=*) SRCDIR="${OPTARG:-${SRCDIR}}" ;;
--prefix=*) modify PREFIX ;;
--exec-prefix=*) modify EPREFIX ;;
--bindir=*) modify BINDIR ;;
--datarootdir=*) modify DATADIR ;;
--mandir=*) modify MANDIR ;;
--docdir=*) modify DOCDIR ;;
--host=*) modify HOST ;;
CC=*) modify CC ;;
CPPFLAGS=*) modify CPPFLAGS ;;
CFLAGS=*) modify CFLAGS ;;
LDFLAGS=*) modify LDFLAGS ;;
TARGET_ARCH=*) modify TARGET_ARCH ;;
esac
done
OPTARG="$SRCDIR"
modify SRCDIR
sed "$CMDS" "$SRCDIR/Makefile.in" >Makefile