From fcb91277669e09f72fd13e9c6cfbb8641ed6f23d Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Tue, 17 Dec 2013 00:00:46 +0100 Subject: [PATCH] Add build support for win32 on cygwin (gcc3). --- .gitignore | 2 + Makefile.in | 10 ++- configure.ac | 1 + misc/mkmakefile.mingw-on-cygwin | 43 +++++++++ win32/config.h.in | 192 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 247 insertions(+), 1 deletions(-) create mode 100755 misc/mkmakefile.mingw-on-cygwin create mode 100644 win32/config.h.in diff --git a/.gitignore b/.gitignore index eddd488..658125d 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,8 @@ /gnushogi/gnuminishogi /gnushogi/gnuminishogi.bbk +/win32/ + /xshogi/scanner.c /xshogi/parser.c /xshogi/xshogi diff --git a/Makefile.in b/Makefile.in index 2ddcab5..ca1af25 100644 --- a/Makefile.in +++ b/Makefile.in @@ -59,6 +59,13 @@ bbk: # +# Alien target architectures +# + +win32/Makefile: misc/mkmakefile.mingw-on-cygwin + $< + +# # Installation. # @@ -101,6 +108,7 @@ dist: tar -cf - --exclude .git --exclude $(DISTNAME) $(ROOT) | (cd $(DISTNAME) && tar -xf -) cd $(DISTNAME) && $(ROOT)/autogen.sh && $(ROOT)/configure cd $(DISTNAME)/doc && $(MAKE) info + cd $(DISTNAME) && $(MAKE) win32/Makefile cd $(DISTNAME) && $(MAKE) distclean tar -zcf $(DISTNAME).tar.gz $(DISTNAME) @@ -122,7 +130,7 @@ distclean: clean # Extra cleanup, for the maintainer only. # -MAINTAINERCLEANFILES = configure config.h.in +MAINTAINERCLEANFILES = configure config.h.in win32/Makefile maintainerclean: distclean rm -f $(MAINTAINERCLEANFILES) diff --git a/configure.ac b/configure.ac index 99b758a..576d1cd 100644 --- a/configure.ac +++ b/configure.ac @@ -181,6 +181,7 @@ AC_SUBST(XSHOGICLEAN) ########## AC_CONFIG_FILES([Makefile gnushogi/Makefile + win32/config.h doc/Makefile xshogi/Makefile]) AC_OUTPUT diff --git a/misc/mkmakefile.mingw-on-cygwin b/misc/mkmakefile.mingw-on-cygwin new file mode 100755 index 0000000..63f4218 --- /dev/null +++ b/misc/mkmakefile.mingw-on-cygwin @@ -0,0 +1,43 @@ +#!/bin/sh +set -e + +# Script to generate cygwin.make from Makefile.in, to build a standard +# win32 binary from a cygwin shell. +# +# Copyright (c) 2013 Yann Dirson and the Free Software Foundation +# +# This file is part of GNU Shogi. +# +# GNU Shogi is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either ../version 3 of the License, or (at your option) +# any later ../version. +# +# GNU Shogi is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Shogi; see the file COPYING. +# If not, see . + +mkdir -p win32 +cat <<'EOF' | sed -f - gnushogi/Makefile.in > win32/Makefile +s,@INSTALL@,/usr/bin/install -c, +s,@INSTALL_DATA@,${INSTALL} -m 644, +s,@INSTALL_PROGRAM@,${INSTALL}, +s,@prefix@,/usr/local, +s,@LIBCURSES@,, +s,@CURSESDSP@,, +s,@CC@,gcc, +s,@WARNINGS@,-Wall -Wno-implicit-int -Wstrict-prototypes -ansi -pedantic, +s,@CFLAGS@,-g -O2 -mno-cygwin -fsigned-char -funroll-loops, +s,@CEXTRAFLAGS@,, +s,@LDFLAGS@,, +s,@top_srcdir@,.., +s,@top_builddir@,., +s,@srcdir@,../gnushogi, +s,@PROGNAME@,gnushogi, +s,^LIBS *= *-lm$,#\0, +EOF diff --git a/win32/config.h.in b/win32/config.h.in new file mode 100644 index 0000000..1d9b43c --- /dev/null +++ b/win32/config.h.in @@ -0,0 +1,192 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `bcopy' function. */ +#undef HAVE_BCOPY + +/* Define to 1 if you have the `dup2' function. */ +#undef HAVE_DUP2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + +/* Define to 1 if you have the `gethostname' function. */ +#undef HAVE_GETHOSTNAME + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if you have lib */ +#undef HAVE_LIBCURSES + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the `termcap' library (-ltermcap). */ +#undef HAVE_LIBTERMCAP + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the `pow' function. */ +#undef HAVE_POW + +/* Define to 1 if you have the `setlinebuf' function. */ +#undef HAVE_SETLINEBUF + +/* Define to 1 if you have the `setvbuf' function. */ +#undef HAVE_SETVBUF + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FILE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + +/* Define to 1 if you have the header file. */ +#undef HAVE_VFORK_H + +/* Define to 1 if `fork' works. */ +#undef HAVE_WORKING_FORK + +/* Define to 1 if `vfork' works. */ +#undef HAVE_WORKING_VFORK + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to build gnuminishogi instead of gnushogi */ +#undef MINISHOGI + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define as `fork' if `vfork' does not work. */ +#undef vfork -- 1.7.0.4