Improve qt diagnostics.
[dhcpcd-ui] / configure
index 381cf84a21a22c8b354820ab42226dc2ab7147f8..cc3a561bef05119c2f666292ae8e2ee04037d29f 100755 (executable)
--- a/configure
+++ b/configure
@@ -234,14 +234,15 @@ fi
 if [ "$DEBUG" != no -a "$DEBUG" != false ]; then
        echo "Adding debugging CFLAGS"
        cat <<EOF >>$CONFIG_MK
-CFLAGS+=       -g -Wall -Wextra -Wshadow -Wformat=2
+CFLAGS+=       -g -Wall -Wextra
 CFLAGS+=       -Wmissing-prototypes -Wmissing-declarations
-CFLAGS+=       -Wmissing-noreturn -Wmissing-format-attribute
-CFLAGS+=       -Wnested-externs
-CFLAGS+=       -Winline -Wwrite-strings -Wcast-align -Wcast-qual
-CFLAGS+=       -Wpointer-arith -Wstrict-overflow
-CFLAGS+=       -Wdeclaration-after-statement
+CFLAGS+=       -Wmissing-format-attribute -Wnested-externs
+CFLAGS+=       -Winline -Wcast-align -Wcast-qual -Wpointer-arith
+CFLAGS+=       -Wreturn-type -Wswitch -Wshadow
+CFLAGS+=       -Wcast-qual -Wwrite-strings
 CFLAGS+=       -Wconversion
+CFLAGS+=       -Wformat=2
+CFLAGS+=       -Wpointer-sign -Wmissing-noreturn
 EOF
        case "$OS" in
        mirbsd*|openbsd*);; # OpenBSD has many redundant decs in system headers
@@ -252,23 +253,6 @@ else
        echo "CFLAGS+=  -DNDEBUG" >>$CONFIG_MK
 fi
 
-printf "OS supports background scanning ... "
-# Most OS's don't support background scanning
-case "$OS" in
-       linux*|freebsd*)
-               BGSCAN=true;;
-       *)      BGSCAN=false;;
-esac
-printf "%s ... " "$OS"
-if $BGSCAN; then
-       echo "yes"
-       echo "CFLAGS+=  -DBG_SCAN" >> $CONFIG_MK
-       QMAKE_CONFIG="$QMAKE_CONFIG CONFIG+=build_bgscan"
-else
-       echo "no"
-fi
-
-
 # Add CPPFLAGS and CFLAGS to CC for testing features
 XCC="$CC `$SED -n -e 's/CPPLAGS+=*\(.*\)/\1/p' $CONFIG_MK`"
 XCC="$XCC `$SED -n -e 's/CFLAGS+=*\(.*\)/\1/p' $CONFIG_MK`"
@@ -381,10 +365,12 @@ if [ "$WITH_GTK" = yes -o -z "$WITH_GTK" ]; then
                WITH_GTK="gtk+-2.0"
        elif pkg-config --cflags gtk+-3.0 >/dev/null 2>&3; then
                WITH_GTK="gtk+-3.0"
+       else
+               echo "No suitable GTK+ library has been found"
        fi
 elif [ -n "$WITH_GTK" -a "$WITH_GTK" != no ]; then
        if ! pkg-config --cflags $WITH_GTK >/dev/null 2>&3; then
-               echo "$0: no suitable GTK+ library has been found" >&2
+               echo "No suitable GTK+ library has been found" >&2
                exit 1
        fi
 fi
@@ -414,6 +400,7 @@ fi
 
 DHCPCD_QT=false
 if [ -z "$WITH_QT" -o "$WITH_QT" != no ]; then
+       printf "Looking for qmake ... "
        if [ -z "$QMAKE" ]; then
                if [ -x "$QTDIR"/bin/qmake ]; then
                        QMAKE="$QTDIR"/bin/qmake
@@ -424,9 +411,13 @@ if [ -z "$WITH_QT" -o "$WITH_QT" != no ]; then
        if [ -x "$QMAKE" ]; then
                UI="$UI${UI+ }dhcpcd-qt"
                DHCPCD_QT=true
+               echo "$QMAKE"
        else
-               echo "$0: no suitable Qt library has been found" >&2
-               [ -z "$WITH_QT" ] || exit 1
+               echo "no"
+               if [ -n "$WITH_QT" ]; then
+                       echo "No suitable Qt library has been found" >&2
+                       exit 1
+               fi
        fi
 fi
 
@@ -485,7 +476,7 @@ EOF
                fi
                rm -f _curses.c _curses
        fi
-else
+elif [ ! "$WITH_CURSES" = no ]; then
        echo "no"
 fi