linux-openmoko-2.6.32: remove changes accidentally pushed in 26f948fd5998390a20f7570c...
[openembedded.git] / classes / mozilla.bbclass
blob2b2f770d58862d50fad29f9b043a8c07822de7b0
1 SECTION = "x11/utils"
2 DEPENDS += "gnu-config-native virtual/libintl libxt libxi \
3             zip-native gtk+ orbit2 libidl-native"
4 LICENSE = "MPL NPL"
5 SRC_URI += "file://mozconfig"
7 inherit gettext pkgconfig
9 # Parallel make is special in mozilla.
10 OLD_PARALLEL_MAKE := "${PARALLEL_MAKE}"
11 PARALLEL_MAKE = ""
13 EXTRA_OECONF = "--target=${TARGET_SYS} --host=${BUILD_SYS} \
14                 --build=${BUILD_SYS} --prefix=${prefix}"
15 SELECTED_OPTIMIZATION = "-Os -fsigned-char -fno-strict-aliasing"
17 export CROSS_COMPILE = "1"
18 export MOZCONFIG = "${WORKDIR}/mozconfig"
19 export MOZ_OBJDIR = "${S}"
21 export CONFIGURE_ARGS = "${EXTRA_OECONF}"
22 export HOST_CC = "${BUILD_CC}"
23 export HOST_CXX = "${BUILD_CXX}"
24 export HOST_CFLAGS = "${BUILD_CFLAGS}"
25 export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
26 export HOST_LDFLAGS = "${BUILD_LDFLAGS}"
27 export HOST_RANLIB = "${BUILD_RANLIB}"
28 export HOST_AR = "${BUILD_AR}"
30 mozilla_do_configure() {
31         (
32                 set -e
33                 for cg in `find ${S} -name config.guess`; do
34                         install -m 0755 \
35                         ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess \
36                         ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub \
37                         `dirname $cg`/
38                 done
39         )
41         # Put PARALLEL_MAKE into mozconfig
42         if [ ! -z "${OLD_PARALLEL_MAKE}" ] ; then
43                 echo mk_add_options MOZ_MAKE_FLAGS=\"${OLD_PARALLEL_MAKE}\" \
44                         >> ${MOZCONFIG}
45         fi
47         # Set the host libIDL stuff correctly.
48         export HOST_LIBIDL_CONFIG="PKG_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/pkgconfig pkg-config libIDL-2.0"
49         # Due to sysroot we need to sed out references to the target staging
50         # when building the native version of xpidl Symptons of the failure
51         # include "gthread.h:344: error: size of array 'type name' is negative"
52         export HOST_LIBIDL_CFLAGS="`${HOST_LIBIDL_CONFIG} --cflags | sed -e s:${STAGING_DIR_TARGET}:${STAGING_DIR_NATIVE}:g`"
53         export HOST_LIBIDL_LIBS="`${HOST_LIBIDL_CONFIG} --libs`"
55         if [ -e ${MOZ_OBJDIR}/Makefile ] ; then
56                 oe_runmake -f client.mk ${MOZ_OBJDIR}/Makefile \
57                                         ${MOZ_OBJDIR}/config.status
58         fi
61 mozilla_do_compile() {
62         oe_runmake -f client.mk build_all
65 mozilla_do_install() {
66         oe_runmake DESTDIR="${D}" destdir="${D}" install
69 EXPORT_FUNCTIONS do_configure do_compile do_install