diff -Nurd -x'*~' emacs-24.3.orig/configure emacs-24.3/configure
--- emacs-24.3.orig/configure	2013-03-08 02:13:36.000000000 -0600
+++ emacs-24.3/configure	2014-05-22 06:49:19.000000000 -0500
@@ -3865,7 +3865,7 @@
 etcdir='${datadir}/emacs/${version}/etc'
 archlibdir='${libexecdir}/emacs/${version}/${configuration}'
 docdir='${datadir}/emacs/${version}/etc'
-gamedir='${localstatedir}/games/emacs'
+gamedir='${localstatedir}/games/emacs24'
 
 
 # Check whether --with-all was given.
diff -Nurd -x'*~' emacs-24.3.orig/fix-info emacs-24.3/fix-info
--- emacs-24.3.orig/fix-info	1969-12-31 18:00:00.000000000 -0600
+++ emacs-24.3/fix-info	2014-05-22 06:50:17.000000000 -0500
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+THE_INFO_PREFIX=$1
+
+for file in $(basename ${THE_INFO_PREFIX}/*.info.gz)
+do
+    gzip -d ${THE_INFO_PREFIX}/${file}
+    ./mangle-info ${THE_INFO_PREFIX}/${file%.gz}
+    gzip -9 ${THE_INFO_PREFIX}/${file%.gz}
+done
+
diff -Nurd -x'*~' emacs-24.3.orig/lib/md5.c emacs-24.3/lib/md5.c
--- emacs-24.3.orig/lib/md5.c	2012-11-02 02:00:03.000000000 -0500
+++ emacs-24.3/lib/md5.c	2014-05-22 09:02:20.000000000 -0500
@@ -61,6 +61,8 @@
 # error "invalid BLOCKSIZE"
 #endif
 
+#define alignof _Alignof
+
 /* This array contains the bytes used to pad the buffer to the next
    64-byte boundary.  (RFC 1321, 3.1: Step 1)  */
 static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */ };
diff -Nurd -x'*~' emacs-24.3.orig/lib/sha1.h emacs-24.3/lib/sha1.h
--- emacs-24.3.orig/lib/sha1.h	2013-01-01 14:37:17.000000000 -0600
+++ emacs-24.3/lib/sha1.h	2014-05-22 09:02:30.000000000 -0500
@@ -27,6 +27,7 @@
 # endif
 
 #define SHA1_DIGEST_SIZE 20
+#define alignof _Alignof
 
 /* Structure to save state of computation between the single steps.  */
 struct sha1_ctx
