Bug 538324 - Move ctypes into js/src. Part 1: Move ctypes into js/src/ctypes. r=sayrer
authorDan Witte <dwitte@mozilla.com>
Fri, 02 Apr 2010 12:02:17 -0700
changeset 40442 7b370d70eb6861f34d56ab523e45fa9858bd6d2a
parent 40441 c0a4b27c724f74162a1577e04ec13598c016012e
child 40443 5492beca24632d6ccd2c8cb781ef70f3f50b5bcc
push idunknown
push userunknown
push dateunknown
reviewerssayrer
bugs538324
milestone1.9.3a4pre
Bug 538324 - Move ctypes into js/src. Part 1: Move ctypes into js/src/ctypes. r=sayrer
configure.in
js/ctypes/CTypes.cpp
js/ctypes/CTypes.h
js/ctypes/Library.cpp
js/ctypes/Library.h
js/ctypes/ctypes.msg
js/ctypes/libffi.patch
js/ctypes/libffi/ChangeLog
js/ctypes/libffi/ChangeLog.libffi
js/ctypes/libffi/ChangeLog.libgcj
js/ctypes/libffi/ChangeLog.v1
js/ctypes/libffi/LICENSE
js/ctypes/libffi/Makefile.am
js/ctypes/libffi/Makefile.in
js/ctypes/libffi/README
js/ctypes/libffi/acinclude.m4
js/ctypes/libffi/aclocal.m4
js/ctypes/libffi/compile
js/ctypes/libffi/config.guess
js/ctypes/libffi/config.sub
js/ctypes/libffi/configure
js/ctypes/libffi/configure.ac
js/ctypes/libffi/configure.host
js/ctypes/libffi/depcomp
js/ctypes/libffi/doc/libffi.info
js/ctypes/libffi/doc/libffi.texi
js/ctypes/libffi/doc/stamp-vti
js/ctypes/libffi/doc/version.texi
js/ctypes/libffi/fficonfig.h.in
js/ctypes/libffi/include/Makefile.am
js/ctypes/libffi/include/Makefile.in
js/ctypes/libffi/include/ffi.h.in
js/ctypes/libffi/include/ffi_common.h
js/ctypes/libffi/install-sh
js/ctypes/libffi/libffi.pc.in
js/ctypes/libffi/libtool-version
js/ctypes/libffi/ltmain.sh
js/ctypes/libffi/m4/libtool.m4
js/ctypes/libffi/m4/ltoptions.m4
js/ctypes/libffi/m4/ltsugar.m4
js/ctypes/libffi/m4/ltversion.m4
js/ctypes/libffi/m4/lt~obsolete.m4
js/ctypes/libffi/man/Makefile.am
js/ctypes/libffi/man/Makefile.in
js/ctypes/libffi/man/ffi.3
js/ctypes/libffi/man/ffi_call.3
js/ctypes/libffi/man/ffi_prep_cif.3
js/ctypes/libffi/mdate-sh
js/ctypes/libffi/missing
js/ctypes/libffi/msvcc.sh
js/ctypes/libffi/src/alpha/ffi.c
js/ctypes/libffi/src/alpha/ffitarget.h
js/ctypes/libffi/src/alpha/osf.S
js/ctypes/libffi/src/arm/ffi.c
js/ctypes/libffi/src/arm/ffitarget.h
js/ctypes/libffi/src/arm/sysv.S
js/ctypes/libffi/src/avr32/ffi.c
js/ctypes/libffi/src/avr32/ffitarget.h
js/ctypes/libffi/src/avr32/sysv.S
js/ctypes/libffi/src/closures.c
js/ctypes/libffi/src/cris/ffi.c
js/ctypes/libffi/src/cris/ffitarget.h
js/ctypes/libffi/src/cris/sysv.S
js/ctypes/libffi/src/debug.c
js/ctypes/libffi/src/dlmalloc.c
js/ctypes/libffi/src/frv/eabi.S
js/ctypes/libffi/src/frv/ffi.c
js/ctypes/libffi/src/frv/ffitarget.h
js/ctypes/libffi/src/ia64/ffi.c
js/ctypes/libffi/src/ia64/ffitarget.h
js/ctypes/libffi/src/ia64/ia64_flags.h
js/ctypes/libffi/src/ia64/unix.S
js/ctypes/libffi/src/java_raw_api.c
js/ctypes/libffi/src/m32r/ffi.c
js/ctypes/libffi/src/m32r/ffitarget.h
js/ctypes/libffi/src/m32r/sysv.S
js/ctypes/libffi/src/m68k/ffi.c
js/ctypes/libffi/src/m68k/ffitarget.h
js/ctypes/libffi/src/m68k/sysv.S
js/ctypes/libffi/src/mips/ffi.c
js/ctypes/libffi/src/mips/ffitarget.h
js/ctypes/libffi/src/mips/n32.S
js/ctypes/libffi/src/mips/o32.S
js/ctypes/libffi/src/moxie/eabi.S
js/ctypes/libffi/src/moxie/ffi.c
js/ctypes/libffi/src/moxie/ffitarget.h
js/ctypes/libffi/src/pa/ffi.c
js/ctypes/libffi/src/pa/ffitarget.h
js/ctypes/libffi/src/pa/hpux32.S
js/ctypes/libffi/src/pa/linux.S
js/ctypes/libffi/src/powerpc/aix.S
js/ctypes/libffi/src/powerpc/aix_closure.S
js/ctypes/libffi/src/powerpc/asm.h
js/ctypes/libffi/src/powerpc/darwin.S
js/ctypes/libffi/src/powerpc/darwin_closure.S
js/ctypes/libffi/src/powerpc/ffi.c
js/ctypes/libffi/src/powerpc/ffi_darwin.c
js/ctypes/libffi/src/powerpc/ffitarget.h
js/ctypes/libffi/src/powerpc/linux64.S
js/ctypes/libffi/src/powerpc/linux64_closure.S
js/ctypes/libffi/src/powerpc/ppc_closure.S
js/ctypes/libffi/src/powerpc/sysv.S
js/ctypes/libffi/src/prep_cif.c
js/ctypes/libffi/src/raw_api.c
js/ctypes/libffi/src/s390/ffi.c
js/ctypes/libffi/src/s390/ffitarget.h
js/ctypes/libffi/src/s390/sysv.S
js/ctypes/libffi/src/sh/ffi.c
js/ctypes/libffi/src/sh/ffitarget.h
js/ctypes/libffi/src/sh/sysv.S
js/ctypes/libffi/src/sh64/ffi.c
js/ctypes/libffi/src/sh64/ffitarget.h
js/ctypes/libffi/src/sh64/sysv.S
js/ctypes/libffi/src/sparc/ffi.c
js/ctypes/libffi/src/sparc/ffitarget.h
js/ctypes/libffi/src/sparc/v8.S
js/ctypes/libffi/src/sparc/v9.S
js/ctypes/libffi/src/types.c
js/ctypes/libffi/src/x86/darwin.S
js/ctypes/libffi/src/x86/darwin64.S
js/ctypes/libffi/src/x86/ffi.c
js/ctypes/libffi/src/x86/ffi64.c
js/ctypes/libffi/src/x86/ffitarget.h
js/ctypes/libffi/src/x86/freebsd.S
js/ctypes/libffi/src/x86/sysv.S
js/ctypes/libffi/src/x86/unix64.S
js/ctypes/libffi/src/x86/win32.S
js/ctypes/libffi/src/x86/win64.S
js/ctypes/libffi/testsuite/Makefile.am
js/ctypes/libffi/testsuite/Makefile.in
js/ctypes/libffi/testsuite/config/default.exp
js/ctypes/libffi/testsuite/lib/libffi-dg.exp
js/ctypes/libffi/testsuite/lib/target-libpath.exp
js/ctypes/libffi/testsuite/lib/wrapper.exp
js/ctypes/libffi/testsuite/libffi.call/call.exp
js/ctypes/libffi/testsuite/libffi.call/closure_fn0.c
js/ctypes/libffi/testsuite/libffi.call/closure_fn1.c
js/ctypes/libffi/testsuite/libffi.call/closure_fn2.c
js/ctypes/libffi/testsuite/libffi.call/closure_fn3.c
js/ctypes/libffi/testsuite/libffi.call/closure_fn4.c
js/ctypes/libffi/testsuite/libffi.call/closure_fn5.c
js/ctypes/libffi/testsuite/libffi.call/closure_fn6.c
js/ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c
js/ctypes/libffi/testsuite/libffi.call/closure_stdcall.c
js/ctypes/libffi/testsuite/libffi.call/cls_12byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_16byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_18byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_19byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_20byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_20byte1.c
js/ctypes/libffi/testsuite/libffi.call/cls_24byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_2byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_3byte1.c
js/ctypes/libffi/testsuite/libffi.call/cls_3byte2.c
js/ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_4byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_5byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_64byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_6byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_7byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_8byte.c
js/ctypes/libffi/testsuite/libffi.call/cls_9byte1.c
js/ctypes/libffi/testsuite/libffi.call/cls_9byte2.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_double.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_float.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c
js/ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c
js/ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c
js/ctypes/libffi/testsuite/libffi.call/cls_double.c
js/ctypes/libffi/testsuite/libffi.call/cls_double_va.c
js/ctypes/libffi/testsuite/libffi.call/cls_float.c
js/ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
js/ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
js/ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c
js/ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c
js/ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
js/ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c
js/ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c
js/ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
js/ctypes/libffi/testsuite/libffi.call/cls_pointer.c
js/ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c
js/ctypes/libffi/testsuite/libffi.call/cls_schar.c
js/ctypes/libffi/testsuite/libffi.call/cls_sint.c
js/ctypes/libffi/testsuite/libffi.call/cls_sshort.c
js/ctypes/libffi/testsuite/libffi.call/cls_uchar.c
js/ctypes/libffi/testsuite/libffi.call/cls_uint.c
js/ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c
js/ctypes/libffi/testsuite/libffi.call/cls_ushort.c
js/ctypes/libffi/testsuite/libffi.call/err_bad_abi.c
js/ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c
js/ctypes/libffi/testsuite/libffi.call/ffitest.h
js/ctypes/libffi/testsuite/libffi.call/float.c
js/ctypes/libffi/testsuite/libffi.call/float1.c
js/ctypes/libffi/testsuite/libffi.call/float2.c
js/ctypes/libffi/testsuite/libffi.call/float3.c
js/ctypes/libffi/testsuite/libffi.call/float4.c
js/ctypes/libffi/testsuite/libffi.call/huge_struct.c
js/ctypes/libffi/testsuite/libffi.call/many.c
js/ctypes/libffi/testsuite/libffi.call/many_win32.c
js/ctypes/libffi/testsuite/libffi.call/negint.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct1.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct10.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct2.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct3.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct4.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct5.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct6.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct7.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct8.c
js/ctypes/libffi/testsuite/libffi.call/nested_struct9.c
js/ctypes/libffi/testsuite/libffi.call/problem1.c
js/ctypes/libffi/testsuite/libffi.call/promotion.c
js/ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c
js/ctypes/libffi/testsuite/libffi.call/return_dbl.c
js/ctypes/libffi/testsuite/libffi.call/return_dbl1.c
js/ctypes/libffi/testsuite/libffi.call/return_dbl2.c
js/ctypes/libffi/testsuite/libffi.call/return_fl.c
js/ctypes/libffi/testsuite/libffi.call/return_fl1.c
js/ctypes/libffi/testsuite/libffi.call/return_fl2.c
js/ctypes/libffi/testsuite/libffi.call/return_fl3.c
js/ctypes/libffi/testsuite/libffi.call/return_ldl.c
js/ctypes/libffi/testsuite/libffi.call/return_ll.c
js/ctypes/libffi/testsuite/libffi.call/return_ll1.c
js/ctypes/libffi/testsuite/libffi.call/return_sc.c
js/ctypes/libffi/testsuite/libffi.call/return_sl.c
js/ctypes/libffi/testsuite/libffi.call/return_uc.c
js/ctypes/libffi/testsuite/libffi.call/return_ul.c
js/ctypes/libffi/testsuite/libffi.call/stret_large.c
js/ctypes/libffi/testsuite/libffi.call/stret_large2.c
js/ctypes/libffi/testsuite/libffi.call/stret_medium.c
js/ctypes/libffi/testsuite/libffi.call/stret_medium2.c
js/ctypes/libffi/testsuite/libffi.call/strlen.c
js/ctypes/libffi/testsuite/libffi.call/strlen_win32.c
js/ctypes/libffi/testsuite/libffi.call/struct1.c
js/ctypes/libffi/testsuite/libffi.call/struct2.c
js/ctypes/libffi/testsuite/libffi.call/struct3.c
js/ctypes/libffi/testsuite/libffi.call/struct4.c
js/ctypes/libffi/testsuite/libffi.call/struct5.c
js/ctypes/libffi/testsuite/libffi.call/struct6.c
js/ctypes/libffi/testsuite/libffi.call/struct7.c
js/ctypes/libffi/testsuite/libffi.call/struct8.c
js/ctypes/libffi/testsuite/libffi.call/struct9.c
js/ctypes/libffi/testsuite/libffi.call/testclosure.c
js/ctypes/libffi/testsuite/libffi.special/ffitestcxx.h
js/ctypes/libffi/testsuite/libffi.special/special.exp
js/ctypes/libffi/testsuite/libffi.special/unwindtest.cc
js/ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc
js/ctypes/libffi/texinfo.tex
js/ctypes/typedefs.h
js/src/Makefile.in
js/src/Makefile.ref
js/src/config/autoconf.mk.in
js/src/configure.in
js/src/ctypes/CTypes.cpp
js/src/ctypes/CTypes.h
js/src/ctypes/Library.cpp
js/src/ctypes/Library.h
js/src/ctypes/ctypes.msg
js/src/ctypes/libffi.patch
js/src/ctypes/libffi/ChangeLog
js/src/ctypes/libffi/ChangeLog.libffi
js/src/ctypes/libffi/ChangeLog.libgcj
js/src/ctypes/libffi/ChangeLog.v1
js/src/ctypes/libffi/LICENSE
js/src/ctypes/libffi/Makefile.am
js/src/ctypes/libffi/Makefile.in
js/src/ctypes/libffi/README
js/src/ctypes/libffi/acinclude.m4
js/src/ctypes/libffi/aclocal.m4
js/src/ctypes/libffi/compile
js/src/ctypes/libffi/config.guess
js/src/ctypes/libffi/config.sub
js/src/ctypes/libffi/configure
js/src/ctypes/libffi/configure.ac
js/src/ctypes/libffi/configure.host
js/src/ctypes/libffi/depcomp
js/src/ctypes/libffi/doc/libffi.info
js/src/ctypes/libffi/doc/libffi.texi
js/src/ctypes/libffi/doc/stamp-vti
js/src/ctypes/libffi/doc/version.texi
js/src/ctypes/libffi/fficonfig.h.in
js/src/ctypes/libffi/include/Makefile.am
js/src/ctypes/libffi/include/Makefile.in
js/src/ctypes/libffi/include/ffi.h.in
js/src/ctypes/libffi/include/ffi_common.h
js/src/ctypes/libffi/install-sh
js/src/ctypes/libffi/libffi.pc.in
js/src/ctypes/libffi/libtool-version
js/src/ctypes/libffi/ltmain.sh
js/src/ctypes/libffi/m4/libtool.m4
js/src/ctypes/libffi/m4/ltoptions.m4
js/src/ctypes/libffi/m4/ltsugar.m4
js/src/ctypes/libffi/m4/ltversion.m4
js/src/ctypes/libffi/m4/lt~obsolete.m4
js/src/ctypes/libffi/man/Makefile.am
js/src/ctypes/libffi/man/Makefile.in
js/src/ctypes/libffi/man/ffi.3
js/src/ctypes/libffi/man/ffi_call.3
js/src/ctypes/libffi/man/ffi_prep_cif.3
js/src/ctypes/libffi/mdate-sh
js/src/ctypes/libffi/missing
js/src/ctypes/libffi/msvcc.sh
js/src/ctypes/libffi/src/alpha/ffi.c
js/src/ctypes/libffi/src/alpha/ffitarget.h
js/src/ctypes/libffi/src/alpha/osf.S
js/src/ctypes/libffi/src/arm/ffi.c
js/src/ctypes/libffi/src/arm/ffitarget.h
js/src/ctypes/libffi/src/arm/sysv.S
js/src/ctypes/libffi/src/avr32/ffi.c
js/src/ctypes/libffi/src/avr32/ffitarget.h
js/src/ctypes/libffi/src/avr32/sysv.S
js/src/ctypes/libffi/src/closures.c
js/src/ctypes/libffi/src/cris/ffi.c
js/src/ctypes/libffi/src/cris/ffitarget.h
js/src/ctypes/libffi/src/cris/sysv.S
js/src/ctypes/libffi/src/debug.c
js/src/ctypes/libffi/src/dlmalloc.c
js/src/ctypes/libffi/src/frv/eabi.S
js/src/ctypes/libffi/src/frv/ffi.c
js/src/ctypes/libffi/src/frv/ffitarget.h
js/src/ctypes/libffi/src/ia64/ffi.c
js/src/ctypes/libffi/src/ia64/ffitarget.h
js/src/ctypes/libffi/src/ia64/ia64_flags.h
js/src/ctypes/libffi/src/ia64/unix.S
js/src/ctypes/libffi/src/java_raw_api.c
js/src/ctypes/libffi/src/m32r/ffi.c
js/src/ctypes/libffi/src/m32r/ffitarget.h
js/src/ctypes/libffi/src/m32r/sysv.S
js/src/ctypes/libffi/src/m68k/ffi.c
js/src/ctypes/libffi/src/m68k/ffitarget.h
js/src/ctypes/libffi/src/m68k/sysv.S
js/src/ctypes/libffi/src/mips/ffi.c
js/src/ctypes/libffi/src/mips/ffitarget.h
js/src/ctypes/libffi/src/mips/n32.S
js/src/ctypes/libffi/src/mips/o32.S
js/src/ctypes/libffi/src/moxie/eabi.S
js/src/ctypes/libffi/src/moxie/ffi.c
js/src/ctypes/libffi/src/moxie/ffitarget.h
js/src/ctypes/libffi/src/pa/ffi.c
js/src/ctypes/libffi/src/pa/ffitarget.h
js/src/ctypes/libffi/src/pa/hpux32.S
js/src/ctypes/libffi/src/pa/linux.S
js/src/ctypes/libffi/src/powerpc/aix.S
js/src/ctypes/libffi/src/powerpc/aix_closure.S
js/src/ctypes/libffi/src/powerpc/asm.h
js/src/ctypes/libffi/src/powerpc/darwin.S
js/src/ctypes/libffi/src/powerpc/darwin_closure.S
js/src/ctypes/libffi/src/powerpc/ffi.c
js/src/ctypes/libffi/src/powerpc/ffi_darwin.c
js/src/ctypes/libffi/src/powerpc/ffitarget.h
js/src/ctypes/libffi/src/powerpc/linux64.S
js/src/ctypes/libffi/src/powerpc/linux64_closure.S
js/src/ctypes/libffi/src/powerpc/ppc_closure.S
js/src/ctypes/libffi/src/powerpc/sysv.S
js/src/ctypes/libffi/src/prep_cif.c
js/src/ctypes/libffi/src/raw_api.c
js/src/ctypes/libffi/src/s390/ffi.c
js/src/ctypes/libffi/src/s390/ffitarget.h
js/src/ctypes/libffi/src/s390/sysv.S
js/src/ctypes/libffi/src/sh/ffi.c
js/src/ctypes/libffi/src/sh/ffitarget.h
js/src/ctypes/libffi/src/sh/sysv.S
js/src/ctypes/libffi/src/sh64/ffi.c
js/src/ctypes/libffi/src/sh64/ffitarget.h
js/src/ctypes/libffi/src/sh64/sysv.S
js/src/ctypes/libffi/src/sparc/ffi.c
js/src/ctypes/libffi/src/sparc/ffitarget.h
js/src/ctypes/libffi/src/sparc/v8.S
js/src/ctypes/libffi/src/sparc/v9.S
js/src/ctypes/libffi/src/types.c
js/src/ctypes/libffi/src/x86/darwin.S
js/src/ctypes/libffi/src/x86/darwin64.S
js/src/ctypes/libffi/src/x86/ffi.c
js/src/ctypes/libffi/src/x86/ffi64.c
js/src/ctypes/libffi/src/x86/ffitarget.h
js/src/ctypes/libffi/src/x86/freebsd.S
js/src/ctypes/libffi/src/x86/sysv.S
js/src/ctypes/libffi/src/x86/unix64.S
js/src/ctypes/libffi/src/x86/win32.S
js/src/ctypes/libffi/src/x86/win64.S
js/src/ctypes/libffi/testsuite/Makefile.am
js/src/ctypes/libffi/testsuite/Makefile.in
js/src/ctypes/libffi/testsuite/config/default.exp
js/src/ctypes/libffi/testsuite/lib/libffi-dg.exp
js/src/ctypes/libffi/testsuite/lib/target-libpath.exp
js/src/ctypes/libffi/testsuite/lib/wrapper.exp
js/src/ctypes/libffi/testsuite/libffi.call/call.exp
js/src/ctypes/libffi/testsuite/libffi.call/closure_fn0.c
js/src/ctypes/libffi/testsuite/libffi.call/closure_fn1.c
js/src/ctypes/libffi/testsuite/libffi.call/closure_fn2.c
js/src/ctypes/libffi/testsuite/libffi.call/closure_fn3.c
js/src/ctypes/libffi/testsuite/libffi.call/closure_fn4.c
js/src/ctypes/libffi/testsuite/libffi.call/closure_fn5.c
js/src/ctypes/libffi/testsuite/libffi.call/closure_fn6.c
js/src/ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c
js/src/ctypes/libffi/testsuite/libffi.call/closure_stdcall.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_12byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_16byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_18byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_19byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_20byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_20byte1.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_24byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_2byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_3byte1.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_3byte2.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_4byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_5byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_64byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_6byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_7byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_8byte.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_9byte1.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_9byte2.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_double.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_float.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_double.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_double_va.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_float.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_pointer.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_schar.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_sint.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_sshort.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_uchar.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_uint.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c
js/src/ctypes/libffi/testsuite/libffi.call/cls_ushort.c
js/src/ctypes/libffi/testsuite/libffi.call/err_bad_abi.c
js/src/ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c
js/src/ctypes/libffi/testsuite/libffi.call/ffitest.h
js/src/ctypes/libffi/testsuite/libffi.call/float.c
js/src/ctypes/libffi/testsuite/libffi.call/float1.c
js/src/ctypes/libffi/testsuite/libffi.call/float2.c
js/src/ctypes/libffi/testsuite/libffi.call/float3.c
js/src/ctypes/libffi/testsuite/libffi.call/float4.c
js/src/ctypes/libffi/testsuite/libffi.call/huge_struct.c
js/src/ctypes/libffi/testsuite/libffi.call/many.c
js/src/ctypes/libffi/testsuite/libffi.call/many_win32.c
js/src/ctypes/libffi/testsuite/libffi.call/negint.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct1.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct10.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct2.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct3.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct4.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct5.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct6.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct7.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct8.c
js/src/ctypes/libffi/testsuite/libffi.call/nested_struct9.c
js/src/ctypes/libffi/testsuite/libffi.call/problem1.c
js/src/ctypes/libffi/testsuite/libffi.call/promotion.c
js/src/ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c
js/src/ctypes/libffi/testsuite/libffi.call/return_dbl.c
js/src/ctypes/libffi/testsuite/libffi.call/return_dbl1.c
js/src/ctypes/libffi/testsuite/libffi.call/return_dbl2.c
js/src/ctypes/libffi/testsuite/libffi.call/return_fl.c
js/src/ctypes/libffi/testsuite/libffi.call/return_fl1.c
js/src/ctypes/libffi/testsuite/libffi.call/return_fl2.c
js/src/ctypes/libffi/testsuite/libffi.call/return_fl3.c
js/src/ctypes/libffi/testsuite/libffi.call/return_ldl.c
js/src/ctypes/libffi/testsuite/libffi.call/return_ll.c
js/src/ctypes/libffi/testsuite/libffi.call/return_ll1.c
js/src/ctypes/libffi/testsuite/libffi.call/return_sc.c
js/src/ctypes/libffi/testsuite/libffi.call/return_sl.c
js/src/ctypes/libffi/testsuite/libffi.call/return_uc.c
js/src/ctypes/libffi/testsuite/libffi.call/return_ul.c
js/src/ctypes/libffi/testsuite/libffi.call/stret_large.c
js/src/ctypes/libffi/testsuite/libffi.call/stret_large2.c
js/src/ctypes/libffi/testsuite/libffi.call/stret_medium.c
js/src/ctypes/libffi/testsuite/libffi.call/stret_medium2.c
js/src/ctypes/libffi/testsuite/libffi.call/strlen.c
js/src/ctypes/libffi/testsuite/libffi.call/strlen_win32.c
js/src/ctypes/libffi/testsuite/libffi.call/struct1.c
js/src/ctypes/libffi/testsuite/libffi.call/struct2.c
js/src/ctypes/libffi/testsuite/libffi.call/struct3.c
js/src/ctypes/libffi/testsuite/libffi.call/struct4.c
js/src/ctypes/libffi/testsuite/libffi.call/struct5.c
js/src/ctypes/libffi/testsuite/libffi.call/struct6.c
js/src/ctypes/libffi/testsuite/libffi.call/struct7.c
js/src/ctypes/libffi/testsuite/libffi.call/struct8.c
js/src/ctypes/libffi/testsuite/libffi.call/struct9.c
js/src/ctypes/libffi/testsuite/libffi.call/testclosure.c
js/src/ctypes/libffi/testsuite/libffi.special/ffitestcxx.h
js/src/ctypes/libffi/testsuite/libffi.special/special.exp
js/src/ctypes/libffi/testsuite/libffi.special/unwindtest.cc
js/src/ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc
js/src/ctypes/libffi/texinfo.tex
js/src/ctypes/typedefs.h
js/src/js-config.h.in
toolkit/toolkit-makefiles.sh
toolkit/toolkit-tiers.mk
--- a/configure.in
+++ b/configure.in
@@ -8127,19 +8127,16 @@ MOZ_ARG_DISABLE_BOOL(ctypes,
 [  --disable-ctypes        Disable js-ctypes],
     BUILD_CTYPES=,
     BUILD_CTYPES=1)
 AC_SUBST(BUILD_CTYPES)
 if test "$BUILD_CTYPES"; then
   if test "$OS_ARCH" = "WINCE" -a `echo $OS_TEST | grep -ic arm` = 1; then
     # Disable ctypes for arm/wince.
     BUILD_CTYPES=
