forked from emacs-mirror/emacs
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdumpemacs.sh
More file actions
executable file
·34 lines (27 loc) · 795 Bytes
/
dumpemacs.sh
File metadata and controls
executable file
·34 lines (27 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# Script to take an undumped emacs and dump it during installation
# What was emacs compiled with
PREFIX=/usr
VERSION=21.2
MINORVERSION=1
DUMPDIR=`/usr/bin/mktemp -d /private/tmp/emacs.XXXXXX`
ln -sf "$PREFIX/share/emacs/$VERSION/etc" "$DUMPDIR/etc"
cp "$DUMPDIR/etc/DOC-$VERSION.$MINORVERSION" "$DUMPDIR/etc/DOC"
mkdir -p "$DUMPDIR/lib-src"
mkdir -p "$DUMPDIR/src"
UNDUMPED="$PREFIX/bin/emacs-undumped"
if [ `lipo -info "$UNDUMPED" | awk '{print $1}'` = "Non-fat" ]
then
# Thin file, do not lipo
cp "$UNDUMPED" "$DUMPDIR/src/temacs"
else
# Fat binary, needs lipo
lipo -extract_family `arch` "$UNDUMPED" -output "$DUMPDIR/src/temacs"
fi
cd "$DUMPDIR/src"
LC_ALL=C; export LC_ALL
./temacs -batch -l loadup dump
rm temacs
pax -rw . "$PREFIX/bin"
cd /
rm -rf "$DUMPDIR"