Improve libnotify support in configure
authorRoy Marples <roy@marples.name>
Tue, 23 Sep 2014 21:00:09 +0000 (21:00 +0000)
committerRoy Marples <roy@marples.name>
Tue, 23 Sep 2014 21:00:09 +0000 (21:00 +0000)
configure

index 68c9da704f4e424d0cc0205e6611fcb80320a9da..879aad41c58d6cf427c93376513e8915fcd3db35 100755 (executable)
--- a/configure
+++ b/configure
@@ -14,7 +14,7 @@ WITH_DHCPCD_ONLINE=yes
 WITH_GTK=
 WITH_QT=
 WITH_ICONS=
-NOTIFY=yes
+NOTIFY=
 INCLUDEDIR=
 UI=
 
@@ -367,9 +367,18 @@ fi
        
 if [ -n "$WITH_GTK" -a "$WITH_GTK" != no ]; then
        PKG="$WITH_GTK"
+       if [ "$NOTIFY" = yes -o -z "$NOTIFY" ]; then
+               if ! pkg-config --cflags libnotify >/dev/null 2>&3; then
+                       echo "libnotify not found" >&2
+                       [ "$NOTIFY" = yes ] && exit 1
+                       NOTIFY=no
+               fi
+               NOTIFY=yes
+       fi
        if [ "$NOTIFY" = yes ]; then
                PKG="$PKG${PKG:+ }libnotify"
                echo "NOTIFY=           -DNOTIFY" >>$CONFIG_MK
+               echo "Building dhcpcd-gtk with notification support"
        fi
        GTK_CFLAGS=$(pkg-config --cflags $PKG)
        [ $? != 0 -a "$WITH_GTK" = yes ] && exit 1