MozillaZine

Build failure with GTK2

Discussion about official Mozilla Thunderbird builds
andred

User avatar
 
Posts: 49
Joined: December 24th, 2002, 10:19 am
Location: Sweden

Post Posted May 7th, 2003, 2:27 pm

I can successfully compile Thunderbird with gtk1.2, but when I use "ac_add_options --enable-default-toolkit=gtk2" the compilation fails with:

c++ -o thunderbird-bin -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -pedantic -Wno-long-long -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -O2 nsMailApp.o -L../../dist/bin -L../../dist/lib -ldl -lm ../../dist/lib/libxulapp_s.a -L../../dist/bin -lmozjs -L../../dist/bin -lxpcom -L../../dist/bin -L/home/andre/devel/cvs/mozilla/obj-i686-pc-linux-gnu-thunderbird/dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl
-Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
../../dist/lib/libxulapp_s.a(nsNativeAppSupportGtk.o)(.text+0x365): In function `nsSplashScreenGtk::Show()':
: undefined reference to `splash_xpm'
collect2: ld returned 1 exit status

I have no problem compiling Mozilla Firebird and Mozilla with GTK2. Is GTK2 not yet supported in Thunderbird?

©dn

User avatar
 
Posts: 683
Joined: April 20th, 2003, 1:53 pm
Location: GB

Post Posted May 7th, 2003, 3:09 pm

there was a patch for that 'splash_xpm' thing, it's defined for Moz, but not for Fire/Thunder
specifically

for mozilla/xpfe/bootstrap/nsNativeAppSupportGtk.cpp

#ifdef MOZ_XUL_APP
extern char* splash_xpm[];
#else
#include SPLASH_XPM
#endif

in place of

#ifdef MOZ_PHOENIX
extern char* splash_xpm[];
#else
#include SPLASH_XPM
#endif

you do have recent sources don't you ?

question: did you apply the patch(es) mentioned on http://www.mozilla.org/projects/thunderbird ?

andred

User avatar
 
Posts: 49
Joined: December 24th, 2002, 10:19 am
Location: Sweden

Post Posted May 8th, 2003, 6:18 am

©dn wrote:you do have recent sources don't you ?

question: did you apply the patch(es) mentioned on http://www.mozilla.org/projects/thunderbird ?


Yes, my sources are recent. I had not applied the two patches mentioned there, though. I had seen them, but I thought both had been applied to the trunk already (only #194315 seams to be applied). I'm now building with the patch in bug #201891 applied.

In my sources I have the "#ifdef MOZ_XUL_APP" variant of what you mentioned above. I tried changing it to "#ifdef MOZ_PHOENIX" (not knowing which one you meant was the correct one...), but then the build fails with:

nsNativeAppSupportGtk.cpp:33:10: #include expects "FILENAME" or <FILENAME>
nsNativeAppSupportGtk.cpp: In member function `virtual nsresult
nsSplashScreenGtk::Show()':
nsNativeAppSupportGtk.cpp:89: `splash_xpm' undeclared (first use this function)
nsNativeAppSupportGtk.cpp:89: (Each undeclared identifier is reported only once
for each function it appears in.)
make[3]: *** [nsNativeAppSupportGtk.o] Error 1

So its not getting declared now either it seams.

©dn

User avatar
 
Posts: 683
Joined: April 20th, 2003, 1:53 pm
Location: GB

Post Posted May 8th, 2003, 8:11 am

you do have MOZ_THUNDERBIRD=1 in .mozconfig ?

I meant MOZ_XUL_APP is the current and one it should be ... : )

andred

User avatar
 
Posts: 49
Joined: December 24th, 2002, 10:19 am
Location: Sweden

Post Posted May 8th, 2003, 2:25 pm

Yes I do. Like I said, a gtk1.2 build works just fine.

©dn

User avatar
 
Posts: 683
Joined: April 20th, 2003, 1:53 pm
Location: GB

Post Posted May 8th, 2003, 3:08 pm

when I was hacking about getting it to build on Linux I changed it to check for MOZ_THUNDERBIRD=1 as well, perhaps you could try that, unless there is anything else you need to .mozconfig when you gtk2

michel v

User avatar
 
Posts: 145
Joined: November 5th, 2002, 8:54 am
Location: Corsica

Post Posted May 8th, 2003, 3:31 pm

Instead of this code:
Code: Select all
#ifdef MOZ_XUL_APP
extern char* splash_xpm[];
#else
#include SPLASH_XPM
#endif

which I gather is supposed to execute the first consequence (extern char, etc), I'll just try to build with this code:
Code: Select all
extern char* splash_xpm[];

This is what we want to do anyway, isn't it? So I might aswell force it for the moment. :)

If it's not what we want to do, then I'll build with:
Code: Select all
#include SPLASH_XPM

It can only be one of the two, heh.

andred

User avatar
 
Posts: 49
Joined: December 24th, 2002, 10:19 am
Location: Sweden

Post Posted May 9th, 2003, 4:06 am