-  elif test "$_MSC_VER" && test -z $AS; then
-    # Disable ctypes if we're on MSVC and MASM is unavailable.
-    AC_MSG_ERROR([No suitable assembler found. An assembler is required to build js-ctypes. You may --disable-ctypes to avoid this. If you are building with MS Visual Studio 8 Express, you may download the MASM 8.0 package, upgrade to Visual Studio 9 Express, or install the Vista SDK.])
   else
     AC_DEFINE(BUILD_CTYPES)
   fi
 fi
 
 dnl NECKO_ configuration options are not global
 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
 
@@ -8720,80 +8717,36 @@ if test -z "$MOZ_NATIVE_NSPR"; then
     fi
     rm -f config/autoconf.mk.bak
 fi
 
 # Run the SpiderMonkey 'configure' script.
 dist=$MOZ_BUILD_ROOT/dist
 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
 ac_configure_args="$ac_configure_args --enable-threadsafe"
+if test "$BUILD_CTYPES"; then
+    # Build js-ctypes on the platforms we can.
+    ac_configure_args="$ac_configure_args --enable-ctypes"
+fi
 if test -z "$MOZ_NATIVE_NSPR"; then
     ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
     ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
 fi
 ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
 ac_configure_args="$ac_configure_args --prefix=$dist"
 ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
 if test "$MOZ_MEMORY"; then
    ac_configure_args="$ac_configure_args --enable-jemalloc"
    if test -n "$MOZ_MEMORY_LDFLAGS"; then
      export MOZ_MEMORY_LDFLAGS
    fi
 fi
 AC_OUTPUT_SUBDIRS(js/src)
 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
 
