Commit 6e5fa6bf authored by Paul Eggert's avatar Paul Eggert
Browse files

Merge from trunk and from gnulib stdio.

parents 81e56e61 77185bdf
2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
2011-03-21 Paul Eggert <eggert@cs.ucla.edu>
* Makefile.in (GNULIB_MODULES): Add socklen.
* configure.in: Do not check for sys/socket.h, since socklen does that.
* m4/socklen.m4: New automatically-generated file, from gnulib.
2011-03-21 Paul Eggert <eggert@cs.ucla.edu>
fakemail: Remove dependency on ignore-value.
* Makefile.in (GNULIB_MODULES): Add stdio.
* lib/stdio.in.h, m4/stdio_h.m4: New files, automatically
imported from gnulib.
* .bzrignore: Add lib/stdio.h.
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.
......@@ -65,7 +85,7 @@
2011-02-21 Christoph Scholtes <cschol2112@gmail.com>
* lib/makefile.w32-in: ($(BLD)/md5.$(O)): Added dependency on
* lib/makefile.w32-in ($(BLD)/md5.$(O)): Added dependency on
$(EMACS_ROOT)/nt/inc/stdint.h.
2011-02-21 Eli Zaretskii <eliz@gnu.org>
......@@ -104,7 +124,7 @@
way to test this so I left it alone.
* configure: Regenerate.
2011-02-20 Christoph Scholtes <cschol2112@gmail.com>
2011-02-20 Christoph Scholtes <cschol2112@gmail.com>
* lib/makefile.w32-in ($(BLD)/md5.$(O)): New recipe, moved from
src/makefile.w32-in.
......@@ -967,7 +987,7 @@
2010-06-28 Jan Djärv <jan.h.d@swipnet.se>
* configure.in: Add --with-x-toolkit=gtk3. Remove HAVE_GTK_MULTIDISPLAY,
* configure.in: Add --with-x-toolkit=gtk3. Remove HAVE_GTK_MULTIDISPLAY,
check for gtk_file_chooser_dialog_new, and HAVE_GTK_FILE_BOTH (implied
by minimum required Gtk+ 2.6). Add checks for functions introduced
in Gtk+ 2.14 or newer (bug#6505).
......
......@@ -4,14 +4,29 @@ 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:
$ ./configure
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
(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.)
(or you can just run `autoreconf -I m4').
You can then configure your build (use `./configure --help' to see
options you can set):
$ ./configure
Some of the files that are included in the Emacs tarball, such as
byte-compiled Lisp files, are not stored in Bazaar. Therefore, to
......
......@@ -332,7 +332,8 @@ DOS_gnulib_comp.m4 = gl-comp.m4
# as per $(gnulib_srcdir)/DEPENDENCIES.
GNULIB_MODULES = \
crypto/md5 dtoastr filemode getloadavg getopt-gnu \
ignore-value intprops lstat mktime readlink socklen strftime symlink sys_stat
ignore-value intprops lstat mktime readlink \
socklen stdio strftime symlink sys_stat
GNULIB_TOOL_FLAGS = \
--import --no-changelog --no-vc-files --makefile-name=gnulib.mk
sync-from-gnulib: $(gnulib_srcdir)
......
......@@ -1005,6 +1005,7 @@ m4_include([m4/stat.m4])
m4_include([m4/stdbool.m4])
m4_include([m4/stddef_h.m4])
m4_include([m4/stdint.m4])
m4_include([m4/stdio_h.m4])
m4_include([m4/stdlib_h.m4])
m4_include([m4/strftime.m4])
m4_include([m4/symlink.m4])
......
......@@ -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.
......
#!/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
This diff is collapsed.
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 autoheader * 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)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/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"
#!/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 ../
opt=
[ "$quiet" ] || opt=-q
bzr commit $opt -m "Auto-commit of generated files." $modified || \
die "bzr commit error"
msg "Committed files: $modified"
exit
### update_autogen ends here
......@@ -681,6 +681,93 @@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
NEXT_SYS_STAT_H
NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
NEXT_STDLIB_H
NEXT_AS_FIRST_DIRECTIVE_STDIO_H
NEXT_STDIO_H
REPLACE_VSPRINTF
REPLACE_VSNPRINTF
REPLACE_VPRINTF
REPLACE_VFPRINTF
REPLACE_VDPRINTF
REPLACE_VASPRINTF
REPLACE_TMPFILE
REPLACE_STDIO_WRITE_FUNCS
REPLACE_SPRINTF
REPLACE_SNPRINTF
REPLACE_RENAMEAT
REPLACE_RENAME
REPLACE_REMOVE
REPLACE_PRINTF
REPLACE_POPEN
REPLACE_PERROR
REPLACE_OBSTACK_PRINTF
REPLACE_GETLINE
REPLACE_GETDELIM
REPLACE_FTELLO
REPLACE_FTELL
REPLACE_FSEEKO
REPLACE_FSEEK
REPLACE_FREOPEN
REPLACE_FPURGE
REPLACE_FPRINTF
REPLACE_FOPEN
REPLACE_FFLUSH
REPLACE_FCLOSE
REPLACE_DPRINTF
HAVE_VDPRINTF
HAVE_VASPRINTF
HAVE_RENAMEAT
HAVE_FTELLO
HAVE_FSEEKO
HAVE_DPRINTF
HAVE_DECL_VSNPRINTF
HAVE_DECL_SNPRINTF
HAVE_DECL_OBSTACK_PRINTF
HAVE_DECL_GETLINE
HAVE_DECL_GETDELIM
HAVE_DECL_FTELLO
HAVE_DECL_FSEEKO
HAVE_DECL_FPURGE
GNULIB_VSPRINTF_POSIX
GNULIB_VSNPRINTF
GNULIB_VPRINTF_POSIX
GNULIB_VPRINTF
GNULIB_VFPRINTF_POSIX
GNULIB_VFPRINTF
GNULIB_VDPRINTF
GNULIB_VASPRINTF
GNULIB_TMPFILE
GNULIB_STDIO_H_SIGPIPE
GNULIB_SPRINTF_POSIX
GNULIB_SNPRINTF
GNULIB_RENAMEAT
GNULIB_RENAME
GNULIB_REMOVE
GNULIB_PUTS
GNULIB_PUTCHAR
GNULIB_PUTC
GNULIB_PRINTF_POSIX
GNULIB_PRINTF
GNULIB_POPEN
GNULIB_PERROR
GNULIB_OBSTACK_PRINTF_POSIX
GNULIB_OBSTACK_PRINTF
GNULIB_GETLINE
GNULIB_GETDELIM
GNULIB_FWRITE
GNULIB_FTELLO