(Re)move autotools generated files from the repository.

Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00225.html

* autogen/: New directory, to be excluded from releases.
* autogen/copy_autogen, autogen/update_autogen: New scripts.
* autogen/README: New file.
* autogen/aclocal.m4, autogen/config.in, autogen/configure:
* autogen/Makefile.in: Add auto-updated generated files.

* autogen.sh: No longer a no-op, now it tests for autotools
and runs them as necessary.

* configure.in: Defaule maintainer-mode to on.

* aclocal.m4, configure, lib/Makefile.in: Remove files.

* src/config.in: Remove file.

* INSTALL.BZR, admin/make-tarball.txt: Update instructions.
This commit is contained in:
Glenn Morris 2011-03-20 16:58:23 -07:00
parent 1fe275ee28
commit 66b874939b
13 changed files with 1034 additions and 640 deletions

View file

@ -1,3 +1,15 @@
2011-03-20 Glenn Morris <rgm@gnu.org>
* autogen/: New directory, to be excluded from releases.
* autogen/copy_autogen, autogen/update_autogen: New scripts.
* autogen/README: New file.
* autogen/aclocal.m4, autogen/config.in, autogen/configure:
* autogen/Makefile.in: Add auto-updated generated files.
* autogen.sh: No longer a no-op, now it tests for autotools
and runs them as necessary.
* configure.in: Defaule maintainer-mode to on.
* aclocal.m4, configure, lib/Makefile.in: Remove files.
2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
Update for gnulib.

View file

@ -4,15 +4,30 @@ See the end of the file for license conditions.
Building and Installing Emacs from Bazaar
If this is the first time you go through it, you'll need to configure
before bootstrapping:
Building Emacs from Bazaar requires some tools that are not needed
when building from a release. You will need:
autoconf - at least the version specified near the start of
configure.in (in the AC_PREREQ command).
automake - we recommend at least version 1.11.
makeinfo - not strictly necessary, but highly recommended, so that
you can build the manuals.
The `autogen.sh' script can help you figure out if you have the
necessary tools.
The first time you build, there are a couple of extra steps.
First, generate the `configure' script:
$ ./autogen.sh
(or you can just run `autoreconf -I m4').
You can then configure your build (use `./configure --help' to see
options you can set):
$ ./configure
(Normally there is no need to run `autoconf' etc. If you do need it,
the relevant command is `autoreconf -I m4'. Be aware that this will
likely lead to conflicts next time you update from Bazaar.)
Some of the files that are included in the Emacs tarball, such as
byte-compiled Lisp files, are not stored in Bazaar. Therefore, to
build from Bazaar you must run "make bootstrap" instead of just "make":

View file

@ -28,11 +28,14 @@ For each step, check for possible errors.
refer to a newer release of Emacs. (This is probably needed only
when preparing a major Emacs release, or branching for it.)
5. autoreconf -I m4 --force
5. Edit configure.in so that maintainer-mode is off by default.
(FIXME - need to find a better way of dealing with this).
autoreconf -I m4 --force
make bootstrap
6. Commit configure, src/config.in, etc/AUTHORS, all the files changed
by M-x set-version, and lisp/cus-edit.el (if modified).
6. Commit etc/AUTHORS, all the files changed by M-x set-version, and
lisp/cus-edit.el (if modified).
Copy lisp/loaddefs.el to lisp/ldefs-boot.el and commit lisp/ldefs-boot.el.
For a release, also commit the ChangeLog files in all directories.

View file

