Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

couch_js doesn't build on centos 5.6 #82

Open
benoitc opened this issue Nov 22, 2011 · 6 comments
Open

couch_js doesn't build on centos 5.6 #82

benoitc opened this issue Nov 22, 2011 · 6 comments

Comments

@benoitc
Copy link
Contributor

benoitc commented Nov 22, 2011

When you try to build couch_js on this platform you get this error :

==> couchjs (compile)
scons: Reading SConscript files ...
Checking for C library m... yes
Checking for C library pthread... yes
Checking for C library curl... yes
Checking for C library nspr4... yes
Checking for C header file mozjs/jsapi.h... no
Checking for C header file js/jsapi.h... no
Checking for C header file jsapi.h... yes
Checking for C library mozjs185-1.0... no
Checking for C library mozjs... no
Checking for C library js... yes
Checking whether JS_NewCompartmentAndGlobalObject is declared... no
Checking whether JS_ThrowStopIteration is declared... no
Checking whether JS_GetStringCharsAndLength is declared... no
Checking for C type JSScript*... yes
scons: done reading SConscript files.
scons: Building targets ...
scons: Configure: creating build/config.h
c++ -o build/main.o -c -g -O2 -DXP_UNIX build/main.c
In file included from build/sm170.c:19,
                 from build/main.c:20:
build/utf8.h:19:7: warning: no newline at end of file
c++ -o build/http.o -c -g -O2 -DXP_UNIX build/http.c
In file included from build/http.c:18:
build/utf8.h:19:7: warning: no newline at end of file
build/http.c: In function 'JSBool go(JSContext*, JSObject*, HTTPData*, char*, size_t)':
build/http.c:394: error: 'CURLOPT_SEEKFUNCTION' was not declared in this scope
build/http.c:395: error: 'curl_seek_callback' was not declared in this scope
build/http.c:440: error: 'CURLOPT_SEEKDATA' was not declared in this scope
scons: *** [build/http.o] Error 1
scons: building terminated because of errors.
@benoitc
Copy link
Contributor Author

benoitc commented Nov 22, 2011

centos 5.6 only provides curl 7.15 and CURLOPT_SEEKFUNCTION have been added in 7.18. Followin patch fix this:

--- a/couchjs/c_src/SConscript
+++ b/couchjs/c_src/SConscript
@@ -51,9 +51,13 @@ if not env.GetOption('clean'):

     require_lib('m')
     require_lib('pthread')
-    require_lib('curl')
     require_lib('nspr4')

+    ## check curl
+    if conf.CheckHeader('curl/curl.h'):
+        if conf.CheckDeclaration('CURLOPT_SEEKFUNCTION', 'curl/curl.h'):
+            conf.Define('WITH_CURL', 1)
+    
     ## check for SpiderMonkey development header
     if conf.CheckHeader('mozjs/jsapi.h'):
         jsapi = 'mozjs/jsapi.h'

@davisp
Copy link
Contributor

davisp commented Nov 22, 2011

lgtm

@kocolosk
Copy link
Contributor

LGTM as well

@davisp
Copy link
Contributor

davisp commented Nov 22, 2011

Hrm. But its not. Hacking together a fix. We've needed this for awhile anyway.

@davisp
Copy link
Contributor

davisp commented Nov 22, 2011

@benoitc Can you try this version?

1cd3eb1

@benoitc
Copy link
Contributor Author

benoitc commented Nov 22, 2011

works for me .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants