(SOLVED) Cannot Build SeaMonkey 2.35 Universal Binary on Mac

Discussion of third-party/unofficial Firefox/Thunderbird/SeaMonkey builds.
Post Reply
barbaz
Posts: 1504
Joined: October 1st, 2014, 3:25 pm

(SOLVED) Cannot Build SeaMonkey 2.35 Universal Binary on Mac

Post by barbaz »

SeaMonkey 2.35 can't be built as a Mac OS X Universal Binary anymore, but a mac64-only build works?
Mac OS X 10.7.5

"Bad" mozconfig (worked for the SeaMonkey '2.34pre' that I'm using at the moment):

Code: Select all

mk_add_options MOZ_OBJDIR=/srv/seamonkey/comm-release/objdir

# Big Hack that unsets CC / CXX so that mozconfig.common doesn't get
# mixed up with host/target CPUs when trying to work out how to do the
# universal build. When we redo the build system (bug 648979) this will
# go away.
if test -e "$topsrcdir/suite/config/version.txt"; then
  unset CC
  unset CXX
fi

. $topsrcdir/build/macosx/universal/mozconfig

ac_add_options --disable-eme
ac_add_options --enable-application=suite

# Include source stamp info
export MOZ_INCLUDE_SOURCE_INFO=1

export CFLAGS="-gdwarf-2"
export CXXFLAGS="-gdwarf-2"

# For NSS symbols
export MOZ_DEBUG_SYMBOLS=1
ac_add_options --enable-debug-symbols="-gdwarf-2"

# needed to build on my Mac
ac_add_options --without-ccache
ac_add_options --with-macos-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk

# Enable parallel compiling
mk_add_options MOZ_MAKE_FLAGS="-j4"


Working mozconfig:

Code: Select all

ac_add_options --disable-eme
ac_add_options --enable-application=suite

export MOZ_INCLUDE_SOURCE_INFO=1

mk_add_options MOZ_OBJDIR=/srv/seamonkey/comm-release/objdir
mk_add_options MOZ_MAKE_FLAGS="-j4"

ac_add_options --with-macos-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk


Failed build log: [deleted]


I would really like to get universal binary build working, because mac64-only builds are unable to make use of all my plugins (some are 32-bit only).

Any ideas?
barbaz
Posts: 1504
Joined: October 1st, 2014, 3:25 pm

Re: (SOLVED) Cannot Build SeaMonkey 2.35 Universal Binary on

Post by barbaz »

The problem is that my "bad" mozconfig sourced the mozconfigs used in (and tailored for) the official build machines - and it was pretty much coincidence that it had worked before. It is no longer possible to "just include" the mozconfig files used for the official builds and expect it to build.

This mozconfig got it built:

Code: Select all

# No DRM
ac_add_options --disable-eme

# Build SeaMonkey
ac_add_options --enable-application=suite
mk_add_options MOZ_OBJDIR=/srv/seamonkey/comm-release/objdir

# Include source stamp info
export MOZ_INCLUDE_SOURCE_INFO=1

# Multi-threaded build
mk_add_options MOZ_MAKE_FLAGS="-j4"


### Everything below this line is Mac specific build options. ###

# Big Hack that unsets CC / CXX so that configure doesn't get
# mixed up with host/target CPUs when trying to work out how to do the
# universal build. When we redo the build system (bug 648979) this will
# go away.
if test -e "$topsrcdir/suite/config/version.txt"; then
  unset CC
  unset CXX
fi

ac_add_options --with-macos-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk

# Configure the compiler
if [ -d "$topsrcdir/clang" ]; then
    # mozilla-central based build
    export CC=$topsrcdir/clang/bin/clang
    export CXX=$topsrcdir/clang/bin/clang++
    export LLVMCONFIG=$topsrcdir/clang/bin/llvm-config
elif [ -d "$topsrcdir/../clang" ]; then
    # comm-central based build
    export CC=$topsrcdir/../clang/bin/clang
    export CXX=$topsrcdir/../clang/bin/clang++
    export LLVMCONFIG=$topsrcdir/../clang/bin/llvm-config
fi

# If not set use the system default clang
if [ -z "$CC" ]; then
    export CC=clang
fi

# If not set use the system default clang++
if [ -z "$CXX" ]; then
    export CXX=clang++
fi
# end compiler configuration.

## i386/x86-64 universal binary ##

mk_add_options MOZ_BUILD_PROJECTS="i386 x86_64"
mk_add_options MOZ_UNIFY_BDATE=1
mk_add_options MOZ_POSTFLIGHT_ALL+=build/macosx/universal/flight.mk

DARWIN_VERSION=`uname -r`
ac_add_app_options i386 --target=i386-apple-darwin$DARWIN_VERSION
ac_add_app_options x86_64 --target=x86_64-apple-darwin$DARWIN_VERSION
ac_add_app_options i386 --with-unify-dist=../x86_64/dist
ac_add_app_options x86_64 --with-unify-dist=../i386/dist


# $MOZ_BUILD_APP is only defined when sourced by configure.  That's not a
# problem, because the variables it affects only need to be set for
# configure.
if test -n "$MOZ_BUILD_APP" ; then
if test "$MOZ_BUILD_APP" = "i386" -o "$MOZ_BUILD_APP" = "x86_64"; then
  TARGET_CPU=$MOZ_BUILD_APP

  # $HOST_CXX is presently unused.  $HOST_CC will only be used during a cross
  # compile.
  HOST_CC=$CC
  HOST_CXX=$CXX

  NATIVE_CPU=`$topsrcdir/build/autoconf/config.guess | cut -f1 -d-`

  # It's not strictly necessary to specify -arch during native builds, but it
  # makes the merged about:buildconfig easier to follow, and it reduces
  # conditionalized differences between builds.
  CC="$CC -arch $TARGET_CPU"
  CXX="$CXX -arch $TARGET_CPU"

  # These must be set for cross builds, and don't hurt straight builds.
  RANLIB=ranlib
  AR=ar
  AS=$CC
  LD=ld
  STRIP="strip"
  OTOOL="otool"

  # Each per-CPU build should be entirely oblivious to the fact that a
  # universal binary will be produced.  The exception is packager.mk, which
  # needs to know to look for universal bits when building the .dmg.
  UNIVERSAL_BINARY=1

  export CC CXX HOST_CC HOST_CXX RANLIB AR AS LD STRIP OTOOL
fi
fi


Thanks to ewong for the suggestion. :D
Post Reply