]> granicus.if.org Git - libexpat/commitdiff
Make wmain work with MinGW
authorSebastian Pipping <sebastian@pipping.org>
Sat, 9 Sep 2017 16:42:41 +0000 (18:42 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 9 Sep 2017 16:59:29 +0000 (18:59 +0200)
expat/configure.ac
expat/xmlwf/Makefile.am
expat/xmlwf/xmlwf.c

index 650d85848ddbfce1c5cae890a9bc65d984fd2934..5388ca7e520d0e6e2eb11cc6307f922ffc97a3a3 100644 (file)
@@ -106,6 +106,9 @@ AC_ARG_WITH([xmlwf], [
 AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], [], [with_xmlwf=yes])
 AM_CONDITIONAL([WITH_XMLWF], [test x${with_xmlwf} = xyes])
 
+AM_CONDITIONAL([MINGW], [echo -- "${host}" | fgrep -q mingw])
+AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | fgrep -q XML_UNICODE])
+
 
 AC_ARG_WITH([libbsd], [
 AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])
index 0ef113c6251ab14271fb63d778ac987bb51d0f77..ff460902caa0a89ffaf949b2783931c4b7a40474 100644 (file)
@@ -28,8 +28,6 @@
 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 # USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-AM_CPPFLAGS = -I$(srcdir)/../lib
-
 bin_PROGRAMS = xmlwf
 
 xmlwf_LDADD = ../lib/libexpat.la
@@ -39,6 +37,15 @@ xmlwf_SOURCES = \
     codepage.c \
     @FILEMAP@.c
 
+xmlwf_CPPFLAGS = -I$(srcdir)/../lib
+
+if MINGW
+if UNICODE
+xmlwf_CPPFLAGS += -mwindows
+xmlwf_LDFLAGS = -municode
+endif
+endif
+
 EXTRA_DIST = \
     codepage.h \
     ct.c \
index d8e3f71e77654a7cd3465ea5c654989735ac3e40..129aa797ec0caeadb2d10d350debb89b7875f476 100644 (file)
@@ -894,6 +894,11 @@ usage(const XML_Char *prog, int rc)
   exit(rc);
 }
 
+#if defined(__MINGW32__) && defined(XML_UNICODE)
+/* Silence warning about missing prototype */
+int wmain(int argc, XML_Char **argv);
+#endif
+
 int
 tmain(int argc, XML_Char **argv)
 {