diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-10-04 09:16:24 +0200 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-10-04 19:44:15 +0200 |
commit | afb765ab3cab7b6582d0def543b23603cd076445 (patch) | |
tree | c394f9eb9cfef5ada5a60d33015f0a7a3d85f0e9 /src | |
parent | 187a0333bf0d1c5dd08ec76c9265e5a6077f8e74 (diff) | |
download | emacs-afb765ab3cab7b6582d0def543b23603cd076445.tar.gz emacs-afb765ab3cab7b6582d0def543b23603cd076445.tar.bz2 emacs-afb765ab3cab7b6582d0def543b23603cd076445.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/comp.c | 22 | ||||
-rw-r--r-- | src/epaths.in | 4 |
2 files changed, 9 insertions, 17 deletions
diff --git a/src/comp.c b/src/comp.c index 058ce7e96ac..5663c9e5624 100644 --- a/src/comp.c +++ b/src/comp.c @@ -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; diff --git a/src/epaths.in b/src/epaths.in index 3cadd160ecf..5b6c650b0da 100644 --- a/src/epaths.in +++ b/src/epaths.in @@ -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 |