diff --git a/bin/Makefile.am b/bin/Makefile.am index c1913d0274e..65f9ab58c55 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -95,6 +95,7 @@ couch-config: couch-config.tpl -e "s|%package_author_name%|@package_author_name@|g" \ -e "s|%package_name%|@package_name@|g" \ -e "s|%version%|@version@|g" \ + -e "s|%erlangversion%|@erlangversion@|g" \ -e "s|%couchdb_command_name%|$(couchdb_command_name)|g" > \ $@ < $< chmod +x $@ @@ -118,6 +119,7 @@ couch-config_dev: couch-config.tpl -e "s|%package_author_name%|@package_author_name@|g" \ -e "s|%package_name%|@package_name@|g" \ -e "s|%version%|@version@|g" \ + -e "s|%erlangversion%|@erlangversion@|g" \ -e "s|%couchdb_command_name%|$(abs_top_builddir)/utils/run|g" > \ $@ < $< chmod +x $@ diff --git a/bin/couch-config.tpl.in b/bin/couch-config.tpl.in index 22a886dfa7d..7db9b2a1a67 100644 --- a/bin/couch-config.tpl.in +++ b/bin/couch-config.tpl.in @@ -22,6 +22,7 @@ viewdir="%localstatelibdir%" confdir="%localconfdir%" urifile="%localstaterundir%/couch.uri" logdir="%localstatelogdir%" +erlangversion="%erlangversion%" version () { cat << EOF @@ -60,6 +61,7 @@ Options: --log-dir log directory --uri-file daemon sockets file --couch-version version of Apache CouchDB + --erlang-version version of Erlang that CouchDB was built with --version version of $basename --help Print usage @@ -108,6 +110,9 @@ do --couch-version) echo $couchversion ;; + --erlang-version) + echo $erlangversion + ;; --version) version exit 0 diff --git a/bin/erlang-version.escript b/bin/erlang-version.escript new file mode 100644 index 00000000000..66aae1c4165 --- /dev/null +++ b/bin/erlang-version.escript @@ -0,0 +1,3 @@ + +main(_) -> + io:format("~s~n", [erlang:system_info(otp_release)]). diff --git a/configure.ac b/configure.ac index bb3ef38326b..9b980fb6f57 100644 --- a/configure.ac +++ b/configure.ac @@ -123,6 +123,7 @@ else fi AC_PATH_PROG([ERL], [erl]) +AC_PATH_PROG([ESCRIPT], [escript]) AS_IF([test x${ERL} = x], [ AC_MSG_ERROR([Could not find the `erl' executable. Is Erlang installed?]) @@ -650,6 +651,9 @@ else fi fi +ERL_VERSION_COMMAND="${ESCRIPT} bin/erlang-version.escript" +erlangversion=`${ERL_VERSION_COMMAND}` + AC_ARG_VAR([ERL], [path to the `erl' executable]) AC_ARG_VAR([ERLC], [path to the `erlc' executable]) @@ -688,6 +692,8 @@ AC_SUBST([locallibdir], [${libdir}/${package_identifier}]) AC_SUBST([localstatelibdir], [${localstatedir}/lib/${package_identifier}]) AC_SUBST([localstatelogdir], [${localstatedir}/log/${package_identifier}]) AC_SUBST([localstaterundir], [${localstatedir}/run/${package_identifier}]) +AC_SUBST([erlangversion], [${erlangversion}]) + # On Windows we install directly into our erlang distribution. if test x${IS_WINDOWS} = xTRUE; then diff --git a/license.skip b/license.skip index fd7b0402826..f214b0f18b1 100644 --- a/license.skip +++ b/license.skip @@ -24,6 +24,7 @@ ^bin/Makefile.in ^bin/couchdb.1 ^bin/couchjs.1 +^bin/erlang-version.escript ^build-aux/.* ^config..* ^configure