this effects only top level package, if crt is to be built:
1. install headers into builddir for staging
2. adjust CPPFLAGS for tools and libraries to find local headers
3. disable sysroot for crt so search path contain only local headers

Signed-off-by: Alon Bar-Lev <[email protected]>
---
 Makefile.am                         |  2 +-
 configure.ac                        | 10 ++++++++--
 mingw-w64-crt/configure.ac          |  5 +++--
 mingw-w64-headers-local/Makefile.am |  9 +++++++++
 4 files changed, 21 insertions(+), 5 deletions(-)
 create mode 100644 mingw-w64-headers-local/Makefile.am

diff --git a/Makefile.am b/Makefile.am
index 26a7606..0cf559c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,7 @@ if HEADER
 endif
 
 if CRT
-  MAYBE_CRT = mingw-w64-crt
+  MAYBE_CRT = mingw-w64-headers-local mingw-w64-crt
 endif
 
 if LIBRARIES_MANGLE
diff --git a/configure.ac b/configure.ac
index 4bb3926..e0f7685 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,13 @@ AC_ARG_WITH([crt],
   [],
   [with_crt=yes])
 AS_CASE([$with_crt],
-  [yes],[AC_CONFIG_SUBDIRS([mingw-w64-crt])],
+  [yes],[
+    AC_CONFIG_SUBDIRS([mingw-w64-crt])
+    CPPFLAGS="-I\$(top_builddir)/../mingw-w64-headers-local/headers/include 
${CPPFLAGS}"
+    export CPPFLAGS # so will effect subpackages
+    SYSROOT_DISABLE=yes
+    export SYSROOT_DISABLE # so will effect crt
+  ],
   [no],[],
   [MW64_OPTION_ERROR([with-crt])])
 AM_CONDITIONAL([CRT],[test "x$with_crt" = xyes])
@@ -108,6 +114,6 @@ 
AM_COND_IF([TOOLS_GENDEF],[AC_CONFIG_SUBDIRS([mingw-w64-tools/gendef])])
 AM_COND_IF([TOOLS_GENIDL],[AC_CONFIG_SUBDIRS([mingw-w64-tools/genidl])])
 AC_MSG_RESULT([$with_tools])
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile mingw-w64-headers-local/Makefile])
 AC_OUTPUT
 
diff --git a/mingw-w64-crt/configure.ac b/mingw-w64-crt/configure.ac
index bcf7d0c..387380f 100644
--- a/mingw-w64-crt/configure.ac
+++ b/mingw-w64-crt/configure.ac
@@ -18,7 +18,8 @@ AC_ARG_WITH([sysroot],
   [AS_HELP_STRING([--with-sysroot=DIR],
     [Search for headers within DIR/include (default: prefix)])],
   [],
-  [AS_VAR_SET([with_sysroot],[yes])])
+  [AS_VAR_IF([SYSROOT_DISABLE], [yes],
+    [AS_VAR_SET([with_sysroot],[no]], [AS_VAR_SET([with_sysroot],[yes])]))])
 AS_CASE([$with_sysroot],
   [no],[],
   [yes],[AS_VAR_SET([with_sysroot],[$prefix])],
@@ -252,7 +253,7 @@ AC_MSG_RESULT([$enable_tests_unicode])
 #AC_FUNC_VPRINTF
 #AC_CHECK_FUNCS([alarm atexit btowc fesetround floor ftruncate gettimeofday 
isascii localeconv mbrlen memmove memset pow rint setlocale sqrt strcasecmp 
strchr strncasecmp strtoull strtoumax])
 
-AC_CHECK_HEADER([_mingw_mac.h], [], [AC_MSG_ERROR([Please check if the 
mingw-w64 header set and the build/host option are set properly.])])
+AC_CHECK_HEADER([_mingw_mac.h], [], [AC_MSG_WARN([Please check if the 
mingw-w64 header set and the build/host option are set properly.])])
 
 #Warnings and errors, default level is 3
 AC_MSG_CHECKING([for warning levels])
diff --git a/mingw-w64-headers-local/Makefile.am 
b/mingw-w64-headers-local/Makefile.am
new file mode 100644
index 0000000..9047e8b
--- /dev/null
+++ b/mingw-w64-headers-local/Makefile.am
@@ -0,0 +1,9 @@
+all-local:     clean-local
+       $(MAKE) \
+               -C "$(top_builddir)/mingw-w64-headers" \
+               prefix="$(abs_builddir)/headers" \
+               includedir="$(abs_builddir)/headers/include" \
+               libdir="$(abs_builddir)/headers/lib" \
+               install
+clean-local:
+       rm -fr headers
-- 
2.3.6


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to