diff options
Diffstat (limited to 'tools/configure')
-rwxr-xr-x | tools/configure | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/tools/configure b/tools/configure index 2cd855e0c5..2bea201324 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -240,7 +240,7 @@ whichdevel () { | |||
240 | # | 240 | # |
241 | echo "" | 241 | echo "" |
242 | echo "Enter your developer options (press enter when done)" | 242 | echo "Enter your developer options (press enter when done)" |
243 | echo "(D)EBUG, (L)ogf, (S)imulator" | 243 | echo "(D)EBUG, (L)ogf, (S)imulator, (P)rofiling" |
244 | cont=1 | 244 | cont=1 |
245 | 245 | ||
246 | while [ $cont = "1" ]; do | 246 | while [ $cont = "1" ]; do |
@@ -249,19 +249,29 @@ whichdevel () { | |||
249 | 249 | ||
250 | case $option in | 250 | case $option in |
251 | [Dd]) | 251 | [Dd]) |
252 | echo "define DEBUG" | 252 | if [ "yes" = "$profile" ]; then |
253 | debug="-DDEBUG" | 253 | echo "Debug is incompatible with profiling" |
254 | GCCOPTS="$GCCOPTS -g -DDEBUG" | 254 | else |
255 | echo "define DEBUG" | ||
256 | use_debug="yes" | ||
257 | fi | ||
255 | ;; | 258 | ;; |
256 | [Ll]) | 259 | [Ll]) |
257 | logf="yes" | ||
258 | echo "logf() support enabled" | 260 | echo "logf() support enabled" |
259 | use_logf="#define ROCKBOX_HAS_LOGF 1" | 261 | logf="yes" |
260 | ;; | 262 | ;; |
261 | [Ss]) | 263 | [Ss]) |
262 | echo "Simulator build enabled" | 264 | echo "Simulator build enabled" |
263 | simulator="yes" | 265 | simulator="yes" |
264 | ;; | 266 | ;; |
267 | [Pp]) | ||
268 | if [ "yes" = "$use_debug" ]; then | ||
269 | echo "Profiling is incompatible with debug" | ||
270 | else | ||
271 | echo "Profiling support is enabled" | ||
272 | profile="yes" | ||
273 | fi | ||
274 | ;; | ||
265 | *) | 275 | *) |
266 | echo "done" | 276 | echo "done" |
267 | cont=0 | 277 | cont=0 |
@@ -269,11 +279,23 @@ whichdevel () { | |||
269 | esac | 279 | esac |
270 | done | 280 | done |
271 | 281 | ||
282 | if [ "yes" = "$use_debug" ]; then | ||
283 | debug="-DDEBUG" | ||
284 | GCCOPTS="$GCCOPTS -g -DDEBUG" | ||
285 | fi | ||
286 | if [ "yes" = "$logf" ]; then | ||
287 | use_logf="#define ROCKBOX_HAS_LOGF 1" | ||
288 | fi | ||
272 | if [ "yes" = "$simulator" ]; then | 289 | if [ "yes" = "$simulator" ]; then |
273 | debug="-DDEBUG" | 290 | debug="-DDEBUG" |
274 | extradefines="-DSIMULATOR" | 291 | extradefines="$extradefines -DSIMULATOR" |
275 | whichsim | 292 | whichsim |
276 | fi | 293 | fi |
294 | if [ "yes" = "$profile" ]; then | ||
295 | extradefines="$extradefines -DRB_PROFILE" | ||
296 | PROFILE_OPTS="-finstrument-functions" | ||
297 | GCCOPTS="$GCCOPTS $GCCOPTIMIZE" | ||
298 | fi | ||
277 | } | 299 | } |
278 | 300 | ||
279 | whichsim () { | 301 | whichsim () { |
@@ -902,6 +924,7 @@ sed > Makefile \ | |||
902 | -e "s,@FLASHFILE@,${flash},g" \ | 924 | -e "s,@FLASHFILE@,${flash},g" \ |
903 | -e "s,@PLUGINS@,${plugins},g" \ | 925 | -e "s,@PLUGINS@,${plugins},g" \ |
904 | -e "s,@CODECS@,${codecs},g" \ | 926 | -e "s,@CODECS@,${codecs},g" \ |
927 | -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \ | ||
905 | -e "s,@GCCOPTS@,${GCCOPTS},g" \ | 928 | -e "s,@GCCOPTS@,${GCCOPTS},g" \ |
906 | -e "s!@LDOPTS@!${LDOPTS}!g" \ | 929 | -e "s!@LDOPTS@!${LDOPTS}!g" \ |
907 | -e "s,@LOADADDRESS@,${loadaddress},g" \ | 930 | -e "s,@LOADADDRESS@,${loadaddress},g" \ |
@@ -952,6 +975,7 @@ export WINDRES=@WINDRES@ | |||
952 | export DLLTOOL=@DLLTOOL@ | 975 | export DLLTOOL=@DLLTOOL@ |
953 | export DLLWRAP=@DLLWRAP@ | 976 | export DLLWRAP=@DLLWRAP@ |
954 | export RANLIB=@RANLIB@ | 977 | export RANLIB=@RANLIB@ |
978 | export PROFILE_OPTS=@PROFILE_OPTS@ | ||
955 | export GCCOPTS=@GCCOPTS@ | 979 | export GCCOPTS=@GCCOPTS@ |
956 | export LOADADDRESS=@LOADADDRESS@ | 980 | export LOADADDRESS=@LOADADDRESS@ |
957 | export SIMVER=@SIMVER@ | 981 | export SIMVER=@SIMVER@ |