Index: /trunk/src/kmk/Makefile.am
===================================================================
--- /trunk/src/kmk/Makefile.am	(revision 1108)
+++ /trunk/src/kmk/Makefile.am	(revision 1109)
@@ -110,4 +110,5 @@
 	-DCONFIG_WITH_XARGS \
 	-DCONFIG_WITH_NANOTS \
+	-DCONFIG_WITH_SET_CONDITIONALS \
 	-DCONFIG_PRETTY_COMMAND_PRINTING \
 	\
@@ -116,7 +117,7 @@
 	-DBUILD_PLATFORM_CPU=\"$(BUILD_TARGET_CPU)\" \
 	\
-        -DKBUILD_VERSION_MAJOR=0 \
-        -DKBUILD_VERSION_MINOR=1 \
-        -DKBUILD_VERSION_PATCH=0 \
+	-DKBUILD_VERSION_MAJOR=0 \
+	-DKBUILD_VERSION_MINOR=1 \
+	-DKBUILD_VERSION_PATCH=0 \
 	\
 	-DCONFIG_WITH_KMK_BUILTIN \
Index: /trunk/src/kmk/Makefile.kmk
===================================================================
--- /trunk/src/kmk/Makefile.kmk	(revision 1108)
+++ /trunk/src/kmk/Makefile.kmk	(revision 1109)
@@ -26,4 +26,5 @@
 	$(PATH_TARGET)/pwd.h \
 	$(PATH_TARGET)/inttypes.h
+TEMPLATE_BIN-KMK_CFLAGS.win.amd64 = $(TEMPLATE_BIN_CFLAGS.win.amd64) -wd4244 -wd4267
 TEMPLATE_BIN-KMK_CLEAN.win = $(TEMPLATE_BIN-KMK_DEPS.win)
 TEMPLATE_BIN-KMK_INCS = $(PATH_TARGET) . $(TEMPLATE_BIN_INCS)
@@ -112,4 +113,5 @@
 	CONFIG_WITH_XARGS \
 	CONFIG_WITH_NANOTS \
+	CONFIG_WITH_SET_CONDITIONALS \
 	CONFIG_PRETTY_COMMAND_PRINTING \
 	\
@@ -367,5 +369,7 @@
 	$(MAKE) -f testcase-math.kmk
 
-
-test_all:	test_math test_stack test_shell
-
+test_if1of:
+	$(MAKE) -f testcase-if1of.kmk
+
+test_all:	test_math test_stack test_shell test_if1of
+
Index: /trunk/src/kmk/read.c
===================================================================
--- /trunk/src/kmk/read.c	(revision 1108)
+++ /trunk/src/kmk/read.c	(revision 1109)
@@ -1519,5 +1519,5 @@
 
 /* Interpret conditional commands "ifdef", "ifndef", "ifeq",
-   "ifneq", "else" and "endif".
+   "ifneq", "if1of", "ifn1of", "else" and "endif".
    LINE is the input line, with the command as its first word.
 
@@ -1534,5 +1534,9 @@
 {
   char *cmdname;
+#ifdef CONFIG_WITH_SET_CONDITIONALS
+  enum { c_ifdef, c_ifndef, c_ifeq, c_ifneq, c_if1of, c_ifn1of, c_else, c_endif } cmdtype;
+#else
   enum { c_ifdef, c_ifndef, c_ifeq, c_ifneq, c_else, c_endif } cmdtype;
+#endif
   unsigned int i;
   unsigned int o;
@@ -1547,4 +1551,8 @@
   else chkword ("ifeq", c_ifeq)
   else chkword ("ifneq", c_ifneq)
+#ifdef CONFIG_WITH_SET_CONDITIONALS
+  else chkword ("if1of", c_if1of)
+  else chkword ("ifn1of", c_ifn1of)
+#endif
   else chkword ("else", c_else)
   else chkword ("endif", c_endif)
@@ -1687,5 +1695,9 @@
   else
     {
+#ifdef CONFIG_WITH_SET_CONDITIONALS
+      /* "ifeq", "ifneq", "if1of" or "ifn1of". */
+#else
       /* "ifeq" or "ifneq".  */
+#endif
       char *s1, *s2;
       unsigned int l;
@@ -1776,5 +1788,31 @@
 
       s2 = variable_expand (s2);