-# Build jsctypes on the platforms we can.
-if test "$BUILD_CTYPES"; then
-  # Run the libffi 'configure' script.
-  ac_configure_args="--disable-shared --enable-static --disable-raw-api"
-  if test "$MOZ_DEBUG"; then
-    ac_configure_args="$ac_configure_args --enable-debug"
-  fi
-  if test "$DSO_PIC_CFLAGS"; then
-    ac_configure_args="$ac_configure_args --with-pic"
-  fi
-  if test "$CROSS_COMPILE"; then
-    case "$target" in
-    *-mingw*)
-      ac_configure_args="$ac_configure_args --build=$build --host=${target_cpu}-${target_os} HOST_CC=\"$HOST_CC\" CC=\"$CC\""
-      ;;
-    *)
-      ac_configure_args="$ac_configure_args --build=$build --host=$target HOST_CC=\"$HOST_CC\" CC=\"$CC\""
-      ;;
-    esac
-  fi
-  if test "$_MSC_VER"; then
-    # Use a wrapper script for cl and ml that looks more like gcc.
-    # autotools can't quite handle an MSVC build environment yet.
-    ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" SHELL=sh.exe"
-    case "${target_cpu}" in
-    x86_64)
-      # Need target since MSYS tools into mozilla-build may be 32bit
-      ac_configure_args="$ac_configure_args CC=\"$_topsrcdir/js/ctypes/libffi/msvcc.sh -m64\" --build=$build --host=$target"
-      ;;
-    *)
-      ac_configure_args="$ac_configure_args CC=$_topsrcdir/js/ctypes/libffi/msvcc.sh"
-      ;;
-    esac
-  fi
-  if test "$SOLARIS_SUNPRO_CC"; then
-    # Always use gcc for libffi on Solaris
-    ac_configure_args="$ac_configure_args CC=gcc"
-  fi
-
-  # Use a separate cache file for libffi, since it does things differently
-  # from our configure.
-  old_cache_file=$cache_file
-  cache_file=js/ctypes/libffi/config.cache
-  AC_OUTPUT_SUBDIRS(js/ctypes/libffi)
-  cache_file=$old_cache_file
-  ac_configure_args="$_SUBDIR_CONFIG_ARGS"
-fi
-
 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
 
 dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
 dnl Needs to be at the end to respect possible changes from NSPR configure
 if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
   echo "config/autoconf.mk is unchanged"
   mv -f config/autoconf.mk.orig config/autoconf.mk 2> /dev/null
 else
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -273,16 +273,37 @@ ifdef WINCE
 # don't need -c
 AS_DASH_C_FLAG =
 ASFLAGS += -arch 6
 ASFILES += jswince.asm
 endif
 
 endif # ENABLE_TRACEJIT
 
