2005-12-22 11:49:43 +01:00
|
|
|
source $stdenv/setup
|
|
|
|
|
2009-10-02 14:45:13 +02:00
|
|
|
# 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.
|
2007-10-24 18:21:41 +02:00
|
|
|
preConfigure() {
|
2009-08-05 15:39:51 +02:00
|
|
|
case "${system}" in
|
2009-10-02 14:45:13 +02:00
|
|
|
x86_64-linux) glibclibdir=lib64 ;;
|
|
|
|
i686-linux) glibclibdir=lib ;;
|
|
|
|
*) return;
|
2009-08-05 15:39:51 +02:00
|
|
|
esac
|
|
|
|
|
2009-10-02 14:45:13 +02:00
|
|
|
libc=$(cat ${NIX_GCC}/nix-support/orig-libc)
|
|
|
|
echo "libc: $libc"
|
|
|
|
|
2008-06-09 16:21:36 +02:00
|
|
|
for i in src/s/*.h src/m/*.h; do
|
|
|
|
substituteInPlace $i \
|
2009-08-05 15:39:51 +02:00
|
|
|
--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
|
2008-06-09 16:21:36 +02:00
|
|
|
done
|
2009-08-05 15:39:51 +02:00
|
|
|
|
2009-02-06 09:43:31 +01:00
|
|
|
for i in Makefile.in ./src/Makefile.in ./lib-src/Makefile.in ./leim/Makefile.in; do
|
2007-10-24 18:21:41 +02:00
|
|
|
substituteInPlace $i --replace /bin/pwd pwd
|
|
|
|
done
|
2005-12-22 11:49:43 +01:00
|
|
|
}
|
|
|
|
|
2007-10-24 18:21:41 +02:00
|
|
|
preBuild="make bootstrap"
|
|
|
|
|
2005-12-22 11:49:43 +01:00
|
|
|
genericBuild
|