From 709cc8800e7d8600e181cf6b9f8b1033faefe596 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 24 Feb 2012 14:35:56 +0100 Subject: make makefile generation under unix sane we now simply call qmake -r, which is also what we do under windows. -fast mode is retained for examples and tests, though with moderately modified semantics (i couldn't be bothered to decipher what the old ones were supposed to be). Change-Id: Id2c2d2bed9c8d52ac42f31b388bffc34f4649650 Reviewed-by: Joerg Bornemann --- configure | 241 ++++++++----------------------------------------------------- qtbase.pro | 4 +- 2 files changed, 34 insertions(+), 211 deletions(-) diff --git a/configure b/configure index 9e17df68ce..a29589befa 100755 --- a/configure +++ b/configure @@ -6125,225 +6125,48 @@ EXEC="" # build makefiles based on the configuration #------------------------------------------------------------------------------- -echo "Finding project files. Please wait..." if [ "$CFG_NOPROCESS" != "yes" ]; then - "$outpath/bin/qmake" -prl -r "${relpath}/qtbase.pro" - if [ -f "${relpath}/qtbase.pro" ]; then - mkfile="${outpath}/Makefile" - [ -f "$mkfile" ] && chmod +w "$mkfile" - QTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" "${relpath}/qtbase.pro" -o "$mkfile" - fi -fi - -# .projects -> projects to process -# .projects.1 -> qt and moc -# .projects.2 -> subdirs and libs -# .projects.3 -> the rest -rm -f .projects .projects.1 .projects.2 .projects.3 - -QMAKE_PROJECTS=`find "$relpath/." -name '*.pro' -print | sed 's-/\./-/-'` -if [ -z "$AWK" ]; then - for p in `echo $QMAKE_PROJECTS`; do - echo "$p" >> .projects - done -else - cat >projects.awk <target_file - } - - matched_target = 0 - template_lib = 0 - input_file = FILENAME - target_file = "" -} - -/^(TARGET.*=)/ { - if ( \$3 == "moc" || \$3 ~ /^Qt/ ) { - target_file = first - matched_target = 1 - } else if ( \$3 == "lrelease" || \$3 == "qm_phony_target" ) { - target_file = second - matched_target = 1 - } -} - -matched_target == 0 && /^(TEMPLATE.*=)/ { - if ( \$3 == "subdirs" ) - target_file = second - else if ( \$3 == "lib" ) - template_lib = 1 - else - target_file = third -} - -matched_target == 0 && template_lib == 1 && /^(CONFIG.*=)/ { - if ( \$0 ~ /plugin/ ) - target_file = third - else - target_file = second -} - -END { - if ( input_file ) { - if ( ! target_file ) - target_file = third - print input_file >>target_file - } -} - -EOF - - rm -f .projects.all - for p in `echo $QMAKE_PROJECTS`; do - echo "$p" >> .projects.all - done - - # if you get errors about the length of the command line to awk, change the -l arg - # to split below - split -l 100 .projects.all .projects.all. - for p in .projects.all.*; do - "$AWK" -f projects.awk `cat $p` - [ -f .projects.1.tmp ] && cat .projects.1.tmp >> .projects.1 - [ -f .projects.2.tmp ] && cat .projects.2.tmp >> .projects.2 - [ -f .projects.3.tmp ] && cat .projects.3.tmp >> .projects.3 - rm -f .projects.1.tmp .projects.2.tmp .projects.3.tmp $p - done - rm -f .projects.all* projects.awk - - [ -f .projects.1 ] && cat .projects.1 >>.projects - [ -f .projects.2 ] && cat .projects.2 >>.projects - rm -f .projects.1 .projects.2 - if [ -f .projects.3 ] && [ "$OPT_FAST" = "no" ]; then - cat .projects.3 >>.projects - rm -f .projects.3 - fi -fi -# don't sort Qt and MOC in with the other project files -# also work around a segfaulting uniq(1) -if [ -f .sorted.projects.2 ]; then - sort .sorted.projects.2 > .sorted.projects.2.new - mv -f .sorted.projects.2.new .sorted.projects.2 - cat .sorted.projects.2 >> .sorted.projects.1 -fi -[ -f .sorted.projects.1 ] && sort .sorted.projects.1 >> .sorted.projects -rm -f .sorted.projects.2 .sorted.projects.1 - -NORM_PROJECTS=0 -FAST_PROJECTS=0 -if [ -f .projects ]; then - uniq .projects >.tmp - mv -f .tmp .projects - NORM_PROJECTS=`cat .projects | wc -l | sed -e "s, ,,g"` -fi -if [ -f .projects.3 ]; then - uniq .projects.3 >.tmp - mv -f .tmp .projects.3 - FAST_PROJECTS=`cat .projects.3 | wc -l | sed -e "s, ,,g"` -fi -echo " `expr $NORM_PROJECTS + $FAST_PROJECTS` projects found." -echo - -PART_ROOTS= -for part in $CFG_BUILD_PARTS; do - case "$part" in - tools) PART_ROOTS="$PART_ROOTS tools" ;; - libs) PART_ROOTS="$PART_ROOTS src" ;; - translations) PART_ROOTS="$PART_ROOTS translations" ;; - examples) PART_ROOTS="$PART_ROOTS examples" ;; - *) ;; - esac -done - -if [ "$CFG_DEV" = "yes" ]; then - PART_ROOTS="$PART_ROOTS tests" -fi - -echo "Creating makefiles. Please wait..." -for file in .projects .projects.3; do - [ '!' -f "$file" ] && continue - for a in `cat $file`; do - IN_ROOT=no - for r in $PART_ROOTS; do - if echo "$a" | grep "^$r" >/dev/null 2>&1 || echo "$a" | grep "^$relpath/$r" >/dev/null 2>&1; then - IN_ROOT=yes - break - fi - done - [ "$IN_ROOT" = "no" ] && continue - - case $a in - *winmain/winmain.pro) - if [ "$CFG_NOPROCESS" = "yes" ] || [ "$XPLATFORM_MINGW" != "yes" ]; then - continue - fi - ;; - */qmake/qmake.pro) continue ;; - *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*tools/qdoc*|*tools/qdbusxml2cpp*|*tools/qdbuscpp2xml*) ;; - *) if [ "$CFG_NOPROCESS" = "yes" ]; then - continue - fi;; - esac - dir=`dirname "$a" | sed -e "s;$sepath;.;g"` - test -d "$dir" || mkdir -p "$dir" - OUTDIR="$outpath/$dir" - if [ -f "${OUTDIR}/Makefile" ] && [ "$OPT_FAST" = "yes" ]; then - # fast configure - the makefile exists, skip it - # since the makefile exists, it was generated by qmake, which means we - # can skip it, since qmake has a rule to regenerate the makefile if the .pro - # file changes... - [ "$OPT_VERBOSE" = "yes" ] && echo " skipping $a" - continue; - fi - echo $ECHO_N " for $a$ECHO_C" - - QMAKE="$outpath/bin/qmake" - if [ "$file" = ".projects.3" ]; then - echo " (fast)" - - cat >"${OUTDIR}/Makefile" < "$outpath/$d/Makefile" <>${OUTDIR}/Makefile - cat >>"${OUTDIR}/Makefile" <