1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/firefox/mozilla-conf.in
3 # Copyright (C) 2004 - 2024 The T2 SDE Project
4 # Copyright (C) 1998 - 2004 ROCK Linux Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
20 # default prefix for mozilla derivatives
21 mozilla_prefix=opt/mozilla
24 var_remove_regex makeopt ' ' 'AS=.*'
25 atstage cross && export DESTDIR=$root
27 # set default homepage and distribution
29 local distro="T2 $sdever"
30 local startpage=https://t2sde.org/startpage/
33 if [ -f xpfe/global/build.dtd.in ]; then
34 sed -i "s,0000000000,$distro," xpfe/global/build.dtd.in
38 find -name region.properties -o -name browserconfig.properties | while read f; do
39 sed -i -e "s,startup.homepage_override_url=.*,startup.homepage_override_url=$startpage," \
40 -e "s,homePageDefault=.*,homePageDefault=$startpage," \
41 -e "s,browser.startup.homepage=.*,browser.startup.homepage=$startpage," \
46 hook_add preconf 2 "mozilla_branding"
48 # default configuration for mozilla's derivatives
50 cat > .mozconfig <<-EOF
51 # Options for client.mk.
52 mk_add_options MOZ_MAKE_FLAGS=-j${SDECFG_PARALLEL:-1}
54 # Options for 'configure' (same as command-line options).
57 if atstage cross; then
58 cat <<-EOF >> .mozconfig
60 TOOLCHAIN_PREFIX=$archprefix
61 ac_add_options --target=$arch_target
62 ac_add_options --host=$arch_build
63 ac_add_options --with-clang-path=$root/TOOLCHAIN/cross/wrapper/$arch_target-clang
65 else cat <<-EOF >> .mozconfig
66 ac_add_options --host=$arch_target # needed?
70 cat <<-EOF >> .mozconfig
71 ac_add_options --prefix=/$prefix
72 ac_add_options --libdir=$libdir
73 #ac_add_options --sysconfdir=/etc/$pkg
74 #ac_add_options --localstatedir=/var
75 #ac_add_options --enable-default-mozilla-five-home
76 #ac_add_options --with-default-mozilla-five-home=$libdir/$pkg-$ver
77 #ac_add_options --disable-dtd-debug
78 #ac_add_options --disable-logging # broken/obsolete since firefox ~42
79 #ac_add_options --disable-pedantic
80 #ac_add_options --enable-xft
81 #ac_add_options --enable-default-toolkit=cairo-gtk2
82 ac_add_options --with-system-zlib
83 #ac_add_options --with-system-mng
84 #ac_add_options --enable-system-cairo
85 #ac_add_options --enable-crypto
86 ac_add_options --disable-jemalloc
89 [ "$SDECFG_DEBUG" = 1 ] &&
90 echo "ac_add_options --enable-debug-symbols --enable-debug" >> .mozconfig ||
91 echo "ac_add_options --enable-strip --enable-optimize" >> .mozconfig
93 [ "$SDECFG_LTO" = 1 ] && case "$arch" in
95 echo "ac_add_options --enable-lto" >> .mozconfig ;;
101 echo "Run the component registration ..."
102 export MOZILLA_FIVE_HOME=$libdir/$pkg-$moz_ver
103 pushd $MOZILLA_FIVE_HOME
104 [ -e ./regxpcom ] && LD_LIBRARY_PATH=. ./regxpcom
105 [ -e ./regchrome ] && LD_LIBRARY_PATH=. ./regchrome
110 moz_ver="`sed -n 's/MOZ_APP_VERSION *= *//p' config/autoconf.mk || true`"
111 moz_ver=${moz_ver:-$ver}
113 # dynamically inject the actual $libdir we are building with
114 sed -i "/lib32\"/d" security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
115 if [[ "$libdir" = *lib ]]; then
116 sed -i "/lib64\"/d" security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
118 sed -i "s/lib64\"/${libdir##*/}\"/" security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
122 var_append makeopt " " "-f client.mk build"
124 # generic configuration
125 hook_add prepatch 1 'mozilla_configure'
126 hook_add premake 5 'mozilla_ver'
127 hook_add postmake 5 'mozilla_register'
132 # atomics crash on i486
133 GCC_WRAPPER_INSERT="${GCC_WRAPPER_INSERT/i486/i586}"
134 # float_t should be 32-bit, ..!? :-/
135 var_append GCC_WRAPPER_INSERT ' ' '-D__FLT_EVAL_METHOD__=0'
138 var_append GCC_WRAPPER_APPEND ' ' '-DLIBYUV_DISABLE_NEON=1'
142 var_remove GCC_WRAPPER_REMOVE " " "-march*"
146 var_append GCC_WRAPPER_APPEND " " "`pkg-config glib-2.0 --cflags`"
147 var_append GCC_WRAPPER_APPEND ' ' "`pkg-config x11 --cflags --libs-only-L`"
149 # cleanups in this fat directory are a bit expensive
153 # distribute this file only with seamonkey
154 if [ "$pkg" != "seamonkey" ]; then
155 var_append flist''del '|' ".*/aclocal/nspr\.m4"