From 6b53cbf5dcb35ce337fd91ff53a8d8465683577d Mon Sep 17 00:00:00 2001 From: Chris Ison Date: Wed, 17 Oct 2001 10:41:25 +0000 Subject: [PATCH] changes to get mingw builds happening under cygwin --- README.cygwin | 40 ++++++++++++++++++++++++++++++++++++++++ configure.ac | 32 ++++++++++++++------------------ include/compat.h | 6 ++++-- 3 files changed, 58 insertions(+), 20 deletions(-) create mode 100644 README.cygwin diff --git a/README.cygwin b/README.cygwin new file mode 100644 index 000000000..17668e034 --- /dev/null +++ b/README.cygwin @@ -0,0 +1,40 @@ +NOTE: this method was determined in windows98, if it doesn't work for your +system, let us know + +email: quake-user@lists.sourceforge.net +IRC: irc.openprojects.net #quakeforge +========================================================================== + +WARNING: QuakeForge may take several hours from bootstrap to the completion + of make install on some systems + +To build win32(mingw) quakeforge bins you will need to download and build +libtools and SDL sources, in that order. + +You will also need 3 headers from the Microsoft Directx SDK. +ddraw.h dinput.h dsound.h +Put them in your /usr/include/w32api dir + +Obtain libtool source from www.gnu.org (good place to get to know), and when you +configure libtool please ensure you use --prefix=/usr otherwise you will +have problems. + +Obtain SDL source from www.libsdl.org. You do not need the SDL mingw file, it is +just a bunch of docs and test source. + +Once both are built and installed, then you can start. + +in quakeforge run +./bootstrap +./configure --disable-oss --host=i386-mingw32 --build=i386-cygwin --target=i386-ming32 --disable-Werror +make +make install + +NOTE: due to bugs in the Directx8 SDK header files you will need +--disable-Werror on the configure command line. This may also be the +case with earlier Directx SDK's but it hasn't been tested. + +Let us know how you go. + + +Chris Ison (WildCode) for Quakeforge \ No newline at end of file diff --git a/configure.ac b/configure.ac index 1fa5ce7ee..3d1e1af4d 100644 --- a/configure.ac +++ b/configure.ac @@ -53,12 +53,20 @@ case "$host_os" in CFLAGS="$CFLAGS -I\$(top_srcdir)/include/win32" CFLAGS="$CFLAGS -I\$(top_srcdir)/include/win32/resources" if test "$host" != "$build"; then - CC="$host_cpu-$host_os-gcc" - AS="$CC" - AR="$host_cpu-$host_os-ar" - RANLIB="$host_cpu-$host_os-ranlib" - endian="little" + case "$build_os" in + cygwin*) + CFLAGS="$CFLAGS -mno-cygwin" + CPPFLAGS="$CPPFLAGS $CFLAGS" + ;; + *) + CC="$host_cpu-$host_os-gcc" + AS="$CC" + AR="$host_cpu-$host_os-ar" + RANLIB="$host_cpu-$host_os-ranlib" + ;; + esac fi + endian="little" ;; cygwin*) cygwin=yes @@ -69,19 +77,7 @@ case "$host_os" in RANLIB="$host_cpu-$host_os-ranlib" endian="little" fi - if test "$host" != "$target"; then - case "$target_os" in - mingw32*) - mingw=yes - CPPFLAGS="$CPPFLAGS -mno-cygwin -mconsole" - CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/include/win32" - CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/include/win32/resources" - LDFLAGS="$LDFLAGS -mno-cygwin -mconsole" - endian="little" - ;; - esac - fi - ;; + ;; esac dnl ================================================================== diff --git a/include/compat.h b/include/compat.h index ced4bc916..47919610e 100644 --- a/include/compat.h +++ b/include/compat.h @@ -56,10 +56,12 @@ #endif /* These may be underscored... */ -#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF) +#if defined(HAVE__SNPRINTF) +# undef snprintf # define snprintf _snprintf #endif -#if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF) +#if defined(HAVE__VSNPRINTF) +# undef vsnprintf # define vsnprintf _vsnprintf #endif #if defined(_WIN32) && !defined(__BORLANDC__)