michel v wrote:If it's not what we want to do, then I'll build with:
Code: Select all
#include SPLASH_XPM

It can only be one of the two, heh.


That's exactly what I thought too before, and I tried both options. None of them worked.

mscott

User avatar
 
Posts: 2516
Joined: April 2nd, 2003, 4:10 pm
Location: Thunderbird Research Center, CA

Post Posted May 9th, 2003, 2:12 pm

I see the problem. There is a MOZ_PHOENIX ifdef that should really be a MOZ_XUL_APP ifdef right here:

http://lxr.mozilla.org/seamonkey/source ... Gtk.cpp#67

Change that line and you should be in business. I'll try to get that checked in if someone can confirm for me that it fixes the problem. I believe it should.
Thunderbirds are Go!

©dn

User avatar
 
Posts: 683
Joined: April 20th, 2003, 1:53 pm
Location: GB

Post Posted May 9th, 2003, 3:17 pm

[I'm fairly sure mine has that fix - although from where/when it got patched I don't remember]

cancel that [ mine doesn't have this fixed : ) ]

[1033 cdn@emperor mozilla]$ cvs diff xpfe/bootstrap/nsNativeAppSupportGtk.cpp
Index: xpfe/bootstrap/nsNativeAppSupportGtk.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpfe/bootstrap/nsNativeAppSupportGtk.cpp,v
retrieving revision 1.13
diff -u -3 -p -r1.13 nsNativeAppSupportGtk.cpp
--- xpfe/bootstrap/nsNativeAppSupportGtk.cpp 24 Apr 2003 06:25:12 -0000 1.13
+++ xpfe/bootstrap/nsNativeAppSupportGtk.cpp 9 May 2003 22:20:42 -0000
@@ -27,6 +27,7 @@
#include "gdk/gdk.h"
#include "prenv.h"
#include "nsString.h"
+
#ifdef MOZ_XUL_APP
extern char* splash_xpm[];
#else

the only difference in mine is an extra \n - but then I build gtk 1.x

andred

User avatar
 
Posts: 49
Joined: December 24th, 2002, 10:19 am
Location: Sweden

Post Posted May 9th, 2003, 4:22 pm

mscott wrote:I see the problem. There is a MOZ_PHOENIX ifdef that should really be a MOZ_XUL_APP ifdef right here:

http://lxr.mozilla.org/seamonkey/source ... Gtk.cpp#67

Change that line and you should be in business. I'll try to get that checked in if someone can confirm for me that it fixes the problem. I believe it should.


Believe it or not, but it's still a no-go here. The change that I did was:

Index: xpfe/bootstrap/nsNativeAppSupportGtk.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpfe/bootstrap/nsNativeAppSupportGtk.cpp,v
retrieving revision 1.13
diff -u -r1.13 nsNativeAppSupportGtk.cpp
--- xpfe/bootstrap/nsNativeAppSupportGtk.cpp 24 Apr 2003 06:25:12 -0000 1.13
+++ xpfe/bootstrap/nsNativeAppSupportGtk.cpp 9 May 2003 23:15:14 -0000
@@ -64,7 +64,7 @@

NS_IMETHODIMP nsSplashScreenGtk::Show()
{
-#ifdef MOZ_PHOENIX
+#ifdef MOZ_XUL_APP
if (!splash_xpm[0])
return NS_OK;
#endif

I did a clobber build, and still:

c++ -o thunderbird-bin -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align
-Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -pedantic -Wno-long-long -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -O2 nsMailApp.o -L../../dist/bin -L../../dist/lib -ldl -lm ../../dist/lib/libxulapp_s.a -L../../dist/bin -lmozjs -L../../dist/bin -lxpcom -L../../dist/bin -L/home/andre/devel/cvs/mozilla/obj-i686-pc-linux-gnu-thunderbird-gtk2/dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
../../dist/lib/libxulapp_s.a(nsNativeAppSupportGtk.o)(.text+0x216): In function `nsSplashScreenGtk::Show()':
: undefined reference to `splash_xpm'
../../dist/lib/libxulapp_s.a(nsNativeAppSupportGtk.o)(.text+0x378): In function `nsSplashScreenGtk::Show()':
: undefined reference to `splash_xpm'
collect2: ld returned 1 exit status
make[4]: *** [thunderbird-bin] Error 1

I know for sure that my build environment is sane: I have been building mozilla/phoenix/firebird for a long time, both against gtk1.2 and gtk2 and this problem is only present in thunderbird.

©dn

User avatar
 
Posts: 683
Joined: April 20th, 2003, 1:53 pm
Location: GB

Post Posted May 9th, 2003, 5:25 pm

even with

cvs diff xpfe/bootstrap/nsNativeAppSupportGtk.cpp
Index: xpfe/bootstrap/nsNativeAppSupportGtk.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpfe/bootstrap/nsNativeAppSupportGtk.cpp,v
retrieving revision 1.13
diff -u -3 -p -r1.13 nsNativeAppSupportGtk.cpp
--- xpfe/bootstrap/nsNativeAppSupportGtk.cpp 24 Apr 2003 06:25:12 -0000 1.13
+++ xpfe/bootstrap/nsNativeAppSupportGtk.cpp 10 May 2003 00:24:57 -0000
@@ -64,7 +64,12 @@ nsSplashScreenGtk::~nsSplashScreenGtk()

NS_IMETHODIMP nsSplashScreenGtk::Show()
{
-#ifdef MOZ_PHOENIX
+#ifdef MOZ_XUL_APP
+ if (!splash_xpm[0])
+ return NS_OK;
+#endif
+
+#ifdef MOZ_THUNDERBIRD
if (!splash_xpm[0])
return NS_OK;
#endif


[ admittedly a dep build ]

gmake[4]: Entering directory `/root0/mozilla/mail/app'
nsMailApp.cpp
c++ -o nsMailApp.o -c -DOSTYPE=\"Linux2.4\" -DOSARCH=\"Linux\" -I../../dist/include/string -I../../dist/include/xpcom -I../../dist/include/xulapp -I../../dist/include/xpinstall -I../../dist/include/appshell -I../../dist/include -I../../dist/include -I/root0/mozilla/dist/include/nspr -I/usr/X11R6/include -fPIC -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -pedantic -Wno-long-long -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -I/usr/X11R6/include -DMOZILLA_CLIENT -include ../../mozilla-config.h -Wp,-MD,.deps/nsMailApp.pp nsMailApp.cpp
c++ -o thunderbird-bin -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -pedantic -Wno-long-long -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED nsMailApp.o -L../../dist/bin -L../../dist/lib -ldl -lm ../../dist/lib/libxulapp_s.a -L../../dist/bin -lmozjs -L../../dist/bin -lxpcom -L../../dist/bin -L/root0/mozilla/dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
../../dist/lib/libxulapp_s.a(nsNativeAppSupportGtk.o): In function `nsSplashScreenGtk::Show()':
nsNativeAppSupportGtk.o(.text+0x315): undefined reference to `splash_xpm'
nsNativeAppSupportGtk.o(.text+0x32f): undefined reference to `splash_xpm'
nsNativeAppSupportGtk.o(.text+0x3e2): undefined reference to `splash_xpm'
collect2: ld returned 1 exit status
gmake[4]: *** [thunderbird-bin] Error 1
gmake[4]: Leaving directory `/root0/mozilla/mail/app'
gmake[3]: *** [libs] Error 2
gmake[3]: Leaving directory `/root0/mozilla/mail'
gmake[2]: *** [tier_99] Error 2
gmake[2]: Leaving directory `/root0/mozilla'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/root0/mozilla'
make: *** [build] Error 2

andred

User avatar
 
Posts: 49
Joined: December 24th, 2002, 10:19 am
Location: Sweden

Post Posted May 10th, 2003, 9:54 am

I have sent an e-mail to bryner asking about this, since he is the one who added the ifdef's for Phoenix. Hopefully he has some clues about what is going on here.

©dn

User avatar
 
Posts: 683
Joined: April 20th, 2003, 1:53 pm
Location: GB

Post Posted May 11th, 2003, 7:07 am

[ netscape.public.mozilla.builds ]
news://news.mozilla.org:119/3EBE32EC.5080500@sun.com :
I tracked this down to - apparently - the fact that I'm trying to compile Thunderbird with GTK2 support, i.e. with --enable-default-toolkit=gtk2.

The problem is that splash_xpm[] is defined in mail/app/nsMailApp.cpp, but only if MOZ_WIDGET_GTK is defined:

#ifdef MOZ_WIDGET_GTK
char* splash_xpm[] = {0};
#endif

and, in my configuration, I don't have MOZ_WIDGET_GTK; I have MOZ_WIDGET_GTK2 instead.


fix with this 'or' ?

toolkit/xre/nsAppRunner.cpp:#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)

calum
 
Posts: 26
Joined: May 11th, 2003, 9:59 am

Post Posted May 11th, 2003, 10:08 am

mscott wrote:I see the problem. There is a MOZ_PHOENIX ifdef that should really be a MOZ_XUL_APP ifdef right here:

http://lxr.mozilla.org/seamonkey/source ... Gtk.cpp#67

Change that line and you should be in business. I'll try to get that checked in if someone can confirm for me that it fixes the problem. I believe it should.


I don't think the MOZ_PHOENIX -> MOZ_XUL_APP change is the problem, although it is a change that should be made. It certainly doesn't fix the problem.

The problem is that the [Thunderbird] code to declare splash_xpm[], in mozilla/mail/app/nsMailApp.cpp, is wrapped in:

#ifdef MOZ_WIDGET_GTK
char* splash_xpm[] = {0};
#endif

but MOZ_WIDGET_GTK is not defined for a GTK2 build. It needs to be changed to something like:

#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)

char* splash_xpm[] = {0};
#endif

and there are probably other occurrences of similar code in Thunderbird which might need to be changed.

Return to Thunderbird Builds


Who is online

Users browsing this forum: No registered users and 2 guests