summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2018-07-28 21:25:15 +0200
committerUlrich Müller <ulm@gentoo.org>2018-07-28 21:26:10 +0200
commit0a7587ec5063edaeeb4698339e699d97e8a1a465 (patch)
tree5c9faa67933b34a4f554e3ac932df28d88fa6d2a /app-editors/emacs/files
parentapp-editors/xemacs: Remove since outdated as compared to gentoo repo (diff)
downloademacs-0a7587ec5063edaeeb4698339e699d97e8a1a465.tar.gz
emacs-0a7587ec5063edaeeb4698339e699d97e8a1a465.tar.bz2
emacs-0a7587ec5063edaeeb4698339e699d97e8a1a465.zip
app-editors/emacs: Restore emacs-24.3 for compatibility testing.
This version is for investigation of some problems with app-emacs/vm and PGP encryption/decryption, where 24.3 is the last known good version. I publish this ebuild only because it was surprisingly hard to make this version build again, given the fact that there are working ebuilds for both 23.4 and 24.5. Since it is meant as a temporary solution, there is no consolidated patchset. Only the patches necessary to make it build are applied. Also some less important features (like shared game score files) have been dropped. Package-Manager: Portage-2.3.43, Repoman-2.3.10
Diffstat (limited to 'app-editors/emacs/files')
-rw-r--r--app-editors/emacs/files/emacs-24.3-data-start.patch626
-rw-r--r--app-editors/emacs/files/emacs-24.3-giflib-5.patch168
-rw-r--r--app-editors/emacs/files/emacs-24.3-jpeg-version.patch25
3 files changed, 819 insertions, 0 deletions
diff --git a/app-editors/emacs/files/emacs-24.3-data-start.patch b/app-editors/emacs/files/emacs-24.3-data-start.patch
new file mode 100644
index 0000000..6a1960e
--- /dev/null
+++ b/app-editors/emacs/files/emacs-24.3-data-start.patch
@@ -0,0 +1,626 @@
+commit 1ddc2bd6ff0b5071454d2591f835927ea5b85a06
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Feb 24 21:55:37 2013 -0800
+
+ Simplify data_start configuration.
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -213,12 +213,6 @@
+ fi
+ fi
+
+-CRT_DIR=
+-AC_ARG_WITH([crt-dir],dnl
+-[AS_HELP_STRING([--with-crt-dir=DIR],[directory containing crtn.o etc.
+-The default is /usr/lib, or /usr/lib64 on some platforms.])])
+-CRT_DIR="${with_crt_dir}"
+-
+ AC_ARG_WITH(gameuser,dnl
+ [AS_HELP_STRING([--with-gameuser=USER],[user for shared game score files])])
+ test "X${with_gameuser}" != X && test "${with_gameuser}" != yes \
+@@ -1031,42 +1025,29 @@
+
+
+ LIB_MATH=-lm
+-LIB_STANDARD=
+-START_FILES=
+ dnl Current possibilities handled by sed (aix4-2 -> aix,
+ dnl gnu-linux -> gnu/linux, etc.):
+ dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix.
+ dnl And special cases: berkeley-unix, usg-unix-v, ms-dos, windows-nt.
+ SYSTEM_TYPE=`echo $opsys | sed -e 's/[[0-9]].*//' -e 's|-|/|'`
+
+-dnl NB do not use CRT_DIR unquoted here, since it might not be set yet.
+ case $opsys in
+ cygwin )
+ LIB_MATH=
+- START_FILES='pre-crt0.o'
+ ;;
+ darwin )
+ ## Adding -lm confuses the dynamic linker, so omit it.
+ LIB_MATH=
+- START_FILES='pre-crt0.o'
+ ;;
+ freebsd )
+- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
+- START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
+ SYSTEM_TYPE=berkeley-unix
+ ;;
+ gnu-linux | gnu-kfreebsd )
+- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
+- START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
+ ;;
+ hpux10-20 | hpux11 )
+- LIB_STANDARD=-lc
+- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o'
+ ;;
+ dnl NB this may be adjusted below.
+ netbsd | openbsd )
+- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
+- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
+ SYSTEM_TYPE=berkeley-unix
+ ;;
+
+@@ -1077,96 +1058,9 @@
+ esac
+
+ AC_SUBST(LIB_MATH)
+-AC_SUBST(START_FILES)
+ AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE",
+ [The type of system you are compiling for; sets `system-type'.])
+
+-dnl Not all platforms use crtn.o files. Check if the current one does.
+-crt_files=
+-
+-for file in x $LIB_STANDARD $START_FILES; do
+- case "$file" in
+- *CRT_DIR*) crt_files="$crt_files `echo $file | sed -e 's|.*/||'`" ;;
+- esac
+-done
+-
+-if test "x$crt_files" != x; then
+-
+- ## If user specified a crt-dir, use that unconditionally.
+- crt_gcc=no
+-
+- if test "X$CRT_DIR" = "X"; then
+-
+- CRT_DIR=/usr/lib # default
+-
+- case "$canonical" in
+- x86_64-*-linux-gnu* | s390x-*-linux-gnu*)
+- ## On x86-64 and s390x GNU/Linux distributions, the standard library
+- ## can be in a variety of places. We only try /usr/lib64 and /usr/lib.
+- ## For anything else (eg /usr/lib32), it is up the user to specify
+- ## the location (bug#5655).
+- ## Test for crtn.o, not just the directory, because sometimes the
+- ## directory exists but does not have the relevant files (bug#1287).
+- ## FIXME better to test for binary compatibility somehow.
+- test -e /usr/lib64/crtn.o && CRT_DIR=/usr/lib64
+- ;;
+-
+- powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*) CRT_DIR=/usr/lib64 ;;
+- esac
+-
+- case "$opsys" in
+- hpux10-20) CRT_DIR=/lib ;;
+- esac
+-
+- test "x${GCC}" = xyes && crt_gcc=yes
+-
+- fi # CRT_DIR = ""
+-
+- crt_missing=
+-
+- for file in $crt_files; do
+-
+- ## If we're using gcc, try to determine it automatically by asking
+- ## gcc. [If this doesn't work, CRT_DIR will remain at the
+- ## system-dependent default from above.]
+- if test $crt_gcc = yes && test ! -e $CRT_DIR/$file; then
+-
+- crt_file=`$CC --print-file-name=$file 2>/dev/null`
+- case "$crt_file" in
+- */*)
+- CRT_DIR=`AS_DIRNAME(["$crt_file"])`
+- ;;
+- esac
+- fi
+-
+- dnl We expect all the files to be in a single directory, so after the
+- dnl first there is no point asking gcc.
+- crt_gcc=no
+-
+- test -e $CRT_DIR/$file || crt_missing="$crt_missing $file"
+- done # $crt_files
+-
+- test "x$crt_missing" = x || \
+- AC_MSG_ERROR([Required file(s) not found:$crt_missing
+-Try using the --with-crt-dir option.])
+-
+-fi # crt_files != ""
+-
+-AC_SUBST(CRT_DIR)
+-
+-case $opsys in
+- netbsd | openbsd )
+- if test -f $CRT_DIR/crti.o; then
+-
+- test -f $CRT_DIR/crtn.o || \
+- AC_MSG_ERROR([Required file not found: crtn.o])
+-
+- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
+- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+- fi
+- ;;
+-esac
+-
+
+ pre_PKG_CONFIG_CFLAGS=$CFLAGS
+ pre_PKG_CONFIG_LIBS=$LIBS
+@@ -1284,7 +1178,7 @@
+ AC_CHECK_HEADERS_ONCE(
+ linux/version.h sys/systeminfo.h
+ stdio_ext.h fcntl.h coff.h pty.h
+- sys/vlimit.h sys/resource.h
++ sys/resource.h
+ sys/utsname.h pwd.h utmp.h dirent.h util.h)
+
+ AC_MSG_CHECKING(if personality LINUX32 can be set)
+@@ -1501,8 +1395,6 @@
+ CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
+ LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}"
+ LIBS_GNUSTEP="-lgnustep-gui -lgnustep-base -lobjc -lpthread"
+- LIB_STANDARD=
+- START_FILES=
+ dnl GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS to 0 or 1.
+ dnl If they had chosen to either define it or not, we could have
+ dnl just used AC_CHECK_DECL here.
+@@ -1591,7 +1483,6 @@
+ AC_SUBST(ns_self_contained)
+ AC_SUBST(NS_OBJ)
+ AC_SUBST(NS_OBJC_OBJ)
+-AC_SUBST(LIB_STANDARD)
+
+ HAVE_W32=no
+ W32_OBJ=
+@@ -1716,6 +1607,20 @@
+ else
+ test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o
+ VMLIMIT_OBJ=vm-limit.o
++
++ AC_CHECK_HEADERS([sys/vlimit.h])
++ AC_CACHE_CHECK([for data_start], [emacs_cv_data_start],
++ [AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [[extern char data_start[]; char ch;]],
++ [[return data_start == &ch;]])],
++ [emacs_cv_data_start=yes],
++ [emacs_cv_data_start=no])])
++ if test $emacs_cv_data_start = yes; then
++ AC_DEFINE([HAVE_DATA_START], 1,
++ [Define to 1 if data_start is the address of the start
++ of the main data segment.])
++ fi
+ fi
+ AC_SUBST(GMALLOC_OBJ)
+ AC_SUBST(VMLIMIT_OBJ)
+@@ -3759,9 +3664,7 @@
+ fi dnl emacs_glibc
+
+
+-dnl Used in vm-limit.c
+-AH_TEMPLATE(DATA_START, [Address of the start of the data segment.])
+-dnl Used in lisp.h, emacs.c, mem-limits.h
++dnl Used in lisp.h, emacs.c, vm-limit.c
+ dnl NEWS.18 describes this as "a number which contains
+ dnl the high bits to be inclusive or'ed with pointers that are unpacked."
+ AH_TEMPLATE(DATA_SEG_BITS, [Extra bits to be or'd in with any pointers
+@@ -3769,23 +3672,15 @@
+ dnl if Emacs uses fewer than 32 bits for the value field of a LISP_OBJECT.
+
+ case $opsys in
+- gnu)
+- dnl libc defines data_start.
+- AC_DEFINE(DATA_START, [({ extern int data_start; (char *) &data_start; })])
+- ;;
+-
+ aix*)
+ dnl This works with 32-bit executables; Emacs doesn't support 64-bit.
+- AC_DEFINE(DATA_START, [0x20000000])
+ AC_DEFINE(DATA_SEG_BITS, [0x20000000])
+ ;;
+ hpux*)
+ dnl The data segment on this machine always starts at address 0x40000000.
+- AC_DEFINE(DATA_START, [0x40000000])
+ AC_DEFINE(DATA_SEG_BITS, [0x40000000])
+ ;;
+ irix6-5)
+- AC_DEFINE(DATA_START, [0x10000000])
+ AC_DEFINE(DATA_SEG_BITS, [0x10000000])
+ ;;
+ esac
+@@ -4373,88 +4268,6 @@
+
+ AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
+
+-
+-LD_FIRSTFLAG=
+-ORDINARY_LINK=
+-case "$opsys" in
+- ## gnu: GNU needs its own crt0.
+- aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;;
+-
+- ## On post 1.3 releases of NetBSD, gcc -nostdlib also clears the
+- ## library search parth, i.e. it won't search /usr/lib for libc and
+- ## friends. Using -nostartfiles instead avoids this problem, and
+- ## will also work on earlier NetBSD releases.
+- netbsd|openbsd) LD_FIRSTFLAG="-nostartfiles" ;;
+-
+- ## powerpc*: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says
+- ## MkLinux/LinuxPPC needs this.
+- ## s390x-* only supports opsys = gnu-linux so it can be added here.
+- gnu-*)
+- case "$canonical" in
+- powerpc*|s390x-*) LD_FIRSTFLAG="-nostdlib" ;;
+- esac
+- ;;
+-esac
+-
+-
+-if test "x$ORDINARY_LINK" = "xyes"; then
+-
+- LD_FIRSTFLAG=""
+- AC_DEFINE(ORDINARY_LINK, 1, [Define if the C compiler is the linker.])
+-
+-## The system files defining neither ORDINARY_LINK nor LD_FIRSTFLAG are:
+-## freebsd, gnu-* not on powerpc*|s390x*.
+-elif test "x$GCC" = "xyes" && test "x$LD_FIRSTFLAG" = "x"; then
+-
+- ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
+- ## places that are difficult to figure out at make time. Fortunately,
+- ## these same versions allow you to pass arbitrary flags on to the
+- ## linker, so there is no reason not to use it as a linker.
+- ##
+- ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from
+- ## searching for libraries in its internal directories, so we have to
+- ## ask GCC explicitly where to find libgcc.a (LIB_GCC below).
+- LD_FIRSTFLAG="-nostdlib"
+-fi
+-
+-## FIXME? What setting of EDIT_LDFLAGS should this have?
+-test "$NS_IMPL_GNUSTEP" = "yes" && LD_FIRSTFLAG="-rdynamic"
+-
+-AC_SUBST(LD_FIRSTFLAG)
+-
+-
+-## FIXME? The logic here is not precisely the same as that above.
+-## There is no check here for a pre-defined LD_FIRSTFLAG.
+-## Should we only be setting LIB_GCC if LD ~ -nostdlib?
+-LIB_GCC=
+-if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then
+-
+- case "$opsys" in
+- freebsd|netbsd|openbsd) LIB_GCC= ;;
+-
+- gnu-*)
+- ## armin76@gentoo.org reported that the lgcc_s flag is necessary to
+- ## build on ARM EABI under GNU/Linux. (Bug#5518)
+- case $host_cpu in
+- arm*)
+- LIB_GCC="-lgcc_s"
+- ;;
+- *)
+- ## FIXME? s/gnu-linux.h used to define LIB_GCC as below, then
+- ## immediately undefine it again and redefine it to empty.
+- ## Was the C_SWITCH_X_SITE part really necessary?
+-## LIB_GCC=`$CC $C_SWITCH_X_SITE -print-libgcc-file-name`
+- LIB_GCC=
+- ;;
+- esac
+- ;;
+-
+- ## Ask GCC where to find libgcc.a.
+- *) LIB_GCC=`$CC -print-libgcc-file-name 2> /dev/null` ;;
+- esac
+-fi dnl if $GCC
+-AC_SUBST(LIB_GCC)
+-
+ ## Common for all window systems
+ if test "$window_system" != "none"; then
+ AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -34,7 +34,6 @@
+ CFLAGS = @CFLAGS@
+ CPPFLAGS = @CPPFLAGS@
+ LDFLAGS = @LDFLAGS@
+-LD_FIRSTFLAG=@LD_FIRSTFLAG@
+ EXEEXT = @EXEEXT@
+ version = @version@
+ # Substitute an assignment for the MAKE variable, because
+@@ -100,10 +99,8 @@
+ ## System-specific LDFLAGS.
+ LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@
+
+-## This holds any special options for linking temacs only (ie, not
+-## used by configure). Not used elsewhere because it sometimes
+-## contains options that have to do with using Emacs's crt0,
+-## which are only good with temacs.
++## This holds any special options for linking temacs only (i.e., not
++## used by configure).
+ LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
+
+ ## Flags to pass to ld only for temacs.
+@@ -121,14 +118,6 @@
+ ## Some systems define this to request special libraries.
+ LIBS_SYSTEM=@LIBS_SYSTEM@
+
+-## Where to find libgcc.a, if using gcc and necessary.
+-LIB_GCC=@LIB_GCC@
+-
+-CRT_DIR=@CRT_DIR@
+-## May use $CRT_DIR.
+-LIB_STANDARD=@LIB_STANDARD@
+-START_FILES = @START_FILES@
+-
+ ## -lm, or empty.
+ LIB_MATH=@LIB_MATH@
+
+@@ -381,17 +370,16 @@
+
+ ## List of object files that make-docfile should not be told about.
+ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
+- $(POST_ALLOC_OBJ) $(VMLIMIT_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
++ $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
+
++## All object files linked into temacs. $(VMLIMIT_OBJ) should be first.
++ALLOBJS = $(VMLIMIT_OBJ) $(obj) $(otherobj)
+
+ ## Configure inserts the file lisp.mk at this point, defining $lisp.
+ @lisp_frag@
+
+
+ ## Construct full set of libraries to be linked.
+-## Note that SunOS needs -lm to come before -lc; otherwise, you get
+-## duplicated symbols. If the standard libraries were compiled
+-## with GCC, we might need LIB_GCC again after them.
+ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
+ $(LIBX_OTHER) $(LIBSOUND) \
+ $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \
+@@ -401,7 +389,7 @@
+ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
+ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
+ $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \
+- $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC)
++ $(LIB_MATH)
+
+ all: emacs$(EXEEXT) $(OTHER_FILES)
+ .PHONY: all
+@@ -448,7 +436,7 @@
+ cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT)
+
+ buildobj.h: Makefile
+- echo "#define BUILDOBJ \"$(obj) $(otherobj) " "\"" > buildobj.h
++ echo "#define BUILDOBJ \"$(ALLOBJS) " "\"" >$@
+
+ globals.h: gl-stamp; @true
+
+@@ -460,14 +448,14 @@
+ $(srcdir)/../build-aux/move-if-change gl-tmp globals.h
+ echo timestamp > $@
+
+-$(obj) $(otherobj): globals.h
++$(ALLOBJS): globals.h
+
+ $(lib)/libgnu.a: $(config_h)
+ cd $(lib) && $(MAKE) libgnu.a
+
+-temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) $(lib)/libgnu.a
+- $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
+- -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES)
++temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) $(lib)/libgnu.a
++ $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
++ -o temacs $(ALLOBJS) $(lib)/libgnu.a $(LIBES)
+ test "$(CANNOT_DUMP)" = "yes" || \
+ test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
+ test "$(CANNOT_DUMP)" = "yes" || test "X$(SETFATTR)" = X || \
+--- a/src/autodeps.mk
++++ b/src/autodeps.mk
+@@ -2,5 +2,4 @@
+
+ ## This is inserted in src/Makefile if AUTO_DEPEND=yes.
+
+-ALLOBJS=$(START_FILES) ${obj} ${otherobj}
+ -include $(ALLOBJS:%.o=${DEPDIR}/%.d)
+--- a/src/deps.mk
++++ b/src/deps.mk
+@@ -143,7 +143,7 @@
+ dispextern.h lisp.h globals.h $(config_h) systime.h coding.h composite.h
+ gmalloc.o: gmalloc.c $(config_h)
+ ralloc.o: ralloc.c lisp.h $(config_h)
+-vm-limit.o: vm-limit.c mem-limits.h lisp.h globals.h $(config_h)
++vm-limit.o: vm-limit.c lisp.h globals.h $(config_h)
+ marker.o: marker.c buffer.h character.h lisp.h globals.h $(config_h)
+ minibuf.o: minibuf.c syntax.h frame.h window.h keyboard.h systime.h \
+ buffer.h commands.h character.h msdos.h $(INTERVALS_H) keymap.h \
+--- a/src/emacs.c
++++ b/src/emacs.c
+@@ -522,32 +522,6 @@
+ static char dump_tz[] = "UtC0";
+ #endif
+
+-#ifndef ORDINARY_LINK
+-/* We don't include crtbegin.o and crtend.o in the link,
+- so these functions and variables might be missed.
+- Provide dummy definitions to avoid error.
+- (We don't have any real constructors or destructors.) */
+-#ifdef __GNUC__
+-
+-/* Define a dummy function F. Declare F too, to pacify gcc
+- -Wmissing-prototypes. */
+-#define DEFINE_DUMMY_FUNCTION(f) \
+- void f (void) ATTRIBUTE_CONST EXTERNALLY_VISIBLE; void f (void) {}
+-
+-#ifndef GCC_CTORS_IN_LIBC
+-DEFINE_DUMMY_FUNCTION (__do_global_ctors)
+-DEFINE_DUMMY_FUNCTION (__do_global_ctors_aux)
+-DEFINE_DUMMY_FUNCTION (__do_global_dtors)
+-/* GNU/Linux has a bug in its library; avoid an error. */
+-#ifndef GNU_LINUX
+-char * __CTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 };
+-#endif
+-char * __DTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 };
+-#endif /* GCC_CTORS_IN_LIBC */
+-DEFINE_DUMMY_FUNCTION (__main)
+-#endif /* __GNUC__ */
+-#endif /* ORDINARY_LINK */
+-
+ /* Test whether the next argument in ARGV matches SSTR or a prefix of
+ LSTR (at least MINLEN characters). If so, then if VALPTR is non-null
+ (the argument is supposed to have a value) store in *VALPTR either
+--- a/src/vm-limit.c
++++ b/src/vm-limit.c
+@@ -19,7 +19,37 @@
+ #include <config.h>
+ #include <unistd.h> /* for 'environ', on AIX */
+ #include "lisp.h"
+-#include "mem-limits.h"
++
++#ifdef MSDOS
++#include <dpmi.h>
++extern int etext;
++#endif
++
++/* Some systems need this before <sys/resource.h>. */
++#include <sys/types.h>
++
++#ifdef HAVE_SYS_RESOURCE_H
++# include <sys/time.h>
++# include <sys/resource.h>
++#else
++# if HAVE_SYS_VLIMIT_H
++# include <sys/vlimit.h> /* Obsolete, says glibc */
++# endif
++#endif
++
++/* Start of data. It is OK if this is approximate; it's used only as
++ a heuristic. */
++#ifdef DATA_START
++# define data_start ((char *) DATA_START)
++#else
++extern char data_start[];
++# ifndef HAVE_DATA_START
++/* Initialize to nonzero, so that it's put into data and not bss.
++ Link this file's object code first, so that this symbol is near the
++ start of data. */
++char data_start[1] = { 1 };
++# endif
++#endif
+
+ /*
+ Level number of warnings already issued.
+@@ -43,6 +73,14 @@
+ /* Number of bytes of writable memory we can expect to be able to get. */
+ static size_t lim_data;
+
++/* Return true if PTR cannot be represented as an Emacs Lisp object. */
++static bool
++exceeds_lisp_ptr (void *ptr)
++{
++ return (! USE_LSB_TAG
++ && VAL_MAX < UINTPTR_MAX
++ && ((uintptr_t) ptr & ~DATA_SEG_BITS) >> VALBITS != 0);
++}
+
+ #if defined (HAVE_GETRLIMIT) && defined (RLIMIT_AS)
+ static void
+@@ -169,6 +207,8 @@
+ {
+ #ifdef REL_ALLOC
+ extern POINTER (*real_morecore) (ptrdiff_t);
++#else
++ POINTER (*real_morecore) (ptrdiff_t) = 0;
+ #endif
+ extern POINTER (*__morecore) (ptrdiff_t);
+
+@@ -182,13 +222,8 @@
+ five_percent = lim_data / 20;
+
+ /* Find current end of memory and issue warning if getting near max */
+-#ifdef REL_ALLOC
+- if (real_morecore)
+- cp = (char *) (*real_morecore) (0);
+- else
+-#endif
+- cp = (char *) (*__morecore) (0);
+- data_size = (char *) cp - (char *) data_space_start;
++ cp = (real_morecore ? real_morecore : __morecore) (0);
++ data_size = cp - data_space_start;
+
+ if (!warn_function)
+ return;
+@@ -235,49 +270,10 @@
+ warnlevel = warned_85;
+ }
+
+- if (EXCEEDS_LISP_PTR (cp))
++ if (exceeds_lisp_ptr (cp))
+ (*warn_function) ("Warning: memory in use exceeds lisp pointer size");
+ }
+
+-#if !defined (CANNOT_DUMP) || !defined (SYSTEM_MALLOC)
+-/* Some systems that cannot dump also cannot implement these. */
+-
+-/*
+- * Return the address of the start of the data segment prior to
+- * doing an unexec. After unexec the return value is undefined.
+- * See crt0.c for further information and definition of data_start.
+- *
+- * Apparently, on BSD systems this is etext at startup. On
+- * USG systems (swapping) this is highly mmu dependent and
+- * is also dependent on whether or not the program is running
+- * with shared text. Generally there is a (possibly large)
+- * gap between end of text and start of data with shared text.
+- *
+- */
+-
+-char *
+-start_of_data (void)
+-{
+-#ifdef BSD_SYSTEM
+- extern char etext;
+- return (POINTER)(&etext);
+-#elif defined DATA_START
+- return ((POINTER) DATA_START);
+-#elif defined ORDINARY_LINK
+- /*
+- * This is a hack. Since we're not linking crt0.c or pre_crt0.c,
+- * data_start isn't defined. We take the address of environ, which
+- * is known to live at or near the start of the system crt0.c, and
+- * we don't sweat the handful of bytes that might lose.
+- */
+- return ((POINTER) &environ);
+-#else
+- extern int data_start;
+- return ((POINTER) &data_start);
+-#endif
+-}
+-#endif /* (not CANNOT_DUMP or not SYSTEM_MALLOC) */
+-
+ /* Enable memory usage warnings.
+ START says where the end of pure storage is.
+ WARNFUN specifies the function to call to issue a warning. */
+@@ -287,10 +283,7 @@
+ {
+ extern void (* __after_morecore_hook) (void); /* From gmalloc.c */
+
+- if (start)
+- data_space_start = start;
+- else
+- data_space_start = start_of_data ();
++ data_space_start = start ? start : data_start;
+
+ warn_function = warnfun;
+ __after_morecore_hook = check_memory_limits;
diff --git a/app-editors/emacs/files/emacs-24.3-giflib-5.patch b/app-editors/emacs/files/emacs-24.3-giflib-5.patch
new file mode 100644
index 0000000..992a811
--- /dev/null
+++ b/app-editors/emacs/files/emacs-24.3-giflib-5.patch
@@ -0,0 +1,168 @@
+commit f3606ef766bcec86789316a05949f1e67a51e7c1
+Author: Barry Fishman <barry_fishman@acm.org>
+Date: Wed Oct 9 20:37:44 2013 -0400
+
+ Handle giflib 5 changes (tiny change)
+
+ * configure.ac: Update for giflib 5.
+
+ * src/image.c (GIFLIB_MAJOR): Ensure it's defined.
+ (DGifOpen, DGifOpenFileName): Handle giflib 5 syntax. (Bug#15531)
+
+commit be316ede5fffb724852ee225489e70778d240bb0
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Tue Jan 7 13:14:32 2014 -0800
+
+ Fix misdisplay of interlaced GIFs with libgif5.
+
+ * image.c (gif_load): libgif5 deinterlaces for us, so don't do
+ it again.
+
+ Fixes: debbugs:16372
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -2674,8 +2674,9 @@
+ || test "${HAVE_W32}" = "yes"; then
+ AC_CHECK_HEADER(gif_lib.h,
+ # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
+-# Earlier versions can crash Emacs.
+- [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])
++# Earlier versions can crash Emacs, but version 5.0 removes EGifPutExtensionLast.
++ [AC_CHECK_LIB(gif, GifMakeMapObject, HAVE_GIF=yes,
++ [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])])
+
+ if test "$HAVE_GIF" = yes; then
+ LIBGIF=-lgif
+--- a/src/image.c
++++ b/src/image.c
+@@ -7095,14 +7095,25 @@
+
+ #endif /* HAVE_NTGUI */
+
++#ifndef GIFLIB_MAJOR
++#define GIFLIB_MAJOR 0
++#endif
++#ifndef GIFLIB_MINOR
++#define GIFLIB_MINOR 0
++#endif
+
+ #ifdef WINDOWSNT
+
+ /* GIF library details. */
+ DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *));
+ DEF_IMGLIB_FN (int, DGifSlurp, (GifFileType *));
++#if GIFLIB_MAJOR < 5
+ DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc));
+ DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *));
++#else
++DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc, int *));
++DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *, int *));
++#endif
+
+ static bool
+ init_gif_functions (void)
+@@ -7192,7 +7203,11 @@
+ }
+
+ /* Open the GIF file. */
++#if GIFLIB_MAJOR < 5
+ gif = fn_DGifOpenFileName (SSDATA (file));
++#else
++ gif = fn_DGifOpenFileName (SSDATA (file), NULL);
++#endif
+ if (gif == NULL)
+ {
+ image_error ("Cannot open `%s'", file, Qnil);
+@@ -7213,7 +7228,11 @@
+ memsrc.len = SBYTES (specified_data);
+ memsrc.index = 0;
+
++#if GIFLIB_MAJOR < 5
+ gif = fn_DGifOpen (&memsrc, gif_read_from_memory);
++#else
++ gif = fn_DGifOpen (&memsrc, gif_read_from_memory, NULL);
++#endif
+ if (!gif)
+ {
+ image_error ("Cannot open memory source `%s'", img->spec, Qnil);
+@@ -7225,7 +7244,11 @@
+ if (!check_image_size (f, gif->SWidth, gif->SHeight))
+ {
+ image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
++#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
+ fn_DGifCloseFile (gif);
++#else
++ fn_DGifCloseFile (gif, NULL);
++#endif
+ return 0;
+ }
+
+@@ -7234,7 +7257,11 @@
+ if (rc == GIF_ERROR || gif->ImageCount <= 0)
+ {
+ image_error ("Error reading `%s'", img->spec, Qnil);
++#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
+ fn_DGifCloseFile (gif);
++#else
++ fn_DGifCloseFile (gif, NULL);
++#endif
+ return 0;
+ }
+
+@@ -7246,7 +7273,11 @@
+ {
+ image_error ("Invalid image number `%s' in image `%s'",
+ image_number, img->spec);
++#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
+ fn_DGifCloseFile (gif);
++#else
++ fn_DGifCloseFile (gif, NULL);
++#endif
+ return 0;
+ }
+ }
+@@ -7264,14 +7295,22 @@
+ if (!check_image_size (f, width, height))
+ {
+ image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
++#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
+ fn_DGifCloseFile (gif);
++#else
++ fn_DGifCloseFile (gif, NULL);
++#endif
+ return 0;
+ }
+
+ /* Create the X image and pixmap. */
+ if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
+ {
++#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
+ fn_DGifCloseFile (gif);
++#else
++ fn_DGifCloseFile (gif, NULL);
++#endif
+ return 0;
+ }
+
+@@ -7370,7 +7409,7 @@
+ }
+
+ /* Apply the pixel values. */
+- if (gif->SavedImages[j].ImageDesc.Interlace)
++ if (GIFLIB_MAJOR < 5 && gif->SavedImages[j].ImageDesc.Interlace)
+ {
+ int row, pass;
+
+@@ -7447,7 +7486,11 @@
+ Fcons (make_number (gif->ImageCount),
+ img->lisp_data));
+
++#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
+ fn_DGifCloseFile (gif);
++#else
++ fn_DGifCloseFile (gif, NULL);
++#endif
+
+ /* Maybe fill in the background field while we have ximg handy. */
+ if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
diff --git a/app-editors/emacs/files/emacs-24.3-jpeg-version.patch b/app-editors/emacs/files/emacs-24.3-jpeg-version.patch
new file mode 100644
index 0000000..a5845c0
--- /dev/null
+++ b/app-editors/emacs/files/emacs-24.3-jpeg-version.patch
@@ -0,0 +1,25 @@
+commit ff3878d749591ebf78da532ec1eb6fa00cb5757d
+Author: Andreas Schwab <schwab@suse.de>
+Date: Mon Mar 23 11:55:24 2015 +0100
+
+ * configure.ac: Fix jpeg version check to work with gcc >= 5.
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -2598,10 +2598,12 @@
+ AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
+ if test "${HAVE_JPEG}" = "yes"; then
+ AC_DEFINE(HAVE_JPEG)
+- AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
+- [#include <jpeglib.h>
+- version=JPEG_LIB_VERSION
+-],
++ AC_EGREP_CPP([version 6b or later],
++ [#include <jpeglib.h>
++ #if JPEG_LIB_VERSION >= 62
++ version 6b or later
++ #endif
++ ],
+ [AC_DEFINE(HAVE_JPEG)],
+ [AC_MSG_WARN([libjpeg found, but not version 6b or later])
+ HAVE_JPEG=no])