1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

Make filename hashing compatible with self contained builds (bug#43532)

* Makefile.in (lispdirrel): Add replace template.
	(epaths-force): Form correctly 'PATH_REL_LOADSEARCH' into epath.h
	* configure.ac (lispdirrel): Define variable (relative path of the
	lisp files from the installation directory).
	* src/comp.c (Fcomp_el_to_eln_filename): Update algorithm not to
	rely on 'PATH_DUMPLOADSEARCH' but on 'PATH_REL_LOADSEARCH'.
	* src/epaths.in (PATH_REL_LOADSEARCH): Add macro template.
This commit is contained in:
Andrea Corallo 2020-10-04 09:16:24 +02:00
parent 187a0333bf
commit afb765ab3c
4 changed files with 19 additions and 19 deletions

View File

@ -223,6 +223,10 @@ iconsrcdir=$(srcdir)/etc/images/icons
# These variables hold the values Emacs will actually use. They are
# based on the values of the standard Make variables above.
# Where lisp files are installed in a distributed with Emacs (relative
# path to the installation directory).
lispdirrel=@lispdirrel@
# Where to install the lisp files distributed with Emacs.
# This includes the Emacs version, so that the lisp files for different
# versions of Emacs will install themselves in separate directories.
@ -368,6 +372,7 @@ epaths-force:
@(gamedir='${gamedir}'; \
sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \
-e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "${standardlisppath}";' \
-e 's;\(#.*PATH_REL_LOADSEARCH\).*$$;\1 "${lispdirrel}";' \
-e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "${locallisppath}";' \
-e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "${buildlisppath}";' \
-e '/^#define PATH_[^ ]*SEARCH /s/\([":]\):*/\1/g' \

View File

@ -187,7 +187,8 @@ dnl It is important that variables on the RHS not be expanded here,
dnl hence the single quotes. This is per the GNU coding standards, see
dnl (autoconf) Installation Directory Variables
dnl See also epaths.h below.
lispdir='${datadir}/emacs/${version}/lisp'
lispdirrel='${version}/lisp'
lispdir='${datadir}/emacs/'${lispdirrel}
standardlisppath='${lispdir}'
locallisppath='${datadir}/emacs/${version}/site-lisp:'\
'${datadir}/emacs/site-lisp'
@ -1908,7 +1909,8 @@ if test "${with_ns}" != no; then
NS_IMPL_COCOA=yes
ns_appdir=`pwd`/nextstep/Emacs.app
ns_appbindir=${ns_appdir}/Contents/MacOS
ns_appresdir=${ns_appdir}/Contents/Resources
lispdirrel=Contents/Resources
ns_appresdir=${ns_appdir}/{lispdirrel}
ns_appsrc=Cocoa/Emacs.base
ns_fontfile=macfont.o
elif flags=$( (gnustep-config --objc-flags) 2>/dev/null); then
@ -5325,6 +5327,7 @@ AC_SUBST(sharedstatedir)
AC_SUBST(libexecdir)
AC_SUBST(mandir)
AC_SUBST(infodir)
AC_SUBST(lispdirrel)
AC_SUBST(lispdir)
AC_SUBST(standardlisppath)
AC_SUBST(locallisppath)

View File

@ -4050,27 +4050,15 @@ If BASE-DIR is nil use the first entry in `comp-eln-load-path'. */)
As installing .eln files compiled during the build changes their
absolute path we need an hashing mechanism that is not sensitive
to that. For this we replace if match PATH_DUMPLOADSEARCH or
PATH_LOADSEARCH with '//' before generating the hash. */
*PATH_REL_LOADSEARCH with '//' before computing the hash. */
if (NILP (loadsearch_re_list))
{
Lisp_Object sys_re;
#ifdef __APPLE__
/* On MacOS we relax the match on PATH_LOADSEARCH making
everything before ".app/" a wildcard. This to obtain a
self-contained Emacs.app (bug#43532). */
char *c;
if ((c = strstr (PATH_LOADSEARCH, ".app/")))
sys_re =
concat2 (build_string ("\\`[[:ascii:]]+"),
Fregexp_quote (build_string (c)));
else
sys_re = Fregexp_quote (build_string (PATH_LOADSEARCH));
#else
sys_re = Fregexp_quote (build_string (PATH_LOADSEARCH));
#endif
Lisp_Object sys_re =
concat2 (build_string ("\\`[[:ascii:]]+"),
Fregexp_quote (build_string ("/" PATH_REL_LOADSEARCH "/")));
loadsearch_re_list =
list2 (sys_re, Fregexp_quote (build_string (PATH_DUMPLOADSEARCH)));
list2 (sys_re, Fregexp_quote (build_string (PATH_DUMPLOADSEARCH "/")));
}
Lisp_Object lds_re_tail = loadsearch_re_list;

View File

@ -27,6 +27,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
*/
#define PATH_LOADSEARCH "/usr/local/share/emacs/lisp"
/* Like PATH_LOADSEARCH, but contains the relative path from the
installation directory.
*/
#define PATH_REL_LOADSEARCH ""
/* Like PATH_LOADSEARCH, but contains the non-standard pieces.
These are the site-lisp directories. Configure sets this to