+#ifdef CONFIG_WITH_SET_CONDITIONALS
+      if (cmdtype == c_if1of || cmdtype == c_ifn1of)
+        {
+          const char *s1_cur;
+          unsigned int s1_len;
+          const char *s1_iterator = s1;
+
+          conditionals->ignoring[o] = (cmdtype == c_if1of); /* if not found */
+          while ((s1_cur = find_next_token (&s1_iterator, &s1_len)) != 0)
+            {
+              const char *s2_cur;
+              unsigned int s2_len;
+              const char *s2_iterator = s2;
+              while ((s2_cur = find_next_token (&s2_iterator, &s2_len)) != 0)
+                if (s2_len == s1_len
+                 && strneq (s2_cur, s1_cur, s1_len) )
+                  {
+                    conditionals->ignoring[o] = (cmdtype != c_if1of); /* found */
+                    break;
+                  }
+            }
+        }
+      else
+        conditionals->ignoring[o] = (streq (s1, s2) == (cmdtype == c_ifneq));
+#else
       conditionals->ignoring[o] = (streq (s1, s2) == (cmdtype == c_ifneq));
+#endif
     }
 
@@ -2069,5 +2107,5 @@
                 cmp timestamp maybe.h || cp -f timestamp maybe.h
 
-        This is implemented in remake.c where we don't consider the mtime of 
+        This is implemented in remake.c where we don't consider the mtime of
         the maybe-updated targets. */
       if (multi_mode != m_no && name[0] == '+'
Index: /trunk/src/kmk/testcase-if1of.kmk
===================================================================
--- /trunk/src/kmk/testcase-if1of.kmk	(revision 1109)
+++ /trunk/src/kmk/testcase-if1of.kmk	(revision 1109)
@@ -0,0 +1,80 @@
+# $Id: $
+## @file
+# kBuild - testcase for the if1of and ifn1of conditionals.
+#
+
+#
+# Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
+#
+# This file is part of kBuild.
+#
+# kBuild is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# kBuild is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with kBuild; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+#
+#
+
+DEPTH = ../..
+include $(PATH_KBUILD)/header.kmk
+
+# the basics.
+if1of (asdf,asdf)
+else
+ $(error busted)
+endif
+ifn1of (asdf,asdf)
+ $(error busted)
+endif
+
+# larger sets.
+if1of (1,2 3 4 5 6 7 8 9 0)
+ $(error busted)
+endif
+if1of (1,12 3 4 5 6 7 8 9 0)
+ $(error busted)
+endif
+if1of (1,2 31 4 5 6 7 8 9 0)
+ $(error busted)
+endif
+ifn1of (1,1 2 3 4 5 6 7 8 9 0)
+ $(error busted)
+endif
+ifn1of (8,1 2 3 4 5 6 7 8 9 0)
+ $(error busted)
+endif
+ifn1of (asdf,asdf)
+ $(error busted)
+endif
+ifn1of (asdf,asdf asdf)
+ $(error busted)
+endif
+
+# any in set 1 match any in set 2.
+if1of (1 3 5 7 9, 2 4 6 8)
+ $(error busted)
+endif
+ifn1of (1 2 3 4 5, 2 4 6 8)
+ $(error busted)
+endif
+
+# real life.
+ifn1of (win linux, linux)
+ $(error busted)
+endif
+ifn1of (win.x86, win.amd64 linux.x86 darwin.x86 win.x86 os2.x86)
+ $(error busted)
+endif
+
+
+all_recursive:
+	$(ECHO) "if1of and ifn1of works fine"
Index: /trunk/src/kmk/variable.c
===================================================================
--- /trunk/src/kmk/variable.c	(revision 1108)
+++ /trunk/src/kmk/variable.c	(revision 1109)
@@ -1036,4 +1036,5 @@
   && defined(CONFIG_WITH_EXPLICIT_MULTITARGET) \
   && defined(CONFIG_WITH_PREPEND_ASSIGNMENT) \
+  && defined(CONFIG_WITH_SET_CONDITIONALS) \
   && defined(KMK_HELPERS)
   (void) define_variable ("KMK_FEATURES", 12,
@@ -1048,4 +1049,5 @@
                           " explicit-multitarget"
                           " prepend-assignment"
+                          " set-conditionals"
                           " kb-src-tool kb-obj-base kb-obj-suff kb-src-prop kb-src-one "
                           , o_default, 0);
@@ -1077,6 +1079,9 @@
   strcat (buf, " explicit-multitarget");
 #  endif
-#  if defined (CONFIG_WITH_PREPEND_ASSIGNMENT) \
+#  if defined (CONFIG_WITH_PREPEND_ASSIGNMENT)
   strcat (buf, " prepend-assignment");
+#  endif
+#  if defined (CONFIG_WITH_SET_CONDITIONALS)
+  strcat (buf, " set-conditionals");
 #  endif
 #  if defined (KMK_HELPERS)
