Add --with-qt and --without-qk options.
[dhcpcd-ui] / configure
index 80c2b4f88273567a12e574f46b26a4d171bc30c3..8da4f077ed7ae320f9a21c7057e742566d5afd3e 100755 (executable)
--- a/configure
+++ b/configure
@@ -37,6 +37,8 @@ for x; do
        --icondir) ICONDIR=$var;;
        --with-gtk|--with-gtk+) WITH_GTK=${var:-yes};;
        --without-gtk|--without-gtk+) WITH_GTK=no;;
+       --with-qt) WITH_QT=${var:-yes};;
+       --without-qt) WITH_QT=no;;
        --enable-notification) NOTIFY=yes;;
        --disable-notification) NOTIFY=no;;
        --help) echo "See the README file for available options"; exit 0;;
@@ -237,6 +239,32 @@ fi
 XCC="$CC `$SED -n -e 's/CPPLAGS+=*\(.*\)/\1/p' $CONFIG_MK`"
 XCC="$XCC `$SED -n -e 's/CFLAGS+=*\(.*\)/\1/p' $CONFIG_MK`"
 
+if [ -z "$GETTEXT" ]; then
+       printf "Testing for gettext ... "
+       cat <<EOF >_gettext.c
+#include <libintl.h>
+int main(void) {
+       gettext("foo");
+       return 0;
+}
+EOF
+       LIB_INTL=
+       if $XCC _gettext.c -o _gettext 2>/dev/null; then
+               GETTEXT=yes
+       elif $XCC _gettext.c -o _gettext -lintl 2>/dev/null; then
+               GETTEXT="yes (-lintl)"
+               LIB_INTL=-lintl
+       else
+               GETTEXT=no
+       fi
+       echo "$GETTEXT"
+       rm -f _gettext.c _gettext
+fi
+if [ "$GETTEXT" != no ]; then
+       echo "#define HAS_GETTEXT" >>$CONFIG_H
+       echo "LIB_INTL= $LIB_INTL" >>$CONFIG_MK
+fi
+
 if [ -z "$STRLCPY" ]; then
        printf "Testing for strlcpy ... "
        cat <<EOF >_strlcpy.c
@@ -287,7 +315,7 @@ echo "LIB_DHCPCD=   $x" >>$CONFIG_MK
 
 # Due to our use of pkg-config, pass --as-needed to ld so we only link
 # what we actually need.
-echo "LDADD+=  -Wl,--as-needed" >>$CONFIG_MK
+echo "LDADD+=          -Wl,--as-needed" >>$CONFIG_MK
 
 UI=
 if [ "$WITH_GTK" = yes -o -z "$WITH_GTK" ]; then
@@ -303,7 +331,7 @@ elif [ -n "$WITH_GTK" -a "$WITH_GTK" != no ]; then
        fi
 fi
        
-if [ -n "$WITH_GTK" ]; then
+if [ -n "$WITH_GTK" -a "$WITH_GTK" != no ]; then
        PKG="$WITH_GTK"
        if [ "$NOTIFY" = yes ]; then
                PKG="$PKG${PKG:+ }libnotify"