Bug 486684 - Port bug 474737 and 477727 to comm-central (fix usage of WinCE SDK). r=KaiRo
authorFlorian Quèze <florian@instantbird.org>
Sat, 25 Apr 2009 16:07:11 +0200
changeset 2486 297939d9a26b7153cf3d7eba21890d2faaf7806b
parent 2485 fa4172dcb406499e730bc87942e8b0ddb115f980
child 2487 29b6f9d77ce7ac183308982bf44558d3f25a298c
push idunknown
push userunknown
push dateunknown
reviewersKaiRo
bugs486684, 474737, 477727
Bug 486684 - Port bug 474737 and 477727 to comm-central (fix usage of WinCE SDK). r=KaiRo
config/autoconf.mk.in
configure.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -573,17 +573,18 @@ endif
 MOZ_MAPINFO	= @MOZ_MAPINFO@
 
 MOZ_THUNDERBIRD = @MOZ_THUNDERBIRD@
 MOZ_STATIC_MAIL_BUILD = @MOZ_STATIC_MAIL_BUILD@
 MOZ_INCOMPLETE_EXTERNAL_LINKAGE = @MOZ_INCOMPLETE_EXTERNAL_LINKAGE@
 MOZ_SUNBIRD	= @MOZ_SUNBIRD@
 MOZ_SUITE	= @MOZ_SUITE@
 WINCE		= @WINCE@
-WINCE_SDK      = @WINCE_SDK@
+WINCE_SDK_DIR   = @WINCE_SDK_DIR@
+WINCE_WINDOWS_MOBILE = @WINCE_WINDOWS_MOBILE@
 
 MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_ID@
 
 MACOS_SDK_DIR	= @MACOS_SDK_DIR@
 NEXT_ROOT	= @NEXT_ROOT@
 GCC_VERSION	= @GCC_VERSION@
 XCODEBUILD_VERSION= @XCODEBUILD_VERSION@
 HAS_XCODE_2_1	= @HAS_XCODE_2_1@
--- a/configure.in
+++ b/configure.in
@@ -238,39 +238,58 @@ dnl ====================================
 
 if test "$COMPILE_ENVIRONMENT"; then
 
 dnl Do some special WinCE toolchain stuff
 case "$target" in
 *wince)
 
     MOZ_ARG_WITH_STRING(wince-sdk,
-    [  --with-wince-sdk=WINCE_SDK
-                        The path to the windows mobile sdk],
-    WINCE_SDK=$withval)
+    [  --with-wince-sdk=WINCE_SDK_DIR
+                        The path to the Windows CE SDK],
+    WINCE_SDK_DIR=$withval)
+
+    dnl Default to Windows Mobile components enabled
+    WINCE_WINDOWS_MOBILE=1
+
+    MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
+    [  --disable-windows-mobile-components
+         Disable Windows Mobile specific components from CE build],
+    WINCE_WINDOWS_MOBILE=,
+    WINCE_WINDOWS_MOBILE=1)
+
+    if test "$WINCE_WINDOWS_MOBILE"; then
+        AC_DEFINE(WINCE_WINDOWS_MOBILE)
+    fi
+
+    AC_SUBST(WINCE_WINDOWS_MOBILE)
 
     export WINCE=1
-    mk_add_options WINCE=1
 
     echo -----------------------------------------------------------------------------
     echo Building Windows CE Shunt Library and Tool Chain
     echo Using SDK in:
-    echo $WINCE_SDK
+    echo $WINCE_SDK_DIR
 
     ac_exeext=.exe
 
-
-    rm -f $srcdir/build/wince/shunt/include/windows.h
-
-    echo -n "#define TOPSRCDIR \"" > $srcdir/build/wince/tools/topsrcdir.h
-    echo `cd "$_topsrcdir" && pwd -W | tr '\n' '\"'` >> $srcdir/build/wince/tools/topsrcdir.h
-    make -C $srcdir/build/wince/tools
-
-    echo "#include \"$WINCE_SDK/windows.h\"" > $srcdir/build/wince/shunt/include/windows.h
-    echo "#define GetProcAddress GetProcAddressA" >> $srcdir/build/wince/shunt/include/windows.h
+    _pwdw=`pwd -W`
+    _pwd=`pwd`
+    make WINCE_SDK_DIR="$WINCE_SDK_DIR" TOPSRCDIR="$srcdir/mozilla" OBJDIR="$_pwdw/mozilla" -C $srcdir/mozilla/build/wince/tools
+
+    CC="$_pwd/mozilla/dist/sdk/bin/arm-wince-gcc"
+    CXX="$_pwd/mozilla/dist/sdk/bin/arm-wince-gcc"
+    CPP="$_pwd/mozilla/dist/sdk/bin/arm-wince-gcc -E -nologo"
+    CXXCPP="$_pwd/mozilla/dist/sdk/bin/arm-wince-gcc -TP -E -nologo"
+    LD="$_pwd/mozilla/dist/sdk/bin/arm-wince-link"
+    AR="$_pwd/mozilla/dist/sdk/bin/arm-wince-lib"
+    AS="$_pwd/mozilla/dist/sdk/bin/arm-wince-as"
+    RC="$_pwd/mozilla/dist/sdk/bin/arm-wince-res"
+
+
     echo -----------------------------------------------------------------------------
 
     ;;
 esac
 
 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
     echo "cross compiling from $host to $target"
     cross_compiling=yes
@@ -1989,16 +2008,22 @@ case "$target" in
     AC_DEFINE(WIN32_LEAN_AND_MEAN)
 
     TARGET_MD_ARCH=win32
     _PLATFORM_DEFAULT_TOOLKIT='windows'
     BIN_SUFFIX='.exe'
     USE_SHORT_LIBNAME=1
     MOZ_ENABLE_POSTSCRIPT=
     MOZ_USER_DIR="Mozilla"
+
+    # Sanity check for WINCE_WINDOWS_MOBILE
+    if test "$WINCE_WINDOWS_MOBILE"; then
+       AC_CHECK_HEADER(tpcshell.h, [],
+            AC_MSG_ERROR([Can't find tpcshell.h in your SDK; are you sure you don't need --disable-windos-mobile-components?]))
+    fi
 ;;
 
 
 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
     DSO_CFLAGS=
     DSO_PIC_CFLAGS=
     DLL_SUFFIX=.dll
     RC=rc.exe
@@ -7160,17 +7185,17 @@ AC_SUBST(USE_DEPENDENT_LIBS)
 AC_SUBST(MOZ_BUILD_ROOT)
 AC_SUBST(MOZ_OS2_TOOLS)
 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
 
 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
 AC_SUBST(MOZ_TIMELINE)
 AC_SUBST(WINCE)
-AC_SUBST(WINCE_SDK)
+AC_SUBST(WINCE_SDK_DIR)
 AC_SUBST(TARGET_DEVICE)
 
 AC_SUBST(MOZ_APP_NAME)
 AC_SUBST(MOZ_APP_DISPLAYNAME)
 AC_SUBST(MOZ_APP_VERSION)
 AC_SUBST(FIREFOX_VERSION)
 AC_SUBST(THUNDERBIRD_VERSION)
 AC_SUBST(SUNBIRD_VERSION)