-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·159 lines (139 loc) · 2.86 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/sh
DEST=Makefile
LOG=config.log
usage()
{
echo "Usage:"
echo " ./configure [options]"
echo "Options:"
echo " --enable-fltk-run (default)"
echo " --disable-fltk-run"
echo " --disable-prebuild"
echo " --enable-slow-cpu"
echo " --disable-slow-cpu (default)"
echo " --disable-xrandr"
echo " --with-fltk-dir=FLTK_DIR (default empty, means use installed version)"
}
log()
{
echo "$1"
echo "$1" >> $LOG
}
destwrite()
{
log "Write '$1'"
echo "$1" >> $DEST
}
USE_FLTK_RUN=1
HAVE_SLOW_CPU=0
FLTK_DIR=""
HAVE_XRANDR=1
PREBUILD_LANDSCAPE=1
rm -f $LOG
log "# input parameters"
if [ "$1" = "" ]; then
log "(none)"
fi
while [ "$1" != "" ]; do
PARAM=`echo $1 | awk -F= '{print $1}'`
VALUE=`echo $1 | awk -F= '{print $2}'`
log "$PARAM $VALUE"
case $PARAM in
--enable-fltk-run )
USE_FLTK_RUN=1
;;
--enable-slow-cpu )
HAVE_SLOW_CPU=1
;;
--disable-fltk-run )
USE_FLTK_RUN=0
;;
--disable-prebuild )
PREBUILD_LANDSCAPE=0
;;
--disable-slow-cpu )
HAVE_SLOW_CPU=0
;;
--disable-xrandr )
HAVE_XRANDR=0
;;
--with-fltk-dir )
FLTK_DIR=$VALUE
;;
-h | --help )
usage
exit 1
;;
*)
log "ERROR: unknown parameter \"$PARAM\""
usage
exit 1
;;
esac
shift
done
rm -f $DEST
# strip a trailing '/' from FLTK_DIR
lastchr=${FLTK_DIR#${FLTK_DIR%?}}
if [ "$lastchr" = "/" ]; then
FLTK_DIR=${FLTK_DIR%?}
fi
log "# output"
if [ "$FLTK_DIR" != "" ]; then
fltk_config=$FLTK_DIR/fltk-config
else
fltk_config=`which fltk-config`
fi
if [ "$fltk_config" = "" ]; then
log "FLTK not found!"
exit 1
fi
log "Using $fltk_config"
fltk_version=`$fltk_config --version`
log "FLTK version $fltk_version"
if [ "$fltk_version" = "" ]; then
log "FLTK version not found!"
exit 1
fi
if [ "$fltk_version" \< "1.3" ]; then
log "FLTK 1.3 or above needed"
exit 1
fi
if [ $HAVE_XRANDR = "1" ]; then
if [ ! -e "/usr/include/X11/extensions/Xrandr.h" ]; then
HAVE_XRANDR=0
log "No fullscreen support (install libxrandr-dev package if required)"
else
log "xrandr will be used for switching to fullscreen."
fi
fi
destwrite "# $DEST created by $0"
log "FLTK_DIR=\"$FLTK_DIR\""
if [ "$FLTK_DIR" != "" ]; then
destwrite "FLTK_DIR=$FLTK_DIR/"
else
destwrite "FLTK_DIR="
fi
destwrite "USE_FLTK_RUN=$USE_FLTK_RUN"
destwrite "HAVE_SLOW_CPU=$HAVE_SLOW_CPU"
if [ "$PREBUILD_LANDSCAPE" = "0" ]; then
destwrite "PREBUILD_LANDSCAPE=0"
fi
if [ "$HAVE_XRANDR" = "1" ]; then
destwrite "HAVE_XRANDR=1"
fi
APLAY_HAVE_PIDFILE=`man aplay | grep "process-id-file"`
if [ "$APLAY_HAVE_PIDFILE" != "" ]; then
destwrite "APLAY_HAVE_PIDFILE=1"
fi
FLTK_USES_XRENDER=`$fltk_config --ldflags | grep "Xrender"`
if [ "$FLTK_USES_XRENDER" != "" ]; then
destwrite "FLTK_USES_XRENDER=1"
fi
cat Makefile.in >>$DEST
log "$DEST written successfully."
# force complete rebuild
log "# postprocessing"
log "make clean"
make clean >> $LOG
log "Success - you can run make now!"