+ifdef JS_HAS_CTYPES
+CPPSRCS += \
+    ctypes/CTypes.cpp \
+    ctypes/Library.cpp \
+    $(NULL)
+
+LOCAL_INCLUDES = \
+    -Ictypes/libffi/include \
+    $(NULL)
+
+ifeq ($(OS_ARCH),OS2)
+# libffi builds an aout lib on OS/2; convert it to an OMF lib.
+ctypes/libffi/.libs/libffi.$(LIB_SUFFIX): ctypes/libffi/.libs/libffi.a
+	emxomf $<
+endif
+
+SHARED_LIBRARY_LIBS = \
+    ctypes/libffi/.libs/libffi.$(LIB_SUFFIX) \
+    $(NULL)
+endif # JS_HAS_CTYPES
+
 ifdef HAVE_DTRACE
 INSTALLED_HEADERS += \
 		jsdtracef.h \
 		$(CURDIR)/javascript-trace.h \
 		$(NULL)
 endif
 
 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
@@ -342,16 +363,26 @@ export:: config/nsinstall$(HOST_BIN_SUFF
 
 config/nsinstall$(HOST_BIN_SUFFIX): $(srcdir)/config/nsinstall.c $(srcdir)/config/pathsub.c
 	$(MAKE) -C config/ nsinstall$(HOST_BIN_SUFFIX)
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
 
+ifdef JS_HAS_CTYPES
+# Build libffi proper as part of the 'exports' target, so things get built
+# in the right order.
+export::
+		$(call SUBMAKE,,ctypes/libffi)
+
+clean::
+		$(call SUBMAKE,clean,ctypes/libffi)
+endif
+
 ifdef MOZ_SYNC_BUILD_FILES
 # Because the SpiderMonkey can be distributed and built independently
 # of the Mozilla source tree, it contains its own copies of many of
 # the files used by the top-level Mozilla build process, from the
 # 'config' and 'build' subtrees.
 #
 # To make it simpler to keep the copies in sync, we follow the policy
 # that the SpiderMonkey copies must always be exact copies of those in
@@ -404,16 +435,20 @@ GARBAGE		+= jscpucfg.o jsautocfg.h jsaut
 ifneq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
 TARGETS		+= jscpucfg$(HOST_BIN_SUFFIX)
 endif
 
 ifdef JS_THREADSAFE
 DEFINES		+= -DJS_THREADSAFE
 endif
 
+ifdef JS_HAS_CTYPES
+DEFINES		+= -DJS_HAS_CTYPES
+endif
+
 ifdef JS_NO_THIN_LOCKS
 DEFINES		+= -DJS_USE_ONLY_NSPR_LOCKS
 endif
 
 ifdef JS_VERSION
 DEFINES		+= -DJS_VERSION=$(JS_VERSION)
 endif
 
--- a/js/src/Makefile.ref
+++ b/js/src/Makefile.ref
@@ -86,16 +86,26 @@ DEFINES += -DJS_THREADSAFE
 INCLUDES += -I$(DIST)/include/nspr
 ifdef USE_MSVC
 OTHER_LIBS += $(DIST)/lib/libnspr$(NSPR_LIBSUFFIX).lib
 else
 OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX)
 endif
 endif
 
