187 LOCALSTATEDIR=$LOCALSTATEDIR |
187 LOCALSTATEDIR=$LOCALSTATEDIR |
188 INCLUDEDIR=$INCLUDEDIR |
188 INCLUDEDIR=$INCLUDEDIR |
189 INFODIR=$INFODIR |
189 INFODIR=$INFODIR |
190 MANDIR=$MANDIR |
190 MANDIR=$MANDIR |
191 __EOF__ |
191 __EOF__ |
192 cat > "$TEMP_DIR/config.mk" << __EOF__ |
192 sort -u -o "$TEMP_DIR/vars.mk" "$TEMP_DIR/vars.mk" |
193 # |
193 |
194 # config.mk generated by configure |
194 |
195 # |
195 # toolchain detection utilities |
196 __EOF__ |
|
197 sort -u "$TEMP_DIR/vars.mk" >> "$TEMP_DIR/config.mk" |
|
198 |
|
199 |
|
200 # toolchain detection |
|
201 # this will insert make vars to config.mk |
|
202 . make/toolchain.sh |
196 . make/toolchain.sh |
203 if [ -n "$TOOLCHAIN_ERROR" ]; then |
|
204 echo "Toolchain error: $TOOLCHAIN_ERROR" |
|
205 echo "Abort." |
|
206 abort_configure |
|
207 fi |
|
208 |
197 |
209 # |
198 # |
210 # DEPENDENCIES |
199 # DEPENDENCIES |
211 # |
200 # |
212 |
201 |
452 break |
451 break |
453 done |
452 done |
454 break |
453 break |
455 done |
454 done |
456 |
455 |
457 # add unnamed dependency flags to config.mk |
456 # add general dependency flags to flags.mk |
458 echo >> "$TEMP_DIR/config.mk" |
457 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
459 if [ -n "${TEMP_CFLAGS}" ]; then |
458 if [ -n "${TEMP_CFLAGS}" ]; then |
460 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk" |
459 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
|
460 fi |
|
461 if [ -n "${TEMP_CXXFLAGS}" ]; then |
|
462 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
461 fi |
463 fi |
462 if [ -n "${TEMP_LDFLAGS}" ]; then |
464 if [ -n "${TEMP_LDFLAGS}" ]; then |
463 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk" |
465 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
464 fi |
466 fi |
465 |
467 |
466 # |
468 # |
467 # OPTION VALUES |
469 # OPTION VALUES |
468 # |
470 # |
629 ERROR=1 |
635 ERROR=1 |
630 fi |
636 fi |
631 fi |
637 fi |
632 fi |
638 fi |
633 |
639 |
634 echo >> "$TEMP_DIR/config.mk" |
|
635 if [ -n "${TEMP_CFLAGS}" ]; then |
640 if [ -n "${TEMP_CFLAGS}" ]; then |
636 echo "DAV_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk" |
641 echo "DAV_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
|
642 fi |
|
643 if [ -n "${TEMP_CXXFLAGS}" ]; then |
|
644 echo "DAV_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
637 fi |
645 fi |
638 if [ "$BUILD_TYPE" = "debug" ]; then |
646 if [ "$BUILD_TYPE" = "debug" ]; then |
639 echo 'DAV_CFLAGS += ${DEBUG_FLAGS}' >> "$TEMP_DIR/config.mk" |
647 echo 'DAV_CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
648 echo 'DAV_CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
640 fi |
649 fi |
641 if [ "$BUILD_TYPE" = "release" ]; then |
650 if [ "$BUILD_TYPE" = "release" ]; then |
642 echo 'DAV_CFLAGS += ${RELEASE_FLAGS}' >> "$TEMP_DIR/config.mk" |
651 echo 'DAV_CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
652 echo 'DAV_CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
643 fi |
653 fi |
644 if [ -n "${TEMP_LDFLAGS}" ]; then |
654 if [ -n "${TEMP_LDFLAGS}" ]; then |
645 echo "DAV_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk" |
655 echo "DAV_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
646 fi |
656 fi |
647 |
657 |
|
658 echo >> "$TEMP_DIR/flags.mk" |
648 # Target |
659 # Target |
|
660 echo "# flags for unnamed target" >> "$TEMP_DIR/flags.mk" |
649 TEMP_CFLAGS= |
661 TEMP_CFLAGS= |
|
662 TEMP_CXXFLAGS= |
650 TEMP_LDFLAGS= |
663 TEMP_LDFLAGS= |
651 |
664 |
652 if dependency_error_deptest; then |
665 if dependency_error_deptest; then |
653 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED deptest " |
666 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED deptest " |
654 ERROR=1 |
667 ERROR=1 |
655 fi |
668 fi |
656 |
669 |
657 # Features |
670 # Features |
658 |
671 |
659 |
672 |
660 echo >> "$TEMP_DIR/config.mk" |
|
661 if [ -n "${TEMP_CFLAGS}" ]; then |
673 if [ -n "${TEMP_CFLAGS}" ]; then |
662 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk" |
674 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
|
675 fi |
|
676 if [ -n "${TEMP_CXXFLAGS}" ]; then |
|
677 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
663 fi |
678 fi |
664 if [ "$BUILD_TYPE" = "debug" ]; then |
679 if [ "$BUILD_TYPE" = "debug" ]; then |
665 echo 'CFLAGS += ${DEBUG_FLAGS}' >> "$TEMP_DIR/config.mk" |
680 echo 'CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
681 echo 'CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
666 fi |
682 fi |
667 if [ "$BUILD_TYPE" = "release" ]; then |
683 if [ "$BUILD_TYPE" = "release" ]; then |
668 echo 'CFLAGS += ${RELEASE_FLAGS}' >> "$TEMP_DIR/config.mk" |
684 echo 'CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
685 echo 'CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
669 fi |
686 fi |
670 if [ -n "${TEMP_LDFLAGS}" ]; then |
687 if [ -n "${TEMP_LDFLAGS}" ]; then |
671 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk" |
688 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
672 fi |
689 fi |
673 |
690 |
|
691 |
|
692 # final result |
674 if [ $ERROR -ne 0 ]; then |
693 if [ $ERROR -ne 0 ]; then |
675 echo |
694 echo |
676 echo "Error: Unresolved dependencies" |
695 echo "Error: Unresolved dependencies" |
677 echo "$DEPENDENCIES_FAILED" |
696 echo "$DEPENDENCIES_FAILED" |
678 abort_configure |
697 abort_configure |