diff -Nurd -x'*~' emacs-24.3.orig/lib/sha256.h emacs-24.3/lib/sha256.h
--- emacs-24.3.orig/lib/sha256.h	2013-01-01 14:37:17.000000000 -0600
+++ emacs-24.3/lib/sha256.h	2014-05-22 09:02:40.000000000 -0500
@@ -25,6 +25,8 @@
 extern "C" {
 # endif
 
+#define alignof _Alignof
+
 /* Structure to save state of computation between the single steps.  */
 struct sha256_ctx
 {
diff -Nurd -x'*~' emacs-24.3.orig/lib/sha512.h emacs-24.3/lib/sha512.h
--- emacs-24.3.orig/lib/sha512.h	2013-01-01 14:37:17.000000000 -0600
+++ emacs-24.3/lib/sha512.h	2014-05-22 09:02:50.000000000 -0500
@@ -26,6 +26,8 @@
 extern "C" {
 # endif
 
+#define alignof _Alignof
+
 /* Structure to save state of computation between the single steps.  */
 struct sha512_ctx
 {
diff -Nurd -x'*~' emacs-24.3.orig/lib/utimens.c emacs-24.3/lib/utimens.c
--- emacs-24.3.orig/lib/utimens.c	2013-01-01 14:37:17.000000000 -0600
+++ emacs-24.3/lib/utimens.c	2014-05-22 10:34:13.000000000 -0500
@@ -88,6 +88,7 @@
   int result = 0;
   int utime_omit_count = 0;
   assert (timespec);
+# if __linux__
   if ((timespec[0].tv_nsec != UTIME_NOW
        && timespec[0].tv_nsec != UTIME_OMIT
        && (timespec[0].tv_nsec < 0 || 1000000000 <= timespec[0].tv_nsec))
@@ -118,6 +119,7 @@
       if (timespec[1].tv_nsec == UTIME_OMIT)
         utime_omit_count++;
     }
+# endif /* __linux__ */
   return result + (utime_omit_count == 1);
 }
 
@@ -131,6 +133,7 @@
 update_timespec (struct stat const *statbuf, struct timespec *ts[2])
 {
   struct timespec *timespec = *ts;
+# if __linux__
   if (timespec[0].tv_nsec == UTIME_OMIT
       && timespec[1].tv_nsec == UTIME_OMIT)
     return true;
@@ -150,6 +153,7 @@
     timespec[1] = get_stat_mtime (statbuf);
   else if (timespec[1].tv_nsec == UTIME_NOW)
     gettime (&timespec[1]);
+#endif /* __linux__ */
 
   return false;
 }
diff -Nurd -x'*~' emacs-24.3.orig/lib-src/Makefile.in emacs-24.3/lib-src/Makefile.in
--- emacs-24.3.orig/lib-src/Makefile.in	2013-01-01 14:37:17.000000000 -0600
+++ emacs-24.3/lib-src/Makefile.in	2014-05-22 06:51:44.000000000 -0500
@@ -210,9 +210,6 @@
 
 ## Install the internal utilities.  Until they are installed, we can
 ## just run them directly from lib-src.
-## If the chown/chmod commands fail, that is not a big deal.
-## update-game-score will detect at runtime that it is not setuid,
-## and handle things accordingly.
 $(DESTDIR)${archlibdir}: all
 	@echo
 	@echo "Installing utilities run internally by Emacs."
@@ -225,10 +222,6 @@
 	umask 022; ${MKDIR_P} $(DESTDIR)${gamedir}; \
 	touch $(DESTDIR)${gamedir}/snake-scores; \
 	touch $(DESTDIR)${gamedir}/tetris-scores
-	-if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
-	  chown ${gameuser} $(DESTDIR)${gamedir}; \
-	  chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
-	fi
 	if [ `cd $(DESTDIR)${archlibdir} && /bin/pwd` \
              != `cd ${srcdir} && /bin/pwd` ]; then \
 	  for file in ${SCRIPTS}; do \
diff -Nurd -x'*~' emacs-24.3.orig/lisp/startup.el emacs-24.3/lisp/startup.el
--- emacs-24.3.orig/lisp/startup.el	2013-01-01 14:37:17.000000000 -0600
+++ emacs-24.3/lisp/startup.el	2014-05-22 06:57:31.000000000 -0500
@@ -393,6 +393,10 @@
 
 (defvar normal-top-level-add-subdirs-inode-list nil)
 
+(defconst fink-emacs-flavor 'emacs24
+  "A symbol representing the particular fink flavor of emacs running.
+Something like 'emacs20, 'xemacs20, etc.")
+
 (defvar no-blinking-cursor nil)
 
 (defvar default-frame-background-mode)
@@ -981,8 +985,18 @@
     ;; 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 -Nurd -x'*~' emacs-24.3.orig/mangle-info emacs-24.3/mangle-info
--- emacs-24.3.orig/mangle-info	1969-12-31 18:00:00.000000000 -0600
+++ emacs-24.3/mangle-info	2014-05-22 06:58:06.000000000 -0500
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w -i
+
+use English;
+use strict;
+
+$RS = undef;
+
+my $prefix = "emacs-24";
+
+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 -Nurd -x'*~' emacs-24.3.orig/src/Makefile.in emacs-24.3/src/Makefile.in
--- emacs-24.3.orig/src/Makefile.in	2013-01-01 14:37:17.000000000 -0600
+++ emacs-24.3/src/Makefile.in	2014-05-22 07:01:22.000000000 -0500
@@ -311,11 +311,11 @@
 ## FIXME? MYCPPFLAGS only referenced in etc/DEBUG.
 ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \
   -I$(lib) -I$(srcdir)/../lib \
-  $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \
+  $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \
   $(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \
   $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) \
-  $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \
-  $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) $(PROFILING_CFLAGS) \
+  $(SETTINGS_CFLAGS)  \
+  $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(C_SWITCH_X_SITE) $(DEPFLAGS) $(PROFILING_CFLAGS) \
   $(LIBGNUTLS_CFLAGS) \
   $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
 ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
diff -Nurd -x'*~' emacs-24.3.orig/src/alloc.c emacs-24.3/src/alloc.c
--- emacs-24.3.orig/src/alloc.c	2013-01-01 14:37:17.000000000 -0600
+++ emacs-24.3/src/alloc.c	2014-05-22 09:50:18.000000000 -0500
@@ -4300,6 +4300,7 @@
 /* Alignment of pointer values.  Use alignof, as it sometimes returns
    a smaller alignment than GCC's __alignof__ and mark_memory might
    miss objects if __alignof__ were used.  */
+#define alignof _Alignof
 #define GC_POINTER_ALIGNMENT alignof (void *)
 
 /* Define POINTERS_MIGHT_HIDE_IN_OBJECTS to 1 if marking via C pointers does
diff -Nurd -x'*~' emacs-24.3.orig/src/callproc.c emacs-24.3/src/callproc.c
--- emacs-24.3.orig/src/callproc.c	2013-02-01 21:20:04.000000000 -0600
+++ emacs-24.3/src/callproc.c	2014-05-22 10:01:54.000000000 -0500
@@ -23,6 +23,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
+extern char **environ;
 
 #include <sys/file.h>
 #include <fcntl.h>
diff -Nurd -x'*~' emacs-24.3.orig/src/editfns.c emacs-24.3/src/editfns.c
--- emacs-24.3.orig/src/editfns.c	2013-01-01 14:37:17.000000000 -0600
+++ emacs-24.3/src/editfns.c	2014-05-22 10:01:34.000000000 -0500
@@ -27,6 +27,7 @@
 #endif
 
 #include <unistd.h>
+extern char **environ;
 
 #ifdef HAVE_SYS_UTSNAME_H
 #include <sys/utsname.h>
diff -Nurd -x'*~' emacs-24.3.orig/src/image.c emacs-24.3/src/image.c
--- emacs-24.3.orig/src/image.c	2013-01-01 15:37:17.000000000 -0500
+++ emacs-24.3/src/image.c	2015-01-22 02:29:51.000000000 -0500
@@ -7121,10 +7121,10 @@
 
 #else
 
-#define fn_DGifCloseFile	DGifCloseFile
+#define fn_DGifCloseFile(a)	DGifCloseFile(a,NULL)
 #define fn_DGifSlurp		DGifSlurp
-#define fn_DGifOpen		DGifOpen
-#define fn_DGifOpenFileName	DGifOpenFileName
+#define fn_DGifOpen(a,b)	DGifOpen(a,b,NULL)
+#define fn_DGifOpenFileName(a)	DGifOpenFileName(a,NULL)
 
 #endif /* WINDOWSNT */
 