+ifdef JS_HAS_CTYPES
+DEFINES += -DJS_HAS_CTYPES
+INCLUDES += -I$(DIST)/include/nspr
+ifdef USE_MSVC
+OTHER_LIBS += $(DIST)/lib/libnspr$(NSPR_LIBSUFFIX).lib
+else
+OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX)
+endif
+endif
+
 ifdef JS_NO_THIN_LOCKS
 DEFINES += -DJS_USE_ONLY_NSPR_LOCKS
 endif
 
 ifdef JS_GC_ZEAL
 DEFINES += -DJS_GC_ZEAL
 endif
 
@@ -387,16 +397,17 @@ endif
 # keeps make from concluding that js-config.h never changes.
 $(OBJDIR)/js-config.h: $(OBJDIR)/js-config.h.stamp
 	@true
 
 js-config-switch=$(if $(value $($1)),-e 's/\#undef $1/\#define $1/')
 $(OBJDIR)/js-config.h.stamp: js-config.h.in Makefile.ref
 	sed < $< > $(@:.stamp=.tmp)			\
 	    $(call js-config-switch,JS_THREADSAFE)	\
+	    $(call js-config-switch,JS_HAS_CTYPES)		\
 	    $(call js-config-switch,JS_GC_ZEAL)		\
 	    -e :dummy
 	if ! [ -f $(@:.stamp=) ] || ! cmp $(@:.stamp=.tmp) $(@:.stamp=); then \
 	    mv $(@:.stamp=.tmp) $(@:.stamp=);				      \
 	fi
 	touch $@
 
 GARBAGE += $(OBJDIR)/js-config.h $(OBJDIR)/js-config.h.stamp
--- a/js/src/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -87,16 +87,17 @@ MOZ_IMG_DECODERS= @MOZ_IMG_DECODERS@
 MOZ_IMG_ENCODERS= @MOZ_IMG_ENCODERS@
 MOZ_JSDEBUGGER  = @MOZ_JSDEBUGGER@
 MOZ_LEAKY	= @MOZ_LEAKY@
 MOZ_MEMORY      = @MOZ_MEMORY@
 MOZ_JPROF       = @MOZ_JPROF@
 MOZ_SHARK       = @MOZ_SHARK@
 MOZ_CALLGRIND   = @MOZ_CALLGRIND@
 MOZ_VTUNE       = @MOZ_VTUNE@
+JS_HAS_CTYPES = @JS_HAS_CTYPES@
 DEHYDRA_PATH    = @DEHYDRA_PATH@
 
 NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
 INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
 MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
 BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
 ENABLE_TESTS	= @ENABLE_TESTS@
 
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -4216,16 +4216,32 @@ fi
 dnl ========================================================
 dnl = Location of malloc wrapper lib
 dnl ========================================================
 MOZ_ARG_WITH_STRING(wrap-malloc,
 [  --with-wrap-malloc=DIR  Location of malloc wrapper library],
     WRAP_MALLOC_LIB=$withval)
 
 dnl ========================================================
+dnl = Build jsctypes if it's enabled
+dnl ========================================================
+MOZ_ARG_ENABLE_BOOL(ctypes,
+[  --enable-ctypes         Enable js-ctypes (default=no)],
+    JS_HAS_CTYPES=1,
+    JS_HAS_CTYPES= )
+AC_SUBST(JS_HAS_CTYPES)
+if test "$JS_HAS_CTYPES"; then
+  if test "$_MSC_VER" && test -z $AS; then
+    # Error out if we're on MSVC and MASM is unavailable.
+    AC_MSG_ERROR([No suitable assembler found. An assembler is required to build js-ctypes. If you are building with MS Visual Studio 8 Express, you may download the MASM 8.0 package, upgrade to Visual Studio 9 Express, or install the Vista SDK.])
+  fi
+  AC_DEFINE(JS_HAS_CTYPES)
+fi
+
+dnl ========================================================
 dnl = Use TraceVis
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(tracevis,
 [  --enable-tracevis       Enable TraceVis tracing tool (default=no)],
     MOZ_TRACEVIS=1,
     MOZ_TRACEVIS= )
 if test -n "$MOZ_TRACEVIS"; then
     AC_DEFINE(MOZ_TRACEVIS)
@@ -5166,16 +5182,18 @@ MOZ_DEFINES=$DEFS
 AC_SUBST(MOZ_DEFINES)
 rm -f confdefs.h
 mv confdefs.h.save confdefs.h
 
 MAKEFILES="
   Makefile
   shell/Makefile
   lirasm/Makefile
+  ctypes/Makefile
+  ctypes/tests/Makefile
   jsapi-tests/Makefile
   tests/Makefile
   config/Makefile
   config/autoconf.mk
   config/mkdepend/Makefile
 "
 
 if test -n "$JS_NATIVE_EDITLINE"; then
@@ -5216,8 +5234,60 @@ if cmp -s config/autoconf.mk config/auto
 else
   rm -f config/autoconf.mk.orig 2> /dev/null
 fi
 
 # Produce the js-config script at configure time; see the comments for
 # 'js-config' in Makefile.in.
 AC_MSG_RESULT(invoking make to create js-config script)
 $MAKE js-config
