I finally got around to checking out the CVS archive from its new
location, how many months later? This is also my first attempt at using
patcher.el. I don't think I handled the ChangeLogs correctly, did I?
And is there some way to make it ignore the generated files, configure
and lib-src/config.values.in in this case? I had to strip them out
manually.
Anyhow, this patch is in support of coexisting builds of XEmacs. For
example, I might want non-MULE, MULE, and gtk builds installed in the
same tree, named xemacs, xemacs-mule, and xemacs-gtk. Since each binary
needs its own DOC file, and the name "DOC" is hardwired in, this is a
problem. This patch eases the pain of such coexisting builds by making
the name of the DOC file configurable.
This patch is against 21.5 CVS. Since it does not fix a bug, I assume
that it is inappropriate for the 21.4 branch, although it should apply
there as well.
ChangeLog addition:
2002-03-14 Jerry James <james(a)xemacs.org>
* Makefile.in.in (docname): New variable.
* Makefile.in.in (install-arch-dep): Use it.
* configure.in (docname): New configure option.
* configure.usage (--docname): Describe it.
lisp/ChangeLog addition:
2002-03-14 Jerry James <james(a)xemacs.org>
* loadup.el: Remove parameter from Snarf-documentation call.
src/ChangeLog addition:
2002-03-14 Jerry James <james(a)xemacs.org>
* Makefile.in.in (DOC): New variable from configure.
* Makefile.in.in: Use it instead of the constant string DOC.
* config.h.in: Record DOC name in DOCNAME constant.
* doc.c (Fsnarf_documentation): Replace parameter with DOCNAME.
xemacs-21.5 source patch:
Diff command: cvs -q diff -u
Files affected: src/doc.c src/config.h.in src/Makefile.in.in lisp/loadup.el
configure.usage configure.in Makefile.in.in
Index: Makefile.in.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/Makefile.in.in,v
retrieving revision 1.5
diff -d -u -u -r1.5 Makefile.in.in
--- Makefile.in.in 2001/12/20 06:08:09 1.5
+++ Makefile.in.in 2002/03/15 03:27:02
@@ -202,6 +202,9 @@
## Where to put the DOC file.
docdir=@docdir@
+## The name of the DOC file.
+docname=@docname@
+
## Where to put executables to be run by XEmacs rather than
## the user. This path usually includes the XEmacs version
## and configuration name, so that multiple configurations
@@ -401,7 +404,7 @@
${INSTALL_DATA} ../Installation ${archlibdir}/Installation; \
fi; \
${INSTALL_DATA} lib-src/config.values ${docdir}/config.values; \
- ${INSTALL_DATA} lib-src/DOC ${docdir}/DOC; \
+ ${INSTALL_DATA} lib-src/${docname} ${docdir}/${docname}; \
for subdir in `find ${archlibdir} -type d ! -name RCS ! -name SCCS ! -name CVS
-print` ; \
do (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; done ; \
else true; fi
Index: configure.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.in,v
retrieving revision 1.174
diff -d -u -u -r1.174 configure.in
--- configure.in 2002/03/13 08:54:05 1.174
+++ configure.in 2002/03/15 03:27:03
@@ -342,6 +342,7 @@
etcdir='${datadir}/${instvardir}/etc'
archlibdir='${libdir}/${instvardir}/${configuration}'
docdir='${archlibdir}'
+docname="DOC"
with_netinstall="no"
with_prefix='yes'
with_site_lisp='no'
@@ -537,6 +538,7 @@
libs | \
ldflags | \
cache_file | \
+ docname | \
native_sound_lib| \
site_lisp | \
x_includes | \
@@ -4720,6 +4722,9 @@
AC_SUBST(LDFLAGS)
RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)'
LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
AC_SUBST(RECURSIVE_MAKE)
+
+AC_SUBST(docname)
+AC_DEFINE_UNQUOTED(DOCNAME,"$docname")
AC_SUBST(native_sound_lib)
AC_SUBST(sound_cflags)
Index: configure.usage
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.usage,v
retrieving revision 1.25
diff -d -u -u -r1.25 configure.usage
--- configure.usage 2002/03/13 08:54:05 1.25
+++ configure.usage 2002/03/15 03:27:03
@@ -56,6 +56,7 @@
--prefix=DIR Install files below DIR. Defaults to `/usr/local'.
--with-prefix=no Don't compile the value of --prefix into the
executable.
+--docname=NAME Install the DOC file as NAME instead of "DOC".
Window-system options:
Index: lisp/loadup.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/loadup.el,v
retrieving revision 1.25
diff -d -u -u -r1.25 loadup.el
--- lisp/loadup.el 2001/04/12 18:21:30 1.25
+++ lisp/loadup.el 2002/03/15 03:27:03
@@ -186,7 +186,7 @@
;; purify-flag is nil if called from loadup-el.el.
(when purify-flag
(message "Finding pointers to doc strings...")
- (Snarf-documentation "DOC")
+ (Snarf-documentation)
(message "Finding pointers to doc strings...done")
(Verify-documentation))
Index: src/Makefile.in.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Makefile.in.in,v
retrieving revision 1.89
diff -d -u -u -r1.89 Makefile.in.in
--- src/Makefile.in.in 2002/03/13 10:16:26 1.89
+++ src/Makefile.in.in 2002/03/15 03:27:03
@@ -25,6 +25,7 @@
## Synched up with: Not synched with FSF.
PROGNAME=@PROGNAME@
+DOC=@docname@
#define NOT_C_CODE
#include "config.h"
@@ -461,7 +462,7 @@
run_temacs = ${temacs_loadup} run-temacs
debug_temacs = gdb ${EXE_TARGET}
-release: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files}
+release: ${EXE_TARGET} ${libsrc}${DOC} $(mo_file) ${other_files}
#ifdef CANNOT_DUMP
ln ${EXE_TARGET} ${PROGNAME}
#else
@@ -472,7 +473,7 @@
touch release
#endif /* ! defined (CANNOT_DUMP) */
-${DUMP_TARGET}: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp
+${DUMP_TARGET}: ${EXE_TARGET} ${libsrc}${DOC} $(mo_file) ${other_files} update-elc.stamp
#ifdef HEAP_IN_DATA
@$(RM) $@ && touch SATISFIED
-${dump_temacs}
@@ -518,10 +519,10 @@
cd ../dynodump && $(RECURSIVE_MAKE)
#endif /* DYNODUMP */
-${libsrc}DOC: ${EXE_TARGET} update-elc.stamp
- $(RM) ${libsrc}DOC; \
+${libsrc}${DOC}: ${EXE_TARGET} update-elc.stamp
+ $(RM) ${libsrc}${DOC}; \
${DUMPENV} ./${EXE_TARGET} -nd -batch -l ${srcdir}/../lisp/make-docfile.el -- \
- -o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \
+ -o ${libsrc}${DOC} -d ${srcdir} -i ${libsrc}../site-packages \
${obj_src} ${mallocdocsrc} ${rallocdocsrc} ${extra_doc_files}
dump_elcs: dump-elcs
@@ -548,7 +549,7 @@
${libsrc}make-msgfile -o ${libsrc}messages ${objs}
cd ${libsrc} && ${xgettext} ${xgettext_args}
$(RM) ${mo_dir}emacs.po
- cd ${libsrc} && ${libsrc}make-po -a ${mo_dir}emacs.po DOC
+ cd ${libsrc} && ${libsrc}make-po -a ${mo_dir}emacs.po ${DOC}
${mo_dir}emacs.mo: ${mo_dir}emacs.po
cd ${mo_dir} && ${msgfmt} -o emacs.mo emacs.po
@@ -860,7 +861,7 @@
GNUmakefile Makefile Makefile.in TAGS ${PROGNAME}.*
realclean: distclean
versionclean:
- $(RM) ${EXE_TARGET} ${DUMP_TARGET} ${libsrc}DOC
+ $(RM) ${EXE_TARGET} ${DUMP_TARGET} ${libsrc}${DOC}
extraclean: realclean
$(RM) *~ \#* m/*~ m/\#* s/*~ s/\#*
Index: src/config.h.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/config.h.in,v
retrieving revision 1.68
diff -d -u -u -r1.68 config.h.in
--- src/config.h.in 2002/03/13 08:52:34 1.68
+++ src/config.h.in 2002/03/15 03:27:03
@@ -915,6 +915,9 @@
#undef HAVE_MKSTEMP
+/* The name of the DOC file */
+#undef DOCNAME
+
#undef PREFIX_USER_DEFINED
#undef EXEC_PREFIX_USER_DEFINED
#undef MODULEDIR_USER_DEFINED
Index: src/doc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/doc.c,v
retrieving revision 1.25
diff -d -u -u -r1.25 doc.c
--- src/doc.c 2002/03/13 08:52:37 1.25
+++ src/doc.c 2002/03/15 03:27:03
@@ -402,15 +402,14 @@
}
-DEFUN ("Snarf-documentation", Fsnarf_documentation, 1, 1, 0, /*
+DEFUN ("Snarf-documentation", Fsnarf_documentation, 0, 0, 0, /*
Used during Emacs initialization, before dumping runnable Emacs,
to find pointers to doc strings stored in `.../lib-src/DOC' and
record them in function definitions.
-One arg, FILENAME, a string which does not include a directory.
-The file is written to `../lib-src', and later found in `exec-directory'
+The DOC file is written to `../lib-src', and later found in `exec-directory'
when doc strings are referred to in the dumped Emacs.
*/
- (filename))
+ ())
{
int fd;
Intbyte buf[1024 + 1];
@@ -423,15 +422,11 @@
#ifndef CANNOT_DUMP
if (!purify_flag)
invalid_operation ("Snarf-documentation can only be called in an undumped
Emacs", Qunbound);
-#endif
-
- CHECK_STRING (filename);
-
-#ifdef CANNOT_DUMP
+#else
if (!NILP (Vdoc_directory))
{
CHECK_STRING (Vdoc_directory);
- name = alloca_intbytes (XSTRING_LENGTH (filename)
+ name = alloca_intbytes (strlen (DOCNAME)
+ XSTRING_LENGTH (Vdoc_directory)
+ 1);
qxestrcpy (name, XSTRING_DATA (Vdoc_directory));
@@ -439,16 +434,16 @@
else
#endif /* CANNOT_DUMP */
{
- name = alloca_intbytes (XSTRING_LENGTH (filename) + 14);
+ name = alloca_intbytes (strlen (DOCNAME) + 14);
qxestrcpy (name, (Intbyte *) "../lib-src/");
}
- qxestrcat (name, XSTRING_DATA (filename));
+ qxestrcat (name, DOCNAME);
fd = qxe_open (name, O_RDONLY | OPEN_BINARY, 0);
if (fd < 0)
report_file_error ("Opening doc string file", build_intstring (name));
- Vinternal_doc_file_name = filename;
+ Vinternal_doc_file_name = build_string (DOCNAME);
filled = 0;
pos = 0;
while (1)