Permalink
Browse files

Merge branch 'optional-nm' into trunk

* optional-nm:
  Make +native compilation of mochijson2.erl a ./configure option.

git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1039679 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
janl committed Nov 27, 2010
1 parent 444919f commit 90f9f46aca66f0d561bae408ecf878680d1bd281
Showing with 12 additions and 1 deletion.
  1. +7 −0 configure.ac
  2. +5 −1 src/mochiweb/Makefile.am
View
@@ -284,6 +284,7 @@ fi
use_init=yes
use_launchd=yes
+native_mochijson_enabled=no
AC_ARG_ENABLE([init], [AC_HELP_STRING([--disable-init],
[don't install init script where applicable])], [
@@ -295,6 +296,11 @@ AC_ARG_ENABLE([launchd], [AC_HELP_STRING([--disable-launchd],
use_launchd=$enableval
], [])
+AC_ARG_ENABLE([native-mochijson], [AC_HELP_STRING([--enable-native-mochijson],
+ [compile mochijson to native code (EXPERIMENTAL)])], [
+ native_mochijson_enabled=$enableval
+], [])
+
init_enabled=false
launchd_enabled=false
@@ -344,6 +350,7 @@ fi
AM_CONDITIONAL([INIT], [test x${init_enabled} = xtrue])
AM_CONDITIONAL([LAUNCHD], [test x${launchd_enabled} = xtrue])
AM_CONDITIONAL([HELP2MAN], [test x${help2man_enabled} = xtrue])
+AM_CONDITIONAL([USE_NATIVE_MOCHIJSON], [test x${native_mochijson_enabled} = xyes])
AC_SUBST([package_author_name], ["LOCAL_PACKAGE_AUTHOR_NAME"])
AC_SUBST([package_author_address], ["LOCAL_PACKAGE_AUTHOR_ADDRESS"])
View
@@ -10,6 +10,10 @@
## License for the specific language governing permissions and limitations under
## the License.
+if USE_NATIVE_MOCHIJSON
+MOCHIJSON_ERLC_FLAGS=+native
+endif
+
mochiwebebindir = $(localerlanglibdir)/mochiweb-7c2bc2/ebin
mochiweb_file_collection = \
@@ -98,7 +102,7 @@ CLEANFILES = \
cp $< $@
mochijson2.beam: mochijson2.erl
- $(ERLC) $(ERLC_FLAGS) +native $<
+ $(ERLC) $(ERLC_FLAGS) $(MOCHIJSON_ERLC_FLAGS) $<
%.beam: %.erl
$(ERLC) $(ERLC_FLAGS) $<

0 comments on commit 90f9f46

Please sign in to comment.