+
+# Build jsctypes if it's enabled.
+if test "$JS_HAS_CTYPES"; then
+  # Run the libffi 'configure' script.
+  ac_configure_args="--disable-shared --enable-static --disable-raw-api"
+  if test "$MOZ_DEBUG"; then
+    ac_configure_args="$ac_configure_args --enable-debug"
+  fi
+  if test "$DSO_PIC_CFLAGS"; then
+    ac_configure_args="$ac_configure_args --with-pic"
+  fi
+  if test "$CROSS_COMPILE"; then
+    case "$target" in
+    *-mingw*)
+      ac_configure_args="$ac_configure_args --build=$build --host=${target_cpu}-${target_os} HOST_CC=\"$HOST_CC\" CC=\"$CC\""
+      ;;
+    *)
+      ac_configure_args="$ac_configure_args --build=$build --host=$target HOST_CC=\"$HOST_CC\" CC=\"$CC\""
+      ;;
+    esac
+  fi
+  if test "$_MSC_VER"; then
+    # Use a wrapper script for cl and ml that looks more like gcc.
+    # autotools can't quite handle an MSVC build environment yet.
+    ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" SHELL=sh.exe"
+    case "${target_cpu}" in
+    x86_64)
+      # Need target since MSYS tools into mozilla-build may be 32bit
+      ac_configure_args="$ac_configure_args CC=\"$_topsrcdir/ctypes/libffi/msvcc.sh -m64\" --build=$build --host=$target"
+      ;;
+    *)
+      ac_configure_args="$ac_configure_args CC=$_topsrcdir/ctypes/libffi/msvcc.sh"
+      ;;
+    esac
+  fi
+  if test "$SOLARIS_SUNPRO_CC"; then
+    # Always use gcc for libffi on Solaris
+    ac_configure_args="$ac_configure_args CC=gcc"
+  fi
+
+  # Use a separate cache file for libffi, since it does things differently
+  # from our configure.
+  old_cache_file=$cache_file
+  cache_file=ctypes/libffi/config.cache
+  old_config_files=$CONFIG_FILES
+  unset CONFIG_FILES
+  AC_OUTPUT_SUBDIRS(ctypes/libffi)
+  cache_file=$old_cache_file
+  ac_configure_args="$_SUBDIR_CONFIG_ARGS"
+  CONFIG_FILES=$old_config_files
+fi
+
rename from js/ctypes/CTypes.cpp
rename to js/src/ctypes/CTypes.cpp
rename from js/ctypes/CTypes.h
rename to js/src/ctypes/CTypes.h
rename from js/ctypes/Library.cpp
rename to js/src/ctypes/Library.cpp
rename from js/ctypes/Library.h
rename to js/src/ctypes/Library.h
rename from js/ctypes/ctypes.msg
rename to js/src/ctypes/ctypes.msg
rename from js/ctypes/libffi.patch
rename to js/src/ctypes/libffi.patch
rename from js/ctypes/libffi/ChangeLog
rename to js/src/ctypes/libffi/ChangeLog
rename from js/ctypes/libffi/ChangeLog.libffi
rename to js/src/ctypes/libffi/ChangeLog.libffi
rename from js/ctypes/libffi/ChangeLog.libgcj
rename to js/src/ctypes/libffi/ChangeLog.libgcj
rename from js/ctypes/libffi/ChangeLog.v1
rename to js/src/ctypes/libffi/ChangeLog.v1
rename from js/ctypes/libffi/LICENSE
rename to js/src/ctypes/libffi/LICENSE
rename from js/ctypes/libffi/Makefile.am
rename to js/src/ctypes/libffi/Makefile.am
rename from js/ctypes/libffi/Makefile.in
rename to js/src/ctypes/libffi/Makefile.in
rename from js/ctypes/libffi/README
rename to js/src/ctypes/libffi/README
rename from js/ctypes/libffi/acinclude.m4
rename to js/src/ctypes/libffi/acinclude.m4
rename from js/ctypes/libffi/aclocal.m4
rename to js/src/ctypes/libffi/aclocal.m4
rename from js/ctypes/libffi/compile
rename to js/src/ctypes/libffi/compile
rename from js/ctypes/libffi/config.guess
rename to js/src/ctypes/libffi/config.guess
rename from js/ctypes/libffi/config.sub
rename to js/src/ctypes/libffi/config.sub
rename from js/ctypes/libffi/configure
rename to js/src/ctypes/libffi/configure
rename from js/ctypes/libffi/configure.ac
rename to js/src/ctypes/libffi/configure.ac
rename from js/ctypes/libffi/configure.host
rename to js/src/ctypes/libffi/configure.host
rename from js/ctypes/libffi/depcomp
rename to js/src/ctypes/libffi/depcomp
rename from js/ctypes/libffi/doc/libffi.info
rename to js/src/ctypes/libffi/doc/libffi.info
rename from js/ctypes/libffi/doc/libffi.texi
rename to js/src/ctypes/libffi/doc/libffi.texi
rename from js/ctypes/libffi/doc/stamp-vti
rename to js/src/ctypes/libffi/doc/stamp-vti
rename from js/ctypes/libffi/doc/version.texi
rename to js/src/ctypes/libffi/doc/version.texi
rename from js/ctypes/libffi/fficonfig.h.in
rename to js/src/ctypes/libffi/fficonfig.h.in
rename from js/ctypes/libffi/include/Makefile.am
rename to js/src/ctypes/libffi/include/Makefile.am
rename from js/ctypes/libffi/include/Makefile.in
rename to js/src/ctypes/libffi/include/Makefile.in
rename from js/ctypes/libffi/include/ffi.h.in
rename to js/src/ctypes/libffi/include/ffi.h.in
rename from js/ctypes/libffi/include/ffi_common.h
rename to js/src/ctypes/libffi/include/ffi_common.h
rename from js/ctypes/libffi/install-sh
rename to js/src/ctypes/libffi/install-sh
rename from js/ctypes/libffi/libffi.pc.in
rename to js/src/ctypes/libffi/libffi.pc.in
rename from js/ctypes/libffi/libtool-version
rename to js/src/ctypes/libffi/libtool-version
rename from js/ctypes/libffi/ltmain.sh
rename to js/src/ctypes/libffi/ltmain.sh
rename from js/ctypes/libffi/m4/libtool.m4
rename to js/src/ctypes/libffi/m4/libtool.m4
rename from js/ctypes/libffi/m4/ltoptions.m4
rename to js/src/ctypes/libffi/m4/ltoptions.m4
rename from js/ctypes/libffi/m4/ltsugar.m4
rename to js/src/ctypes/libffi/m4/ltsugar.m4
rename from js/ctypes/libffi/m4/ltversion.m4
rename to js/src/ctypes/libffi/m4/ltversion.m4
rename from js/ctypes/libffi/m4/lt~obsolete.m4
rename to js/src/ctypes/libffi/m4/lt~obsolete.m4
rename from js/ctypes/libffi/man/Makefile.am
rename to js/src/ctypes/libffi/man/Makefile.am
rename from js/ctypes/libffi/man/Makefile.in
rename to js/src/ctypes/libffi/man/Makefile.in
rename from js/ctypes/libffi/man/ffi.3
rename to js/src/ctypes/libffi/man/ffi.3
rename from js/ctypes/libffi/man/ffi_call.3
rename to js/src/ctypes/libffi/man/ffi_call.3
rename from js/ctypes/libffi/man/ffi_prep_cif.3
rename to js/src/ctypes/libffi/man/ffi_prep_cif.3
rename from js/ctypes/libffi/mdate-sh
rename to js/src/ctypes/libffi/mdate-sh
rename from js/ctypes/libffi/missing
rename to js/src/ctypes/libffi/missing
rename from js/ctypes/libffi/msvcc.sh
rename to js/src/ctypes/libffi/msvcc.sh
rename from js/ctypes/libffi/src/alpha/ffi.c
rename to js/src/ctypes/libffi/src/alpha/ffi.c
rename from js/ctypes/libffi/src/alpha/ffitarget.h
rename to js/src/ctypes/libffi/src/alpha/ffitarget.h
rename from js/ctypes/libffi/src/alpha/osf.S
rename to js/src/ctypes/libffi/src/alpha/osf.S
rename from js/ctypes/libffi/src/arm/ffi.c
rename to js/src/ctypes/libffi/src/arm/ffi.c
rename from js/ctypes/libffi/src/arm/ffitarget.h
rename to js/src/ctypes/libffi/src/arm/ffitarget.h
rename from js/ctypes/libffi/src/arm/sysv.S
rename to js/src/ctypes/libffi/src/arm/sysv.S
rename from js/ctypes/libffi/src/avr32/ffi.c
rename to js/src/ctypes/libffi/src/avr32/ffi.c
rename from js/ctypes/libffi/src/avr32/ffitarget.h
rename to js/src/ctypes/libffi/src/avr32/ffitarget.h
rename from js/ctypes/libffi/src/avr32/sysv.S
rename to js/src/ctypes/libffi/src/avr32/sysv.S
rename from js/ctypes/libffi/src/closures.c
rename to js/src/ctypes/libffi/src/closures.c
rename from js/ctypes/libffi/src/cris/ffi.c
rename to js/src/ctypes/libffi/src/cris/ffi.c
rename from js/ctypes/libffi/src/cris/ffitarget.h
rename to js/src/ctypes/libffi/src/cris/ffitarget.h
rename from js/ctypes/libffi/src/cris/sysv.S
rename to js/src/ctypes/libffi/src/cris/sysv.S
rename from js/ctypes/libffi/src/debug.c
rename to js/src/ctypes/libffi/src/debug.c
rename from js/ctypes/libffi/src/dlmalloc.c
rename to js/src/ctypes/libffi/src/dlmalloc.c
rename from js/ctypes/libffi/src/frv/eabi.S
rename to js/src/ctypes/libffi/src/frv/eabi.S
rename from js/ctypes/libffi/src/frv/ffi.c
rename to js/src/ctypes/libffi/src/frv/ffi.c
rename from js/ctypes/libffi/src/frv/ffitarget.h
rename to js/src/ctypes/libffi/src/frv/ffitarget.h
rename from js/ctypes/libffi/src/ia64/ffi.c
rename to js/src/ctypes/libffi/src/ia64/ffi.c
rename from js/ctypes/libffi/src/ia64/ffitarget.h
rename to js/src/ctypes/libffi/src/ia64/ffitarget.h
rename from js/ctypes/libffi/src/ia64/ia64_flags.h
rename to js/src/ctypes/libffi/src/ia64/ia64_flags.h
rename from js/ctypes/libffi/src/ia64/unix.S
rename to js/src/ctypes/libffi/src/ia64/unix.S
rename from js/ctypes/libffi/src/java_raw_api.c
rename to js/src/ctypes/libffi/src/java_raw_api.c
rename from js/ctypes/libffi/src/m32r/ffi.c
rename to js/src/ctypes/libffi/src/m32r/ffi.c
rename from js/ctypes/libffi/src/m32r/ffitarget.h
rename to js/src/ctypes/libffi/src/m32r/ffitarget.h
rename from js/ctypes/libffi/src/m32r/sysv.S
rename to js/src/ctypes/libffi/src/m32r/sysv.S
rename from js/ctypes/libffi/src/m68k/ffi.c
rename to js/src/ctypes/libffi/src/m68k/ffi.c
rename from js/ctypes/libffi/src/m68k/ffitarget.h
rename to js/src/ctypes/libffi/src/m68k/ffitarget.h
rename from js/ctypes/libffi/src/m68k/sysv.S
rename to js/src/ctypes/libffi/src/m68k/sysv.S
rename from js/ctypes/libffi/src/mips/ffi.c
rename to js/src/ctypes/libffi/src/mips/ffi.c
rename from js/ctypes/libffi/src/mips/ffitarget.h
rename to js/src/ctypes/libffi/src/mips/ffitarget.h
rename from js/ctypes/libffi/src/mips/n32.S
rename to js/src/ctypes/libffi/src/mips/n32.S
rename from js/ctypes/libffi/src/mips/o32.S
rename to js/src/ctypes/libffi/src/mips/o32.S
rename from js/ctypes/libffi/src/moxie/eabi.S
rename to js/src/ctypes/libffi/src/moxie/eabi.S
rename from js/ctypes/libffi/src/moxie/ffi.c
rename to js/src/ctypes/libffi/src/moxie/ffi.c
rename from js/ctypes/libffi/src/moxie/ffitarget.h
rename to js/src/ctypes/libffi/src/moxie/ffitarget.h
rename from js/ctypes/libffi/src/pa/ffi.c
rename to js/src/ctypes/libffi/src/pa/ffi.c
rename from js/ctypes/libffi/src/pa/ffitarget.h
rename to js/src/ctypes/libffi/src/pa/ffitarget.h
rename from js/ctypes/libffi/src/pa/hpux32.S
rename to js/src/ctypes/libffi/src/pa/hpux32.S
rename from js/ctypes/libffi/src/pa/linux.S
rename to js/src/ctypes/libffi/src/pa/linux.S
rename from js/ctypes/libffi/src/powerpc/aix.S
rename to js/src/ctypes/libffi/src/powerpc/aix.S
rename from js/ctypes/libffi/src/powerpc/aix_closure.S
rename to js/src/ctypes/libffi/src/powerpc/aix_closure.S
rename from js/ctypes/libffi/src/powerpc/asm.h
rename to js/src/ctypes/libffi/src/powerpc/asm.h
rename from js/ctypes/libffi/src/powerpc/darwin.S
rename to js/src/ctypes/libffi/src/powerpc/darwin.S
rename from js/ctypes/libffi/src/powerpc/darwin_closure.S
rename to js/src/ctypes/libffi/src/powerpc/darwin_closure.S
rename from js/ctypes/libffi/src/powerpc/ffi.c
rename to js/src/ctypes/libffi/src/powerpc/ffi.c
rename from js/ctypes/libffi/src/powerpc/ffi_darwin.c
rename to js/src/ctypes/libffi/src/powerpc/ffi_darwin.c
rename from js/ctypes/libffi/src/powerpc/ffitarget.h
rename to js/src/ctypes/libffi/src/powerpc/ffitarget.h
rename from js/ctypes/libffi/src/powerpc/linux64.S
rename to js/src/ctypes/libffi/src/powerpc/linux64.S
rename from js/ctypes/libffi/src/powerpc/linux64_closure.S
rename to js/src/ctypes/libffi/src/powerpc/linux64_closure.S
rename from js/ctypes/libffi/src/powerpc/ppc_closure.S
rename to js/src/ctypes/libffi/src/powerpc/ppc_closure.S
rename from js/ctypes/libffi/src/powerpc/sysv.S
rename to js/src/ctypes/libffi/src/powerpc/sysv.S
rename from js/ctypes/libffi/src/prep_cif.c
rename to js/src/ctypes/libffi/src/prep_cif.c
rename from js/ctypes/libffi/src/raw_api.c
rename to js/src/ctypes/libffi/src/raw_api.c
rename from js/ctypes/libffi/src/s390/ffi.c
rename to js/src/ctypes/libffi/src/s390/ffi.c
rename from js/ctypes/libffi/src/s390/ffitarget.h
rename to js/src/ctypes/libffi/src/s390/ffitarget.h
rename from js/ctypes/libffi/src/s390/sysv.S
rename to js/src/ctypes/libffi/src/s390/sysv.S
rename from js/ctypes/libffi/src/sh/ffi.c
rename to js/src/ctypes/libffi/src/sh/ffi.c
rename from js/ctypes/libffi/src/sh/ffitarget.h
rename to js/src/ctypes/libffi/src/sh/ffitarget.h
rename from js/ctypes/libffi/src/sh/sysv.S
rename to js/src/ctypes/libffi/src/sh/sysv.S
rename from js/ctypes/libffi/src/sh64/ffi.c
rename to js/src/ctypes/libffi/src/sh64/ffi.c
rename from js/ctypes/libffi/src/sh64/ffitarget.h
rename to js/src/ctypes/libffi/src/sh64/ffitarget.h
rename from js/ctypes/libffi/src/sh64/sysv.S
rename to js/src/ctypes/libffi/src/sh64/sysv.S
rename from js/ctypes/libffi/src/sparc/ffi.c
rename to js/src/ctypes/libffi/src/sparc/ffi.c
rename from js/ctypes/libffi/src/sparc/ffitarget.h
rename to js/src/ctypes/libffi/src/sparc/ffitarget.h
rename from js/ctypes/libffi/src/sparc/v8.S
rename to js/src/ctypes/libffi/src/sparc/v8.S
rename from js/ctypes/libffi/src/sparc/v9.S
rename to js/src/ctypes/libffi/src/sparc/v9.S
rename from js/ctypes/libffi/src/types.c
rename to js/src/ctypes/libffi/src/types.c
rename from js/ctypes/libffi/src/x86/darwin.S
rename to js/src/ctypes/libffi/src/x86/darwin.S
rename from js/ctypes/libffi/src/x86/darwin64.S
rename to js/src/ctypes/libffi/src/x86/darwin64.S
rename from js/ctypes/libffi/src/x86/ffi.c
rename to js/src/ctypes/libffi/src/x86/ffi.c
rename from js/ctypes/libffi/src/x86/ffi64.c
rename to js/src/ctypes/libffi/src/x86/ffi64.c
rename from js/ctypes/libffi/src/x86/ffitarget.h
rename to js/src/ctypes/libffi/src/x86/ffitarget.h
rename from js/ctypes/libffi/src/x86/freebsd.S
rename to js/src/ctypes/libffi/src/x86/freebsd.S
rename from js/ctypes/libffi/src/x86/sysv.S
rename to js/src/ctypes/libffi/src/x86/sysv.S
rename from js/ctypes/libffi/src/x86/unix64.S
rename to js/src/ctypes/libffi/src/x86/unix64.S
rename from js/ctypes/libffi/src/x86/win32.S
rename to js/src/ctypes/libffi/src/x86/win32.S
rename from js/ctypes/libffi/src/x86/win64.S
rename to js/src/ctypes/libffi/src/x86/win64.S
rename from js/ctypes/libffi/testsuite/Makefile.am
rename to js/src/ctypes/libffi/testsuite/Makefile.am
rename from js/ctypes/libffi/testsuite/Makefile.in
rename to js/src/ctypes/libffi/testsuite/Makefile.in
rename from js/ctypes/libffi/testsuite/config/default.exp
rename to js/src/ctypes/libffi/testsuite/config/default.exp
rename from js/ctypes/libffi/testsuite/lib/libffi-dg.exp
rename to js/src/ctypes/libffi/testsuite/lib/libffi-dg.exp
rename from js/ctypes/libffi/testsuite/lib/target-libpath.exp
rename to js/src/ctypes/libffi/testsuite/lib/target-libpath.exp
rename from js/ctypes/libffi/testsuite/lib/wrapper.exp
rename to js/src/ctypes/libffi/testsuite/lib/wrapper.exp
rename from js/ctypes/libffi/testsuite/libffi.call/call.exp
rename to js/src/ctypes/libffi/testsuite/libffi.call/call.exp
rename from js/ctypes/libffi/testsuite/libffi.call/closure_fn0.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/closure_fn0.c
rename from js/ctypes/libffi/testsuite/libffi.call/closure_fn1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/closure_fn1.c
rename from js/ctypes/libffi/testsuite/libffi.call/closure_fn2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/closure_fn2.c
rename from js/ctypes/libffi/testsuite/libffi.call/closure_fn3.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/closure_fn3.c
rename from js/ctypes/libffi/testsuite/libffi.call/closure_fn4.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/closure_fn4.c
rename from js/ctypes/libffi/testsuite/libffi.call/closure_fn5.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/closure_fn5.c
rename from js/ctypes/libffi/testsuite/libffi.call/closure_fn6.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/closure_fn6.c
rename from js/ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c
rename from js/ctypes/libffi/testsuite/libffi.call/closure_stdcall.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/closure_stdcall.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_12byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_12byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_16byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_16byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_18byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_18byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_19byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_19byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_20byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_20byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_20byte1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_20byte1.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_24byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_24byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_2byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_2byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_3byte1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_3byte1.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_3byte2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_3byte2.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_4byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_4byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_5byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_5byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_64byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_64byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_6byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_6byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_7byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_7byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_8byte.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_8byte.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_9byte1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_9byte1.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_9byte2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_9byte2.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_double.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_double.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_float.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_float.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_double.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_double.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_double_va.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_double_va.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_float.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_float.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_pointer.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_pointer.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_schar.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_schar.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_sint.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_sint.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_sshort.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_sshort.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_uchar.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_uchar.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_uint.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_uint.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c
rename from js/ctypes/libffi/testsuite/libffi.call/cls_ushort.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/cls_ushort.c
rename from js/ctypes/libffi/testsuite/libffi.call/err_bad_abi.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/err_bad_abi.c
rename from js/ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c
rename from js/ctypes/libffi/testsuite/libffi.call/ffitest.h
rename to js/src/ctypes/libffi/testsuite/libffi.call/ffitest.h
rename from js/ctypes/libffi/testsuite/libffi.call/float.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/float.c
rename from js/ctypes/libffi/testsuite/libffi.call/float1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/float1.c
rename from js/ctypes/libffi/testsuite/libffi.call/float2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/float2.c
rename from js/ctypes/libffi/testsuite/libffi.call/float3.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/float3.c
rename from js/ctypes/libffi/testsuite/libffi.call/float4.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/float4.c
rename from js/ctypes/libffi/testsuite/libffi.call/huge_struct.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/huge_struct.c
rename from js/ctypes/libffi/testsuite/libffi.call/many.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/many.c
rename from js/ctypes/libffi/testsuite/libffi.call/many_win32.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/many_win32.c
rename from js/ctypes/libffi/testsuite/libffi.call/negint.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/negint.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct1.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct10.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct10.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct2.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct3.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct3.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct4.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct4.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct5.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct5.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct6.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct6.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct7.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct7.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct8.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct8.c
rename from js/ctypes/libffi/testsuite/libffi.call/nested_struct9.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/nested_struct9.c
rename from js/ctypes/libffi/testsuite/libffi.call/problem1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/problem1.c
rename from js/ctypes/libffi/testsuite/libffi.call/promotion.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/promotion.c
rename from js/ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_dbl.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_dbl.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_dbl1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_dbl1.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_dbl2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_dbl2.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_fl.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_fl.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_fl1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_fl1.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_fl2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_fl2.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_fl3.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_fl3.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_ldl.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_ldl.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_ll.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_ll.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_ll1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_ll1.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_sc.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_sc.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_sl.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_sl.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_uc.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_uc.c
rename from js/ctypes/libffi/testsuite/libffi.call/return_ul.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/return_ul.c
rename from js/ctypes/libffi/testsuite/libffi.call/stret_large.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/stret_large.c
rename from js/ctypes/libffi/testsuite/libffi.call/stret_large2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/stret_large2.c
rename from js/ctypes/libffi/testsuite/libffi.call/stret_medium.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/stret_medium.c
rename from js/ctypes/libffi/testsuite/libffi.call/stret_medium2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/stret_medium2.c
rename from js/ctypes/libffi/testsuite/libffi.call/strlen.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/strlen.c
rename from js/ctypes/libffi/testsuite/libffi.call/strlen_win32.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/strlen_win32.c
rename from js/ctypes/libffi/testsuite/libffi.call/struct1.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/struct1.c
rename from js/ctypes/libffi/testsuite/libffi.call/struct2.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/struct2.c
rename from js/ctypes/libffi/testsuite/libffi.call/struct3.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/struct3.c
rename from js/ctypes/libffi/testsuite/libffi.call/struct4.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/struct4.c
rename from js/ctypes/libffi/testsuite/libffi.call/struct5.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/struct5.c
rename from js/ctypes/libffi/testsuite/libffi.call/struct6.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/struct6.c
rename from js/ctypes/libffi/testsuite/libffi.call/struct7.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/struct7.c
rename from js/ctypes/libffi/testsuite/libffi.call/struct8.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/struct8.c
rename from js/ctypes/libffi/testsuite/libffi.call/struct9.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/struct9.c
rename from js/ctypes/libffi/testsuite/libffi.call/testclosure.c
rename to js/src/ctypes/libffi/testsuite/libffi.call/testclosure.c
rename from js/ctypes/libffi/testsuite/libffi.special/ffitestcxx.h
rename to js/src/ctypes/libffi/testsuite/libffi.special/ffitestcxx.h
rename from js/ctypes/libffi/testsuite/libffi.special/special.exp
rename to js/src/ctypes/libffi/testsuite/libffi.special/special.exp
rename from js/ctypes/libffi/testsuite/libffi.special/unwindtest.cc
rename to js/src/ctypes/libffi/testsuite/libffi.special/unwindtest.cc
rename from js/ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc
rename to js/src/ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc
rename from js/ctypes/libffi/texinfo.tex
rename to js/src/ctypes/libffi/texinfo.tex
rename from js/ctypes/typedefs.h
rename to js/src/ctypes/typedefs.h
--- a/js/src/js-config.h.in
+++ b/js/src/js-config.h.in
@@ -43,16 +43,19 @@
 
 /* Definitions set at build time that affect SpiderMonkey's public API.
    This header file is generated by the SpiderMonkey configure script,
    and installed along with jsapi.h.  */
 
 /* Define to 1 if SpiderMonkey should support multi-threaded clients.  */
 #undef JS_THREADSAFE
 
