I have to use this prefix as I am installing emacs in my $HOME and I don't have write access to /usr/local/.
I needed to add that sed command because something about the build did not work correctly by simply adding that prefix to the configure command... I also needed to update the hard coded paths in src/epaths.in. (Unfortunately I did not document the exact reason why this file had to be manually edited; but I know for sure that it definitely needed to be.)
So, I am trying to understand the exact reason why we need to manually update the src/epaths.in .. Or do we need to?
In addition, as plain "./configure" does not work for me, I also have this to call my custom configure command instead of plain ./configure in GNUmakefile. So I have this too in my build script:
sed -i 's|./configure|${MY_EMACS_CONFIGURE}|g' GNUmakefile
The value of ${MY_EMACS_CONFIGURE} is the above mentioned custom configure command with prefix and all.
The default ./configure caused Makefile build failure as it could not find the giflib automatically.