Enable forced 32-bit build on Windows
authorHuadong Liu <HLiu@fusionio.com>
Tue, 5 Feb 2013 07:43:14 +0000 (08:43 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 5 Feb 2013 07:43:14 +0000 (08:43 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
README
configure

diff --git a/README b/README
index 4c7b542a8ecf4688b139aaf488225eeac26228db..41732376a68af06993fb4fd1744ec3c1a8eba7c6 100644 (file)
--- a/README
+++ b/README
@@ -125,6 +125,9 @@ How to compile FIO on 64-bit Windows:
  5. Run 'make clean'.
  6. Run 'make'.
 
+To build fio on 32-bit Windows, download x86/pthreadGC2.dll instead and do
+'./configure --build-32bit-win=yes' before 'make'.
+
 
 Command line
 ------------
index 078dab8885002459e71f44a8b98dbe69d230e2cd..c0114367b2b1f7b69facb59fac65f7c71db63695 100755 (executable)
--- a/configure
+++ b/configure
@@ -133,6 +133,8 @@ for opt do
   ;;
   --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
   ;;
+  --build-32bit-win=*) build_32bit_win="$optarg"
+  ;;
   --help)
   show_help="yes"
   ;;
@@ -183,10 +185,18 @@ SunOS)
 CYGWIN*)
   echo "Forcing known good options on Windows"
   if test -z "$CC" ; then
-    CC="x86_64-w64-mingw32-gcc"
+    if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
+      CC="i686-w64-mingw32-gcc"
+    else
+      CC="x86_64-w64-mingw32-gcc"
+    fi
   fi
   output_sym "CONFIG_LITTLE_ENDIAN"
-  output_sym "CONFIG_64BIT_LLP64"
+  if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
+    output_sym "CONFIG_32BIT"
+  else
+    output_sym "CONFIG_64BIT_LLP64"
+  fi
   output_sym "CONFIG_FADVISE"
   output_sym "CONFIG_SOCKLEN_T"
   output_sym "CONFIG_POSIX_FALLOCATE"