summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac10
-rw-r--r--src/couchdb/Makefile.am2
2 files changed, 7 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index a281a868..ddaff741 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,10 +103,10 @@ esac
AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE])
-AC_CHECK_LIB([mozjs], [JS_NewContext], [], [
- AC_CHECK_LIB([js], [JS_NewContext], [], [
- AC_CHECK_LIB([js3250], [JS_NewContext], [], [
- AC_CHECK_LIB([js32], [JS_NewContext], [], [
+AC_CHECK_LIB([mozjs], [JS_NewContext], [JSLIB=-lmozjs], [
+ AC_CHECK_LIB([js], [JS_NewContext], [JSLIB=-ljs], [
+ AC_CHECK_LIB([js3250], [JS_NewContext], [JSLIB=-ljs3250], [
+ AC_CHECK_LIB([js32], [JS_NewContext], [JSLIB=-ljs32], [
AC_MSG_ERROR([Could not find the js library.
Is the Mozilla SpiderMonkey library installed?])])])])])
@@ -122,6 +122,8 @@ AC_CHECK_HEADER([jsapi.h], [], [
Are the Mozilla SpiderMonkey headers installed?])
])])
+AC_SUBST(JSLIB)
+
AC_LANG_PUSH(C)
OLD_CFLAGS="$CFLAGS"
CFLAGS="-Werror-implicit-function-declaration"
diff --git a/src/couchdb/Makefile.am b/src/couchdb/Makefile.am
index 71b17f4a..017dc169 100644
--- a/src/couchdb/Makefile.am
+++ b/src/couchdb/Makefile.am
@@ -36,7 +36,7 @@ locallibbin_PROGRAMS = couchjs
couchjs_SOURCES = couch_js.c curlhelper.c curlhelper.h
couchjs_LDFLAGS = $(CURL_LDFLAGS)
couchjs_CFLAGS = $(CURL_CFLAGS)
-couchjs_LDADD = $(CURL_LDFLAGS)
+couchjs_LDADD = $(CURL_LDFLAGS) @JSLIB@
if WINDOWS
couch_erl_driver_la_LDFLAGS += -no-undefined