codegooglecom / libproxy

Automatically exported from code.google.com/p/libproxy
GNU Lesser General Public License v2.1
0 stars 0 forks source link

compile fails #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. configure and compile

What is the expected output? What do you see instead?
compilation failure

What version of the product are you using? On what operating system?
ubuntu/x86_64 8.10

gcc-Version 4.3.2 (Ubuntu 4.3.2-1ubuntu11)

    Plugins to build...
        envvar          : yes
        file            : yes
        gnome           : yes
        kde             : yes
        webkit          : no
        mozjs           : yes
        networkmanager  : no

    Bindings to build...
        python          : yes
        java            : no
        dotnet          : no
------------------------------------------------------

 gcc -DPACKAGE_NAME=\"libproxy\" -DPACKAGE_TARNAME=\"libproxy\" -
DPACKAGE_VERSION=\"0.2.3\" "-DPACKAGE_STRING=\"libproxy 0.2.3\"" -
DPACKAGE_BUGREPORT=\"nathaniel@natemccallum.com\" -DPACKAGE=\"libproxy\" -
DVERSION=\"0.2.3\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -
DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -
DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -
DHAVE_DLFCN_H=1 -DSTDC_HEADERS=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -
DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -I. -I../../src/lib -DXP_UNIX -
DJS_THREADSAFE -I/opt/gnome2/include/nspr -I/usr/include/xulrunner-1.9.0.4/
stable -g -std=c99 -g -O1 -Wall -march=athlon64 -DPLUGINDIR=\"/opt/gnome2/
lib64/libproxy/0.2.3/plugins\" -DSYSCONFDIR=\"/opt/gnome2/etc\" -
D_POSIX_C_SOURCE=1 -MT mozjs_la-mozjs.lo -MD -MP -MF .deps/mozjs_la-
mozjs.Tpo -c mozjs.c  -fPIC -DPIC -o .libs/mozjs_la-mozjs.o
mozjs.c:32:19: error: jsapi.h: No such file or directory
mozjs.c:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before 
'dnsResolve'
mozjs.c:70: error: expected '=', ',', ';', 'asm' or '__attribute__' before 
'myIpAddress'
mozjs.c:83: error: expected specifier-qualifier-list before 'JSRuntime'
mozjs.c: In function 'ctxs_free':
mozjs.c:92: error: 'ctxStore' has no member named 'ctx'
mozjs.c:92: warning: implicit declaration of function 'JS_DestroyContext'
mozjs.c:92: error: 'ctxStore' has no member named 'ctx'
mozjs.c:93: error: 'ctxStore' has no member named 'run'
mozjs.c:93: warning: implicit declaration of function 'JS_DestroyRuntime'
mozjs.c:93: error: 'ctxStore' has no member named 'run'
mozjs.c:94: error: 'ctxStore' has no member named 'cls'
mozjs.c:94: error: 'ctxStore' has no member named 'cls'
mozjs.c:95: error: 'ctxStore' has no member named 'pac'
mozjs.c: In function 'ctxs_new':
mozjs.c:101: error: 'JSObject' undeclared (first use in this function)
mozjs.c:101: error: (Each undeclared identifier is reported only once
mozjs.c:101: error: for each function it appears in.)
mozjs.c:101: error: 'global' undeclared (first use in this function)
mozjs.c:102: error: 'jsval' undeclared (first use in this function)
mozjs.c:102: error: expected ';' before 'rval'
mozjs.c:108: error: 'ctxStore' has no member named 'cls'
mozjs.c:108: error: 'JSClass' undeclared (first use in this function)
mozjs.c:109: error: 'ctxStore' has no member named 'cls'
mozjs.c:110: error: 'ctxStore' has no member named 'cls'
mozjs.c:111: error: 'ctxStore' has no member named 'cls'
mozjs.c:111: error: 'JS_PropertyStub' undeclared (first use in this 
function)
mozjs.c:112: error: 'ctxStore' has no member named 'cls'
mozjs.c:113: error: 'ctxStore' has no member named 'cls'
mozjs.c:114: error: 'ctxStore' has no member named 'cls'
mozjs.c:115: error: 'ctxStore' has no member named 'cls'
...

