Will not compile

Help
Pigeoneye
2013-02-03
2013-05-30
  • Pigeoneye
    Pigeoneye
    2013-02-03

    I tried compiling with 
    -with-js-h=/usr/local/include/js  -with-js-libs=/usr/local/lib

    and I get the following when the configure stops on error;
    checking for JS_NewObject in -ljs… no
    checking for JS_NewObject in -lsmjs… no
    checking for JS_NewObject in -lmozjs… no
    configure: error: Spidermonkey not found in requested location /usr/local/lib

    Now I built this from source and installed it. The header files are all found but even though /usr/local/lib/libmozjs185-1.0.a exists it is not found. The config.log shows this:

    configure:23788: checking for JS_NewObject in -lmozjs
    configure:23823: g++ -o conftest -g -O2 -DXP_UNIX  -DXP_UNIX -L/usr/local/lib   -lrt -lmozjs  conftest.cpp -lmozjs   >&5
    /usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: cannot find -lmozjs
    /usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: cannot find -lmozjs
    collect2: error: ld returned 1 exit status

    It is also not finding ffmpeg which is also installed and I have been using quite a lot lately.

    Any help appreciated

     
  • Jin
    Jin
    2013-02-03

    Are you using the latest git sources or did you check out the older svn tree?

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    I am using the sources from the mediatomb webpage download link version  0.12.1

     
  • Jin
    Jin
    2013-02-03

    This release is too old, it won't work. Try the latest code:

    git clone git://mediatomb.git.sourceforge.net/gitroot/mediatomb/mediatomb

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    I'll give it a shot, thanks.

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    This contains no autogen.sh or configure script, how do you build it?

     
  • Jin
    Jin
    2013-02-03

    autoreconf -i

    :P

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    Ok 20 years with linux and I have never seen that one.   :)
    Thanks

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    cool, that fixed everything. Thanks a load

     
  • Jin
    Jin
    2013-02-03

    Hmm.. that's been around for quite a while actually, it's default autotools stuff :)

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    just never had an occasion to need it til now.   :)

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    Good Grief, The configure script found everything but the make died with:

    /bin/ld: cannot find -lmozjs185

     
  • Jin
    Jin
    2013-02-03

    Well, seems not much has changed in the last 3 years - spidermonkey is always "somewhere" on various distros.

    Which distro do you use? What does pkg-config libjs -libs give you? What does pkg-config mozjs185 -libs give you?

    Basically, check your pkg-config configuration for spidermonkey, if it returns wrong or broken flags - you'll be in trouble, just as above

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    pkg-config libjs -libs
    Package libjs was not found in the pkg-config search path.

    pkg-config mozjs185 -libs
    -L/usr/local/lib -lmozjs185 -lplds4 -lplc4 -lnspr4

     
  • Jin
    Jin
    2013-02-03

    is libmozjs185.* present in /usr/local/lib?

    What distro do you use, I see you installed JS yourself (otherwise it would not be in local?)

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    Yes it's there
    /usr/local/lib/libmozjs185-1.0.a
    /usr/local/lib/libmozjs185.so.1.0.0

    Slackware

     
  • Jin
    Jin
    2013-02-03

    run configure with -disable-silent-rules and please paste me the last lines when it fails. I'd like to see if the flags are correct.

    But actually, when I think about it, I guess you are missing some symlinks there?
    libmozjs185.so should point to libmozjs185.so.1.0 and the latter should point to the actual libmozjs185.so.1.0.0

    By the way, those symlinks do get created when you compile and make install spidermonkey, so I wonder why they are missing on your system?

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    they aren't missing I just didn't paste them

     
  • Pigeoneye
    Pigeoneye
    2013-02-03

    BTW I decided to build it without the js option, I don't need that part anyway. All I'm using it for is to stream movies from my computer and it's working fine. But here's the last lines anyway.
    Thanks for all your help

    g++ -I../src -I../tombupnp/ixml/inc -I../tombupnp/threadutil/inc -I../tombupnp/upnp/inc -I..  -I/usr/include/mysql -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1 -I/usr/local/include/js -I/usr/include/nspr   -I/usr/include/taglib       -pthread  -I/usr/local/include   -I/usr/local/include        -g -O2  -lmagic  -o mediatomb mediatomb-main.o libmediatomb.a ../tombupnp/build/libtombupnp.a               -lsqlite3 -ldl   -L/usr/lib -lmysqlclient_r -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -L/usr/lib -ltag  -L/usr/local/lib -lmozjs185 -lplds4 -lplc4 -lnspr4   -lmagic   -lexif  -lz   -lrt  -pthread  -Wl,-rpath,/usr/lib -pthread -L/usr/local/lib -lavformat -lavcodec -ldl -lasound -lSDL -lpthread -lbz2 -lz -lrt -lavutil -lm   -L/usr/local/lib -lavutil -lm    -lexpat      -lcurl  
    /usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: cannot find -lmozjs185

     
  • Jin
    Jin
    2013-02-03

    Thanks for the paste, hmm.. the flags are there and they are correct:  -L/usr/local/lib -lmozjs185

    Can't say why it does not work for you… maybe some ldconfig problem? It must be related to your system, were you able to build anything else that requires spidermonkey?