Skip to content

Instantly share code, notes, and snippets.

@udonchan
Created April 13, 2010 05:36
Show Gist options
  • Save udonchan/364344 to your computer and use it in GitHub Desktop.
Save udonchan/364344 to your computer and use it in GitHub Desktop.
firefox ビルド用 .mozconfig
CPU=`sysctl -a hw 2>&1 | grep 'hw.availcpu' | sed 's|hw.availcpu = *||'`
let J=$CPU*4
CFLAGS="-O3 -finline-limit=8000 -fstack-protector -param=ssp-buffer-size=4 -mieee-fp -funroll-loops -fpeel-loops -march=core2 -fno-trapping-math -fno-tree-pre -ftree-vectorize -ftracer -fsee"
CXXFLAGS="${CFLAGS}"
# As used here, arguments in $MOZ_BUILD_PROJECTS are suitable as arguments
# to gcc's -arch parameter.
mk_add_options MOZ_BUILD_PROJECTS="x86_64 i386"
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 x86_64 --target=x86_64-apple-darwin$DARWIN_VERSION
ac_add_app_options i386 --target=i386-apple-darwin$DARWIN_VERSION
# $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
GCC_VERSION=4.2
# 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="gcc-$GCC_VERSION -arch $TARGET_CPU"
CXX="g++-$GCC_VERSION -arch $TARGET_CPU"
# $HOST_CXX is presently unused. $HOST_CC will only be used during a cross
# compile. Always use the 4.2 compiler, since it will always be present and
# will always work.
HOST_CC=gcc-4.2
HOST_CXX=g++-4.2
# These must be set for cross builds, and don't hurt straight builds.
RANLIB=ranlib
AR=ar
AS=$CC
LD=ld
STRIP="strip -x -S"
NATIVE_CPU=`uname -m`
if test "$NATIVE_CPU" = "x86_64" ; then
NATIVE_CPU=x86_64
fi
# Let configure know that we mean business.
if test "$NATIVE_CPU" != "$TARGET_CPU" ; then
CROSS_COMPILE=1
fi
# 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
fi
fi
# Options for client.mk.
mk_add_options MOZ_MAKE_FLAGS=-j${J}
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
mk_add_options AUTOCONF=autoconf213
mk_add_options BUILD_OPT=1
# Options for 'configure' (same as command-line options).
ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk
ac_add_options --enable-macos-target=10.6
ac_add_options --enable-application=browser
ac_add_options --enable-update-packaging
#ac_add_options --enable-update-channel=nightly
ac_add_options --enable-optimize
ac_add_options --enable-strip
ac_add_options --disable-debug
ac_add_options --disable-tests
ac_add_options --disable-crashreporter
# 本当は書いてはいけない
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export MOZ_OFFICIAL_BRANDING=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options MOZ_OFFICIAL_BRANDING=1
ac_add_options --enable-official-branding
ac_add_options --with-branding=other-licenses/branding/firefox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment