delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/12/09/10:52:20

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL
X-Spam-Check-By: sourceware.org
Message-ID: <4B1FC7A2.10401@cornell.edu>
Date: Wed, 09 Dec 2009 10:52:02 -0500
From: Ken Brown <kbrown AT cornell DOT edu>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Need help building emacs with system malloc
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------080408040302050406060308
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Emacs by default uses its own malloc, but the emacs developers have 
suggested that I try to build it so that it uses Cygwin's malloc.  (See 
http://lists.gnu.org/archive/html/emacs-devel/2009-12/threads.html#00369 
for the context if you're curious.)  When I try to do this, the build 
fails as follows:

gcc    -o temacs ecrt0.o dispnew.o frame.o scroll.o xdisp.o menu.o 
window.o charset.o coding.o category.o ccl.o character.o chartab.o cm.o 
term.o terminal.o xfaces.o    emacs.o keyboard.o macros.o keymap.o 
sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o 
dired.o filemode.o cmds.o casetab.o casefiddle.o indent.o search.o 
regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o 
floatfns.o fns.o font.o print.o lread.o syntax.o unexcw.o bytecode.o 
process.o callproc.o region-cache.o sound.o atimer.o doprnt.o strftime.o 
intervals.o textprop.o composite.o md5.o   sheap.o  terminfo.o 
lastfile.o vm-limit.o  getloadavg.o       -lcurses -lg   `gcc 
-print-libgcc-file-name` -lm -lc `gcc -print-libgcc-file-name`
vm-limit.o:vm-limit.c:(.text+0x17): undefined reference to 
`___after_morecore_hook'
vm-limit.o:vm-limit.c:(.text+0x6c): undefined reference to `___morecore'

Is this one of those situations where the libraries are listed in the 
wrong order in the gcc command?  Or is there something else going on? 
I'm attaching my .cygport and .src.patch files in case it's more subtle 
and someone else wants to give it a try.

Ken


--------------080408040302050406060308
Content-Type: text/plain;
 name="emacs-23.1.90-1.cygport"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="emacs-23.1.90-1.cygport"

DESCRIPTION="Emacs is the extensible, customizable, self-documenting real-time display editor."
HOMEPAGE="http://www.gnu.org/software/emacs/"
# SRC_URI="http://ftp.gnu.org/pub/gnu/emacs/emacs-${PV}.tar.gz"
SRC_URI="ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-${PV}.tar.gz"

PKG_NAMES="${PN} ${PN}-el ${PN}-X11"
PKG_HINTS="setup ${PN}-el ${PN}-X11"
PKG_CONTENTS[0]="--exclude=usr/share/${PN}/${PV}/lisp*el.gz \
                 --exclude=usr/share/${PN}/${PV}/leim*el.gz \
                 --exclude=usr/share/${PN}/${PV}/etc/make_shortcut.sh \
                 --exclude=usr/bin/emacs-X11.exe \
                 --exclude=etc/postinstall/emacs-X11.sh \
                 --exclude=etc/preremove/emacs-X11.sh \
                 *"
PKG_CONTENTS[1]="--exclude=usr/share/${PN}/${PV}/lisp*el \
                 --exclude=usr/share/${PN}/${PV}/leim*el \
		 --exclude=usr/share/${PN}/${PV}/lisp*elc \
                 --exclude=usr/share/${PN}/${PV}/leim*elc \
                 --exclude=usr/share/${PN}/${PV}/lisp/COPYING \
                 --exclude=usr/share/${PN}/${PV}/lisp/README \
                 --exclude=usr/share/${PN}/${PV}/lisp/calc/README \
                 --exclude=usr/share/${PN}/${PV}/lisp/calc/README.prev \
                 --exclude=usr/share/${PN}/${PV}/lisp/international/README \
                 --exclude=usr/share/${PN}/${PV}/lisp/term/README \
                 --exclude=usr/share/${PN}/${PV}/lisp/nxml/TODO \
                 --exclude=usr/share/${PN}/${PV}/lisp/forms-d2.dat \
                 usr/share/${PN}/${PV}/lisp \
                 usr/share/${PN}/${PV}/leim"
PKG_CONTENTS[2]="usr/bin/emacs-X11.exe \
                 etc/postinstall/emacs-X11.sh \
                 etc/preremove/emacs-X11.sh \
                 usr/share/${PN}/${PV}/etc/make_shortcut.sh"

DIFF_EXCLUDES="loaddefs.el config.in *.elc"

src_compile() {
	cd ${S}
	cygautoreconf
	cd ${B}
	# build non-X11 binary first
	cygconf --with-x=no
	cygmake
	# save non-X11 binary
	cp -v src/emacs.exe emacs-nox.exe
	# cleanup build dir
	make distclean
	# build X11 binary
	cygconf
	cygmake
	# restore non-X11 binary
	mv -v emacs-nox.exe src/emacs-nox.exe
	cp -v src/emacs.exe src/emacs-X11.exe
}

src_install() {
	cd ${B}
	cyginstall
	# additionally install non-X11 binary
	dobin src/emacs-nox.exe
	dobin src/emacs-X11.exe
	# install windows icon
	cp -v ${S}/nt/icons/emacs.ico ${D}/usr/share/emacs/${PV}/etc/
	# install postinstall/preremove scripts for sub packages
	dodir /etc/postinstall
	cp -v ${C}/emacs-X11.postinstall.sh ${D}/etc/postinstall/emacs-X11.sh
	dodir /etc/preremove
	cp -v ${C}/emacs-X11.preremove.sh ${D}/etc/preremove/emacs-X11.sh
	# install script for making desktop shortcut
	install ${C}/make_shortcut.sh ${D}/usr/share/emacs/${PV}/etc/
	cp -v ${C}/emacs.xml ${D}/usr/share/emacs/${PV}/etc/
	# remove some files that do not need to be packaged
	cd ${D}
	rm -fv	usr/bin/emacs-${PV}.exe \
		usr/bin/emacs.exe \
		usr/bin/b2m.exe \
		usr/bin/rcs-checkin \
		usr/bin/ctags.exe \
		usr/bin/etags.exe \
		usr/share/man/man1/ctags* \
		usr/share/man/man1/etags*
}

### Local Variables:
### mode: sh
### End:

--------------080408040302050406060308
Content-Type: text/plain;
 name="emacs-23.1.90-1.src.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="emacs-23.1.90-1.src.patch"

--- origsrc/emacs-23.1.90/src/s/cygwin.h	2009-12-08 20:01:43.000000000 -0500
+++ src/emacs-23.1.90/src/s/cygwin.h	2009-12-09 09:55:20.343750000 -0500
@@ -130,7 +130,9 @@ along with GNU Emacs.  If not, see <http
    memalign and on Cygwin, that becomes the Cygwin-supplied memalign.
    As malloc is not the Cygwin malloc, the Cygwin memalign always
    returns ENOSYS.  A workaround is to set G_SLICE=always-malloc. */
-#define G_SLICE_ALWAYS_MALLOC
+/* #define G_SLICE_ALWAYS_MALLOC */
+
+#define SYSTEM_MALLOC
 
 /* the end */
 


--------------080408040302050406060308
Content-Type: text/plain; charset=us-ascii

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
--------------080408040302050406060308--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019