From 69b1d07cf27c992c7375de5d7aa95db4edc58153 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 29 Mar 2010 21:08:58 +0200 Subject: do not detect the echo-without-newline syntax over and over this is a) more maintainable and b) faster, as it was done in the makefile generation loop as well. --- configure | 42 ++++++++++++------------------------------ 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/configure b/configure index de72c46..0cf7542 100755 --- a/configure +++ b/configure @@ -173,6 +173,12 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +# detect the "echo without newline" style. usage: echo $ECHO_N "$ECHO_C" +if echo '\c' | grep '\c' >/dev/null; then + ECHO_N=-n +else + ECHO_C='\c' +fi #------------------------------------------------------------------------------- # window system detection @@ -399,11 +405,7 @@ elif [ $COMMERCIAL_USER = "yes" ]; then else if [ -z "$LicenseKeyExt" ]; then echo - if echo '\c' | grep '\c' >/dev/null; then - echo -n "Please enter your license key: " - else - echo "Please enter your license key: \c" - fi + echo $ECHO_N "Please enter your license key: $ECHO_C" read LicenseKeyExt Licensee="Unknown user" fi @@ -3966,11 +3968,7 @@ elif [ "$Edition" = "OpenSource" ]; then echo "Type 'yes' to accept this license offer." echo "Type 'no' to decline this license offer." echo - if echo '\c' | grep '\c' >/dev/null; then - echo -n "Do you accept the terms of $affix license? " - else - echo "Do you accept the terms of $affix license? \c" - fi + echo $ECHO_N "Do you accept the terms of $affix license? $ECHO_C" read acceptance fi echo @@ -4001,11 +3999,7 @@ elif [ "$Edition" = "Preview" ]; then echo "Type 'yes' to accept this license offer." echo "Type 'no' to decline this license offer." echo - if echo '\c' | grep '\c' >/dev/null; then - echo -n "Do you accept the terms of the license? " - else - echo "Do you accept the terms of the license? \c" - fi + echo $ECHO_N "Do you accept the terms of the license? $ECHO_C" read acceptance fi echo @@ -4091,11 +4085,7 @@ elif [ "$Edition" != "OpenSource" ]; then echo "Type 'yes' to accept this license offer." echo "Type 'no' to decline this license offer." echo - if echo '\c' | grep '\c' >/dev/null; then - echo -n "Do you accept the terms of the $TheLicense? " - else - echo "Do you accept the terms of the $TheLicense? \c" - fi + echo $ECHO_N "Do you accept the terms of the $TheLicense? $ECHO_C" read acceptance fi echo @@ -7390,11 +7380,7 @@ else fi if [ "$OPT_VERBOSE" = "yes" ]; then - if echo '\c' | grep '\c' >/dev/null; then - echo -n "qmake vars .......... " - else - echo "qmake vars .......... \c" - fi + echo $ECHO_N "qmake vars .......... $ECHO_C" cat "$QMAKE_VARS_FILE" | tr '\n' ' ' echo "qmake switches ...... $QMAKE_SWITCHES" fi @@ -7771,11 +7757,7 @@ for file in .projects .projects.3; do continue; fi QMAKE_SPEC_ARGS="-spec $SPEC" - if echo '\c' | grep '\c' >/dev/null; then - echo -n " for $a" - else - echo " for $a\c" - fi + echo $ECHO_N " for $a$ECHO_C" QMAKE="$outpath/bin/qmake" QMAKE_ARGS="$QMAKE_SWITCHES $QMAKE_SPEC_ARGS" -- cgit v0.12