@ -1,7 +1,207 @@
#!/bin/sh
### autogen.sh - tool to help build Emacs from a bzr checkout
echo "Please read INSTALL.BZR for instructions on how to build Emacs from Bazaar."
## Copyright (C) 2011 Free Software Foundation, Inc.
# Exit with failure, since people may have generic build scripts that
# try things like "autogen.sh && ./configure && make".
exit 1
## Author: Glenn Morris <rgm@gnu.org>
## 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 <http://www.gnu.org/licenses/>.
### 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 <<EOF
Checking whether you have the necessary tools...
(Read INSTALL.BZR for more details on building Emacs)
EOF
missing=
for prog in $progs; do
eval min=\$${prog}_min
echo "Checking for $prog (need at least version $min)..."
check_version $prog $min
retval=$?
case $retval in
0) stat="ok" ;;
1) stat="missing" ;;
2) stat="too old" ;;
*) stat="unable to check" ;;
esac
echo $stat
if [ $retval -ne 0 ]; then
missing="$missing $prog"
eval ${prog}_why=\""$stat"\"
fi
done
if [ x"$missing" != x ]; then
cat <<EOF
Building Emacs from Bzr requires the following specialized programs:
EOF
for prog in $progs; do
eval min=\$${prog}_min
echo "$prog (minimum version $min)"
done
cat <<EOF
Your system seems to be missing the following tool(s):
EOF
for prog in $missing; do
eval why=\$${prog}_why
echo "$prog ($why)"
done
cat <<EOF
If you think you have the required tools, please add them to your PATH
and re-run this script.
Otherwise, please try installing them.
On systems using rpm and yum, try: "yum install PACKAGE"
On systems using dpkg and apt, try: "apt-get install PACKAGE"
Then re-run this script.
If you do not have permission to do this, or if the version provided
by your system is too old, it is normally straightforward to build
these packages from source. You can find the sources at:
ftp://ftp.gnu.org/gnu/PACKAGE/
Download the package (make sure you get at least the minimum version
listed above), extract it using tar, then run configure, make,
make install. Add the installation directory to your PATH and re-run
this script.
If you know that the required versions are in your PATH, but this
script has made an error, then you can simply run
autoreconf -I m4
instead of this script.
If all else fails, you can try using the pre-built versions of the
generated files by doing:
cd autogen && ./copy_autogen
This is not recommended - see the comments in \`copy_autogen'.
Please report any problems with this script to bug-gnu-emacs@gnu.org .
EOF
exit 1
fi
echo "Your system has the required tools, running autoreconf..."
## Let autoreconf figure out what, if anything, needs doing.
autoreconf -I m4 || exit $?
echo "You can now run \`./configure'."
exit 0
### autogen.sh ends here

14
autogen/README Normal file
View file

@ -0,0 +1,14 @@
This directory contains some pre-built generated files.
Most people do not need to use these files - instead you should
generate them yourself using eg `autogen.sh'.
File: Destination: Created by:
configure ../ autoconf
config.in ../src autoconf * also used by MSDOS bzr build
aclocal.m4 ../ aclocal
Makefile.in ../lib automake
There are also some scripts:
copy_autogen - copy pre-built generated files into place
update_autogen - regenerate generated files (for maintainers)

View file

