[msvc] Allow cygwin "make" to be called after winsetup.bat
authorJo Shields <jo.shields@xamarin.com>
Tue, 25 Nov 2014 12:49:26 +0000 (12:49 +0000)
committerJo Shields <jo.shields@xamarin.com>
Tue, 25 Nov 2014 12:49:26 +0000 (12:49 +0000)
As-is, winsetup.bat replaces config.h with winconfig.h, which is needed for the MSVC compilation - but breaks all further use of cygwin's make (e.g. to build the class library, or run "make install").

This patch introduces a new cygconfig.h as a backup prior to squashing config.h (if it exists, so the runtime can still be built without cygwin ever being used), and makes winconfig.h use it on non-MSVC compilers (i.e. cygwin)

.gitignore
msvc/winsetup.bat
winconfig.h

index ea48a9e7fb97074a8d4e78730d00394afbf64e44..55a955ec624e0e86ba27aba53940285245c10261 100644 (file)
@@ -69,6 +69,7 @@ config.status
 config.sub
 configure
 configure.scan
+cygconfig.h
 depcomp
 install-sh
 libtool
index 33a72f6b1bd8d7e0611fda19d337a2080e62eaed..6b1c6f8461ec4ff3b7993e513cf1773c5b055296 100755 (executable)
@@ -1,5 +1,6 @@
 @echo off
 cd ..
+if exist config.h if not exist cygconfig.h copy config.h cygconfig.h
 copy winconfig.h config.h
 goto end
 :error
index 6e3b9fd3f68bc5e6f285f4aa62a47db553d2b79a..21cc0d506d76c94167459d5f961d950b1ab269a8 100644 (file)
@@ -1,6 +1,10 @@
 /* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
+#ifndef _MSC_VER
+#include "cygconfig.h"
+#else
+
 /* The architecture this is running on */
 #if defined(_M_IA64)
 #define ARCHITECTURE "ia64"
 
 /* Version number of package */
 #define VERSION "3.12.1"
+#endif