Subject: Re: bug#24974: CANNOT_DUMP build assumes Emacs is already installed

From: Glenn Morris <[email-masked]>
Date: Wed, 30 Nov 2016 19:36:29 -0500

How about:

--- a/src/lread.c
+++ b/src/lread.c
@@ -4296,6 +4296,8 @@ BUFFER is the buffer to evaluate (nil means use current buffer),
 #endif
 
   normal = PATH_LOADSEARCH;
+  if (!NILP (Vinstallation_directory)) normal = PATH_DUMPLOADSEARCH;
+
 #ifdef HAVE_NS
   lpath = decode_env_path (0, loadpath ? loadpath : normal, 0);
 #else