Closed Bug 647910 Opened 13 years ago Closed 13 years ago

Firefox-4.0 compile fails on using "--enable-javaxpcom"

Categories

(Firefox :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 612873

People

(Reporter: alupu, Unassigned)

References

()

Details

User-Agent:       Opera/9.80 (X11; Linux i686; U; en) Presto/2.7.62 Version/11.01
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0

ERRORS

c++ -o nsJavaXPTCStub.o -c  -fvisibility=hidden -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DSTATIC_EXPORTABLE_JS_API -DOSTYPE=\"Linux2.6.37\" -DOSARCH=Linux -I"/opt/jdk/include" -I"/opt/jdk/include"/linux -I/usr/src/mozilla-2.0/extensions/java/xpcom/src -I. -I../../../../dist/include -I../../../../dist/include/nsprpub  -I/usr/include/nspr -I/usr/include/nss       -fPIC  -frtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -pedantic -Wno-long-long -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fomit-frame-pointer -finline-limit=50   -DMOZILLA_CLIENT -include ../../../../mozilla-config.h /usr/src/mozilla-2.0/extensions/java/xpcom/src/nsJavaXPTCStub.cpp

/usr/src/mozilla-2.0/extensions/java/xpcom/src/nsJavaInterfaces.cpp: In function 'nsresult InitEmbedding_Impl(JNIEnv*, _jobject*, _jobject*, _jobject*)':

/usr/src/mozilla-2.0/extensions/java/xpcom/src/nsJavaInterfaces.cpp:95: error: 'XRE_InitEmbedding' was not declared in this scope

/usr/src/mozilla-2.0/extensions/java/xpcom/src/nsJavaInterfaces.cpp: In function '_jobject* Java_org_mozilla_xpcom_internal_XPCOMImpl_getComponentManager(JNIEnv*, _jobject*)':

/usr/src/mozilla-2.0/extensions/java/xpcom/src/nsJavaInterfaces.cpp:238: error: incomplete type 'nsIComponentManager' used in nested name specifier

/usr/src/mozilla-2.0/extensions/java/xpcom/src/nsJavaInterfaces.cpp:238: error: expected primary-expression before 'int'

/usr/src/mozilla-2.0/extensions/java/xpcom/src/nsJavaInterfaces.cpp:238: error: expected `)' before 'int'

make[4]: *** [nsJavaInterfaces.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/usr/src/firefox-build/extensions/java/xpcom/src'
make[3]: *** [libs_tier_platform] Error 2
make[3]: Leaving directory `/usr/src/firefox-build'
make[2]: *** [tier_platform] Error 2
make[2]: Leaving directory `/usr/src/firefox-build'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/usr/src/firefox-build'
make: *** [build] Error 2


Reproducible: Always

Steps to Reproduce:
1.  make -f client.mk build
2.
3.
Actual Results:  
See "Details" above 

Expected Results:  
For the compile (make build) to work.

FIXES (temporary, workarounds?)

[]$ diff nsJavaInterfaces.cpp-original nsJavaInterfaces.cpp-fix
49a50
> #include "nsIComponentManager.h"
95c96,97
<   return XRE_InitEmbedding(libXULDir, appDir, provider, nsnull, 0);
---
> // return XRE_InitEmbedding(libXULDir, appDir, provider, nsnull, 0);
>    return XRE_InitEmbedding2((nsILocalFile*) aLibXULDirectory,
>    (nsILocalFile*) aAppDirectory, (nsIDirectoryServiceProvider*)
>    aAppDirProvider);

------

1. For the line 238 error

 Added '.../nsIComponentManager.h' into
    '.../mozilla-2.0/extensions/java/xpcom/src/'

Comment:  seems pretty straightforward.
(based on "the more the merrier" principle.)

2. For the line 95 error

Comments:
- This is tricky.  Ugly casts.
  I'm not sure if the result is in the spirit of what
  the author(s) intended (even if in a more elegant way).

- I haven't been able to find an XRE_InitEmbedding (without the "2")
  function defined anywhere.  (There's a lot of talk about it, but
  like I said, no definition.)

Whatever the case might be, once with these "fixes" in place,
Firefox-4.0 compiles to a successful completion.

REFERENCES
(B)LFS i686-pc-linux-gnu 2.6.37.3
 gcc-4.1.2
 JDK-1.6.0_24  (jdk-6u24)
 Xorg-7.6
 glib-2.28.4
 gtk+-2.24.3  (with DJ Lucas "icons" patch - See Bug 640850)
 sqlite-3.7.5
 nspr-4.8.7
 nss-3.12.9
 libpng-1.5.1 +apng
 cairo-1.10.2 +tee
 firefox-4.0.source.tar.bz2   MD5sum: 3468a2c463b4fc2788ba621e4b511c30
 (with 'nsPNGDecoder.cpp' patch - See Bug 645519)
------------------------------------------------------------------------
'.mozconfig'

. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../firefox-build
mk_add_options MOZ_MAKE_FLAGS="-j4"
ac_add_options --prefix=/usr
#
ac_add_options --disable-accessibility
ac_add_options --disable-auto-deps
ac_add_options --disable-crashreporter
ac_add_options --disable-dbm
ac_add_options --disable-gnomevfs
ac_add_options --disable-installer
ac_add_options --disable-tests
ac_add_options --disable-updater
ac_add_options --enable-cpp-rtti
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-image-decoders=all
ac_add_options --enable-image-encoders=all
ac_add_options --enable-jemalloc
ac_add_options --enable-official-branding
ac_add_options --enable-optimize
ac_add_options --enable-places
ac_add_options --enable-safe-browsing
ac_add_options --enable-strip
ac_add_options --enable-system-cairo
ac_add_options --enable-system-lcms
ac_add_options --enable-system-sqlite
ac_add_options --enable-valgrind
ac_add_options --enable-libxul
ac_add_options --with-java-bin-path=/opt/jdk/bin
ac_add_options --with-java-include-path=/opt/jdk/include
ac_add_options --with-pthreads
ac_add_options --with-qtdir=/opt/qt
ac_add_options --with-system-bz2
ac_add_options --with-system-jpeg
ac_add_options --with-system-libxul
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-png
ac_add_options --with-system-zlib
ac_add_options --with-x
ac_add_options --enable-javaxpcom
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.