Commit b2d610e028b5ce48d1ad7e5d0debc9c321d891b2

Josh Triplett 2014-03-21T11:10:13

Compile win32.S on 32-bit Darwin as well

diff --git a/Makefile.am b/Makefile.am
index e2011e7..7ab945f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -138,6 +138,9 @@ nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win64.S
 endif
 if X86_DARWIN
 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
+if X86_DARWIN32
+nodist_libffi_la_SOURCES += src/x86/win32.S
+endif
 endif
 if SPARC
 nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
diff --git a/configure.ac b/configure.ac
index ffcdd49..00b4317 100644
--- a/configure.ac
+++ b/configure.ac
@@ -300,6 +300,8 @@ AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD)
 AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
 AM_CONDITIONAL(X86_WIN64, test x$TARGET = xX86_WIN64)
 AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN)
+AM_CONDITIONAL(X86_DARWIN32, test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 4)
+AM_CONDITIONAL(X86_DARWIN64, test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 8)
 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
 AM_CONDITIONAL(M32R, test x$TARGET = xM32R)
diff --git a/generate-darwin-source-and-headers.py b/generate-darwin-source-and-headers.py
index 05b7128..964e861 100644
--- a/generate-darwin-source-and-headers.py
+++ b/generate-darwin-source-and-headers.py
@@ -19,7 +19,7 @@ class simulator_platform(Platform):
     prefix = "#ifdef __i386__\n\n"
     suffix = "\n\n#endif"
     src_dir = 'x86'
-    src_files = ['darwin.S', 'ffi.c']
+    src_files = ['darwin.S', 'win32.S', 'ffi.c']
 
 
 class simulator64_platform(Platform):
@@ -68,7 +68,7 @@ class desktop32_platform(Platform):
     triple = 'i386-apple-darwin10'
     version_min = '-mmacosx-version-min=10.6'
     src_dir = 'x86'
-    src_files = ['darwin.S', 'ffi.c']
+    src_files = ['darwin.S', 'win32.S', 'ffi.c']
 
     prefix = "#ifdef __i386__\n\n"
     suffix = "\n\n#endif"