Building 1.1.16 w/ Firefox 1.5.0.7

0 views
Skip to first unread message

Ricky Rivera

unread,
Sep 27, 2006, 1:31:32 PM9/27/06
to Mugshot Community
I'm attempting to upgrade to the latest version of mugshot, and the
compile dies out on the new firefox extension. Is there a specific
version of Firefox mugshot requires? I'm building on a Gentoo system
against Firefox 1.5.0.7 with the following configure options:
--with-gecko-sdk=/usr/lib/mozilla-firefox
--with-xpidl=/usr/lib/mozilla-firefox/xpidl

The compile error is below.

Thanks,
Ricky

-----
i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I./config
-DHIPPO_COMPILATION -DHIPPO_OS_LINUX
-DVERSION_FILE=\"/usr/share/mugshot/version\" -I./config
-I./common-dist -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/nspr
-I ./common-dist/firefox/include -I config/hippo -I
/usr/lib/mozilla-firefox/include -I
./common-dist/firefox/gecko-private/include -march=athlon-xp -Os -pipe
-fomit-frame-pointer -Wall -Wchar-subscripts -Wpointer-arith
-Wcast-align -Wfloat-equal -Wsign-compare -Wno-non-virtual-dtor -MT
libhippofirefox_la-hippoExtension.lo -MD -MP -MF
.deps/libhippofirefox_la-hippoExtension.Tpo -c
./common-dist/firefox/src/hippoExtension.cpp -fPIC -DPIC -o
.libs/libhippofirefox_la-hippoExtension.o
./common-dist/firefox/src/hippoExtension.cpp:3:22: error: nsMemory.h:
No such file or directory
./common-dist/firefox/src/hippoExtension.cpp:5:30: error:
nsISupportsUtils.h: No such file or directory
In file included from ./common-dist/firefox/src/hippoExtension.h:2,
from ./common-dist/firefox/src/hippoExtension.cpp:6:
config/hippo/hippoIExtension.h:10:25: error: nsISupports.h: No such
file or directory
In file included from ./common-dist/firefox/src/hippoExtension.cpp:6:
./common-dist/firefox/src/hippoExtension.h:4:22: error: nsCOMPtr.h: No
such file or directory
./common-dist/firefox/src/hippoExtension.h:5:25: error: nsStringAPI.h:
No such file or directory
config/hippo/hippoIExtension.h:25: error: expected class-name before
'{' token
config/hippo/hippoIExtension.h:28: error: expected identifier before
'{' token
config/hippo/hippoIExtension.h:28: error: expected `)' before '{' token
config/hippo/hippoIExtension.h:28: error: ISO C++ forbids declaration
of 'NS_DEFINE_STATIC_IID_ACCESSOR' with no type
config/hippo/hippoIExtension.h:28: error: expected unqualified-id
before ')' token
config/hippo/hippoIExtension.h:34: error: 'NS_IMETHOD' does not name a
type
config/hippo/hippoIExtension.h: In member function 'int
hippoIExtension::NS_DEFINE_STATIC_IID_ACCESSOR(int)':
config/hippo/hippoIExtension.h:28: warning: left-hand operand of comma
has no effect
config/hippo/hippoIExtension.h:28: warning: right-hand operand of comma
has no effect
config/hippo/hippoIExtension.h:28: error: expected primary-expression
before '{' token
config/hippo/hippoIExtension.h:28: error: expected `;' before '{' token
config/hippo/hippoIExtension.h:28: warning: no return statement in
function returning non-void
./common-dist/firefox/src/hippoExtension.h: At global scope:
./common-dist/firefox/src/hippoExtension.h:10: error:
'NS_DECL_ISUPPORTS' does not name a type
./common-dist/firefox/src/hippoExtension.h:11: error: 'NS_IMETHOD' does
not name a type
./common-dist/firefox/src/hippoExtension.h:18: error: 'nsCString' does
not name a type
./common-dist/firefox/src/hippoExtension.cpp:10: error: expected
constructor, destructor, or type conversion before 'hippoExtension'
./common-dist/firefox/src/hippoExtension.cpp:21: error: 'NS_IMETHODIMP'
does not name a type
./common-dist/firefox/src/hippoExtension.cpp:28: error: 'NS_IMETHODIMP'
does not name a type
make[1]: *** [libhippofirefox_la-hippoExtension.lo] Error 1
make[1]: Leaving directory
`/var/tmp/portage/mugshot-1.1.16/work/mugshot-1.1.16'make: *** [all]
Error 2

Owen Taylor

unread,
Sep 27, 2006, 2:01:18 PM9/27/06
to mug...@googlegroups.com
On Wed, 2006-09-27 at 17:31 +0000, Ricky Rivera wrote:
> I'm attempting to upgrade to the latest version of mugshot, and the
> compile dies out on the new firefox extension. Is there a specific
> version of Firefox mugshot requires? I'm building on a Gentoo system
> against Firefox 1.5.0.7 with the following configure options:
> --with-gecko-sdk=/usr/lib/mozilla-firefox
> --with-xpidl=/usr/lib/mozilla-firefox/xpidl

I'm not sure, but I don't think the problem has anything to do with
the particular version of Firefox. I think the problem is rather
that the set of files in /usr/lib/mozilla-firefox isn't organized
the way that the Mugshot client build process expects.

During the build of firefox itself the include files are organized
in a very "deep" fashion with a lot of subdirectories. Then when
the "Gecko SDK" is created, it flattens that out into a simpler
hierarchy. Maybe /usr/lib/mozilla-firefox/include has the build
configuration rather than the "Gecko SDK" configuration?

What does:

find nsMemory.h /usr/lib/mozilla-firefox/include

show?
- Owen

Ricky Rivera

unread,
Sep 27, 2006, 2:17:21 PM9/27/06
to mug...@googlegroups.com
/usr/lib/mozilla-firefox/include/xpcom/nsMemory.h

> -I./common-dist -I/usr/include/glib- 2.0 -I/usr/lib/glib-2.0/include

> -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/nspr
> -I ./common-dist/firefox/include -I config/hippo -I
> /usr/lib/mozilla-firefox/include -I
> ./common-dist/firefox/gecko-private/include -march=athlon-xp -Os -pipe
> -fomit-frame-pointer -Wall -Wchar-subscripts -Wpointer-arith
> -Wcast-align -Wfloat-equal -Wsign-compare -Wno-non-virtual-dtor -MT
> libhippofirefox_la-hippoExtension.lo -MD -MP -MF
> .deps/libhippofirefox_la- hippoExtension.Tpo -c

Owen Taylor

unread,
Sep 27, 2006, 3:36:20 PM9/27/06
to mug...@googlegroups.com
On Wed, 2006-09-27 at 14:17 -0400, Ricky Rivera wrote:
> /usr/lib/mozilla-firefox/include/xpcom/nsMemory.h

OK, yeah, suspicions confirmed - it's an include tree layout problem.

You could:

A) Just get the prebuilt gecko-sdk and build against that. See:

http://developer.mugshot.org/wiki/Linux_Client_Development_Setup

B) Set CPPFLAGS to include the directories where the missing .h files
are.

That is,

CPPFLAGS="-I /usr/lib/mozila-firefox/include/xpcom \
-I/usr/lib/mozilla-firefox/include/xpcom ......" configure

C) Come up with a configure.ac patch to detect the variant layout and
handle it. You'd like have to replace GECKO_INCLUDEDIR with a
GECKO_INCLUDES variable that includes the -I flags so that you can
specify multiple directories.

C) is obviously the most work, but appreciated if you want to tackle it.

[ If you go path B) and get that to work, let us know what directories you
needed and we might be able to create a configure.ac patch from that. ]

Regards,
- Owen


John Patterson

unread,
Sep 27, 2006, 4:12:47 PM9/27/06
to Mugshot Community
I've been wrestling with this too. I'm also on Gentoo, but amd64.

Following the info above, I can get it to mostly build with:

CPPFLAGS="-I/usr/lib64/mozilla-firefox/include/xpcom
-I/usr/lib64/mozilla-firefox/include/string
-I/usr/lib64/mozilla-firefox/include/necko" ./configure
--with-gecko-sdk=/usr/lib64/mozilla-firefox
--with-xpidl=/usr/lib64/mozilla-firefox

But it bombs out towards the end:

/usr/lib64/mozilla-firefox -I /usr/lib64/mozilla-firefox/idl -I
./common-dist/firefox/public -m typelib -e hippoIExtension.xpt
common-dist/firefox/public/hippoIExtension.idl
make[1]: execvp: /usr/lib64/mozilla-firefox: Permission denied
make[1]: *** [hippoIExtension.xpt] Error 127
make[1]: Leaving directory `/home/jarel/temp/mugshot-1.1.16'


make: *** [all] Error 2

Regards,
John

Owen Taylor

unread,
Sep 27, 2006, 4:22:48 PM9/27/06
to mug...@googlegroups.com
On Wed, 2006-09-27 at 13:12 -0700, John Patterson wrote:
> I've been wrestling with this too. I'm also on Gentoo, but amd64.
>
> Following the info above, I can get it to mostly build with:
>
> CPPFLAGS="-I/usr/lib64/mozilla-firefox/include/xpcom
> -I/usr/lib64/mozilla-firefox/include/string
> -I/usr/lib64/mozilla-firefox/include/necko" ./configure
> --with-gecko-sdk=/usr/lib64/mozilla-firefox
> --with-xpidl=/usr/lib64/mozilla-firefox
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Your problem. You need to pass in the path the the xpidl
binary.
- Owen

> But it bombs out towards the end:
>
> /usr/lib64/mozilla-firefox -I /usr/lib64/mozilla-firefox/idl -I
> ./common-dist/firefox/public -m typelib -e hippoIExtension.xpt
> common-dist/firefox/public/hippoIExtension.idl
> make[1]: execvp: /usr/lib64/mozilla-firefox: Permission denied
> make[1]: *** [hippoIExtension.xpt] Error 127
> make[1]: Leaving directory `/home/jarel/temp/mugshot-1.1.16'
> make: *** [all] Error 2

(configure.ac does:

if ! test -x "$XPIDL" ; then
AC_MSG_ERROR([Cannot find xpidl at $XPIDL])
fi

so it's going to pass directories, which typically have the
executable bit set, I suppose it could do:

if !test -x "$XPIDL" -a \! -d "$XPIDL" ; then

But the simple 'test -x' is sort of traditional...)


John Patterson

unread,
Sep 27, 2006, 4:33:45 PM9/27/06
to Mugshot Community
Owen Taylor wrote:
> You need to pass in the path the the xpidl binary.

Thanks Owen. I'd got confused by the SOURCE_DIR in the configure
--help output (it's been a long day!), but with that it compiles fine.

I've since noticed that Sebi Ryffel has added an updated ebuild and a
patch for the configure script to Gentoo's bugzilla, which also
builds/installs/runs for me:

http://bugs.gentoo.org/show_bug.cgi?id=135524

Regards,
John

Owen Taylor

unread,
Sep 27, 2006, 4:45:59 PM9/27/06
to mug...@googlegroups.com

Doh! Looking at the patch there, it turns out that I *already* had
written the support for that style of include directory organization,
but the test in the configure.ac wasn't quite right.

Oh, well. I'll fix it in subversion :-)
- Owen


Owen Taylor

unread,
Sep 27, 2006, 5:00:04 PM9/27/06
to mug...@googlegroups.com
On Wed, 2006-09-27 at 13:33 -0700, John Patterson wrote:

I've committed something very much like the patch there, now. If you
want to add a note there, that would be appreciated.

Thanks for the pointer.
- Owen


John Patterson

unread,
Sep 27, 2006, 5:21:30 PM9/27/06
to Mugshot Community
Thanks again. I've added a note to the Gentoo bug.

Ricky Rivera

unread,
Sep 28, 2006, 8:06:18 AM9/28/06
to mug...@googlegroups.com
On 9/27/06, Owen Taylor <ota...@redhat.com> wrote:
I guess I can stop poking at a patch of my own (and abandon my ebuild). :-)

Thanks!

--Ricky

Dan Nicholson

unread,
Oct 7, 2006, 5:03:23 PM10/7/06
to Mugshot Community
Owen Taylor wrote:
> On Wed, 2006-09-27 at 17:31 +0000, Ricky Rivera wrote:
> > I'm attempting to upgrade to the latest version of mugshot, and the
> > compile dies out on the new firefox extension. Is there a specific
> > version of Firefox mugshot requires? I'm building on a Gentoo system
> > against Firefox 1.5.0.7 with the following configure options:
> > --with-gecko-sdk=/usr/lib/mozilla-firefox
> > --with-xpidl=/usr/lib/mozilla-firefox/xpidl
>
> I'm not sure, but I don't think the problem has anything to do with
> the particular version of Firefox. I think the problem is rather
> that the set of files in /usr/lib/mozilla-firefox isn't organized
> the way that the Mugshot client build process expects.

I ran into problems with this myself, and I would agree that it has a
lot to do with how you expect the SDK to be organized. Which is tough
because firefox comes out very differently depending on if you grab the
binaries or build from source.

Now, I got the same error as the OP because (after I forced
HAVE_FULL_GECKO) the CPPFLAGS don't include $(GECKO_INCLUDEDIR) by
itself, which is where nsISupports.h lives on my system. I don't know
how the distros package things up, but if you build firefox straight
from the tarball with `make install', the headers end up in
/usr/include/firefox. nsIURI.h and nsISupports.h are at the top level
and I still have all the subdirectories dom, js, xpcom, etc.

I just worked around by setting CPPFLAGS='-I/usr/include/firefox' for
configure, but I was wondering what the header setup looks like for
others. Seems the OP has /usr/lib/mozilla-firefox/include?

Eventually, I came up with these two diffs. The one you already got,
the other seems harmless and would work with the tarball `make
install'. I'm using the google groups interface since I don't have an
email to reply too, so it's screwed the formatting on the diff.

--
Dan

--- mugshot-1.1.16.orig/configure.ac 2006-09-26 05:26:09.000000000
-0700
+++ mugshot-1.1.16/configure.ac 2006-10-07 13:27:45.000000000 -0700
@@ -341,10 +341,10 @@ else
fi

if test "x$GECKO_INCLUDEDIR" != x ; then
- if test -f "$GECKO_INCLUDEDIR/nsIURI.h" ; then
- :
- elif test -f "$GECKO_INCLUDEDIR/caps/nsIScriptSecurityManager.h" ;
then
+ if test -f "$GECKO_INCLUDEDIR/caps/nsIScriptSecurityManager.h" ;
then
have_full_gecko=true
+ elif test -f "$GECKO_INCLUDEDIR/nsIURI.h" ; then
+ :
else
AC_MSG_ERROR([Cannot find Gecko headers in $GECKO_INCLUDEDIR])
fi
--- mugshot-1.1.16.orig/Makefile-libhippofirefox.am 2006-08-19
12:44:46.000000000 -0700
+++ mugshot-1.1.16/Makefile-libhippofirefox.am 2006-10-07
13:49:27.000000000 -0700
@@ -50,6 +50,7 @@ libhippofirefox_la_CPPFLAGS = \

if HAVE_FULL_GECKO
libhippofirefox_la_CPPFLAGS += \
+ -I $(GECKO_INCLUDEDIR) \
-I $(GECKO_INCLUDEDIR)/caps \
-I $(GECKO_INCLUDEDIR)/dom \
-I $(GECKO_INCLUDEDIR)/js \

Reply all
Reply to author
Forward
0 new messages