From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: A better autogen.sh [was Re: Still unable to build trunk] Date: Mon, 07 Mar 2011 23:22:15 -0500 Message-ID: References: <87y66fv2d3.fsf@stupidchicken.com> <4D388F7F.20708@swipnet.se> <87r5c7jk5m.fsf@stupidchicken.com> <4D39EF9C.1050804@cs.ucla.edu> <4D3A8666.4070609@cs.ucla.edu> <877hdvd49f.fsf@meyering.net> <83mxmrzhb6.fsf@gnu.org> <4D3C9C5B.8050303@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1299558253 31144 80.91.229.12 (8 Mar 2011 04:24:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 Mar 2011 04:24:13 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 08 05:24:08 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PwoRd-0004xA-4O for ged-emacs-devel@m.gmane.org; Tue, 08 Mar 2011 05:24:07 +0100 Original-Received: from localhost ([127.0.0.1]:48438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwoRS-0006jG-Ss for ged-emacs-devel@m.gmane.org; Mon, 07 Mar 2011 23:22:38 -0500 Original-Received: from [140.186.70.92] (port=59955 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwoRL-0006iF-25 for emacs-devel@gnu.org; Mon, 07 Mar 2011 23:22:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwoR6-0004d5-QW for emacs-devel@gnu.org; Mon, 07 Mar 2011 23:22:19 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:44293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwoR6-0004d1-MV for emacs-devel@gnu.org; Mon, 07 Mar 2011 23:22:16 -0500 Original-Received: from localhost ([127.0.0.1]:39794) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwoR6-0000gs-27; Mon, 07 Mar 2011 23:22:16 -0500 X-Spook: jihad Blowfish Ansar al-Islam BROMURE South Africa Tony X-Ran: v$'-kvnIa3/(Oj!t&Re$f[|nCFr~rrzj`.|x-:Zh,P]B:E|6N'T1UiT0b^1q6_Hr9CxN}^ X-Hue: yellow X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:136868 Archived-At: Stefan Monnier wrote: > But if people can arrange Emacs's build so that it doesn't require a > pre-build configure and yet is still easy to install under something > like Debian stable, I could change my mind. It might even be a good > change if it can help users figure out which packages need to be > installed (autotools, header files, ...). I'm not entirely sure what you want, but here is an attempt at a hand-holding autogen.sh. Tested on RHEL4 and 5, Debian testing, and some old version of Solaris. I would also update INSTALL.BZR. The idea is, people would run autogen.sh the first time they checkout from bzr. Subsequently, I assume the Makefiles are already correctly set-up such that eg configure will be recreated if necessary. This might require enable-maintainer-mode to be on by default in bzr checkouts, and disabled in release tarfiles; I don't know. Obviously there would be some teething problems in the transition period when configure disappears from the repo. #!/bin/sh ### autogen.sh - tool to help build Emacs from a bzr checkout ## Copyright (C) 2011 Free Software Foundation, Inc. ## This file is part of GNU Emacs. ## GNU Emacs is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## GNU Emacs is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## You should have received a copy of the GNU General Public License ## along with GNU Emacs. If not, see . ### Commentary: ## The Emacs bzr repository does not include the configure script ## (and associated helpers). The first time you fetch Emacs from bzr, ## run this script to generate the necessary files. ## For more details, see the file INSTALL.BZR. ### Code: ## Tools we need: progs="autoconf automake" ## Minimum versions we need: autoconf_min=`sed -n 's/^ *AC_PREREQ(\([0-9\.]*\)).*/\1/p' configure.in` ## FIXME how to determine this from the sources? automake_min=1.11 ## $1 = program, eg "autoconf". ## Echo the version string, eg "2.59". ## FIXME does not handle things like "1.4a", but AFAIK those are ## all old versions, so it is OK to fail there. ## Also note that we do not handle micro versions. get_version () { $1 --version 2>&1 | sed -n '1 s/.* \([1-9][0-9\.]*\).*/\1/p' } ## $1 = version string, eg "2.59" ## Echo the major version, eg "2". major_version () { echo $1 | sed -e 's/\([0-9][0-9]*\)\..*/\1/' } ## $1 = version string, eg "2.59" ## Echo the minor version, eg "59". minor_version () { echo $1 | sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/' } ## $1 = program ## $2 = minimum version. ## Return 0 if program is present with version >= minumum version. ## Return 1 if program is missing. ## Return 2 if program is present but too old. ## Return 3 for unexpected error (eg failed to parse version). check_version () { have_version=`get_version $1` [ x"$have_version" = x ] && return 1 have_maj=`major_version $have_version` need_maj=`major_version $2` [ x"$have_maj" != x ] && [ x"$need_maj" != x ] || return 3 [ $have_maj -gt $need_maj ] && return 0 [ $have_maj -lt $need_maj ] && return 2 have_min=`minor_version $have_version` need_min=`minor_version $2` [ x"$have_min" != x ] && [ x"$need_min" != x ] || return 3 [ $have_min -ge $need_min ] && return 0 return 2 } cat <