the Fink project is an effort to port
popular Unix programs to Mac OS X
Package: emacs22-carbon
Version: 22.3
Revision: 3
BuildDepends: libncurses5 (>= 5.4-20041023-1006), fink (>= 0.24.12)
Depends: emacsen-common, ncurses (>= 5.4-20041023-1006), libncurses5-shlibs (>= 5.4-20041023-1006), passwd, macosx
Provides: emacsen
Source: mirror:gnu:emacs/emacs-%v.tar.gz
Source-MD5: aa8ba34f548cd78b35914ae5a7bb87eb
Source2: http://downloads.sourceforge.jp/macemacsjp/30446/inline_patch-1.0.4.tar.gz
Source2-MD5: 63c14c4edb754e472dfd806435ecace1
Source3: http://downloads.sourceforge.jp/macemacsjp/30185/transparency-3.1.2.tar.gz
Source3-MD5: 2074a81514a5f53ccd34f902a9437e31
Source4: http://downloads.sourceforge.jp/macemacsjp/30186/fixed-width-fontset.1.2.5.tar.gz
Source4-MD5: c68c147cffcbbba24ad513c365972bde
Source5: http://downloads.sourceforge.jp/macemacsjp/17718/mac-functions.patch
Source5Rename: mac-functions-20051116.patch
Source5-MD5: 6d122157a8c1c98b2b569e07da545206
Source6: http://downloads.sourceforge.jp/macemacsjp/23457/utf-8m.el
Source6Rename: utf-8m-20070105.el
Source6-MD5: 779d181fa3b5ba5b2b30f1ec8aa995e7
Source7: http://downloads.sourceforge.jp/macemacsjp/24135/hide_menubar.tar.gz
Source7Rename: hide_menubar-0.2.0.tar.gz
Source7-MD5: df47c265c220ed6ea4aaf4f5887772fb
# Obtained from http://svn.sourceforge.jp/view/*checkout*/inline_patch/trunk/emacs-inline.patch?rev=554&root=macemacsjp
Source8: http://fink.sodan.ecc.u-tokyo.ac.jp/pkgdists/emacs-inline-20080629.patch
Source8-MD5: dfd877f23d7159db875105318ed9f788
# Obtained from http://svn.sourceforge.jp/view/*checkout*/zenitani/CarbonEmacs/src/patch/transparency4.patch?content-type=text%2Fplain&root=macwiki
Source9: http://fink.sodan.ecc.u-tokyo.ac.jp/pkgdists/transparency4-20081120.patch
Source9-MD5: 2b66f28b8e5c17da4706da279f7e8138
Description: Flexible real-time text editor, Aqua native
DocFiles: <<
AUTHORS COPYING README mac/README:mac.README
../transparency*/readme:transparency.readme
../fixed-width-fontset.*/readme:fixed-width-fontset.readme
../fixed-width-fontset.*/readme.ja:fixed-width-fontset.readme.ja
<<
ConfFiles: %p/var/games/%n/tetris-scores %p/var/games/%n/snake-scores
AppBundles: finktmp/mac/Emacs22.app
PatchFile: %n.patch
PatchFile-MD5: 77acb99901b10a373716f6bfe433ce1b
PatchScript: <<
#!/bin/sh -ev
sed -i.bak -e 's|P_ ((scroll_bar|P_ ((struct scroll_bar|' src/macterm.h
# Remove CVS date from version number (%v) and append '-carbon' suffix
v=`echo "%v"|sed 's/\.cvs.*$//'`-carbon
sed -e 's|@PREFIX@|%p|g' \
-e 's|@EMACS-FLAVOR@|%n|g' \
-e "s|@EMACS-VERSION@|$v|g" \
%{PatchFile} | patch -p1
#/usr/bin/patch -p0 -i ../inline_patch-*/emacs-inline.patch
/usr/bin/patch -p0 -i ../emacs-inline*.patch
#/usr/bin/patch -p0 -i ../transparency*/transparency*.patch
/usr/bin/patch -p0 -i ../transparency*.patch
mkdir finktmp
cp ../fixed-width-fontset.*/carbon-font.el ../fixed-width-fontset.*/fixed-width-fontset.el finktmp
/usr/bin/patch -p0 -i ../mac-functions-*.patch
cp ../utf-8m-*.el finktmp/utf-8m.el
/usr/bin/patch -p1 -i ../hide_menubar.patch
<<
SetMAKEFLAGS: -j1
SetCPPFLAGS: -DUSE_ATSUI -DUSE_MAC_TSM
SetCFLAGS: -fconstant-cfstrings -Os
ConfigureParams: --build=%m-apple-darwin`uname -r|sed 's/\\..*//'` --infodir='${prefix}/share/info' --mandir='${prefix}/share/man' --libexecdir='${prefix}/lib' --with-carbon --enable-carbon-appdir= --without-x --without-gif --without-toolkit-scroll-bars
CompileScript: <<
#!/bin/sh -ev
# Remove CVS date from version number (%v) and append '-carbon' suffix
v=`echo "%v"|sed 's/\.cvs.*$//'`-carbon
set +v
case `uname -r` in
7.*)
QTver="`/usr/lib/plistread /System/Library/Frameworks/QuickTime.framework/Resources/version.plist CFBundleShortVersionString`"
case ${QTver} in
7.0.4)
echo "**************** ERROR ****************" >&2
echo 'QuickTime 7.0.4 breaks the build on 10.3.' >&2
echo 'Get 7.0.1 reinstaller and downgrade QuickTime.' >&2
echo 'http://www.apple.com/support/downloads/quicktime701reinstallerforquicktime704.html' >&2
echo "**************** ERROR ****************" >&2
exit 1
;;
7.2* | 7.3* | 7.4* | 7.5*)
echo "**************** ERROR ****************" >&2
echo "QuickTime ${QTver} breaks the build on 10.3." >&2
echo "Get 7.1.6 installer and downgrade QuickTime." >&2
echo "**************** ERROR ****************" >&2
exit 1
;;
esac
;;
esac
set -v
./configure %c
# Sync .elc's with patched .el's
(cd src && make bootstrap) || exit
(cd lisp && make recompile EMACS=../src/bootstrap-emacs) || exit
# Compile emacs with new *.elc
make
/usr/bin/find mac/Emacs.app ! -path "*/CVS/*" ! -name CVS ! -name .cvsignore > app.list
/usr/bin/cpio -pdL finktmp < app.list
mv finktmp/mac/Emacs.app finktmp/mac/Emacs22.app
EMACSLOADPATH=$PWD/finktmp:$PWD/lisp src/emacs -batch --no-init-file --no-site-file --multibyte -f batch-byte-compile 01carbon-emacs.el finktmp/*.el
<<
InstallScript: <<
#!/bin/sh -ev
# Remove CVS date from version number (%v) and append '-carbon' suffix
v=`echo "%v"|sed 's/\.cvs.*$//'`-carbon
# Install Everything (except Emacs.app)
make prefix=%i install
# Move some files to avoid conflicts with other emacsen
for f in %i/share/man/man1/{emacs.1,ctags.1,emacsclient.1,etags.1} \
%i/bin/{ctags,emacsclient,etags} \
%i/bin/{b2m,rcs-checkin,ebrowse,grep-changelog}; do
mv "$f" "$f.%n"
done
# Wrapper script for the command-line invokation
rm %i/bin/emacs %i/bin/emacs-$v
install -m 755 emacs.bash %i/bin/emacs-$v
ln -s emacs-$v %i/bin/%n
ln -s emacs-$v %i/bin/Emacs22.app
mkdir -p %i/etc/%n/site-start.d
mkdir -p %i/share/%n
mv %i/share/emacs/$v/site-lisp %i/share/%n/
(cd %i/share/emacs/$v; ln -s ../../%n/site-lisp site-lisp) || exit
mv %i/share/info %i/share/info-%n
mkdir -p %i/share/info
mv %i/share/info-%n %i/share/info/%n
rm %i/share/info/%n/dir %i/share/info/%n/dir.old
chmod 755 fix-info mangle-info
./fix-info %i/share/info/%n
rm %i/share/emacs/site-lisp/subdirs.el
install -m 644 finktmp/*.el finktmp/*.elc %i/share/%n/site-lisp
install -m 644 01carbon-emacs.el 01carbon-emacs.elc %i/etc/%n/site-start.d
# Patch Emacs22.app to load %p/bin/init.sh
ebd="finktmp/mac/Emacs22.app/Contents/MacOS/"
mv "$ebd/Emacs" "$ebd/Emacs.bin"
install -m 755 Emacs.finkwrap "$ebd/Emacs"
<<
PostInstScript: <<
# Remove CVS date from version number (%v) and append '-carbon' suffix
v=`echo "%v"|sed 's/\.cvs.*$//'`-carbon
libdir=%p/lib/emacs/$v/%m-apple-darwin`uname -r|sed 's/\\..*//'`
chown games:admin $libdir/update-game-score
chmod 4755 $libdir/update-game-score
chown -R games:admin %p/var/games/%n
mkdir -p %p/etc/lisp/emacs/$v/site-lisp
mkdir -p %p/etc/lisp/emacs/site-lisp
# Priorities are set to low not to disturb non-carbon emacsen...
update-alternatives --install %p/bin/emacs emacs %p/bin/%n 35 \
--slave %p/share/man/man1/emacs.1 emacs.1 %p/share/man/man1/emacs.1.%n
update-alternatives --install %p/bin/ctags ctags %p/bin/ctags.%n 35 \
--slave %p/share/man/man1/ctags.1 ctags.1 %p/share/man/man1/ctags.1.%n
update-alternatives --install %p/bin/etags etags %p/bin/etags.%n 55 \
--slave %p/share/man/man1/etags.1 etags.1 %p/share/man/man1/etags.1.%n
update-alternatives \
--install %p/bin/emacsclient emacsclient %p/bin/emacsclient.%n 35 \
--slave %p/share/man/man1/emacsclient.1 emacsclient.1 \
%p/share/man/man1/emacsclient.1.%n
update-alternatives --install %p/bin/b2m b2m %p/bin/b2m.%n 35
update-alternatives \
--install %p/bin/rcs-checkin rcs-checkin %p/bin/rcs-checkin.%n 35
update-alternatives --install %p/bin/ebrowse ebrowse %p/bin/ebrowse.%n 35
update-alternatives --install %p/bin/grep-changelog grep-changelog \
%p/bin/grep-changelog.%n 35
# Regiser ourselves with emacsen-common
%p/lib/emacsen-common/emacs-install %n
# Since we're placing our info files in a subdirectory of %p/share/info
# we need to manually add each doc to the info dir-file
# NOTE: list of info docs also present in prerm script and "fixinfo"
# included in the emacs22-carbon.patch
for file in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
eintr elisp emacs emacs-mime erc eshell eudc flymake \
forms gnus idlwave info message mh-e newsticker org pcl-cvs \
pgg rcirc reftex sc ses sieve smtpmail speedbar tramp url \
vip viper widget woman
do
install-info --infodir=%p/share/info \
--section "Carbon Emacs" "Carbon Emacs" %p/share/info/%n/${file}
done
<<
PreRmScript: <<
# Remove CVS date from version number (%v) and append '-carbon' suffix
v=`echo "%v"|sed 's/\.cvs.*$//'`-carbon
# Manually remove all of our info docs from the dir-file
for file in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
eintr elisp emacs emacs-mime erc eshell eudc flymake \
forms gnus idlwave info message mh-e newsticker org pcl-cvs \
pgg rcirc reftex sc ses sieve smtpmail speedbar tramp url \
vip viper widget woman
do
install-info --infodir=%p/share/info --remove-exactly %n/${file}
done
if [ $1 != "upgrade" ]; then
update-alternatives --remove emacs %p/bin/%n
update-alternatives --remove emacsclient %p/bin/emacsclient.%n
update-alternatives --remove ctags %p/bin/ctags.%n
update-alternatives --remove etags %p/bin/etags.%n
update-alternatives --remove b2m %p/bin/b2m.%n
update-alternatives --remove rcs-checkin %p/bin/rcs-checkin.%n
update-alternatives --remove ebrowse %p/bin/ebrowse.%n
%p/lib/emacsen-common/emacs-remove %n
fi
<<
DescDetail: <<
GNU Emacs is an extensible, customizable, self-documenting real-time
display editor. Through its extensibility, it is actually much more
than an editor. You can use it as a file manager, mail reader, web
browser, and for many other tasks. Some people even use it to control
their coffee machine.
This package installs Carbon port of GNU Emacs, which can natively run
on Mac OS X window system. Also supports input methods for
international languages.
Use -nw option to use this emacs on terminal.
<<
DescPackaging: <<
This .info file is essentially based on the emacs21 package by:
Christian Swinehart
The first author of this package is:
NAKAHASHI Ichiro
update-alternatives is used for emacs, emacsclient, ctags, etags, b2m
rcs-checkin, ebrowse, and grep-changelog to allow parallel installation
of emacs22 & xemacs & emacs22-carbon.
Its info files are installed into the emacs22-carbon subdirectory of
<<
DescPort: <<
You can lauch emacs22 from Finder, as well as terminal using usual
command line syntax. For this purpose, Emacs22.app is placed on
%p/Applications and will be symlinked to /Applications/Fink. To gain a
better integration with the fink environments, it automatically loads
%p/bin/init.sh at startup.
I don't know why nichiro set $0 to Emacs instead of Emacs.bin.
The patchfile modifies startup.el, and brings in the scripts fix-info and
mangle-info, in order to implement our emacs packaging system.
<<
DescUsage: <<
You can launch emacs22-carbon, not just by double-clicking, but also by typing
$ emacs22-carbon
or
$ Emacs22.app
in the terminal. In this way, you can pass runtime options to emacs, e.g.
$ emacs22-carbon --no-site-file
If you want to input characters via MacIM in inline style, add your .emacs.el:
(if (eq window-system 'mac)
(setq default-input-method "MacOSX"))
In addition, if you want to input "Backslash" instead of "Yen Sign", add:
(if (eq window-system 'mac) (progn
(setq default-input-method "MacOSX")
(mac-translate-from-yen-to-backslash)))
<<
License: GPL
Maintainer: Todai Fink Team
Homepage: http://www.emacswiki.org/cgi-bin/wiki
diff -Naur emacs-22.1.orig/01carbon-emacs.el emacs-22.1/01carbon-emacs.el
--- emacs-22.1.orig/01carbon-emacs.el 1970-01-01 00:00:00.000000000 +0000
+++ emacs-22.1/01carbon-emacs.el 2007-06-08 13:59:50.000000000 +0000
@@ -0,0 +1,13 @@
+(if (eq window-system 'mac)
+ (progn
+ ;; append "PREFIX/sbin" "PREFIX/bin" to exec-path
+ (if (not (member "@PREFIX@/sbin" exec-path))
+ (setq exec-path (append '("@PREFIX@/sbin") exec-path))
+ )
+ (if (not (member "@PREFIX@/bin" exec-path))
+ (setq exec-path (append '("@PREFIX@/bin") exec-path))
+ )
+
+ ;; inline image support
+ (auto-image-file-mode)
+ ))
diff -Naur emacs-22.1.orig/Emacs.finkwrap emacs-22.1/Emacs.finkwrap
--- emacs-22.1.orig/Emacs.finkwrap 1970-01-01 00:00:00.000000000 +0000
+++ emacs-22.1/Emacs.finkwrap 2006-03-06 15:42:52.000000000 +0000
@@ -0,0 +1,3 @@
+#!/bin/bash
+. @PREFIX@/bin/init.sh
+exec -a "$0" "$0.bin" "$@"
diff -Naur emacs-22.1.orig/Makefile.in emacs-22.1/Makefile.in
--- emacs-22.1.orig/Makefile.in 2007-05-14 14:56:28.000000000 +0000
+++ emacs-22.1/Makefile.in 2007-06-07 13:14:37.000000000 +0000
@@ -436,8 +436,7 @@
&& (echo "Copying $${dir} to $${dest}..." ; \
(cd $${dir}; tar -chf - . ) \
| (cd $${dest}; umask 022; \
- tar -xvf - && cat > /dev/null) || exit 1; \
- find $${dest} -exec chown $${LOGNAME:-$$USERNAME} {} ';' ;\
+ tar -xvf - --no-same-owner --no-same-permissions && cat > /dev/null) || exit 1; \
for subdir in `find $${dest} -type d ! -name RCS ! -name CVS -print` ; do \
chmod a+rx $${subdir} ; \
rm -rf $${subdir}/RCS ; \
@@ -476,8 +475,8 @@
then \
echo "Copying etc/DOC-* to $(DESTDIR)${docdir} ..." ; \
(cd ./etc; tar -chf - DOC*) \
- |(cd $(DESTDIR)${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd $(DESTDIR)$(docdir); chown $${LOGNAME:-$$USERNAME} DOC*; chmod a+r DOC*; \
+ |(cd $(DESTDIR)${docdir}; umask 022; tar -xvf - --no-same-owner --no-same-permissions && cat > /dev/null) || exit 1; \
+ (cd $(DESTDIR)$(docdir); chmod a+r DOC*; \
if test "`echo DOC-*`" != "DOC-*"; then rm -f DOC; fi); \
else true; fi
-unset CDPATH; \
@@ -488,8 +487,7 @@
then \
echo "Copying lisp/*.el and lisp/*.elc to $(DESTDIR)${lispdir} ..." ; \
(cd lisp; tar -chf - *.el *.elc) \
- |(cd $(DESTDIR)${lispdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
- (cd $(DESTDIR)${lispdir}; find . -exec chown $${LOGNAME:-$$USERNAME} {} ';') ; \
+ |(cd $(DESTDIR)${lispdir}; umask 022; tar -xvf - --no-same-owner --no-same-permissions && cat > /dev/null) || exit 1; \
else true; fi
-unset CDPATH; \
if [ -n "${GZIP_PROG}" ]; \
diff -Naur emacs-22.3.orig/leim/Makefile.in emacs-22.3/leim/Makefile.in
--- emacs-22.3.orig/leim/Makefile.in~ 2008-01-07 17:09:43.000000000 +0900
+++ emacs-22.3/leim/Makefile.in 2009-12-28 01:34:23.000000000 +0900
@@ -228,13 +228,13 @@
echo "Copying leim files to ${INSTALLDIR} ..." ; \
if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \
tar -chf - leim-list.el quail ja-dic \
- | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
+ | (cd ${INSTALLDIR}; umask 0; tar -xvf - --no-same-owner --no-same-permissions && cat > /dev/null) ;\
else \
tar -chf - leim-list.el quail \
- | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
+ | (cd ${INSTALLDIR}; umask 0; tar -xvf - --no-same-owner --no-same-permissions && cat > /dev/null) ;\
cd ${srcdir}; \
tar -chf - quail/* ja-dic \
- | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
+ | (cd ${INSTALLDIR}; umask 0; tar -xvf - --no-same-owner --no-same-permissions && cat > /dev/null) ;\
fi; \
rm -rf ${INSTALLDIR}/CVS ${INSTALLDIR}/*/CVS; \
rm -f ${INSTALLDIR}/.cvsignore ${INSTALLDIR}/*/.cvsignore; \
@@ -253,7 +253,6 @@
done) \
else true; fi
-chmod -R a+r ${INSTALLDIR}
- -find ${INSTALLDIR} -exec chown $${LOGNAME:-$$USERNAME} '{}' ';'
clean mostlyclean:
rm -f ${TIT-MISC} ${TIT-MISC:.elc=.el} \
diff -Naur emacs-22.1.orig/configure emacs-22.1/configure
--- emacs-22.1.orig/configure 2007-05-25 12:43:29.000000000 +0000
+++ emacs-22.1/configure 2007-06-07 13:14:37.000000000 +0000
@@ -1807,7 +1807,7 @@
etcdir='${datadir}/emacs/${version}/etc'
archlibdir='${libexecdir}/emacs/${version}/${configuration}'
docdir='${datadir}/emacs/${version}/etc'
-gamedir='${localstatedir}/games/emacs'
+gamedir='${localstatedir}/games/@EMACS-FLAVOR@'
gameuser=games
@@ -22935,6 +22935,7 @@
echo "$as_me: error: can't find current emacs version in \`${srcdir}/lisp/version.el'." >&2;}
{ (exit 1); exit 1; }; }
fi
+version="@EMACS-VERSION@"
### Specify what sort of things we'll be editing into Makefile and config.h.
### Use configuration here uncanonicalized to avoid exceeding size limits.
diff -Naur emacs-22.1.orig/emacs.bash emacs-22.1/emacs.bash
--- emacs-22.1.orig/emacs.bash 1970-01-01 00:00:00.000000000 +0000
+++ emacs-22.1/emacs.bash 2006-03-06 15:42:52.000000000 +0000
@@ -0,0 +1,3 @@
+#!/bin/bash
+exec -a "@PREFIX@/Applications/Emacs22.app/Contents/MacOS/Emacs" \
+ "@PREFIX@/Applications/Emacs22.app/Contents/MacOS/Emacs.bin" "$@"
diff -Naur emacs-22.1.orig/fix-info emacs-22.1/fix-info
--- emacs-22.1.orig/fix-info 1970-01-01 00:00:00.000000000 +0000
+++ emacs-22.1/fix-info 2007-06-07 13:22:34.000000000 +0000
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+THE_INFO_PREFIX=$1
+
+for file in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq \
+ elisp eintr emacs emacs-mime eshell eudc flymake \
+ forms gnus idlwave info message mh-e newsticker org pcl-cvs \
+ pgg reftex sc ses sieve speedbar tramp vip viper widget \
+ woman smtpmail url rcirc erc
+do
+ ./mangle-info ${THE_INFO_PREFIX}/${file}
+done
diff -Naur emacs-22.1.orig/lisp/startup.el emacs-22.1/lisp/startup.el
--- emacs-22.1.orig/lisp/startup.el 2007-05-14 14:56:29.000000000 +0000
+++ emacs-22.1/lisp/startup.el 2007-06-07 13:14:37.000000000 +0000
@@ -292,6 +292,10 @@
(defvar default-frame-background-mode)
+(defconst fink-emacs-flavor '@EMACS-FLAVOR@
+ "A symbol representing the particular fink flavor of emacs running.
+Something like 'emacs20, 'xemacs20, etc.")
+
(defvar pure-space-overflow nil
"Non-nil if building Emacs overflowed pure space.")
@@ -815,8 +819,20 @@
;; be loaded from site-run-file and wants to test if -q was given
;; should check init-file-user instead, since that is already set.
;; See cus-edit.el for an example.
+
+ ;; (if site-run-file
+ ;; (load site-run-file t t))
+
+ ;; Fink version of site-start.
(if site-run-file
- (load site-run-file t t))
+ (progn
+ ;; Load all the fink package snippets.
+ ;; It's in here because we want -q to kill it too.
+ (if (load "fink-startup" t t nil)
+ (fink-startup fink-emacs-flavor))
+ ;; Now the normal site file...
+ (load site-run-file t t nil)))
+
;; Sites should not disable this. Only individuals should disable
;; the startup screen.
diff -Naur emacs-22.1.orig/mangle-info emacs-22.1/mangle-info
--- emacs-22.1.orig/mangle-info 1970-01-01 00:00:00.000000000 +0000
+++ emacs-22.1/mangle-info 2006-03-06 15:42:52.000000000 +0000
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w -i
+
+use English;
+use strict;
+
+$RS = undef;
+
+my $prefix = "@EMACS-FLAVOR@";
+
+my $x = <>;
+if(!($x =~ m/^(\s*START-INFO-DIR-ENTRY\s+\*\s*[^:]+:\s*)\(([^\)]+)\)/mo)) {
+ die "Couldn't find START-INFO-DIR-ENTRY.";
+}
+
+print ${PREMATCH};
+print "$1($prefix/$2)";
+print ${POSTMATCH};
diff -Naur emacs-22.3.orig/src/s/darwin.h emacs-22.3/src/s/darwin.h
--- emacs-22.3.orig/src/s/darwin.h 2008-07-23 18:40:47.000000000 +0200
+++ emacs-22.3/src/s/darwin.h 2009-09-09 13:20:52.000000000 +0200
@@ -351,6 +351,9 @@
#define malloc unexec_malloc
#define realloc unexec_realloc
#define free unexec_free
+/* Don't use posix_memalign because it is not compatible with
+ unexmacosx.c. */
+#undef HAVE_POSIX_MEMALIGN
#endif
/* This makes create_process in process.c save and restore signal
diff -Naur emacs-22.3.orig/src/unexmacosx.c emacs-22.3/src/unexmacosx.c
--- emacs-22.3.orig/src/unexmacosx.c 2008-01-08 05:29:48.000000000 +0100
+++ emacs-22.3/src/unexmacosx.c 2009-09-09 13:24:03.000000000 +0200
@@ -584,6 +584,14 @@
printf ("LC_UUID ");
break;
#endif
+#ifdef LC_DYLD_INFO
+ case LC_DYLD_INFO:
+ printf ("LC_DYLD_INFO ");
+ break;
+ case LC_DYLD_INFO_ONLY:
+ printf ("LC_DYLD_INFO_ONLY");
+ break;
+#endif
default:
printf ("unknown ");
}
@@ -821,6 +829,7 @@
|| strncmp (sectp->sectname, "__const", 16) == 0
|| strncmp (sectp->sectname, "__cfstring", 16) == 0
|| strncmp (sectp->sectname, "__gcc_except_tab", 16) == 0
+ || strncmp (sectp->sectname, "__program_vars", 16) == 0
|| strncmp (sectp->sectname, "__objc_", 7) == 0)
{
if (!unexec_copy (sectp->offset, old_file_offset, sectp->size))
@@ -1088,6 +1097,36 @@
curr_header_offset += lc->cmdsize;
}
+#ifdef LC_DYLD_INFO
+/* Copy a LC_DYLD_INFO(_ONLY) load command from the input file to the output
+ file, adjusting the file offset fields. */
+static void
+copy_dyld_info (struct load_command *lc, long delta)
+{
+ struct dyld_info_command *dip = (struct dyld_info_command *) lc;
+
+ if (dip->rebase_off > 0)
+ dip->rebase_off += delta;
+ if (dip->bind_off > 0)
+ dip->bind_off += delta;
+ if (dip->weak_bind_off > 0)
+ dip->weak_bind_off += delta;
+ if (dip->lazy_bind_off > 0)
+ dip->lazy_bind_off += delta;
+ if (dip->export_off > 0)
+ dip->export_off += delta;
+
+ printf ("Writing ");
+ print_load_command_name (lc->cmd);
+ printf (" command\n");
+
+ if (!unexec_write (curr_header_offset, lc, lc->cmdsize))
+ unexec_error ("cannot write dyld info command to header");
+
+ curr_header_offset += lc->cmdsize;
+}
+#endif
+
/* Copy other kinds of load commands from the input file to the output
file, ones that do not require adjustments of file offsets. */
static void
@@ -1154,6 +1193,12 @@
case LC_TWOLEVEL_HINTS:
copy_twolevelhints (lca[i], linkedit_delta);
break;
+#ifdef LC_DYLD_INFO
+ case LC_DYLD_INFO:
+ case LC_DYLD_INFO_ONLY:
+ copy_dyld_info (lca[i], linkedit_delta);
+ break;
+#endif
default:
copy_other (lca[i]);
break;