@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
[m4_warning([this file was generated for autoconf 2.68.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
[m4_warning([this file was generated for autoconf 2.65.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])

View file

@ -1206,9 +1206,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
# define __restrict__
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define to any substitute for sys_siglist. */
#undef sys_siglist

File diff suppressed because it is too large Load diff

20
autogen/copy_autogen Executable file
View file

@ -0,0 +1,20 @@
#!/bin/sh
## Helper script for those building Emacs from bzr without autoconf etc.
## This installs some pre-generated versions of the automatically
## generated files. It is highly recommended to install the necessary
## tools instead of using this. Note that if eg configure.in
## is updated, the next time you run make it will attempt to
## regenerate configure and will fail if you do not have the required
## tools. You will have to run this script again.
if test ! -e config.in; then
echo "You must run this script from the autogen/ directory."
exit 1
fi
cp configure aclocal.m4 ../
cp config.in ../src/
cp Makefile.in ../lib/
echo "You can now run configure"

180
autogen/update_autogen Executable file
View file

@ -0,0 +1,180 @@
#!/bin/bash
### update_autogen - update the generated files in Emacs autogen/ directory
## Copyright (C) 2011 Free Software Foundation, Inc.
## Author: Glenn Morris <rgm@gnu.org>
## 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 <http://www.gnu.org/licenses/>.
### Commentary:
## This is a helper script to update the pre-built generated files in
## the autogen/ directory. This is suitable for running from cron.
## Only Emacs maintainers need use this, so it uses bash features.
### Code:
function die () # write error to stderr and exit
{
[ $# -gt 0 ] && echo "$PN: $@" >&2
exit 1
}
PN=${0##*/} # basename of script
PD=${0%/*}
[ "$PD" = "$0" ] && PD=. # if PATH includes PWD
## This should be the autogen directory.
cd $PD
cd ../
[ -d autogen ] || die "Could not locate autogen directory"
function usage ()
{
cat 1>&2 <<EOF
Usage: ${PN} [-f] [-c] [-q]
Update the generated files in the Emacs autogen/ directory.
Options:
-f: force an update even if the source files are locally modified.
-c: if the update succeeds and the generated files are modified,
commit them (caution).
-q: be quiet; only give error messages, not status messages.
EOF
exit 1
}
## Defaults.
force=
commit=
quiet=
## Parameters.
sources="configure.in lib/Makefile.am"
genfiles="configure aclocal.m4 src/config.in lib/Makefile.in"
for g in $genfiles; do
basegen="$basegen ${g##*/}"
done
[ "$basegen" ] || die "internal error"
tempfile=/tmp/$PN.$$
trap "rm -f $tempfile 2> /dev/null" EXIT
while getopts ":hcfq" option ; do
case $option in
(h) usage ;;
(c) commit=1 ;;
(f) force=1 ;;
(q) quiet=1 ;;
(\?) die "Bad option -$OPTARG" ;;
(:) die "Option -$OPTARG requires an argument" ;;
(*) die "getopts error" ;;
esac
done
shift $(( --OPTIND ))
OPTIND=1
[ $# -eq 0 ] || die "Wrong number of arguments"
function msg ()
{
[ "$quiet" ] && return 0
echo "$@"
} # function msg
msg "Running bzr status..."
bzr status -S $sources >| $tempfile || die "bzr status error for sources"
while read stat file; do
case $stat in
M)
msg "Locally modified: $file"
[ "$force" ] || die "There are local modifications"
;;
*) die "Unexpected status ($stat) for $file" ;;
esac
done < $tempfile
msg "Running autoreconf..."
autoreconf -I m4 || die "autoreconf error"
cp $genfiles autogen/
cd autogen
bzr status -S $basegen >| $tempfile || \
die "bzr status error for generated files"
modified=
while read stat file; do
[ "$stat" != "M" ] && die "Unexpected status ($stat) for generated $file"
modified="$modified $file"
done < $tempfile
[ "$modified" ] || {
msg "No files were modified"
exit 0
}
msg "Modified file(s): $modified"
[ "$commit" ] || exit 0
msg "Committing..."
## bzr status output is annoyingly always relative to top-level, not PWD.
cd ../
bzr commit -m "Auto-commit of generated files." $modified || \
die "bzr commit error"
msg "Committed files: $modified"
exit
### update_autogen ends here

View file

@ -229,7 +229,7 @@ AC_ARG_ENABLE(maintainer-mode,
[enable make rules and dependencies not useful (and sometimes
confusing) to the casual installer])],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
USE_MAINTAINER_MODE=yes)
if test $USE_MAINTAINER_MODE = yes; then
MAINT=
else

View file

@ -1,3 +1,7 @@
2011-03-20 Glenn Morris <rgm@gnu.org>
* config.in: Remove file.
2011-03-20 Juanma Barranquero <lekktu@gmail.com>
* minibuf.c (Vcompleting_read_function): Don't declare, global variables