Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2AB277FE5 for ; Sun, 30 Oct 2011 16:54:50 +0000 (UTC) Received: (qmail 62940 invoked by uid 500); 30 Oct 2011 16:54:50 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 62900 invoked by uid 500); 30 Oct 2011 16:54:50 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 62893 invoked by uid 99); 30 Oct 2011 16:54:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Oct 2011 16:54:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Oct 2011 16:54:47 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 50BE054879; Sun, 30 Oct 2011 16:54:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jan@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: Try to determine the location of erl_driver.h at configure time Message-Id: <20111030165426.50BE054879@tyr.zones.apache.org> Date: Sun, 30 Oct 2011 16:54:26 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Updated Branches: refs/heads/1.2.x 6e077c302 -> 13136475c Try to determine the location of erl_driver.h at configure time Use the existence of erl in path to try to figure out where the file should be located unless the user specified it. Patch by Trond Norbye. Closes COUCHDB-162 Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/13136475 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/13136475 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/13136475 Branch: refs/heads/1.2.x Commit: 13136475cc0a533e454b274f579c4324ee7b0fc2 Parents: 6e077c3 Author: Trond Norbye Authored: Wed Sep 21 09:13:02 2011 +0200 Committer: Jan Lehnardt Committed: Sun Oct 30 17:54:21 2011 +0100 ---------------------------------------------------------------------- configure.ac | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/13136475/configure.ac ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index d68106f..697a37f 100644 --- a/configure.ac +++ b/configure.ac @@ -112,14 +112,28 @@ else AC_MSG_RESULT([no]) fi +AC_PATH_PROG([ERL], [erl]) +AS_IF([test x${ERL} = x], [ + AC_MSG_ERROR([Could not find the `erl' executable. Is Erlang installed?]) + ]) + AC_ARG_WITH([erlang], [AC_HELP_STRING([--with-erlang=PATH], [set PATH to the Erlang include directory])], [ ERLANG_FLAGS="-I$withval" ], [ - ERLANG_FLAGS="-I${libdir}/erlang/usr/include" - ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/lib/erlang/usr/include" - ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/local/lib/erlang/usr/include" - ERLANG_FLAGS="$ERLANG_FLAGS -I/opt/local/lib/erlang/usr/include" + realerl=`readlink -f $ERL 2>/dev/null` + AS_IF([test $? -eq 0], [ + erlbase=`dirname $realerl` + erlbase=`dirname $erlbase` + ERLANG_FLAGS="-I${erlbase}/usr/include" + ], [ + # Failed to figure out where erl is installed.. + # try to add some default directories to search + ERLANG_FLAGS="-I${libdir}/erlang/usr/include" + ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/lib/erlang/usr/include" + ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/local/lib/erlang/usr/include" + ERLANG_FLAGS="$ERLANG_FLAGS -I/opt/local/lib/erlang/usr/include" + ]) ]) AC_SUBST(ERLANG_FLAGS) @@ -356,11 +370,6 @@ case "$(uname -s)" in ;; esac -AC_PATH_PROG([ERL], [erl]) - -if test x${ERL} = x; then - AC_MSG_ERROR([Could not find the `erl' executable. Is Erlang installed?]) -fi erlang_version_error="The installed Erlang version is less than 5.6.5 (R12B05)."