--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;;
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
# 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
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"