Index: /trunk/src/gmakenew/Makefile.kmk
===================================================================
--- /trunk/src/gmakenew/Makefile.kmk	(revision 941)
+++ /trunk/src/gmakenew/Makefile.kmk	(revision 942)
@@ -50,4 +50,6 @@
 	kmkbuiltin/strmode.c \
 	kmkbuiltin/strlcpy.c \
+	getopt.c \
+	getopt1.c \
 	electric.c
 
@@ -65,13 +67,11 @@
 	kmkbuiltin/fts.c \
 	glob/glob.c \
-	glob/fnmatch.c \
-	getopt.c \
-	getopt1.c
+	glob/fnmatch.c
 
 kmkmissing_SOURCES.win += \
+	kmkbuiltin/mscfakes.c \
+	kmkbuiltin/fts.c
 	glob/glob.c \
 	glob/fnmatch.c \
-	getopt.c \
-	getopt1.c \
 	getloadavg.c \
 	w32/subproc/misc.c \
@@ -79,7 +79,5 @@
 	w32/subproc/w32err.c \
 	w32/compat/dirent.c \
-	w32/pathstuff.c \
-	kmkbuiltin/mscfakes.c \
-	kmkbuiltin/fts.c
+	w32/pathstuff.c
 
 #
Index: /trunk/src/gmakenew/kmkbuiltin/cat.c
===================================================================
--- /trunk/src/gmakenew/kmkbuiltin/cat.c	(revision 941)
+++ /trunk/src/gmakenew/kmkbuiltin/cat.c	(revision 942)
@@ -105,10 +105,5 @@
 	optarg = NULL;
 	optopt = 0;
-#if defined(__FreeBSD__) || defined(__EMX__) || defined(__APPLE__)
-	optreset = 1;
-	optind = 1;
-#else
 	optind = 0; /* init */
-#endif
 
 #ifdef kmk_builtin_cat /* kmk did this already. */
Index: /trunk/src/gmakenew/kmkbuiltin/cp.c
===================================================================
--- /trunk/src/gmakenew/kmkbuiltin/cp.c	(revision 941)
+++ /trunk/src/gmakenew/kmkbuiltin/cp.c	(revision 942)
@@ -139,10 +139,5 @@
         optarg = NULL;
         optopt = 0;
-#if defined(__FreeBSD__) || defined(__EMX__) || defined(__APPLE__)
-        optreset = 1;
-        optind = 1;
-#else
         optind = 0; /* init */
-#endif
 
 	Hflag = Lflag = Pflag = 0;
Index: /trunk/src/gmakenew/kmkbuiltin/install.c
===================================================================
--- /trunk/src/gmakenew/kmkbuiltin/install.c	(revision 941)
+++ /trunk/src/gmakenew/kmkbuiltin/install.c	(revision 942)
@@ -154,10 +154,5 @@
         optarg = NULL;
         optopt = 0;
-#if defined(__FreeBSD__) || defined(__EMX__) || defined(__APPLE__)
-        optreset = 1;
-        optind = 1;
-#else
         optind = 0; /* init */
-#endif
 
 	iflags = 0;
Index: /trunk/src/gmakenew/kmkbuiltin/ln.c
===================================================================
--- /trunk/src/gmakenew/kmkbuiltin/ln.c	(revision 941)
+++ /trunk/src/gmakenew/kmkbuiltin/ln.c	(revision 942)
@@ -92,10 +92,5 @@
         optarg = NULL;
         optopt = 0;
-#if defined(__FreeBSD__) || defined(__EMX__) || defined(__APPLE__)
-        optreset = 1;
-        optind = 1;
-#else
         optind = 0; /* init */
-#endif
 
 #if 0 /* kmk: we don't need this. */
Index: /trunk/src/gmakenew/kmkbuiltin/mkdir.c
===================================================================
--- /trunk/src/gmakenew/kmkbuiltin/mkdir.c	(revision 941)
+++ /trunk/src/gmakenew/kmkbuiltin/mkdir.c	(revision 942)
@@ -82,18 +82,13 @@
 	mode = NULL;
 
-    /* reinitialize globals */
-    vflag = 0;
-
-    /* kmk: reset getopt and set progname */
-    g_progname = argv[0];
-    opterr = 1;
-    optarg = NULL;
-    optopt = 0;
-#if defined(__FreeBSD__) || defined(__EMX__) || defined(__APPLE__)
-    optreset = 1;
-    optind = 1;
-#else
-    optind = 0; /* init */
-#endif
+	/* reinitialize globals */
+	vflag = 0;
+
+	/* kmk: reset getopt and set progname */
+	g_progname = argv[0];
+	opterr = 1;
+	optarg = NULL;
+	optopt = 0;
+	optind = 0; /* init */
 	while ((ch = getopt(argc, argv, "m:pv")) != -1)
 		switch(ch) {
Index: /trunk/src/gmakenew/kmkbuiltin/mv.c
===================================================================
--- /trunk/src/gmakenew/kmkbuiltin/mv.c	(revision 941)
+++ /trunk/src/gmakenew/kmkbuiltin/mv.c	(revision 942)
@@ -132,10 +132,5 @@
 	optarg = NULL;
 	optopt = 0;
-#if defined(__FreeBSD__) || defined(__EMX__) || defined(__APPLE__)
-	optreset = 1;
-	optind = 1;
-#else
 	optind = 0; /* init */
-#endif
 
 	while ((ch = getopt(argc, argv, "finv")) != -1)
Index: /trunk/src/gmakenew/kmkbuiltin/printf.c
===================================================================
--- /trunk/src/gmakenew/kmkbuiltin/printf.c	(revision 941)
+++ /trunk/src/gmakenew/kmkbuiltin/printf.c	(revision 942)
@@ -146,10 +146,5 @@
 	optarg = NULL;
 	optopt = 0;
-#if defined(__FreeBSD__) || defined(__EMX__) || defined(__APPLE__)
-	optreset = 1;
-	optind = 1;
-#else
 	optind = 0; /* init */
-#endif
 
 #if !defined(SHELL) && !defined(BUILTIN) && !defined(kmk_builtin_printf) /* kmk did this already. */
Index: /trunk/src/gmakenew/kmkbuiltin/rm.c
===================================================================
--- /trunk/src/gmakenew/kmkbuiltin/rm.c	(revision 941)
+++ /trunk/src/gmakenew/kmkbuiltin/rm.c	(revision 942)
@@ -123,10 +123,5 @@
         optarg = NULL;
         optopt = 0;
-#if defined(__FreeBSD__) || defined(__EMX__) || defined(__APPLE__)
-        optreset = 1;
-        optind = 1;
-#else
         optind = 0; /* init */
-#endif
 
 #if 0 /* kmk: we don't need this */
Index: /trunk/src/gmakenew/kmkbuiltin/rmdir.c
===================================================================
--- /trunk/src/gmakenew/kmkbuiltin/rmdir.c	(revision 941)
+++ /trunk/src/gmakenew/kmkbuiltin/rmdir.c	(revision 942)
@@ -87,10 +87,5 @@
 	optarg = NULL;
 	optopt = 0;
-#if defined(__FreeBSD__) || defined(__EMX__) || defined(__APPLE__)
-	optreset = 1;
-	optind = 1;
-#else
 	optind = 0; /* init */
-#endif
 	while ((ch = getopt_long(argc, argv, "pv", long_options, NULL)) != -1)
 		switch(ch) {