+/* Define to 1 if SpiderMonkey should include ctypes support.  */
+#undef JS_HAS_CTYPES
+
 /* Define to 1 if SpiderMonkey should support the ability to perform
    entirely too much GC.  */
 #undef JS_GC_ZEAL
 
 /* Define to 1 if the standard <stdint.h> header is present and
    useable.  See jstypes.h and jsstdint.h.  */
 #undef JS_HAVE_STDINT_H
 
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -207,20 +207,16 @@ MAKEFILES_xpconnect="
   js/src/xpconnect/tools/idl/Makefile
 "
 
 MAKEFILES_jsdebugger="
   js/jsd/Makefile
   js/jsd/idl/Makefile
 "
 
-MAKEFILES_jsctypes="
-  js/ctypes/Makefile
-"
-
 MAKEFILES_content="
   content/Makefile
   content/base/Makefile
   content/base/public/Makefile
   content/base/src/Makefile
   content/base/test/Makefile
   content/base/test/chrome/Makefile
   content/canvas/Makefile
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -106,26 +106,19 @@ endif
 #
 
 ifdef MOZ_IPC
 tier_platform_dirs += ipc
 endif
 
 tier_platform_dirs += \
 		js/src/xpconnect \
-		js/ctypes \
 		intl/chardet \
 		$(NULL)
 
-ifdef BUILD_CTYPES
-tier_platform_staticdirs += \
-		js/ctypes/libffi \
-		$(NULL)
-endif
-
 ifdef MOZ_ENABLE_GTK2
 ifdef MOZ_X11
 tier_platform_dirs     += widget/src/gtkxtbin
 endif
 endif
 
 tier_platform_dirs	+= \
 		modules/libjar \