-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
executable file
·83 lines (70 loc) · 1.81 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
#!/bin/sh
PREFIX=/usr/local
OPT=yes
DBG=yes
PTHREAD=no
config_h=src/config.h
for arg; do
case "$arg" in
--prefix=*)
value=`echo $arg | sed 's/--prefix=//'`
PREFIX=${value:-$prefix}
;;
--enable-opt)
OPT=yes;;
--disable-opt)
OPT=no;;
--enable-debug)
DBG=yes;;
--disable-debug)
DBG=no;;
--thread-safe)
PTHREAD=yes;;
--thread-unsafe)
PTHREAD=no;;
--help)
echo 'usage: ./configure [options]'
echo 'options:'
echo ' --prefix=<path>: installation path (default: /usr/local)'
echo ' --enable-opt: enable speed optimizations (default)'
echo ' --disable-opt: disable speed optimizations'
echo ' --enable-debug: include debugging symbols (default)'
echo ' --disable-debug: do not include debugging symbols'
echo ' --thread-safe: protect concurrent access to matrix cache'
echo ' --thread-unsafe: assume only single-threaded operation (default)'
echo 'all invalid options are silently ignored'
exit 0
;;
esac
done
echo "prefix: $PREFIX"
echo "optimize for speed: $OPT"
echo "include debugging symbols: $DBG"
echo "multi-threading safe: $PTHREAD"
echo 'creating makefile ...'
echo "PREFIX = $PREFIX" >Makefile
if [ "$DBG" = 'yes' ]; then
echo 'dbg = -g' >>Makefile
fi
if [ "$OPT" = 'yes' ]; then
echo 'opt = -O3' >>Makefile
fi
if [ "$PTHREAD" = yes ]; then
echo 'pthr = -lpthread' >>Makefile
echo 'name = anim-mt' >>Makefile
else
echo 'name = anim' >>Makefile
fi
cat Makefile.in >>Makefile
echo 'creating config.h ...'
echo '#ifndef ANIM_CONFIG_H_' >src/config.h
echo '#define ANIM_CONFIG_H_' >>src/config.h
echo >>src/config.h
if [ "$PTHREAD" = yes ]; then
echo '#define ANIM_THREAD_SAFE' >>src/config.h
else
echo '#undef ANIM_THREAD_SAFE' >>src/config.h
fi
echo >>src/config.h
echo '#endif /* ANIM_CONFIG_H_ */'>>src/config.h
echo 'configuration completed, type make (or gmake) to build.'