Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more build tweaks for windows.

  • Loading branch information...
commit 1f257eacacd1eb140259155e2871669c85acf024 1 parent 5fad96a
@mhammond mhammond authored
Showing with 26 additions and 12 deletions.
  1. +12 −7 configure.ac
  2. +14 −5 src/couchdb/Makefile.am
View
19 configure.ac
@@ -86,7 +86,11 @@ case "$(uname -s)" in
FLAGS="$LIB_FLAGS $ERLANG_FLAGS $JS_FLAGS -DXP_WIN $FLAGS"
CPPFLAGS="$FLAGS $CPPFLAGS"
LDFLAGS="$FLAGS $LDFLAGS"
- IS_WINDOWS="SADLY"
+ IS_WINDOWS="TRUE"
+ # The erlang cc.sh/ld.sh scripts will convert a -O option
+ # into the same optimization flags erlang itself uses.
+ CFLAGS="-O2"
+ LTCFLAGS="$CFLAGS"
;;
*)
# XP_UNIX required for jsapi.h and has been tested to work on Linux and Darwin.
@@ -97,14 +101,15 @@ case "$(uname -s)" in
;;
esac
-AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xSADLY])
+AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE])
AC_CHECK_LIB([js], [JS_NewContext], [], [
AC_CHECK_LIB([mozjs], [JS_NewContext], [], [
AC_CHECK_LIB([js3250], [JS_NewContext], [], [
- AC_MSG_ERROR([Could not find the js library.
+ AC_CHECK_LIB([js32], [JS_NewContext], [], [
+ AC_MSG_ERROR([Could not find the js library.
-Is the Mozilla SpiderMonkey library installed?])])])])
+Is the Mozilla SpiderMonkey library installed?])])])])])
AC_CHECK_HEADER([jsapi.h], [], [
AC_MSG_ERROR([Could not find the jsapi header.
@@ -280,7 +285,7 @@ AC_SUBST([localstatelogdir], [${localstatedir}/log/${package_identifier}])
AC_SUBST([localstaterundir], [${localstatedir}/run/${package_identifier}])
# On Windows we install directly into our erlang distribution.
-if test x${IS_WINDOWS} = xSADLY; then
+if test x${IS_WINDOWS} = xTRUE; then
AC_SUBST([locallibbindir], [${prefix}/bin])
AC_SUBST([localerlangbindir], [${libdir}])
AC_SUBST([localerlanglibdir], [${libdir}])
@@ -326,9 +331,9 @@ AC_OUTPUT
# expects GNU style lib names). I can't work out how to configure this
# option sanely, so we pass the script through sed to modify it.
# Also, the erlang cc.sh script doesn't cope well with the '-link' command
-# line libtool provides.
+# line option libtool provides.
# PLEASE, someone help put this out of its misery!!
-if test x${IS_WINDOWS} = xSADLY; then
+if test x${IS_WINDOWS} = xTRUE; then
sed -e 's,libname_spec="lib\\$name",libname_spec="\\\$name",' \
-e 's,-link,,' \
< libtool > libtool.tmp
View
19 src/couchdb/Makefile.am
@@ -187,13 +187,22 @@ couch.app: couch.app.tpl
$(ERLC) $(ERLC_FLAGS) ${TEST} $<;
install-data-hook:
- if test -f "$(DESTDIR)/$(couchprivlibdir)/couch_erl_driver"; then \
- rm -f "$(DESTDIR)/$(couchprivlibdir)/couch_erl_driver.so"; \
- cd "$(DESTDIR)/$(couchprivlibdir)" && \
+ if test -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver"; then \
+ rm -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver.so"; \
+ cd "$(DESTDIR)$(couchprivlibdir)" && \
$(LN_S) couch_erl_driver couch_erl_driver.so; \
fi
+if WINDOWS
+# libtool and automake have defeated markh. For each of our executables
+# we end up with 2 copies - one directly in the 'target' folder (eg, 'priv')
+# and another - the correct one - in .libs. The former doesn't work but is
+# what gets installed for 'couchspawnkillable' - but the correct one for
+# couchjs.exe *does* get copied. *shrug* So just clobber it with the
+# correct one here...
+ $(INSTALL) priv/.libs/couchspawnkillable.exe "$(DESTDIR)$(couchprivdir)/."
+endif
uninstall-local:
- if test -f "$(DESTDIR)/$(couchprivlibdir)/couch_erl_driver"; then \
- rm -f "$(DESTDIR)/$(couchprivlibdir)/couch_erl_driver.so"; \
+ if test -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver"; then \
+ rm -f "$(DESTDIR)$(couchprivlibdir)/couch_erl_driver.so"; \
fi
Please sign in to comment.
Something went wrong with that request. Please try again.