172 "--mandir"*) mandir=${ARG#--mandir} ;; |
175 "--mandir"*) mandir=${ARG#--mandir} ;; |
173 "--localedir"*) localedir=${ARG#--localedir} ;; |
176 "--localedir"*) localedir=${ARG#--localedir} ;; |
174 "--help"*) printhelp; abort_configure ;; |
177 "--help"*) printhelp; abort_configure ;; |
175 "--debug") BUILD_TYPE="debug" ;; |
178 "--debug") BUILD_TYPE="debug" ;; |
176 "--release") BUILD_TYPE="release" ;; |
179 "--release") BUILD_TYPE="release" ;; |
|
180 "--enable-static") FEATURE_STATIC=on ;; |
|
181 "--disable-static") unset FEATURE_STATIC ;; |
177 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
182 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
178 esac |
183 esac |
179 done |
184 done |
180 |
185 |
181 |
186 |
272 shift |
277 shift |
273 printf "$@" |
278 printf "$@" |
274 fi |
279 fi |
275 } |
280 } |
276 |
281 |
|
282 dependency_error_static() |
|
283 { |
|
284 print_check_msg "$dep_checked_static" "checking for static... " |
|
285 # dependency static toolchain="gcc" |
|
286 while true |
|
287 do |
|
288 if notistoolchain "gcc"; then |
|
289 break |
|
290 fi |
|
291 TEMP_LDFLAGS="$TEMP_LDFLAGS -static" |
|
292 print_check_msg "$dep_checked_static" "yes\n" |
|
293 dep_checked_static=1 |
|
294 return 1 |
|
295 done |
|
296 |
|
297 # dependency static toolchain="clang" |
|
298 while true |
|
299 do |
|
300 if notistoolchain "clang"; then |
|
301 break |
|
302 fi |
|
303 TEMP_LDFLAGS="$TEMP_LDFLAGS -static" |
|
304 print_check_msg "$dep_checked_static" "yes\n" |
|
305 dep_checked_static=1 |
|
306 return 1 |
|
307 done |
|
308 |
|
309 print_check_msg "$dep_checked_static" "no\n" |
|
310 dep_checked_static=1 |
|
311 return 0 |
|
312 } |
277 |
313 |
278 # start collecting dependency information |
314 # start collecting dependency information |
279 echo > "$TEMP_DIR/flags.mk" |
315 echo > "$TEMP_DIR/flags.mk" |
280 |
316 |
281 DEPENDENCIES_FAILED= |
317 DEPENDENCIES_FAILED= |
318 # |
354 # |
319 # TARGETS |
355 # TARGETS |
320 # |
356 # |
321 |
357 |
322 echo >> "$TEMP_DIR/flags.mk" |
358 echo >> "$TEMP_DIR/flags.mk" |
323 echo "configuring target: default" |
359 echo "configuring global target" |
324 echo "# flags for target default" >> "$TEMP_DIR/flags.mk" |
360 echo "# flags for unnamed target" >> "$TEMP_DIR/flags.mk" |
325 TEMP_CFLAGS= |
361 TEMP_CFLAGS= |
326 TEMP_CXXFLAGS= |
362 TEMP_CXXFLAGS= |
327 TEMP_LDFLAGS= |
363 TEMP_LDFLAGS= |
328 |
364 |
329 |
365 |
330 # Features |
366 # Features |
|
367 if [ -n "$FEATURE_STATIC" ]; then |
|
368 # check dependency |
|
369 if dependency_error_static ; then |
|
370 # "auto" features can fail and are just disabled in this case |
|
371 if [ "$FEATURE_STATIC" = "auto" ]; then |
|
372 DISABLE_FEATURE_STATIC=1 |
|
373 else |
|
374 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED static " |
|
375 ERROR=1 |
|
376 fi |
|
377 fi |
|
378 if [ -n "$DISABLE_FEATURE_STATIC" ]; then |
|
379 unset FEATURE_STATIC |
|
380 fi |
|
381 fi |
|
382 if [ -n "$FEATURE_STATIC" ]; then |
|
383 : |
|
384 else |
|
385 : |
|
386 fi |
331 |
387 |
332 |
388 |
333 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
389 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
334 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
390 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
335 fi |
391 fi |
368 echo "configure finished" |
424 echo "configure finished" |
369 echo |
425 echo |
370 echo "Build Config:" |
426 echo "Build Config:" |
371 echo " PREFIX: $prefix" |
427 echo " PREFIX: $prefix" |
372 echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
428 echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
|
429 echo "Features:" |
|
430 if [ -n "$FEATURE_STATIC" ]; then |
|
431 echo " static: on" |
|
432 else |
|
433 echo " static: off" |
|
434 fi |
373 echo |
435 echo |
374 |
436 |
375 # generate the config.mk file |
437 # generate the config.mk file |
376 cat > "$TEMP_DIR/config.mk" << __EOF__ |
438 cat > "$TEMP_DIR/config.mk" << __EOF__ |
377 # |
439 # |