Break crt headers into separate directory structure with separate enable switch.  Change all with options to enable options.

git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@1517 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-headers/Makefile.am b/mingw-w64-headers/Makefile.am
index 2efaed7..903a595 100644
--- a/mingw-w64-headers/Makefile.am
+++ b/mingw-w64-headers/Makefile.am
@@ -7,9 +7,6 @@
   include/*.hxx \
   include/*.rh \
   include/*.ver \
-  include/sys/*.h \
-  include/sec_api/*.h \
-  include/sec_api/sys/*.h \
   include/GL/*.h
 
 baseheaddir = $(includedir)/../$(host)/include
@@ -19,14 +16,41 @@
 glheaddir = $(baseheaddir)/GL
 sdksheaddir = $(baseheaddir)/sdks
 
-basehead_HEADERS = @BASEHEAD_LIST@
-syshead_HEADERS = @SYSHEAD_LIST@
-sechead_HEADERS = @SECHEAD_LIST@
-secsyshead_HEADERS = @SECSYSHEAD_LIST@
-glhead_HEADERS = @GLHEAD_LIST@
-sdkshead_HEADERS = @SDKSHEAD_LIST@
 
-#Optional headers
+if ENABLE_CRT
+basehead_HEADERS = \
+  crt/assert.h             crt/complex.h   crt/conio.h     crt/crtdbg.h    crt/crtdefs.h    crt/ctype.h       crt/direct.h           \
+  crt/dirent.h             crt/dir.h       crt/dos.h       crt/dvec.h      crt/eh.h         crt/errno.h       crt/fcntl.h            \
+  crt/fenv.h               crt/float.h     crt/fpieee.h    crt/fvec.h      crt/getopt.h     crt/ieeefp.h      crt/intrin.h           \
+  crt/inttypes.h           crt/io.h        crt/libgen.h    crt/limits.h    crt/locale.h     crt/malloc.h      crt/math.h             \
+  crt/mbctype.h            crt/mbstring.h  crt/mem.h       crt/memory.h    crt/_mingw.h     crt/_mingw_mac.h  crt/_mingw_print_pop.h \
+  crt/_mingw_print_push.h  crt/new.h       crt/poppack.h   crt/pshpack1.h  crt/pshpack2.h   crt/pshpack4.h    crt/pshpack8.h         \
+  crt/search.h             crt/sehmap.h    crt/setjmpex.h  crt/setjmp.h    crt/share.h      crt/stdarg.h      crt/stddef.h           \
+  crt/stdexcpt.h           crt/stdint.h    crt/stdio.h     crt/stdlib.h    crt/syslimits.h  crt/tchar.h       crt/time.h             \
+  crt/unistd.h             crt/utime.h     crt/vadefs.h    crt/varargs.h   crt/wchar.h      crt/xlocinfo.h    crt/xmath.h            \
+  crt/ymath.h              crt/yvals.h
+syshead_HEADERS = \
+  crt/sys/cdefs.h  crt/sys/fcntl.h  crt/sys/file.h  crt/sys/ioctl.h  crt/sys/locking.h  crt/sys/param.h \
+  crt/sys/stat.h   crt/sys/timeb.h  crt/sys/time.h  crt/sys/types.h  crt/sys/unistd.h   crt/sys/utime.h
+sechead_HEADERS = \
+  crt/sec_api/conio_s.h  crt/sec_api/crtdbg_s.h  crt/sec_api/io_s.h        crt/sec_api/mbstring_s.h  crt/sec_api/search_s.h \
+  crt/sec_api/stdio_s.h  crt/sec_api/stdlib_s.h  crt/sec_api/stralign_s.h  crt/sec_api/string_s.h    crt/sec_api/tchar_s.h  \
+  crt/sec_api/time_s.h   crt/sec_api/wchar_s.h
+secsyshead_HEADERS = crt/sec_api/sys/timeb_s.h
+sdkshead_HEADERS = crt/sdks/_mingw_directx.h
+else
+basehead_HEADERS = 
+syshead_HEADERS = 
+sechead_HEADERS = 
+secsyshead_HEADERS = 
+sdkshead_HEADERS = 
+endif
+
+
+basehead_HEADERS += @BASEHEAD_LIST@
+sdkshead_HEADERS += @SDKSHEAD_LIST@
+glhead_HEADERS = @GLHEAD_LIST@
+
 
 ddkheaddir = $(baseheaddir)/ddk
 dxheaddir = $(baseheaddir)
@@ -34,4 +58,4 @@
 ddkhead_HEADERS = @DDKHEAD_LIST@
 dxhead_HEADERS = @DXHEAD_LIST@
 
-DISTCHECK_CONFIGURE_FLAGS = --with-sdk=all
+DISTCHECK_CONFIGURE_FLAGS = --enable-sdk=all
diff --git a/mingw-w64-headers/Makefile.in b/mingw-w64-headers/Makefile.in
index 1727872..892dd5b 100644
--- a/mingw-w64-headers/Makefile.in
+++ b/mingw-w64-headers/Makefile.in
@@ -35,13 +35,14 @@
 build_triplet = @build@
 host_triplet = @host@
 subdir = .
-DIST_COMMON = $(am__configure_deps) $(basehead_HEADERS) \
+DIST_COMMON = $(am__basehead_HEADERS_DIST) $(am__configure_deps) \
+	$(am__sdkshead_HEADERS_DIST) $(am__sechead_HEADERS_DIST) \
+	$(am__secsyshead_HEADERS_DIST) $(am__syshead_HEADERS_DIST) \
 	$(ddkhead_HEADERS) $(dxhead_HEADERS) $(glhead_HEADERS) \
-	$(sdkshead_HEADERS) $(sechead_HEADERS) $(secsyshead_HEADERS) \
 	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-	$(srcdir)/config.h.in $(syshead_HEADERS) \
-	$(top_srcdir)/configure build-aux/config.guess \
-	build-aux/config.sub build-aux/install-sh build-aux/missing
+	$(srcdir)/config.h.in $(top_srcdir)/configure \
+	build-aux/config.guess build-aux/config.sub \
+	build-aux/install-sh build-aux/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -54,6 +55,22 @@
 CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__basehead_HEADERS_DIST = @BASEHEAD_LIST@ crt/assert.h crt/complex.h \
+	crt/conio.h crt/crtdbg.h crt/crtdefs.h crt/ctype.h \
+	crt/direct.h crt/dirent.h crt/dir.h crt/dos.h crt/dvec.h \
+	crt/eh.h crt/errno.h crt/fcntl.h crt/fenv.h crt/float.h \
+	crt/fpieee.h crt/fvec.h crt/getopt.h crt/ieeefp.h crt/intrin.h \
+	crt/inttypes.h crt/io.h crt/libgen.h crt/limits.h crt/locale.h \
+	crt/malloc.h crt/math.h crt/mbctype.h crt/mbstring.h crt/mem.h \
+	crt/memory.h crt/_mingw.h crt/_mingw_mac.h \
+	crt/_mingw_print_pop.h crt/_mingw_print_push.h crt/new.h \
+	crt/poppack.h crt/pshpack1.h crt/pshpack2.h crt/pshpack4.h \
+	crt/pshpack8.h crt/search.h crt/sehmap.h crt/setjmpex.h \
+	crt/setjmp.h crt/share.h crt/stdarg.h crt/stddef.h \
+	crt/stdexcpt.h crt/stdint.h crt/stdio.h crt/stdlib.h \
+	crt/syslimits.h crt/tchar.h crt/time.h crt/unistd.h \
+	crt/utime.h crt/vadefs.h crt/varargs.h crt/wchar.h \
+	crt/xlocinfo.h crt/xmath.h crt/ymath.h crt/yvals.h
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -79,6 +96,19 @@
 	"$(DESTDIR)$(dxheaddir)" "$(DESTDIR)$(glheaddir)" \
 	"$(DESTDIR)$(sdksheaddir)" "$(DESTDIR)$(secheaddir)" \
 	"$(DESTDIR)$(secsysheaddir)" "$(DESTDIR)$(sysheaddir)"
+am__sdkshead_HEADERS_DIST = @SDKSHEAD_LIST@ crt/sdks/_mingw_directx.h
+am__sechead_HEADERS_DIST = crt/sec_api/conio_s.h \
+	crt/sec_api/crtdbg_s.h crt/sec_api/io_s.h \
+	crt/sec_api/mbstring_s.h crt/sec_api/search_s.h \
+	crt/sec_api/stdio_s.h crt/sec_api/stdlib_s.h \
+	crt/sec_api/stralign_s.h crt/sec_api/string_s.h \
+	crt/sec_api/tchar_s.h crt/sec_api/time_s.h \
+	crt/sec_api/wchar_s.h
+am__secsyshead_HEADERS_DIST = crt/sec_api/sys/timeb_s.h
+am__syshead_HEADERS_DIST = crt/sys/cdefs.h crt/sys/fcntl.h \
+	crt/sys/file.h crt/sys/ioctl.h crt/sys/locking.h \
+	crt/sys/param.h crt/sys/stat.h crt/sys/timeb.h crt/sys/time.h \
+	crt/sys/types.h crt/sys/unistd.h crt/sys/utime.h
 HEADERS = $(basehead_HEADERS) $(ddkhead_HEADERS) $(dxhead_HEADERS) \
 	$(glhead_HEADERS) $(sdkshead_HEADERS) $(sechead_HEADERS) \
 	$(secsyshead_HEADERS) $(syshead_HEADERS)
@@ -129,12 +159,9 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 SDKSHEAD_LIST = @SDKSHEAD_LIST@
-SECHEAD_LIST = @SECHEAD_LIST@
-SECSYSHEAD_LIST = @SECSYSHEAD_LIST@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SYSHEAD_LIST = @SYSHEAD_LIST@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -191,9 +218,6 @@
   include/*.hxx \
   include/*.rh \
   include/*.ver \
-  include/sys/*.h \
-  include/sec_api/*.h \
-  include/sec_api/sys/*.h \
   include/GL/*.h
 
 baseheaddir = $(includedir)/../$(host)/include
@@ -202,19 +226,52 @@
 secsysheaddir = $(baseheaddir)/sec_api/sys
 glheaddir = $(baseheaddir)/GL
 sdksheaddir = $(baseheaddir)/sdks
-basehead_HEADERS = @BASEHEAD_LIST@
-syshead_HEADERS = @SYSHEAD_LIST@
-sechead_HEADERS = @SECHEAD_LIST@
-secsyshead_HEADERS = @SECSYSHEAD_LIST@
-glhead_HEADERS = @GLHEAD_LIST@
-sdkshead_HEADERS = @SDKSHEAD_LIST@
+@ENABLE_CRT_FALSE@basehead_HEADERS = @BASEHEAD_LIST@
+@ENABLE_CRT_TRUE@basehead_HEADERS = crt/assert.h crt/complex.h \
+@ENABLE_CRT_TRUE@	crt/conio.h crt/crtdbg.h crt/crtdefs.h \
+@ENABLE_CRT_TRUE@	crt/ctype.h crt/direct.h crt/dirent.h \
+@ENABLE_CRT_TRUE@	crt/dir.h crt/dos.h crt/dvec.h crt/eh.h \
+@ENABLE_CRT_TRUE@	crt/errno.h crt/fcntl.h crt/fenv.h \
+@ENABLE_CRT_TRUE@	crt/float.h crt/fpieee.h crt/fvec.h \
+@ENABLE_CRT_TRUE@	crt/getopt.h crt/ieeefp.h crt/intrin.h \
+@ENABLE_CRT_TRUE@	crt/inttypes.h crt/io.h crt/libgen.h \
+@ENABLE_CRT_TRUE@	crt/limits.h crt/locale.h crt/malloc.h \
+@ENABLE_CRT_TRUE@	crt/math.h crt/mbctype.h crt/mbstring.h \
+@ENABLE_CRT_TRUE@	crt/mem.h crt/memory.h crt/_mingw.h \
+@ENABLE_CRT_TRUE@	crt/_mingw_mac.h crt/_mingw_print_pop.h \
+@ENABLE_CRT_TRUE@	crt/_mingw_print_push.h crt/new.h \
+@ENABLE_CRT_TRUE@	crt/poppack.h crt/pshpack1.h crt/pshpack2.h \
+@ENABLE_CRT_TRUE@	crt/pshpack4.h crt/pshpack8.h crt/search.h \
+@ENABLE_CRT_TRUE@	crt/sehmap.h crt/setjmpex.h crt/setjmp.h \
+@ENABLE_CRT_TRUE@	crt/share.h crt/stdarg.h crt/stddef.h \
+@ENABLE_CRT_TRUE@	crt/stdexcpt.h crt/stdint.h crt/stdio.h \
+@ENABLE_CRT_TRUE@	crt/stdlib.h crt/syslimits.h crt/tchar.h \
+@ENABLE_CRT_TRUE@	crt/time.h crt/unistd.h crt/utime.h \
+@ENABLE_CRT_TRUE@	crt/vadefs.h crt/varargs.h crt/wchar.h \
+@ENABLE_CRT_TRUE@	crt/xlocinfo.h crt/xmath.h crt/ymath.h \
+@ENABLE_CRT_TRUE@	crt/yvals.h @BASEHEAD_LIST@
+@ENABLE_CRT_FALSE@syshead_HEADERS = 
+@ENABLE_CRT_TRUE@syshead_HEADERS = \
+@ENABLE_CRT_TRUE@  crt/sys/cdefs.h  crt/sys/fcntl.h  crt/sys/file.h  crt/sys/ioctl.h  crt/sys/locking.h  crt/sys/param.h \
+@ENABLE_CRT_TRUE@  crt/sys/stat.h   crt/sys/timeb.h  crt/sys/time.h  crt/sys/types.h  crt/sys/unistd.h   crt/sys/utime.h
 
-#Optional headers
+@ENABLE_CRT_FALSE@sechead_HEADERS = 
+@ENABLE_CRT_TRUE@sechead_HEADERS = \
+@ENABLE_CRT_TRUE@  crt/sec_api/conio_s.h  crt/sec_api/crtdbg_s.h  crt/sec_api/io_s.h        crt/sec_api/mbstring_s.h  crt/sec_api/search_s.h \
+@ENABLE_CRT_TRUE@  crt/sec_api/stdio_s.h  crt/sec_api/stdlib_s.h  crt/sec_api/stralign_s.h  crt/sec_api/string_s.h    crt/sec_api/tchar_s.h  \
+@ENABLE_CRT_TRUE@  crt/sec_api/time_s.h   crt/sec_api/wchar_s.h
+
+@ENABLE_CRT_FALSE@secsyshead_HEADERS = 
+@ENABLE_CRT_TRUE@secsyshead_HEADERS = crt/sec_api/sys/timeb_s.h
+@ENABLE_CRT_FALSE@sdkshead_HEADERS = @SDKSHEAD_LIST@
+@ENABLE_CRT_TRUE@sdkshead_HEADERS = crt/sdks/_mingw_directx.h \
+@ENABLE_CRT_TRUE@	@SDKSHEAD_LIST@ $(am__empty)
+glhead_HEADERS = @GLHEAD_LIST@
 ddkheaddir = $(baseheaddir)/ddk
 dxheaddir = $(baseheaddir)
 ddkhead_HEADERS = @DDKHEAD_LIST@
 dxhead_HEADERS = @DXHEAD_LIST@
-DISTCHECK_CONFIGURE_FLAGS = --with-sdk=all
+DISTCHECK_CONFIGURE_FLAGS = --enable-sdk=all
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 
diff --git a/mingw-w64-headers/aclocal.m4 b/mingw-w64-headers/aclocal.m4
index 99803da..501584d 100644
--- a/mingw-w64-headers/aclocal.m4
+++ b/mingw-w64-headers/aclocal.m4
@@ -108,6 +108,42 @@
 am_aux_dir=`cd $ac_aux_dir && pwd`
 ])
 
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
 # Do all the work for Automake.                             -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
diff --git a/mingw-w64-headers/configure b/mingw-w64-headers/configure
index fd3b502..6ba84a4 100755
--- a/mingw-w64-headers/configure
+++ b/mingw-w64-headers/configure
@@ -553,16 +553,15 @@
 PACKAGE_BUGREPORT='mingw-w64-public@lists.sourceforge.net'
 PACKAGE_URL=''
 
-ac_unique_file="include/_mingw.h"
+ac_unique_file="crt/_mingw.h"
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 DDKHEAD_LIST
 DXHEAD_LIST
+ENABLE_CRT_FALSE
+ENABLE_CRT_TRUE
 SDKSHEAD_LIST
 GLHEAD_LIST
-SECSYSHEAD_LIST
-SECHEAD_LIST
-SYSHEAD_LIST
 BASEHEAD_LIST
 host_os
 host_vendor
@@ -636,7 +635,8 @@
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-with_sdk
+enable_crt
+enable_sdk
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1257,10 +1257,12 @@
    esac
   cat <<\_ACEOF
 
-Optional Packages:
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-sdk=ARG          Add the desired SDK, where ARG can be one of ddk,
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-crt           Do not use the default crt headers
+  --enable-sdk=ARG        Add the desired SDK, where ARG can be one of ddk,
                           directx, or all
 
 Report bugs to <mingw-w64-public@lists.sourceforge.net>.
@@ -2274,9 +2276,6 @@
 
 # Checks for header files.
 
-SYSHEAD_LIST=$srcdir/include/sys/*.h
-SECHEAD_LIST=$srcdir/include/sec_api/*.h
-SECSYSHEAD_LIST=$srcdir/include/sec_api/sys/*.h
 GLHEAD_LIST=$srcdir/include/GL/*.h
 BASEHEAD_LIST=$srcdir/include/*.h
 for i in c dlg h16 hxx rh ver; do
@@ -2287,53 +2286,67 @@
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for c-runtime headers" >&5
+$as_echo_n "checking for c-runtime headers... " >&6; }
+# Check whether --enable-crt was given.
+if test "${enable_crt+set}" = set; then :
+  enableval=$enable_crt;
+else
+  enable_crt=yes
+fi
 
+ if test x$enable_crt=xyes; then
+  ENABLE_CRT_TRUE=
+  ENABLE_CRT_FALSE='#'
+else
+  ENABLE_CRT_TRUE='#'
+  ENABLE_CRT_FALSE=
+fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_crt" >&5
+$as_echo "$enable_crt" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optional sdk headers" >&5
 $as_echo_n "checking for optional sdk headers... " >&6; }
-
-# Check whether --with-sdk was given.
-if test "${with_sdk+set}" = set; then :
-  withval=$with_sdk;
+# Check whether --enable-sdk was given.
+if test "${enable_sdk+set}" = set; then :
+  enableval=$enable_sdk;
 else
-  with_sdk=no
+  enable_sdk=no
 fi
 
-case $with_sdk in #(
+case $enable_sdk in #(
   all|yes) :
 
-    with_sdk="ddk,directx"
-    with_ddk=yes
-    with_directx=yes ;; #(
+    enable_sdk="ddk,directx"
+    enable_ddk=yes
+    enable_directx=yes ;; #(
   ddk) :
 
-    with_ddk=yes
-    with_directx=no ;; #(
+    enable_ddk=yes
+    enable_directx=no ;; #(
   directx) :
 
-    with_ddk=no
-    with_directx=yes ;; #(
+    enable_ddk=no
+    enable_directx=yes ;; #(
   no) :
 
-    with_ddk=no
-    with_directx=no ;; #(
+    enable_ddk=no
+    enable_directx=no ;; #(
   *) :
-    as_fn_error "Invalid option: $with_sdk.  Please choose one of ddk, directx, or all." "$LINENO" 5 ;;
+    as_fn_error "Invalid option: $enable_sdk.  Please choose one of ddk, directx, or all." "$LINENO" 5 ;;
 esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sdk" >&5
-$as_echo "$with_sdk" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_sdk" >&5
+$as_echo "$enable_sdk" >&6; }
 
-if test $with_directx = yes; then :
+if test $enable_directx = yes; then :
 
   DXHEAD_LIST=$srcdir/direct-x/include/*.[hi]*
   SDKSHEAD_LIST=$srcdir/direct-x/include/sdks/*.h
-else
-  SDKSHEAD_LIST=$srcdir/include/sdks/*.h
 fi
 
 
-if test $with_ddk = yes; then :
+if test $enable_ddk = yes; then :
 
   DDKHEAD_LIST=$srcdir/ddk/include/ddk/*.h
   SDKSHEAD_LIST="$SDKSHEAD_LIST "$srcdir/ddk/include/sdks/*.h
@@ -2445,6 +2458,10 @@
 
 
 
+if test -z "${ENABLE_CRT_TRUE}" && test -z "${ENABLE_CRT_FALSE}"; then
+  as_fn_error "conditional \"ENABLE_CRT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_write_fail=0
diff --git a/mingw-w64-headers/configure.ac b/mingw-w64-headers/configure.ac
index 557e69f..05b0f35 100644
--- a/mingw-w64-headers/configure.ac
+++ b/mingw-w64-headers/configure.ac
@@ -3,7 +3,7 @@
 
 AC_PREREQ([2.64])
 AC_INIT([mingw-w64-headers], [1.0b], [mingw-w64-public@lists.sourceforge.net])
-AC_CONFIG_SRCDIR([include/_mingw.h])
+AC_CONFIG_SRCDIR([crt/_mingw.h])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([config.h])
 
@@ -17,9 +17,6 @@
 
 # Checks for header files.
 
-SYSHEAD_LIST=$srcdir/include/sys/*.h
-SECHEAD_LIST=$srcdir/include/sec_api/*.h
-SECSYSHEAD_LIST=$srcdir/include/sec_api/sys/*.h
 GLHEAD_LIST=$srcdir/include/GL/*.h
 BASEHEAD_LIST=$srcdir/include/*.h
 for i in c dlg h16 hxx rh ver; do
@@ -27,42 +24,48 @@
 done
 #FIXME: Add in base directx
 AC_SUBST([BASEHEAD_LIST])
-AC_SUBST([SYSHEAD_LIST])
-AC_SUBST([SECHEAD_LIST])
-AC_SUBST([SECSYSHEAD_LIST])
 AC_SUBST([GLHEAD_LIST])
 AC_SUBST([SDKSHEAD_LIST])
 
+AC_MSG_CHECKING([for c-runtime headers])
+AC_ARG_ENABLE([crt],
+  [AS_HELP_STRING([--disable-crt],
+    [Do not use the default crt headers])],
+  [],
+  [enable_crt=yes])
+AM_CONDITIONAL([ENABLE_CRT],[test x$enable_crt=xyes])
+AC_MSG_RESULT([$enable_crt])
+
 AC_MSG_CHECKING([for optional sdk headers])
-AC_ARG_WITH([sdk],
-  [AS_HELP_STRING([--with-sdk=ARG],
+AC_ARG_ENABLE([sdk],
+  [AS_HELP_STRING([--enable-sdk=ARG],
     [Add the desired SDK, where ARG can be one of ddk, directx, or all])],
   [],
-  [with_sdk=no])
-AS_CASE([$with_sdk],
+  [enable_sdk=no])
+AS_CASE([$enable_sdk],
   [all|yes],[
-    with_sdk="ddk,directx"
-    with_ddk=yes
-    with_directx=yes],
+    enable_sdk="ddk,directx"
+    enable_ddk=yes
+    enable_directx=yes],
   [ddk],[
-    with_ddk=yes
-    with_directx=no],
+    enable_ddk=yes
+    enable_directx=no],
   [directx],[
-    with_ddk=no
-    with_directx=yes],
+    enable_ddk=no
+    enable_directx=yes],
   [no],[
-    with_ddk=no
-    with_directx=no],
-  [AC_ERROR([Invalid option: $with_sdk.  Please choose one of ddk, directx, or all.])])
-AC_MSG_RESULT([$with_sdk])
+    enable_ddk=no
+    enable_directx=no],
+  [AC_ERROR([Invalid option: $enable_sdk.  Please choose one of ddk, directx, or all.])])
+AC_MSG_RESULT([$enable_sdk])
 
-AS_IF([test $with_directx = yes],[
+AS_IF([test $enable_directx = yes],[
   DXHEAD_LIST=$srcdir/direct-x/include/*.[[hi]]*
   SDKSHEAD_LIST=$srcdir/direct-x/include/sdks/*.h],
-  [SDKSHEAD_LIST=$srcdir/include/sdks/*.h])
+  [])
 AC_SUBST([DXHEAD_LIST])
 
-AS_IF([test $with_ddk = yes],[
+AS_IF([test $enable_ddk = yes],[
   DDKHEAD_LIST=$srcdir/ddk/include/ddk/*.h
   SDKSHEAD_LIST="$SDKSHEAD_LIST "$srcdir/ddk/include/sdks/*.h],
   [])
diff --git a/mingw-w64-headers/include/_mingw.h b/mingw-w64-headers/crt/_mingw.h
similarity index 100%
rename from mingw-w64-headers/include/_mingw.h
rename to mingw-w64-headers/crt/_mingw.h
diff --git a/mingw-w64-headers/include/_mingw_mac.h b/mingw-w64-headers/crt/_mingw_mac.h
similarity index 100%
rename from mingw-w64-headers/include/_mingw_mac.h
rename to mingw-w64-headers/crt/_mingw_mac.h
diff --git a/mingw-w64-headers/include/_mingw_print_pop.h b/mingw-w64-headers/crt/_mingw_print_pop.h
similarity index 100%
rename from mingw-w64-headers/include/_mingw_print_pop.h
rename to mingw-w64-headers/crt/_mingw_print_pop.h
diff --git a/mingw-w64-headers/include/_mingw_print_push.h b/mingw-w64-headers/crt/_mingw_print_push.h
similarity index 100%
rename from mingw-w64-headers/include/_mingw_print_push.h
rename to mingw-w64-headers/crt/_mingw_print_push.h
diff --git a/mingw-w64-headers/include/assert.h b/mingw-w64-headers/crt/assert.h
similarity index 100%
rename from mingw-w64-headers/include/assert.h
rename to mingw-w64-headers/crt/assert.h
diff --git a/mingw-w64-headers/include/complex.h b/mingw-w64-headers/crt/complex.h
similarity index 100%
rename from mingw-w64-headers/include/complex.h
rename to mingw-w64-headers/crt/complex.h
diff --git a/mingw-w64-headers/include/conio.h b/mingw-w64-headers/crt/conio.h
similarity index 100%
rename from mingw-w64-headers/include/conio.h
rename to mingw-w64-headers/crt/conio.h
diff --git a/mingw-w64-headers/include/crtdbg.h b/mingw-w64-headers/crt/crtdbg.h
similarity index 100%
rename from mingw-w64-headers/include/crtdbg.h
rename to mingw-w64-headers/crt/crtdbg.h
diff --git a/mingw-w64-headers/include/crtdefs.h b/mingw-w64-headers/crt/crtdefs.h
similarity index 100%
rename from mingw-w64-headers/include/crtdefs.h
rename to mingw-w64-headers/crt/crtdefs.h
diff --git a/mingw-w64-headers/include/ctype.h b/mingw-w64-headers/crt/ctype.h
similarity index 100%
rename from mingw-w64-headers/include/ctype.h
rename to mingw-w64-headers/crt/ctype.h
diff --git a/mingw-w64-headers/include/dir.h b/mingw-w64-headers/crt/dir.h
similarity index 100%
rename from mingw-w64-headers/include/dir.h
rename to mingw-w64-headers/crt/dir.h
diff --git a/mingw-w64-headers/include/direct.h b/mingw-w64-headers/crt/direct.h
similarity index 100%
rename from mingw-w64-headers/include/direct.h
rename to mingw-w64-headers/crt/direct.h
diff --git a/mingw-w64-headers/include/dirent.h b/mingw-w64-headers/crt/dirent.h
similarity index 100%
rename from mingw-w64-headers/include/dirent.h
rename to mingw-w64-headers/crt/dirent.h
diff --git a/mingw-w64-headers/include/dos.h b/mingw-w64-headers/crt/dos.h
similarity index 100%
rename from mingw-w64-headers/include/dos.h
rename to mingw-w64-headers/crt/dos.h
diff --git a/mingw-w64-headers/include/dvec.h b/mingw-w64-headers/crt/dvec.h
similarity index 100%
rename from mingw-w64-headers/include/dvec.h
rename to mingw-w64-headers/crt/dvec.h
diff --git a/mingw-w64-headers/include/eh.h b/mingw-w64-headers/crt/eh.h
similarity index 100%
rename from mingw-w64-headers/include/eh.h
rename to mingw-w64-headers/crt/eh.h
diff --git a/mingw-w64-headers/include/errno.h b/mingw-w64-headers/crt/errno.h
similarity index 100%
rename from mingw-w64-headers/include/errno.h
rename to mingw-w64-headers/crt/errno.h
diff --git a/mingw-w64-headers/include/fcntl.h b/mingw-w64-headers/crt/fcntl.h
similarity index 100%
rename from mingw-w64-headers/include/fcntl.h
rename to mingw-w64-headers/crt/fcntl.h
diff --git a/mingw-w64-headers/include/fenv.h b/mingw-w64-headers/crt/fenv.h
similarity index 100%
rename from mingw-w64-headers/include/fenv.h
rename to mingw-w64-headers/crt/fenv.h
diff --git a/mingw-w64-headers/include/float.h b/mingw-w64-headers/crt/float.h
similarity index 100%
rename from mingw-w64-headers/include/float.h
rename to mingw-w64-headers/crt/float.h
diff --git a/mingw-w64-headers/include/fpieee.h b/mingw-w64-headers/crt/fpieee.h
similarity index 100%
rename from mingw-w64-headers/include/fpieee.h
rename to mingw-w64-headers/crt/fpieee.h
diff --git a/mingw-w64-headers/include/fvec.h b/mingw-w64-headers/crt/fvec.h
similarity index 100%
rename from mingw-w64-headers/include/fvec.h
rename to mingw-w64-headers/crt/fvec.h
diff --git a/mingw-w64-headers/include/getopt.h b/mingw-w64-headers/crt/getopt.h
similarity index 100%
rename from mingw-w64-headers/include/getopt.h
rename to mingw-w64-headers/crt/getopt.h
diff --git a/mingw-w64-headers/include/ieeefp.h b/mingw-w64-headers/crt/ieeefp.h
similarity index 100%
rename from mingw-w64-headers/include/ieeefp.h
rename to mingw-w64-headers/crt/ieeefp.h
diff --git a/mingw-w64-headers/include/intrin.h b/mingw-w64-headers/crt/intrin.h
similarity index 100%
rename from mingw-w64-headers/include/intrin.h
rename to mingw-w64-headers/crt/intrin.h
diff --git a/mingw-w64-headers/include/inttypes.h b/mingw-w64-headers/crt/inttypes.h
similarity index 100%
rename from mingw-w64-headers/include/inttypes.h
rename to mingw-w64-headers/crt/inttypes.h
diff --git a/mingw-w64-headers/include/io.h b/mingw-w64-headers/crt/io.h
similarity index 100%
rename from mingw-w64-headers/include/io.h
rename to mingw-w64-headers/crt/io.h
diff --git a/mingw-w64-headers/include/libgen.h b/mingw-w64-headers/crt/libgen.h
similarity index 100%
rename from mingw-w64-headers/include/libgen.h
rename to mingw-w64-headers/crt/libgen.h
diff --git a/mingw-w64-headers/include/limits.h b/mingw-w64-headers/crt/limits.h
similarity index 100%
rename from mingw-w64-headers/include/limits.h
rename to mingw-w64-headers/crt/limits.h
diff --git a/mingw-w64-headers/include/locale.h b/mingw-w64-headers/crt/locale.h
similarity index 100%
rename from mingw-w64-headers/include/locale.h
rename to mingw-w64-headers/crt/locale.h
diff --git a/mingw-w64-headers/include/malloc.h b/mingw-w64-headers/crt/malloc.h
similarity index 100%
rename from mingw-w64-headers/include/malloc.h
rename to mingw-w64-headers/crt/malloc.h
diff --git a/mingw-w64-headers/include/math.h b/mingw-w64-headers/crt/math.h
similarity index 100%
rename from mingw-w64-headers/include/math.h
rename to mingw-w64-headers/crt/math.h
diff --git a/mingw-w64-headers/include/mbctype.h b/mingw-w64-headers/crt/mbctype.h
similarity index 100%
rename from mingw-w64-headers/include/mbctype.h
rename to mingw-w64-headers/crt/mbctype.h
diff --git a/mingw-w64-headers/include/mbstring.h b/mingw-w64-headers/crt/mbstring.h
similarity index 100%
rename from mingw-w64-headers/include/mbstring.h
rename to mingw-w64-headers/crt/mbstring.h
diff --git a/mingw-w64-headers/include/mem.h b/mingw-w64-headers/crt/mem.h
similarity index 100%
rename from mingw-w64-headers/include/mem.h
rename to mingw-w64-headers/crt/mem.h
diff --git a/mingw-w64-headers/include/memory.h b/mingw-w64-headers/crt/memory.h
similarity index 100%
rename from mingw-w64-headers/include/memory.h
rename to mingw-w64-headers/crt/memory.h
diff --git a/mingw-w64-headers/include/new.h b/mingw-w64-headers/crt/new.h
similarity index 100%
rename from mingw-w64-headers/include/new.h
rename to mingw-w64-headers/crt/new.h
diff --git a/mingw-w64-headers/include/poppack.h b/mingw-w64-headers/crt/poppack.h
similarity index 100%
rename from mingw-w64-headers/include/poppack.h
rename to mingw-w64-headers/crt/poppack.h
diff --git a/mingw-w64-headers/include/pshpack1.h b/mingw-w64-headers/crt/pshpack1.h
similarity index 100%
rename from mingw-w64-headers/include/pshpack1.h
rename to mingw-w64-headers/crt/pshpack1.h
diff --git a/mingw-w64-headers/include/pshpack2.h b/mingw-w64-headers/crt/pshpack2.h
similarity index 100%
rename from mingw-w64-headers/include/pshpack2.h
rename to mingw-w64-headers/crt/pshpack2.h
diff --git a/mingw-w64-headers/include/pshpack4.h b/mingw-w64-headers/crt/pshpack4.h
similarity index 100%
rename from mingw-w64-headers/include/pshpack4.h
rename to mingw-w64-headers/crt/pshpack4.h
diff --git a/mingw-w64-headers/include/pshpack8.h b/mingw-w64-headers/crt/pshpack8.h
similarity index 100%
rename from mingw-w64-headers/include/pshpack8.h
rename to mingw-w64-headers/crt/pshpack8.h
diff --git a/mingw-w64-headers/include/sdks/_mingw_directx.h b/mingw-w64-headers/crt/sdks/_mingw_directx.h
similarity index 100%
rename from mingw-w64-headers/include/sdks/_mingw_directx.h
rename to mingw-w64-headers/crt/sdks/_mingw_directx.h
diff --git a/mingw-w64-headers/include/search.h b/mingw-w64-headers/crt/search.h
similarity index 100%
rename from mingw-w64-headers/include/search.h
rename to mingw-w64-headers/crt/search.h
diff --git a/mingw-w64-headers/include/sec_api/conio_s.h b/mingw-w64-headers/crt/sec_api/conio_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/conio_s.h
rename to mingw-w64-headers/crt/sec_api/conio_s.h
diff --git a/mingw-w64-headers/include/sec_api/crtdbg_s.h b/mingw-w64-headers/crt/sec_api/crtdbg_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/crtdbg_s.h
rename to mingw-w64-headers/crt/sec_api/crtdbg_s.h
diff --git a/mingw-w64-headers/include/sec_api/io_s.h b/mingw-w64-headers/crt/sec_api/io_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/io_s.h
rename to mingw-w64-headers/crt/sec_api/io_s.h
diff --git a/mingw-w64-headers/include/sec_api/mbstring_s.h b/mingw-w64-headers/crt/sec_api/mbstring_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/mbstring_s.h
rename to mingw-w64-headers/crt/sec_api/mbstring_s.h
diff --git a/mingw-w64-headers/include/sec_api/search_s.h b/mingw-w64-headers/crt/sec_api/search_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/search_s.h
rename to mingw-w64-headers/crt/sec_api/search_s.h
diff --git a/mingw-w64-headers/include/sec_api/stdio_s.h b/mingw-w64-headers/crt/sec_api/stdio_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/stdio_s.h
rename to mingw-w64-headers/crt/sec_api/stdio_s.h
diff --git a/mingw-w64-headers/include/sec_api/stdlib_s.h b/mingw-w64-headers/crt/sec_api/stdlib_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/stdlib_s.h
rename to mingw-w64-headers/crt/sec_api/stdlib_s.h
diff --git a/mingw-w64-headers/include/sec_api/stralign_s.h b/mingw-w64-headers/crt/sec_api/stralign_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/stralign_s.h
rename to mingw-w64-headers/crt/sec_api/stralign_s.h
diff --git a/mingw-w64-headers/include/sec_api/string_s.h b/mingw-w64-headers/crt/sec_api/string_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/string_s.h
rename to mingw-w64-headers/crt/sec_api/string_s.h
diff --git a/mingw-w64-headers/include/sec_api/sys/timeb_s.h b/mingw-w64-headers/crt/sec_api/sys/timeb_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/sys/timeb_s.h
rename to mingw-w64-headers/crt/sec_api/sys/timeb_s.h
diff --git a/mingw-w64-headers/include/sec_api/tchar_s.h b/mingw-w64-headers/crt/sec_api/tchar_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/tchar_s.h
rename to mingw-w64-headers/crt/sec_api/tchar_s.h
diff --git a/mingw-w64-headers/include/sec_api/time_s.h b/mingw-w64-headers/crt/sec_api/time_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/time_s.h
rename to mingw-w64-headers/crt/sec_api/time_s.h
diff --git a/mingw-w64-headers/include/sec_api/wchar_s.h b/mingw-w64-headers/crt/sec_api/wchar_s.h
similarity index 100%
rename from mingw-w64-headers/include/sec_api/wchar_s.h
rename to mingw-w64-headers/crt/sec_api/wchar_s.h
diff --git a/mingw-w64-headers/include/sehmap.h b/mingw-w64-headers/crt/sehmap.h
similarity index 100%
rename from mingw-w64-headers/include/sehmap.h
rename to mingw-w64-headers/crt/sehmap.h
diff --git a/mingw-w64-headers/include/setjmp.h b/mingw-w64-headers/crt/setjmp.h
similarity index 100%
rename from mingw-w64-headers/include/setjmp.h
rename to mingw-w64-headers/crt/setjmp.h
diff --git a/mingw-w64-headers/include/setjmpex.h b/mingw-w64-headers/crt/setjmpex.h
similarity index 100%
rename from mingw-w64-headers/include/setjmpex.h
rename to mingw-w64-headers/crt/setjmpex.h
diff --git a/mingw-w64-headers/include/share.h b/mingw-w64-headers/crt/share.h
similarity index 100%
rename from mingw-w64-headers/include/share.h
rename to mingw-w64-headers/crt/share.h
diff --git a/mingw-w64-headers/include/stdarg.h b/mingw-w64-headers/crt/stdarg.h
similarity index 100%
rename from mingw-w64-headers/include/stdarg.h
rename to mingw-w64-headers/crt/stdarg.h
diff --git a/mingw-w64-headers/include/stddef.h b/mingw-w64-headers/crt/stddef.h
similarity index 100%
rename from mingw-w64-headers/include/stddef.h
rename to mingw-w64-headers/crt/stddef.h
diff --git a/mingw-w64-headers/include/stdexcpt.h b/mingw-w64-headers/crt/stdexcpt.h
similarity index 100%
rename from mingw-w64-headers/include/stdexcpt.h
rename to mingw-w64-headers/crt/stdexcpt.h
diff --git a/mingw-w64-headers/include/stdint.h b/mingw-w64-headers/crt/stdint.h
similarity index 100%
rename from mingw-w64-headers/include/stdint.h
rename to mingw-w64-headers/crt/stdint.h
diff --git a/mingw-w64-headers/include/stdio.h b/mingw-w64-headers/crt/stdio.h
similarity index 100%
rename from mingw-w64-headers/include/stdio.h
rename to mingw-w64-headers/crt/stdio.h
diff --git a/mingw-w64-headers/include/stdlib.h b/mingw-w64-headers/crt/stdlib.h
similarity index 100%
rename from mingw-w64-headers/include/stdlib.h
rename to mingw-w64-headers/crt/stdlib.h
diff --git a/mingw-w64-headers/include/sys/cdefs.h b/mingw-w64-headers/crt/sys/cdefs.h
similarity index 100%
rename from mingw-w64-headers/include/sys/cdefs.h
rename to mingw-w64-headers/crt/sys/cdefs.h
diff --git a/mingw-w64-headers/include/sys/fcntl.h b/mingw-w64-headers/crt/sys/fcntl.h
similarity index 100%
rename from mingw-w64-headers/include/sys/fcntl.h
rename to mingw-w64-headers/crt/sys/fcntl.h
diff --git a/mingw-w64-headers/include/sys/file.h b/mingw-w64-headers/crt/sys/file.h
similarity index 100%
rename from mingw-w64-headers/include/sys/file.h
rename to mingw-w64-headers/crt/sys/file.h
diff --git a/mingw-w64-headers/include/sys/ioctl.h b/mingw-w64-headers/crt/sys/ioctl.h
similarity index 100%
rename from mingw-w64-headers/include/sys/ioctl.h
rename to mingw-w64-headers/crt/sys/ioctl.h
diff --git a/mingw-w64-headers/include/sys/locking.h b/mingw-w64-headers/crt/sys/locking.h
similarity index 100%
rename from mingw-w64-headers/include/sys/locking.h
rename to mingw-w64-headers/crt/sys/locking.h
diff --git a/mingw-w64-headers/include/sys/param.h b/mingw-w64-headers/crt/sys/param.h
similarity index 100%
rename from mingw-w64-headers/include/sys/param.h
rename to mingw-w64-headers/crt/sys/param.h
diff --git a/mingw-w64-headers/include/sys/stat.h b/mingw-w64-headers/crt/sys/stat.h
similarity index 100%
rename from mingw-w64-headers/include/sys/stat.h
rename to mingw-w64-headers/crt/sys/stat.h
diff --git a/mingw-w64-headers/include/sys/time.h b/mingw-w64-headers/crt/sys/time.h
similarity index 100%
rename from mingw-w64-headers/include/sys/time.h
rename to mingw-w64-headers/crt/sys/time.h
diff --git a/mingw-w64-headers/include/sys/timeb.h b/mingw-w64-headers/crt/sys/timeb.h
similarity index 100%
rename from mingw-w64-headers/include/sys/timeb.h
rename to mingw-w64-headers/crt/sys/timeb.h
diff --git a/mingw-w64-headers/include/sys/types.h b/mingw-w64-headers/crt/sys/types.h
similarity index 100%
rename from mingw-w64-headers/include/sys/types.h
rename to mingw-w64-headers/crt/sys/types.h
diff --git a/mingw-w64-headers/include/sys/unistd.h b/mingw-w64-headers/crt/sys/unistd.h
similarity index 100%
rename from mingw-w64-headers/include/sys/unistd.h
rename to mingw-w64-headers/crt/sys/unistd.h
diff --git a/mingw-w64-headers/include/sys/utime.h b/mingw-w64-headers/crt/sys/utime.h
similarity index 100%
rename from mingw-w64-headers/include/sys/utime.h
rename to mingw-w64-headers/crt/sys/utime.h
diff --git a/mingw-w64-headers/include/syslimits.h b/mingw-w64-headers/crt/syslimits.h
similarity index 100%
rename from mingw-w64-headers/include/syslimits.h
rename to mingw-w64-headers/crt/syslimits.h
diff --git a/mingw-w64-headers/include/tchar.h b/mingw-w64-headers/crt/tchar.h
similarity index 100%
rename from mingw-w64-headers/include/tchar.h
rename to mingw-w64-headers/crt/tchar.h
diff --git a/mingw-w64-headers/include/time.h b/mingw-w64-headers/crt/time.h
similarity index 100%
rename from mingw-w64-headers/include/time.h
rename to mingw-w64-headers/crt/time.h
diff --git a/mingw-w64-headers/include/unistd.h b/mingw-w64-headers/crt/unistd.h
similarity index 100%
rename from mingw-w64-headers/include/unistd.h
rename to mingw-w64-headers/crt/unistd.h
diff --git a/mingw-w64-headers/include/utime.h b/mingw-w64-headers/crt/utime.h
similarity index 100%
rename from mingw-w64-headers/include/utime.h
rename to mingw-w64-headers/crt/utime.h
diff --git a/mingw-w64-headers/include/vadefs.h b/mingw-w64-headers/crt/vadefs.h
similarity index 100%
rename from mingw-w64-headers/include/vadefs.h
rename to mingw-w64-headers/crt/vadefs.h
diff --git a/mingw-w64-headers/include/varargs.h b/mingw-w64-headers/crt/varargs.h
similarity index 100%
rename from mingw-w64-headers/include/varargs.h
rename to mingw-w64-headers/crt/varargs.h
diff --git a/mingw-w64-headers/include/wchar.h b/mingw-w64-headers/crt/wchar.h
similarity index 100%
rename from mingw-w64-headers/include/wchar.h
rename to mingw-w64-headers/crt/wchar.h
diff --git a/mingw-w64-headers/include/xlocinfo.h b/mingw-w64-headers/crt/xlocinfo.h
similarity index 100%
rename from mingw-w64-headers/include/xlocinfo.h
rename to mingw-w64-headers/crt/xlocinfo.h
diff --git a/mingw-w64-headers/include/xmath.h b/mingw-w64-headers/crt/xmath.h
similarity index 100%
rename from mingw-w64-headers/include/xmath.h
rename to mingw-w64-headers/crt/xmath.h
diff --git a/mingw-w64-headers/include/ymath.h b/mingw-w64-headers/crt/ymath.h
similarity index 100%
rename from mingw-w64-headers/include/ymath.h
rename to mingw-w64-headers/crt/ymath.h
diff --git a/mingw-w64-headers/include/yvals.h b/mingw-w64-headers/crt/yvals.h
similarity index 100%
rename from mingw-w64-headers/include/yvals.h
rename to mingw-w64-headers/crt/yvals.h