Skip to content

Commit

Permalink
Merge branch 'optional-nm' into trunk
Browse files Browse the repository at this point in the history
* 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 90f9f46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions configure.ac
Expand Up @@ -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])], [
Expand All @@ -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

Expand Down Expand Up @@ -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"])
Expand Down
6 changes: 5 additions & 1 deletion src/mochiweb/Makefile.am
Expand Up @@ -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 = \
Expand Down Expand Up @@ -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.