Commit 9a514d4a authored by Paul Eggert's avatar Paul Eggert
Browse files

Automate syncing from gnulib.

parent 278f6845
2011-01-08 Paul Eggert <>
Automate syncing from gnulib.
* INSTALL, README: Document new subdirectory 'lib'.
* (SUBDIR): Add lib.
(SUBDIR_MAKEFILES): Add lib/Makefile.
(lib-src, src, TAGS, tags): Depend on lib.
(gnulib_srcdir, GNULIB_MODULES, GNULIB_TOOL_FLAGS): New macros.
($(gnulib_srcdir)): New rule.
(sync-from-gnulib): New rule, which is .PHONY.
(lib): New rule, which is like lib-src.
(Makefile): Depend on lib/
(AUTOCONF_INPUTS): Depend on aclocal.m4.
($(srcdir)/aclocal.m4, $(srcdir)/lib/ New rules.
(am--refresh): New rule, to pacify Automake.
(mostlyclean, clean, distclean, bootstrap-clean, maintainer-clean):
Clean lib, too.
(top_maintainer_clean): New macro, to remove gnulib-tool and Automake
(maintainer-clean, extraclean): Use it.
* Initialize for automake and gnulib, by invoking
lib/Makefile, too. Use automake to build gnulib, as gnulib works
more conveniently with automake.
* lib/ New file.
* make-dist: Also put into the distribution aclocal.m4,
compile, depcomp, missing, and the files under lib/.
2011-01-07 Paul Eggert <>
* install-sh, mkinstalldirs, move-if-change: Update from master
......@@ -675,12 +675,15 @@ the following steps.
`./src/epaths.h' from the template file `./src/', changing
the paths to the values specified in `./Makefile'.
2) Go to directory `./lib-src' and run `make'. This creates
2) Go to directory `./lib' and run `make'. This creates include files
and libraries used in later steps.
3) Go to directory `./lib-src' and run `make'. This creates
executables named `etags', `make-docfile', and others.
3) Go to directory `./src' and run `make'. This refers to files in
the `./lisp' and `./lib-src' subdirectories using names `../lisp' and
4) Go to directory `./src' and run `make'. This refers to files in
the `./lisp', `./lib', and `./lib-src' subdirectories using names
`../lisp', `../lib', and `../lib-src'.
This creates a file `./src/emacs' which is the runnable Emacs,
which has another name that contains a version number.
......@@ -264,10 +264,10 @@ EMACSFULL = `echo emacs-${version}${EXEEXT} | sed '$(TRANSFORM)'`
# Actually, we now include `lisp' as well, since the compiled files
# are not included any more in case of bootstrap or in case Emacs was
# checked out from a VCS.
SUBDIR = lib-src src lisp
SUBDIR = lib lib-src src lisp
# The subdir makefiles created by config.status.
SUBDIR_MAKEFILES = lib-src/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispref/Makefile doc/lispintro/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile lisp/Makefile
SUBDIR_MAKEFILES = lib/Makefile lib-src/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispref/Makefile doc/lispintro/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile lisp/Makefile
# Subdirectories to install, and where they'll go.
# lib-src's makefile knows how to install it, so we don't do that here.
......@@ -313,6 +313,8 @@ leim: src Makefile FRC
lib-src src: lib
src: lib-src FRC
......@@ -320,8 +322,32 @@ src: lib-src FRC
# We need to build `emacs' in `src' to compile the *.elc files in `lisp'.
lisp: src
# Maintainers can put a copy of gnulib into $(gnulib_srcdir).
gnulib_srcdir = ../gnulib
git clone git:// $@
# Update modules from gnulib, for maintainers, who should have it in
# $(gnulib_srcdir) (relative to $(srcdir) and should have build tools
# as per $(gnulib_srcdir)/DEPENDENCIES.
GNULIB_MODULES = dummy # Just a dummy for now, to establish the mechanism.
--import --no-changelog --no-vc-files
sync-from-gnulib: $(gnulib_srcdir)
cd $(srcdir) && \
$(gnulib_srcdir)/gnulib-tool $(GNULIB_TOOL_FLAGS) $(GNULIB_MODULES)
cp $(gnulib_srcdir)/build-aux/texinfo.tex $(srcdir)/doc/misc
cp \
$(gnulib_srcdir)/build-aux/config.sub \
$(gnulib_srcdir)/build-aux/config.guess \
$(gnulib_srcdir)/build-aux/install-sh \
$(gnulib_srcdir)/build-aux/mkinstalldirs \
$(gnulib_srcdir)/build-aux/move-if-change \
.PHONY: sync-from-gnulib
# These targets should be "${SUBDIR} without `src'".
lib-src lisp: Makefile FRC
lib lib-src lisp: Makefile FRC
cd $@; $(MAKE) all $(MFLAGS) \
......@@ -360,6 +386,7 @@ blessmail: Makefile src FRC
Makefile: config.status $(srcdir)/src/ \
$(srcdir)/ \
$(srcdir)/src/ \
$(srcdir)/lib/ \
$(srcdir)/lib-src/ \
$(srcdir)/doc/emacs/ \
$(srcdir)/doc/misc/ \
......@@ -374,11 +401,20 @@ Makefile: config.status $(srcdir)/src/ \
config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
./config.status --recheck
AUTOCONF_INPUTS = @MAINT@ $(srcdir)/ $(srcdir)/m4/getopt.m4
AUTOCONF_INPUTS = @MAINT@ $(srcdir)/ $(srcdir)/m4/getopt.m4 $(srcdir)/aclocal.m4
$(srcdir)/configure: $(AUTOCONF_INPUTS)
cd ${srcdir} && autoconf
ACLOCAL_INPUTS = @MAINT@ $(srcdir)/m4/gnulib-comp.m4
$(srcdir)/aclocal.m4: $(ACLOCAL_INPUTS)
cd $(srcdir) && aclocal -I m4
AUTOMAKE_INPUTS = @MAINT@ $(srcdir)/aclocal.m4 $(srcdir)/lib/
$(srcdir)/lib/ $(AUTOMAKE_INPUTS)
cd $(srcdir) && automake --gnu -a -c lib/Makefile
$(srcdir)/src/ $(srcdir)/src/
@ # Usually, there's no need to rebuild src/ just
@ # because has changed (since building
......@@ -710,6 +746,7 @@ mostlyclean: FRC
(cd src; $(MAKE) $(MFLAGS) mostlyclean)
(cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean)
(cd lwlib; $(MAKE) $(MFLAGS) mostlyclean)
(cd lib; $(MAKE) $(MFLAGS) mostlyclean)
(cd lib-src; $(MAKE) $(MFLAGS) mostlyclean)
-(cd doc/emacs && $(MAKE) $(MFLAGS) mostlyclean)
-(cd doc/misc && $(MAKE) $(MFLAGS) mostlyclean)
......@@ -729,6 +766,7 @@ clean: FRC
(cd src; $(MAKE) $(MFLAGS) clean)
(cd oldXMenu; $(MAKE) $(MFLAGS) clean)
(cd lwlib; $(MAKE) $(MFLAGS) clean)
(cd lib; $(MAKE) $(MFLAGS) clean)
(cd lib-src; $(MAKE) $(MFLAGS) clean)
-(cd doc/emacs && $(MAKE) $(MFLAGS) clean)
-(cd doc/misc && $(MAKE) $(MFLAGS) clean)
......@@ -753,6 +791,7 @@ distclean: FRC
(cd src; $(MAKE) $(MFLAGS) distclean)
(cd oldXMenu; $(MAKE) $(MFLAGS) distclean)
(cd lwlib; $(MAKE) $(MFLAGS) distclean)
(cd lib; $(MAKE) $(MFLAGS) distclean)
(cd lib-src; $(MAKE) $(MFLAGS) distclean)
(cd doc/emacs && $(MAKE) $(MFLAGS) distclean)
(cd doc/misc && $(MAKE) $(MFLAGS) distclean)
......@@ -769,6 +808,7 @@ bootstrap-clean: FRC
(cd src; $(MAKE) $(MFLAGS) bootstrap-clean)
(cd oldXMenu; $(MAKE) $(MFLAGS) maintainer-clean)
(cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean)
(cd lib; $(MAKE) $(MFLAGS) maintainer-clean)
(cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean)
-(cd doc/emacs && $(MAKE) $(MFLAGS) maintainer-clean)
-(cd doc/misc && $(MAKE) $(MFLAGS) maintainer-clean)
......@@ -789,10 +829,15 @@ bootstrap-clean: FRC
### Makefile. More generally, `make maintainer-clean' should not delete
### anything that needs to exist in order to run `configure' and then
### begin to build the program.
${top_distclean}; \
rm -fr autom4te.cache; \
rm -f aclocal.m4 lib/ m4/gnulib-cache.m4
maintainer-clean: bootstrap-clean FRC
(cd src; $(MAKE) $(MFLAGS) maintainer-clean)
(cd lib; $(MAKE) $(MFLAGS) maintainer-clean)
(cd lisp; $(MAKE) $(MFLAGS) maintainer-clean)
### This doesn't actually appear in the coding standards, but Karl
### says GCC supports it, and that's where the configuration part of
......@@ -800,13 +845,13 @@ maintainer-clean: bootstrap-clean FRC
### it deletes backup and autosave files too.
for i in ${SUBDIR} leim; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done
-rm -f config-tmp-*
-rm -f *~ \#*
# The src subdir knows how to do the right thing
# even when the build directory and source dir are different.
TAGS tags: lib-src src
TAGS tags: lib lib-src src
cd src; $(MAKE) tags
......@@ -63,6 +63,7 @@ There are several subdirectories:
`leim' holds the library of Emacs input methods, Lisp code and
auxiliary data files required to type international characters
which can't be directly produced by your keyboard.
`lib' holds source code for libraries used by Emacs and its utilities
`lib-src' holds the source code for some utility programs for use by or
with Emacs, like movemail and etags.
`etc' holds miscellaneous architecture-independent data files Emacs
......@@ -27,6 +27,7 @@ AC_PREREQ(2.65)
AC_INIT(emacs, 24.0.50)
dnl Support for --program-prefix, --program-suffix and
dnl --program-transform-name options
......@@ -638,6 +639,10 @@ SPECIFIED_CFLAGS="$CFLAGS"
dnl Sets GCC=yes if using gcc.
# Initialize gnulib right after verifying that the C compiler works.
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
......@@ -2668,6 +2673,9 @@ AC_SUBST(GETOPTOBJS)
# Configure gnulib.
# UNIX98 PTYs.
......@@ -3747,7 +3755,7 @@ dnl Secondly, the GNU Coding standards require that one should be able
dnl to run `make prefix=/some/where/else' and override the values set
dnl by configure. This also explains the `move-if-change' test and
dnl the use of force in the `epaths-force' rule in
AC_OUTPUT(Makefile lib-src/Makefile oldXMenu/Makefile \
AC_OUTPUT(Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \
doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
doc/lispref/Makefile src/Makefile \
lwlib/Makefile lisp/Makefile leim/Makefile, [
2011-01-08 Paul Eggert <>
Automate syncing from gnulib.
* (EXE_FILES): New macro.
(BASE_CFLAGS): Add -I../lib and -I${srcdir}/../lib,
for gnulib's .h files.
(LOADLIBES): Add ../lib/libgnu.a.
($(EXE_FILES)): Depend on ../lib/libgnu.a.
(../lib/libgnu.a): New rule.
2011-01-08 Paul Eggert <>
* (EXECUTABLES): Remove; macro unused since 1993.
......@@ -128,6 +128,9 @@ DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
SCRIPTS= rcs2log vcdiff
STAMP_SCRIPTS= stamp-rcs2log stamp-vcdiff
# All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
# Specify additional -D flags for movemail. Options:
# -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
# See the comments about locking in movemail.c. Normally the values
......@@ -166,13 +169,15 @@ LIBS_SYSTEM = @LIBS_SYSTEM@
# defined before they know they can take advantage of the information
# in ../src/config.h.
-DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src
-DHAVE_CONFIG_H -I. -I../src -I../lib \
-I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib
LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM)
$(EXE_FILES): ../lib/libgnu.a
## This is the default compilation command.
## But we should never rely on it, because some make version failed to
......@@ -320,6 +325,9 @@ getopt.o: ${srcdir}/getopt.c $(GETOPT_H) ${srcdir}/gettext.h
getopt1.o: ${srcdir}/getopt1.c $(GETOPT_H)
${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
../lib/libgnu.a: ../src/config.h
cd ../lib && $(MAKE) libgnu.a
REGEXPOBJ = regex.o
REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
noinst_LIBRARIES =
DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src
......@@ -286,12 +286,14 @@ ln INSTALL README BUGS move-if-change ${tempdir}
ln ChangeLog configure ${tempdir}
ln config.bat make-dist update-subdirs vpath.sed .dir-locals.el ${tempdir}
ln mkinstalldirs config.sub config.guess install-sh ${tempdir}
ln aclocal.m4 ${tempdir}
ln compile depcomp missing ${tempdir}
echo "Creating subdirectories"
for subdir in site-lisp \
leim leim/CXTERM-DIC leim/MISC-DIC \
leim/SKK-DIC leim/ja-dic leim/quail \
src src/m src/s src/bitmaps lib-src oldXMenu lwlib \
src src/m src/s src/bitmaps lib lib-src oldXMenu lwlib \
nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \
`find etc lisp -type d` \
doc doc/emacs doc/misc doc/man doc/lispref doc/lispintro \
......@@ -368,6 +370,14 @@ echo "Making links to \`src/s'"
(cd src/s
ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/s)
echo "Making links to \`lib'"
(build_aux_h=`(ls *.h)`
cd lib
ln [a-zA-Z]*.[ch] ../${tempdir}/lib
ln ../${tempdir}/lib
cd ../${tempdir}/lib
rm -f `(echo "$build_aux_h"; ls *.in.h) | sed '/[*]/d; s/.in.h$/.h/'`)
echo "Making links to \`lib-src'"
(cd lib-src
ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src
......@@ -477,7 +487,7 @@ echo "Making links to \`doc/man'"
### It would be nice if they could all be symlinks to top-level copy, but
### you're not supposed to have any symlinks in distribution tar files.
echo "Making sure copying notices are all copies of \`COPYING'"
for subdir in . etc info leim lib-src lisp lwlib msdos nt src; do
for subdir in . etc info leim lib lib-src lisp lwlib msdos nt src; do
rm -f ${tempdir}/${subdir}/COPYING
cp COPYING ${tempdir}/${subdir}
2011-01-08 Paul Eggert <>
Automate syncing from gnulib.
* (lib): New macro.
(ALL_CFLAGS): Add -I$(lib) -I$(srcdir)/../lib.
($(lib)/libgnu.a): New rule.
(temacs$(EXEEXT)): Also link $(lib)/libgnu.a.
2011-01-08 Andreas Schwab <>
* fns.c (Fyes_or_no_p): Add usage.
......@@ -29483,4 +29491,3 @@ See ChangeLog.10 for earlier changes.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <>.
......@@ -47,6 +47,7 @@ version = @version@
lispsource = $(srcdir)/../lisp
lib = ../lib
libsrc = ../lib-src
etc = ../etc
oldXMenudir = ../oldXMenu
......@@ -320,6 +321,7 @@ MKDEPDIR=@MKDEPDIR@
## FIXME? MYCPPFLAGS only referenced in etc/DEBUG.
-I$(lib) -I$(srcdir)/../lib \
......@@ -644,10 +646,12 @@ $(libsrc)/make-docfile$(EXEEXT):
buildobj.h: Makefile
echo "#define BUILDOBJ \"$(obj) $(otherobj) " "\"" > buildobj.h
$(lib)/libgnu.a: $(config_h)
cd $(lib) && $(MAKE) libgnu.a
temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj)
temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) $(lib)/libgnu.a
-o temacs $(START_FILES) $(obj) $(otherobj) $(LIBES)
-o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES)
## The following oldxmenu-related rules are only (possibly) used if
## HAVE_X11 && !USE_GTK, but there is no harm in always defining them
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment