emacs-23: apply the crt{1,i,n}.o patch only on Linux

svn path=/nixpkgs/trunk/; revision=17603
This commit is contained in:
Peter Simons 2009-10-02 12:45:13 +00:00
parent e25c7cb445
commit 7ec88bf6bd

View file

@ -1,14 +1,19 @@
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() {
case "${system}" in
x86_64-linux) glibclibdir=lib64 ;;
i686-linux) glibclibdir=lib ;;
*) return;
esac
libc=$(cat ${NIX_GCC}/nix-support/orig-libc)
echo "libc: $libc"
case "${system}" in
x86_64-*) glibclibdir=lib64 ;;
*) glibclibdir=lib ;;
esac
for i in src/s/*.h src/m/*.h; do
substituteInPlace $i \
--replace /usr/${glibclibdir}/crt1.o $libc/${glibclibdir}/crt1.o \