2012-01-21 19:28:54 +01:00
|
|
|
source $stdenv/setup
|
|
|
|
|
|
|
|
# This hook is supposed to be run on Linux. It patches the proper locations of
|
|
|
|
# the crt{1,i,n}.o files into the build to ensure that Emacs is linked with
|
|
|
|
# *our* versions, not the ones found in the system, as it would do by default.
|
|
|
|
# On other platforms, this appears to be unnecessary.
|
|
|
|
preConfigure() {
|
2015-02-09 01:15:09 +01:00
|
|
|
for i in Makefile.in ./src/Makefile.in ./lib-src/Makefile.in ./leim/Makefile.in; do
|
|
|
|
substituteInPlace $i --replace /bin/pwd pwd
|
|
|
|
done
|
|
|
|
|
2012-01-21 19:28:54 +01:00
|
|
|
case "${system}" in
|
|
|
|
x86_64-linux) glibclibdir=lib64 ;;
|
|
|
|
i686-linux) glibclibdir=lib ;;
|
|
|
|
*) return;
|
|
|
|
esac
|
|
|
|
|
2014-12-17 19:11:30 +01:00
|
|
|
libc=$(cat ${NIX_CC}/nix-support/orig-libc)
|
2012-01-21 19:28:54 +01:00
|
|
|
echo "libc: $libc"
|
|
|
|
|
|
|
|
for i in src/s/*.h src/m/*.h; do
|
|
|
|
substituteInPlace $i \
|
|
|
|
--replace /usr/${glibclibdir}/crt1.o $libc/${glibclibdir}/crt1.o \
|
|
|
|
--replace /usr/${glibclibdir}/crti.o $libc/${glibclibdir}/crti.o \
|
|
|
|
--replace /usr/${glibclibdir}/crtn.o $libc/${glibclibdir}/crtn.o \
|
|
|
|
--replace /usr/lib/crt1.o $libc/${glibclibdir}/crt1.o \
|
|
|
|
--replace /usr/lib/crti.o $libc/${glibclibdir}/crti.o \
|
|
|
|
--replace /usr/lib/crtn.o $libc/${glibclibdir}/crtn.o
|
|
|
|
done
|
2015-02-09 01:15:09 +01:00
|
|
|
}
|
2012-01-21 19:28:54 +01:00
|
|
|
|
2015-02-09 01:15:09 +01:00
|
|
|
preInstall () {
|
2012-01-21 19:28:54 +01:00
|
|
|
for i in Makefile.in ./src/Makefile.in ./lib-src/Makefile.in ./leim/Makefile.in; do
|
|
|
|
substituteInPlace $i --replace /bin/pwd pwd
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
genericBuild
|