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

fixed per NightStrike technical comments, sending just for reference,
waiting for input of alternate methods.

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

diff --git a/Makefile.am b/Makefile.am
index 26a7606..1a25781 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,6 +2,10 @@ if HEADER
   MAYBE_HEADER = mingw-w64-headers
 endif
 
+if HEADER_LOCAL
+  MAYBE_HEADER_LOCAL = mingw-w64-headers-local
+endif
+
 if CRT
   MAYBE_CRT = mingw-w64-crt
 endif
@@ -22,7 +26,7 @@ if TOOLS_GENIDL
   MAYBE_TOOLS_GENIDL = mingw-w64-tools/genidl
 endif
 
-SUBDIRS = $(MAYBE_HEADER) $(MAYBE_CRT) $(MAYBE_LIBRARIES_MANGLE) 
$(MAYBE_LIBRARIES_PSEH) $(MAYBE_TOOLS_GENDEF) $(MAYBE_TOOLS_GENIDL)
+SUBDIRS = $(MAYBE_HEADER) $(MAYBE_HEADER_LOCAL) $(MAYBE_CRT) 
$(MAYBE_LIBRARIES_MANGLE) $(MAYBE_LIBRARIES_PSEH) $(MAYBE_TOOLS_GENDEF) 
$(MAYBE_TOOLS_GENIDL)
 
 DISTCHECK_CONFIGURE_FLAGS = --with-headers --with-crt --with-libraries=all 
--with-tools=all
 
diff --git a/configure.ac b/configure.ac
index 4bb3926..22e20d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,16 @@ AC_ARG_WITH([crt],
   [],
   [with_crt=yes])
 AS_CASE([$with_crt],
-  [yes],[AC_CONFIG_SUBDIRS([mingw-w64-crt])],
+  [yes],[AS_CASE([$with_headers],
+    [yes],[
+      AC_CONFIG_SUBDIRS([mingw-w64-crt])
+      
AS_VAR_SET([CPPFLAGS],["-I\$(abs_top_builddir)/../mingw-w64-headers-local/headers/include
 ${CPPFLAGS}"])
+      AS_VAR_SET([SYSROOT_DISABLE],[yes])
+      # export so will effect subpackages
+      export CPPFLAGS
+      export SYSROOT_DISABLE
+      AM_CONDITIONAL([HEADER_LOCAL],[true])
+    ])],
   [no],[],
   [MW64_OPTION_ERROR([with-crt])])
 AM_CONDITIONAL([CRT],[test "x$with_crt" = xyes])
@@ -108,6 +117,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..12d1980 100644
--- a/mingw-w64-crt/configure.ac
+++ b/mingw-w64-crt/configure.ac
@@ -18,7 +18,9 @@ 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_CASE([$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 +254,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..f26b6e8
--- /dev/null
+++ b/mingw-w64-headers-local/Makefile.am
@@ -0,0 +1,10 @@
+all-local:
+       rm -fr headers
+       $(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