Bug 551724 - Disable ctypes on x86/msvc if MASM is unavailable. r=ted
authorDan Witte <dwitte@mozilla.com>
Mon, 15 Mar 2010 11:39:31 -0700
changeset 39469 540a1651c0594acffba1c5dc21295e79f886fa8b
parent 39468 a20ed5e85c3d3d65d6a57199c51d9d2d4bb475ea
child 39470 69cb1df1cb0f4a47fb7711b274c7b88872932580
push id12212
push userdwitte@mozilla.com
push dateMon, 15 Mar 2010 18:39:55 +0000
treeherdermozilla-central@540a1651c059 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs551724
milestone1.9.3a4pre
Bug 551724 - Disable ctypes on x86/msvc if MASM is unavailable. r=ted
configure.in
--- a/configure.in
+++ b/configure.in
@@ -4753,16 +4753,17 @@ MOZ_XTF=1
 MOZ_XUL=1
 MOZ_ZIPWRITER=1
 NS_PRINTING=1
 NECKO_WIFI=1
 NECKO_COOKIES=1
 NECKO_DISK_CACHE=1
 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
 NECKO_SMALL_BUFFERS=
+BUILD_CTYPES=1
 XPC_IDISPATCH_SUPPORT=
 
 
 case "$target_os" in
 darwin*|*wince*|*winmo*)
     ACCESSIBILITY=
     ;;
 *)
@@ -8115,22 +8116,33 @@ MOZ_ARG_DISABLE_BOOL(cookies,
     NECKO_COOKIES=,
     NECKO_COOKIES=1)
 AC_SUBST(NECKO_COOKIES)
 if test "$NECKO_COOKIES"; then
     AC_DEFINE(NECKO_COOKIES)
 fi
 
 dnl
-dnl Build jsctypes on the platforms we can.
+dnl Build jsctypes on the platforms we can, unless it's explicitly disabled.
 dnl
+MOZ_ARG_DISABLE_BOOL(ctypes,
+[  --disable-ctypes        Disable js-ctypes],
+    BUILD_CTYPES=,
+    BUILD_CTYPES=1)
 AC_SUBST(BUILD_CTYPES)
-if test "$OS_ARCH" != "WINCE" -o `echo $OS_TEST | grep -ic arm` != 1; then
-  BUILD_CTYPES=1
-  AC_DEFINE(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_"
 
 dnl Only build Mork if it's required
 AC_SUBST(MOZ_MORK)
 if test "$MOZ_MORK"; then