commit:     41955ffcb8f13bc558ade34abac9ff7da851e7fd
Author:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 18:27:42 2015 +0000
Commit:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
CommitDate: Wed Dec 23 21:29:11 2015 +0000
URL:        https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=41955ffc

eclass reworking for cross-compile and other improvements

set --host only when cross-compiling, do not set --build

 eclass/mozconfig-v6.38.eclass                    | 18 ++++++++-----
 eclass/mozconfig-v6.42.eclass                    | 18 ++++++++-----
 eclass/mozcoreconf-v3.eclass                     | 18 ++++++++++++-
 www-client/firefox/files/nss.m4.pkg-config.patch | 33 ++++++++++++++++++++++++
 4 files changed, 74 insertions(+), 13 deletions(-)

diff --git a/eclass/mozconfig-v6.38.eclass b/eclass/mozconfig-v6.38.eclass
index ecd4578..361c9e6 100644
--- a/eclass/mozconfig-v6.38.eclass
+++ b/eclass/mozconfig-v6.38.eclass
@@ -193,10 +193,10 @@ mozconfig_config() {
        fi
 
        # These are enabled by default in all mozilla applications
-       mozconfig_annotate '' --with-system-nspr 
--with-nspr-prefix="${EPREFIX}"/usr
-       mozconfig_annotate '' --with-system-nss 
--with-nss-prefix="${EPREFIX}"/usr
-       mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include 
--x-libraries="${EPREFIX}"/usr/$(get_libdir)
-       mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
+       mozconfig_annotate '' --with-system-nspr 
--with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
+       mozconfig_annotate '' --with-system-nss 
--with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
+       mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include 
--x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
+       mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
        mozconfig_annotate '' --prefix="${EPREFIX}"/usr
        mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
        mozconfig_annotate 'Gentoo default' --enable-system-hunspell
@@ -219,8 +219,14 @@ mozconfig_config() {
                mozconfig_annotate '' --enable-replace-malloc
        fi
 
-       mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
-       mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
+       # Instead of the standard --build= and --host=, mozilla uses --host 
instead
+       # of --build, and --target intstead of --host.
+       # Note, mozilla also has --build but it does not do what you think it 
does.
+       mozconfig_annotate '' --target="${CHOST}"
+       if [[ "${CBUILD:-${CHOST}}" != "${CHOST}" ]]; then
+               # set --host only when cross-compiling
+               mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
+       fi
 
        if use gstreamer ; then
                mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0

diff --git a/eclass/mozconfig-v6.42.eclass b/eclass/mozconfig-v6.42.eclass
index 1feea38..40616c7 100644
--- a/eclass/mozconfig-v6.42.eclass
+++ b/eclass/mozconfig-v6.42.eclass
@@ -219,10 +219,10 @@ mozconfig_config() {
        fi
 
        # These are enabled by default in all mozilla applications
-       mozconfig_annotate '' --with-system-nspr 
--with-nspr-prefix="${EPREFIX}"/usr
-       mozconfig_annotate '' --with-system-nss 
--with-nss-prefix="${EPREFIX}"/usr
-       mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include 
--x-libraries="${EPREFIX}"/usr/$(get_libdir)
-       mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
+       mozconfig_annotate '' --with-system-nspr 
--with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
+       mozconfig_annotate '' --with-system-nss 
--with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
+       mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include 
--x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
+       mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
        mozconfig_annotate '' --prefix="${EPREFIX}"/usr
        mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
        mozconfig_annotate 'Gentoo default' --enable-system-hunspell
@@ -245,8 +245,14 @@ mozconfig_config() {
                mozconfig_annotate '' --enable-replace-malloc
        fi
 
-       mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
-       mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
+       # Instead of the standard --build= and --host=, mozilla uses --host 
instead
+       # of --build, and --target intstead of --host.
+       # Note, mozilla also has --build but it does not do what you think it 
does.
+       mozconfig_annotate '' --target="${CHOST}"
+       if [[ "${CBUILD:-${CHOST}}" != "${CHOST}" ]]; then
+               # set --host only when cross-compiling
+               mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
+       fi
 
        if use gstreamer ; then
                mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0

diff --git a/eclass/mozcoreconf-v3.eclass b/eclass/mozcoreconf-v3.eclass
index 9588ce2..e933db3 100644
--- a/eclass/mozcoreconf-v3.eclass
+++ b/eclass/mozcoreconf-v3.eclass
@@ -10,12 +10,17 @@
 #
 # inherit mozconfig-v5.* or above for mozilla configuration support
 
+# @ECLASS-VARIABLE: MOZILLA_FIVE_HOME
+# @DESCCRIPTION:
+# This is an eclass-generated variable that defines the rpath that the mozilla
+# product will be installed in.  Read-only
+
 if [[ ! ${_MOZCORECONF_V3} ]]; then
 
 PYTHON_COMPAT=( python2_7 )
 PYTHON_REQ_USE='threads,sqlite'
 
-inherit multilib flag-o-matic python-any-r1 versionator
+inherit multilib toolchain-funcs flag-o-matic python-any-r1 versionator
 
 IUSE="${IUSE} custom-cflags custom-optimization"
 
@@ -80,6 +85,9 @@ moz_pkgsetup() {
        export LC_MESSAGES="C"
        export LC_CTYPE="C"
 
+       # Ensure we use correct toolchain
+       tc-export CC CXX LD PKG_CONFIG
+
        # Ensure that we have a sane build enviroment
        export MOZILLA_CLIENT=1
        export BUILD_OPT=1
@@ -89,6 +97,9 @@ moz_pkgsetup() {
        # ensure MOZCONFIG is not defined
        eval unset MOZCONFIG
 
+       # set MOZILLA_FIVE_HOME
+       export MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
+
        # nested configure scripts in mozilla products generate unrecognized 
options
        # false positives when toplevel configure passes downwards.
        export QA_CONFIGURE_OPTIONS=".*"
@@ -196,6 +207,11 @@ mozconfig_init() {
        # Go a little faster; use less RAM
        append-flags "$MAKEEDIT_FLAGS"
 
+       # Use the MOZILLA_FIVE_HOME for the rpath
+       append-ldflags -Wl,-rpath="${MOZILLA_FIVE_HOME}"
+       # Set MOZILLA_FIVE_HOME in mozconfig
+       mozconfig_annotate '' 
--with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
+
        ####################################
        #
        # mozconfig setup

diff --git a/www-client/firefox/files/nss.m4.pkg-config.patch 
b/www-client/firefox/files/nss.m4.pkg-config.patch
new file mode 100644
index 0000000..e3ac8f8
--- /dev/null
+++ b/www-client/firefox/files/nss.m4.pkg-config.patch
@@ -0,0 +1,33 @@
+--- a/build/autoconf/nss.m4    2015-11-20 15:37:26.951993242 -0500
++++ b/build/autoconf/nss.m4    2015-11-20 15:37:19.431992752 -0500
+@@ -8,6 +8,8 @@
+ AC_DEFUN([AM_PATH_NSS],
+ [dnl
+ 
++PKG_CHECK_MODULES([NSS],[nss >= $1],[ifelse([$2], , :, [$2])],[
++
+ AC_ARG_WITH(nss-prefix,
+       [  --with-nss-prefix=PFX   Prefix where NSS is installed],
+       nss_config_prefix="$withval",
+@@ -84,8 +86,9 @@
+               ifelse([$3], , :, [$3])
+       fi
+ 
++      ])
+ 
+-      AC_SUBST(NSS_CFLAGS)
++      AC_SUBST_LIST(NSS_CFLAGS)
+       AC_SUBST_LIST(NSS_LIBS)
+ 
+ ])
+--- a/configure.in     2015-11-20 15:40:57.401762087 -0500
++++ b/configure.in     2015-11-20 15:50:10.080854755 -0500
+@@ -8775,7 +8775,7 @@
+ AC_SUBST(NSPR_CFLAGS)
+ AC_SUBST(MOZ_NATIVE_NSPR)
+ 
+-AC_SUBST(NSS_CFLAGS)
++AC_SUBST_LIST(NSS_CFLAGS)
+ AC_SUBST(MOZ_NATIVE_NSS)
+ AC_SUBST(NSS_DISABLE_DBM)
+ 

Reply via email to