diff options
| author | Glenn Morris | 2012-06-30 14:10:50 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-06-30 14:10:50 -0700 |
| commit | ca26824cb07d494481a14fea1642d38ad6c2a9e4 (patch) | |
| tree | c0a3d299f228fd444741729ea0549c1927f96582 /src/lread.c | |
| parent | 9ff8f76bbca43e021f842b24493885f1c034f6a4 (diff) | |
| download | emacs-ca26824cb07d494481a14fea1642d38ad6c2a9e4.tar.gz emacs-ca26824cb07d494481a14fea1642d38ad6c2a9e4.zip | |
Make --no-site-lisp work for --enable-locallisppath elements
without "site-lisp" in the name.
Ref http://debbugs.gnu.org/10208#25, point iii).
* configure.in (standardlisppath): New output variable.
(lisppath): Use standardlisppath.
* Makefile.in (standardlisppath): New, set by configure.
(epaths-force): Use standardlisppath and locallisppath rather than lisppath.
* src/epaths.in (PATH_SITELOADSEARCH): New.
* src/lread.c (init_lread): Use PATH_SITELOADSEARCH.
* nt/paths.h (PATH_SITELOADSEARCH): New.
Fixes: debbugs:11658
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 237 |
1 files changed, 114 insertions, 123 deletions
diff --git a/src/lread.c b/src/lread.c index 2cd203da5b9..7a0b20880e9 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -4072,15 +4072,15 @@ init_lread (void) | |||
| 4072 | int turn_off_warning = 0; | 4072 | int turn_off_warning = 0; |
| 4073 | 4073 | ||
| 4074 | /* Compute the default Vload-path, with the following logic: | 4074 | /* Compute the default Vload-path, with the following logic: |
| 4075 | If CANNOT_DUMP just use PATH_LOADSEARCH. | 4075 | If CANNOT_DUMP, just use PATH_LOADSEARCH, prepending PATH_SITELOADSEARCH |
| 4076 | unless --no-site-lisp. | ||
| 4076 | Else if purify-flag (ie dumping) start from PATH_DUMPLOADSEARCH; | 4077 | Else if purify-flag (ie dumping) start from PATH_DUMPLOADSEARCH; |
| 4077 | otherwise start from PATH_LOADSEARCH. | 4078 | otherwise start from PATH_LOADSEARCH. |
| 4078 | If !initialized, then just set both Vload_path and dump_path. | 4079 | If !initialized, then just set both Vload_path and dump_path. |
| 4079 | If initialized, then if Vload_path != dump_path, do nothing. | 4080 | If initialized, then if Vload_path != dump_path, do nothing. |
| 4080 | (Presumably the load-path has already been changed by something.) | 4081 | (Presumably the load-path has already been changed by something. |
| 4081 | Also do nothing if Vinstallation_directory is nil. | 4082 | This can only (?) be from a site-load file during dumping.) |
| 4082 | Otherwise: | 4083 | If Vinstallation_directory is not nil (ie, running uninstalled): |
| 4083 | Remove site-lisp directories from the front of load-path. | ||
| 4084 | Add installation-dir/lisp (if exists and not already a member), | 4084 | Add installation-dir/lisp (if exists and not already a member), |
| 4085 | at the front, and turn off warnings about missing directories | 4085 | at the front, and turn off warnings about missing directories |
| 4086 | (because we are presumably running uninstalled). | 4086 | (because we are presumably running uninstalled). |
| @@ -4094,8 +4094,7 @@ init_lread (void) | |||
| 4094 | install-dir/src/Makefile.in does NOT exist (this is a sanity | 4094 | install-dir/src/Makefile.in does NOT exist (this is a sanity |
| 4095 | check), then repeat the above steps for source-dir/lisp, | 4095 | check), then repeat the above steps for source-dir/lisp, |
| 4096 | leim and site-lisp. | 4096 | leim and site-lisp. |
| 4097 | Finally, add the previously removed site-lisp directories back | 4097 | Finally, add the site-lisp directories at the front (if !no_site_lisp). |
| 4098 | at the front (if !no_site_lisp). | ||
| 4099 | 4098 | ||
| 4100 | We then warn about any of the load-path elements that do not | 4099 | We then warn about any of the load-path elements that do not |
| 4101 | exist. The only ones that might not exist are those from | 4100 | exist. The only ones that might not exist are those from |
| @@ -4111,9 +4110,16 @@ init_lread (void) | |||
| 4111 | uninstalled, the eventual installation directories should not yet | 4110 | uninstalled, the eventual installation directories should not yet |
| 4112 | be included in load-path. | 4111 | be included in load-path. |
| 4113 | */ | 4112 | */ |
| 4113 | |||
| 4114 | #ifdef CANNOT_DUMP | 4114 | #ifdef CANNOT_DUMP |
| 4115 | normal = PATH_LOADSEARCH; | 4115 | normal = PATH_LOADSEARCH; |
| 4116 | Vload_path = decode_env_path (0, normal); | 4116 | Vload_path = decode_env_path (0, normal); |
| 4117 | if (!no_site_lisp) | ||
| 4118 | { | ||
| 4119 | Lisp_Object sitelisp; | ||
| 4120 | sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); | ||
| 4121 | if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path); | ||
| 4122 | } | ||
| 4117 | #else | 4123 | #else |
| 4118 | if (NILP (Vpurify_flag)) | 4124 | if (NILP (Vpurify_flag)) |
| 4119 | normal = PATH_LOADSEARCH; | 4125 | normal = PATH_LOADSEARCH; |
| @@ -4131,123 +4137,108 @@ init_lread (void) | |||
| 4131 | if (! NILP (Fequal (dump_path, Vload_path))) | 4137 | if (! NILP (Fequal (dump_path, Vload_path))) |
| 4132 | { | 4138 | { |
| 4133 | Vload_path = decode_env_path (0, normal); | 4139 | Vload_path = decode_env_path (0, normal); |
| 4134 | if (no_site_lisp || !NILP (Vinstallation_directory)) | 4140 | if (!NILP (Vinstallation_directory)) |
| 4135 | { | 4141 | { |
| 4136 | Lisp_Object tem, tem1, sitelisp; | 4142 | Lisp_Object tem, tem1; |
| 4137 | 4143 | ||
| 4138 | /* Remove "site-lisp" dirs from front of path temporarily | 4144 | /* Add to the path the lisp subdir of the |
| 4139 | and store them in sitelisp, then conc them on at the | 4145 | installation dir, if it exists. */ |
| 4140 | end so they're always first in path. | 4146 | tem = Fexpand_file_name (build_string ("lisp"), |
| 4141 | Note that this won't work if you used a | 4147 | Vinstallation_directory); |
| 4142 | --enable-locallisppath element that does not happen | 4148 | tem1 = Ffile_exists_p (tem); |
| 4143 | to contain "site-lisp" in its name. | 4149 | if (!NILP (tem1)) |
| 4144 | */ | 4150 | { |
| 4145 | sitelisp = Qnil; | 4151 | if (NILP (Fmember (tem, Vload_path))) |
| 4146 | while (1) | 4152 | { |
| 4147 | { | 4153 | turn_off_warning = 1; |
| 4148 | tem = Fcar (Vload_path); | 4154 | Vload_path = Fcons (tem, Vload_path); |
| 4149 | tem1 = Fstring_match (build_string ("site-lisp"), | 4155 | } |
| 4150 | tem, Qnil); | 4156 | } |
| 4151 | if (!NILP (tem1)) | 4157 | else |
| 4152 | { | 4158 | /* That dir doesn't exist, so add the build-time |
| 4153 | Vload_path = Fcdr (Vload_path); | 4159 | Lisp dirs instead. */ |
| 4154 | sitelisp = Fcons (tem, sitelisp); | 4160 | Vload_path = nconc2 (Vload_path, dump_path); |
| 4155 | } | 4161 | |
| 4156 | else | 4162 | /* Add leim under the installation dir, if it exists. */ |
| 4157 | break; | 4163 | tem = Fexpand_file_name (build_string ("leim"), |
| 4158 | } | 4164 | Vinstallation_directory); |
| 4159 | 4165 | tem1 = Ffile_exists_p (tem); | |
| 4160 | if (!NILP (Vinstallation_directory)) | 4166 | if (!NILP (tem1)) |
| 4161 | { | 4167 | { |
| 4162 | /* Add to the path the lisp subdir of the | 4168 | if (NILP (Fmember (tem, Vload_path))) |
| 4163 | installation dir, if it exists. */ | 4169 | Vload_path = Fcons (tem, Vload_path); |
| 4164 | tem = Fexpand_file_name (build_string ("lisp"), | 4170 | } |
| 4165 | Vinstallation_directory); | 4171 | |
| 4166 | tem1 = Ffile_exists_p (tem); | 4172 | /* Add site-lisp under the installation dir, if it exists. */ |
| 4167 | if (!NILP (tem1)) | 4173 | if (!no_site_lisp) |
| 4168 | { | 4174 | { |
| 4169 | if (NILP (Fmember (tem, Vload_path))) | 4175 | tem = Fexpand_file_name (build_string ("site-lisp"), |
| 4170 | { | 4176 | Vinstallation_directory); |
| 4171 | turn_off_warning = 1; | 4177 | tem1 = Ffile_exists_p (tem); |
| 4172 | Vload_path = Fcons (tem, Vload_path); | 4178 | if (!NILP (tem1)) |
| 4173 | } | 4179 | { |
| 4174 | } | 4180 | if (NILP (Fmember (tem, Vload_path))) |
| 4175 | else | 4181 | Vload_path = Fcons (tem, Vload_path); |
| 4176 | /* That dir doesn't exist, so add the build-time | 4182 | } |
| 4177 | Lisp dirs instead. */ | 4183 | } |
| 4178 | Vload_path = nconc2 (Vload_path, dump_path); | 4184 | |
| 4179 | 4185 | /* If Emacs was not built in the source directory, | |
| 4180 | /* Add leim under the installation dir, if it exists. */ | 4186 | and it is run from where it was built, add to load-path |
| 4181 | tem = Fexpand_file_name (build_string ("leim"), | 4187 | the lisp, leim and site-lisp dirs under that directory. */ |
| 4182 | Vinstallation_directory); | 4188 | |
| 4183 | tem1 = Ffile_exists_p (tem); | 4189 | if (NILP (Fequal (Vinstallation_directory, Vsource_directory))) |
| 4184 | if (!NILP (tem1)) | 4190 | { |
| 4185 | { | 4191 | Lisp_Object tem2; |
| 4186 | if (NILP (Fmember (tem, Vload_path))) | 4192 | |
| 4187 | Vload_path = Fcons (tem, Vload_path); | 4193 | tem = Fexpand_file_name (build_string ("src/Makefile"), |
| 4188 | } | 4194 | Vinstallation_directory); |
| 4189 | 4195 | tem1 = Ffile_exists_p (tem); | |
| 4190 | /* Add site-lisp under the installation dir, if it exists. */ | 4196 | |
| 4191 | if (!no_site_lisp) | 4197 | /* Don't be fooled if they moved the entire source tree |
| 4192 | { | 4198 | AFTER dumping Emacs. If the build directory is indeed |
| 4193 | tem = Fexpand_file_name (build_string ("site-lisp"), | 4199 | different from the source dir, src/Makefile.in and |
| 4194 | Vinstallation_directory); | 4200 | src/Makefile will not be found together. */ |
| 4195 | tem1 = Ffile_exists_p (tem); | 4201 | tem = Fexpand_file_name (build_string ("src/Makefile.in"), |
| 4196 | if (!NILP (tem1)) | 4202 | Vinstallation_directory); |
| 4197 | { | 4203 | tem2 = Ffile_exists_p (tem); |
| 4198 | if (NILP (Fmember (tem, Vload_path))) | 4204 | if (!NILP (tem1) && NILP (tem2)) |
| 4199 | Vload_path = Fcons (tem, Vload_path); | 4205 | { |
| 4200 | } | 4206 | tem = Fexpand_file_name (build_string ("lisp"), |
| 4201 | } | 4207 | Vsource_directory); |
| 4202 | 4208 | ||
| 4203 | /* If Emacs was not built in the source directory, | 4209 | if (NILP (Fmember (tem, Vload_path))) |
| 4204 | and it is run from where it was built, add to load-path | 4210 | Vload_path = Fcons (tem, Vload_path); |
| 4205 | the lisp, leim and site-lisp dirs under that directory. */ | 4211 | |
| 4206 | 4212 | tem = Fexpand_file_name (build_string ("leim"), | |
| 4207 | if (NILP (Fequal (Vinstallation_directory, Vsource_directory))) | 4213 | Vsource_directory); |
| 4208 | { | 4214 | |
| 4209 | Lisp_Object tem2; | 4215 | if (NILP (Fmember (tem, Vload_path))) |
| 4210 | 4216 | Vload_path = Fcons (tem, Vload_path); | |
| 4211 | tem = Fexpand_file_name (build_string ("src/Makefile"), | 4217 | |
| 4212 | Vinstallation_directory); | 4218 | if (!no_site_lisp) |
| 4213 | tem1 = Ffile_exists_p (tem); | 4219 | { |
| 4214 | 4220 | tem = Fexpand_file_name (build_string ("site-lisp"), | |
| 4215 | /* Don't be fooled if they moved the entire source tree | 4221 | Vsource_directory); |
| 4216 | AFTER dumping Emacs. If the build directory is indeed | 4222 | |
| 4217 | different from the source dir, src/Makefile.in and | 4223 | if (NILP (Fmember (tem, Vload_path))) |
| 4218 | src/Makefile will not be found together. */ | 4224 | Vload_path = Fcons (tem, Vload_path); |
| 4219 | tem = Fexpand_file_name (build_string ("src/Makefile.in"), | 4225 | } |
| 4220 | Vinstallation_directory); | 4226 | } |
| 4221 | tem2 = Ffile_exists_p (tem); | 4227 | } /* Vinstallation_directory != Vsource_directory */ |
| 4222 | if (!NILP (tem1) && NILP (tem2)) | 4228 | |
| 4223 | { | 4229 | } /* if Vinstallation_directory */ |
| 4224 | tem = Fexpand_file_name (build_string ("lisp"), | 4230 | |
| 4225 | Vsource_directory); | 4231 | /* Add the site-lisp directories at the front. */ |
| 4226 | 4232 | /* Note: If the site changed the load-path during dumping, | |
| 4227 | if (NILP (Fmember (tem, Vload_path))) | 4233 | --no-site-lisp is ignored. I don't know what to do about this. |
| 4228 | Vload_path = Fcons (tem, Vload_path); | 4234 | */ |
| 4229 | 4235 | if (!no_site_lisp) | |
| 4230 | tem = Fexpand_file_name (build_string ("leim"), | 4236 | { |
| 4231 | Vsource_directory); | 4237 | Lisp_Object sitelisp; |
| 4232 | 4238 | sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); | |
| 4233 | if (NILP (Fmember (tem, Vload_path))) | 4239 | if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path); |
| 4234 | Vload_path = Fcons (tem, Vload_path); | 4240 | } |
| 4235 | 4241 | } /* if dump_path == Vload_path */ | |
| 4236 | if (!no_site_lisp) | ||
| 4237 | { | ||
| 4238 | tem = Fexpand_file_name (build_string ("site-lisp"), | ||
| 4239 | Vsource_directory); | ||
| 4240 | |||
| 4241 | if (NILP (Fmember (tem, Vload_path))) | ||
| 4242 | Vload_path = Fcons (tem, Vload_path); | ||
| 4243 | } | ||
| 4244 | } | ||
| 4245 | } /* Vinstallation_directory != Vsource_directory */ | ||
| 4246 | } /* if Vinstallation_directory */ | ||
| 4247 | if (!NILP (sitelisp) && !no_site_lisp) | ||
| 4248 | Vload_path = nconc2 (Fnreverse (sitelisp), Vload_path); | ||
| 4249 | } /* if Vinstallation_directory || no_site_lisp */ | ||
| 4250 | } /* if dump_path == Vload_path */ | ||
| 4251 | } | 4242 | } |
| 4252 | else /* !initialized */ | 4243 | else /* !initialized */ |
| 4253 | { | 4244 | { |