Re-write libdhcpcd to talk to dhcpcd directly and not use DBus.
[dhcpcd-ui] / configure
index 6be180d62798ac25087a8c30e78ebd790c7dffcf..cd598facdf4b0ac6f682ccd23fcf9b18a1aa3767 100755 (executable)
--- a/configure
+++ b/configure
@@ -170,8 +170,18 @@ if ! type "$CC" >/dev/null 2>&1; then
 fi
 
 echo "Using compiler .. $CC"
-if ! type "$CC" >/dev/null 2>&1; then
-       echo "$CC is not an executable"
+cat <<EOF >_test.c
+int main(void) {
+       return 0;
+}
+EOF
+_CC=false
+if $CC _test.c -o _test >/dev/null 2>&1; then
+       [ -x _test ] && _CC=true
+fi
+rm -f _test.c _test
+if ! $_CC; then
+       echo "$CC does not create executables"
        exit 1
 fi
 [ "$CC" != cc ] && echo "CC=   $CC" >>$CONFIG_MK
@@ -218,6 +228,9 @@ EOF
        mirbsd*|openbsd*);; # OpenBSD has many redundant decs in system headers
        *)              echo "CFLAGS+=  -Wredundant-decls" >>$CONFIG_MK;;
        esac
+else
+       # Disable assertations
+       echo "CFLAGS+=  -DNDEBUG" >>$CONFIG_MK
 fi
 
 # Add CPPFLAGS and CFLAGS to CC for testing features
@@ -275,20 +288,12 @@ echo "LIB_DHCPCD= $x" >>$CONFIG_MK
 # what we actually need.
 echo "LDADD+=  -Wl,--as-needed" >>$CONFIG_MK
 
-# Get DBus CFLAGS
-DBUS_CFLAGS=$(pkg-config --cflags dbus-1) || exit 1
-DBUS_LIBS=$(pkg-config --libs dbus-1) || exit 1
-echo "DBus CFLAGS=$DBUS_CFLAGS"
-echo "DBus LIBS=$DBUS_LIBS"
-echo "DBUS_CFLAGS=     $DBUS_CFLAGS" >>$CONFIG_MK
-echo "DBUS_LIBS=       $DBUS_LIBS" >>$CONFIG_MK
-
 UI=
 if [ "$WITH_GTK" = yes -o -z "$WITH_GTK" ]; then
-       if pkg-config --cflags gtk+-3.0 >/dev/null 2>&1; then
-               WITH_GTK="gtk+-3.0"
-       elif pkg-config --cflags gtk+-2.0 >/dev/null 2>&1; then
+       if pkg-config --cflags gtk+-2.0 >/dev/null 2>&1; then
                WITH_GTK="gtk+-2.0"
+       elif pkg-config --cflags gtk+-3.0 >/dev/null 2>&1; then
+               WITH_GTK="gtk+-3.0"
        fi
 elif [ -n "$WITH_GTK" -a "$WITH_GTK" != no ]; then
        if ! pkg-config --cflags $WITH_GTK >/dev/null; then