Original issue reported on code.google.com by christia...@gmail.com on 12 Dec 2008 at 12:13

GoogleCodeExporter commented 9 years ago
Christian,

We're using pkg-config to get the correct include statements.
Yours seems to be failing with the mozjs header.

Can you check the output of
pkg-config --cflags xulrunner-js
please?

Original comment by dominiqu...@gmail.com on 14 Dec 2008 at 9:56

GoogleCodeExporter commented 9 years ago
Addendum:
I assume your the output from the command above would be
-DXP_UNIX -
DJS_THREADSAFE -I/opt/gnome2/include/nspr -I/usr/include/xulrunner-1.9.0.4/

on your machine.
Either the jsapi.h is really in the location /usr/include/xulrunner-1.9.0.4/ (I
doubt, as then the build would actually succeed) or actually the pkg-config 
from your
distribution is wrong.

In case the path is wrong in xulrunner-js.pc, you can override it for configure 
with

mozjs_CFLAGS="-DXP_UNIX -DJS_THREADSAFE -I/opt/gnome2/include/nspr
-I/usr/include/xulrunner-1.9.0.4/js" ./configure; make

Original comment by dominiqu...@gmail.com on 14 Dec 2008 at 10:25

GoogleCodeExporter commented 9 years ago
hmm in the configure run, this looks odd

checking for mozjs... no
checking for mozjs... no
checking for mozjs... yes

nazgul@rivendell:~$ pkg-config --cflags xulrunner-js
Package xulrunner-js was not found in the pkg-config search path.
Perhaps you should add the directory containing `xulrunner-js.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xulrunner-js' found

I'll investigate tomorrow

Original comment by christia...@gmail.com on 14 Dec 2008 at 11:28

GoogleCodeExporter commented 9 years ago
Thanks Cristian,

There are several ways on how we detect mozjs Seems at least one of them is 
broken :(

Question: could you try with the svn snapshot? I'm not certain, but I think 
there
were some changes in the configure script since the 0.2.3 release.

Original comment by dominiqu...@gmail.com on 15 Dec 2008 at 9:00

GoogleCodeExporter commented 9 years ago
Tracked a bit more down for you:
PKG_CHECK_MODULES(mozjs, xulrunner-js, have_mozjs=yes,
                [PKG_CHECK_MODULES(mozjs, firefox-js, have_mozjs=yes,
                [PKG_CHECK_MODULES(mozjs, mozilla-js, have_mozjs=yes, have_mozjs=no)])])

So, we have three checks, all using pkg-config:
pkg-config --cflags xulrunner-js
pkg-config --cflags firefox-js
pkg-config --cflags mozilla-js

From my guess I would say the 3rd one is the one your system replies to.
Can you chck that please?

Original comment by dominiqu...@gmail.com on 15 Dec 2008 at 9:57

GoogleCodeExporter commented 9 years ago
as you predicted

nazgul@rivendell:~$ pkg-config --cflags xulrunner-js
Package xulrunner-js was not found in the pkg-config search path.
Perhaps you should add the directory containing `xulrunner-js.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xulrunner-js' found
nazgul@rivendell:~$ pkg-config --cflags firefox-js
Package firefox-js was not found in the pkg-config search path.
Perhaps you should add the directory containing `firefox-js.pc'
to the PKG_CONFIG_PATH environment variable
No package 'firefox-js' found
nazgul@rivendell:~$ pkg-config --cflags mozilla-js
-DXP_UNIX -DJS_THREADSAFE -I/usr/include/xulrunner-1.9.0.4/stable 
-I/usr/include/
nspr 

hmm actually theres not even a single mozilla* package installed on my system

I see exactly the same behaviour for the svn version

could this be a packaging problem? the header file seems to be missing

nazgul@rivendell:/svn/libproxy-read-only$ cat /usr/lib/pkgconfig/mozilla-js.pc 
prefix=/usr
sdkdir=/usr/lib/xulrunner-devel-1.9.0.4
includedir=/usr/include/xulrunner-1.9.0.4

Name: JavaScript
Description: The Mozilla JavaScript Library
Version: 1.9.0.4
Requires: nspr >= 3.12.0
Libs: -L${sdkdir}/lib -lmozjs
Cflags: -I${includedir}/stable -DXP_UNIX -DJS_THREADSAFE

nazgul@rivendell:/svn/libproxy-read-only$ ls 
/usr/include/xulrunner-1.9.0.4/stable/
js*

nazgul@rivendell:/svn/libproxy-read-only$ ls /usr/lib/xulrunner-devel-1.9.0.4/
include/jsapi*
/usr/lib/xulrunner-devel-1.9.0.4/include/jsapi.h

Original comment by christia...@gmail.com on 15 Dec 2008 at 7:51

GoogleCodeExporter commented 9 years ago
Christian,

To me (well, that does not mean much) it looks like a packaging bug.
Can you find out which package installed mozilla-js ? This should for sure be
installed with the other header files.

The location of jsapi.h which you find in 
/usr/lib/xulrunner-devel-1.9.0.4/include is
first of al 'bad practice' (/usr/lib is arch dependent folder typically, include
files don't belong there) and secondly it's not what is written in the .pc 
file. 

According to this file, the jsapi.h file HAS TO reside in ${includedir}/stable,
wheras includedir=/usr/include/xulrunner-1.9.0.4

I'd suggest raising this with your distro packager.

As a workaround, you can use the command line posted earlier:
mozjs_CFLAGS="-I/usr/lib/xulrunner-devel-1.9.0.4/include -DXP_UNIX 
-DJS_THREADSAFE"
./configure; make

Unfortunately without any guarantee that not something else will be failing.

Original comment by dominiqu...@gmail.com on 15 Dec 2008 at 8:51

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Some links to keep track off:
- http://paste.ubuntu.com/85795/
- http://paste.ubuntu.com/85797/
- http://paste.ubuntu.com/85798/

Ubuntu devs suggest to create a glue between libproxy and mozjs in order to 
avoid
this situation.

Original comment by dominiqu...@gmail.com on 15 Dec 2008 at 10:48

GoogleCodeExporter commented 9 years ago
You need to build against libmozjs0.  Install libmozjs-dev.  When you do this
pkg-config --cflags xulrunner-js will work properly, so build will succeed.  
This is
tested and working on all Ubuntus since 7.10 (including Jaunty).

Original comment by npmccallum@gmail.com on 17 Jan 2009 at 9:08

GoogleCodeExporter commented 9 years ago
Issue 34 has been merged into this issue.

Original comment by dominiqu...@gmail.com on 25 Feb 2009 at 7:22

GoogleCodeExporter commented 9 years ago
I'm using gentoo, and I had the same problem.

In my case I had to modify /usr/lib64/pkgconfig/mozilla-js.pc
so that it pointed to
/usr/include/xulrunner-1.9/unstable
rather than
/usr/include/xulrunner-1.9/stable

so either the xulrunner version in question (1.9.0.7) is bugged on gentoo, or 
the
jsapi.h for some reason got shifted to unstable...

I'm afraid it may be the same in this case...

Original comment by karol.sz...@gmail.com on 19 Mar 2009 at 9:50

GoogleCodeExporter commented 9 years ago
Karol Szumski

I suggest you raise this with the mozilla package of your distribution. The 
point of
the .pc files is to be able to rely on them. But this requires the packager to 
work
properly and deliver accurate information.

Nothing we can change from our side (without ugly hacks for broken distro 
detection).

Original comment by dominiqu...@gmail.com on 21 Mar 2009 at 10:36