diff -Nurd -x'*~' tcltk-8.5.15.orig/tcl8.5.15/generic/tclInt.h tcltk-8.5.15/tcl8.5.15/generic/tclInt.h
--- tcltk-8.5.15.orig/tcl8.5.15/generic/tclInt.h	2013-08-30 11:58:39.000000000 -0400
+++ tcltk-8.5.15/tcl8.5.15/generic/tclInt.h	2013-10-09 12:06:39.000000000 -0400
@@ -2808,7 +2808,7 @@
 MODULE_SCOPE int	TclClockOldscanObjCmd(
 			    ClientData clientData, Tcl_Interp *interp,
 			    int objc, Tcl_Obj *const objv[]);
-MODULE_SCOPE int	Tcl_CloseObjCmd(ClientData clientData,
+extern int	Tcl_CloseObjCmd(ClientData clientData,
 			    Tcl_Interp *interp, int objc,
 			    Tcl_Obj *const objv[]);
 MODULE_SCOPE int	Tcl_ConcatObjCmd(ClientData clientData,
@@ -2969,7 +2969,7 @@
 MODULE_SCOPE int	Tcl_RenameObjCmd(ClientData clientData,
 			    Tcl_Interp *interp, int objc,
 			    Tcl_Obj *const objv[]);
-MODULE_SCOPE int	Tcl_ReturnObjCmd(ClientData clientData,
+extern int	Tcl_ReturnObjCmd(ClientData clientData,
 			    Tcl_Interp *interp, int objc,
 			    Tcl_Obj *const objv[]);
 MODULE_SCOPE int	Tcl_ScanObjCmd(ClientData clientData,
diff -Nurd -x'*~' tcltk-8.5.15.orig/tcl8.5.15/generic/tclPort.h tcltk-8.5.15/tcl8.5.15/generic/tclPort.h
--- tcltk-8.5.15.orig/tcl8.5.15/generic/tclPort.h	2013-08-30 11:58:39.000000000 -0400
+++ tcltk-8.5.15/tcl8.5.15/generic/tclPort.h	2013-10-09 12:06:39.000000000 -0400
@@ -20,7 +20,7 @@
 #if defined(_WIN32)
 #   include "tclWinPort.h"
 #else
-#   include "tclUnixPort.h"
+#   include "../unix/tclUnixPort.h"
 #endif
 #include "tcl.h"
 
diff -Nurd -x'*~' tcltk-8.5.15.orig/tcl8.5.15/unix/configure tcltk-8.5.15/tcl8.5.15/unix/configure
--- tcltk-8.5.15.orig/tcl8.5.15/unix/configure	2013-09-13 12:07:56.000000000 -0400
+++ tcltk-8.5.15/tcl8.5.15/unix/configure	2013-10-09 12:06:39.000000000 -0400
@@ -18796,7 +18796,7 @@
     else
         TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`"
     fi
-    TCL_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_LIB_FLAG}"
+    TCL_BUILD_LIB_SPEC="`pwd`/${TCL_LIB_FILE}"
     TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}"
 fi
 VERSION='${VERSION}'
@@ -18840,7 +18840,7 @@
     TCL_STUB_LIB_FLAG="-ltclstub`echo ${TCL_VERSION} | tr -d .`"
 fi
 
-TCL_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
+TCL_BUILD_STUB_LIB_SPEC="`pwd`/${TCL_STUB_LIB_FILE}"
 TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}"
 TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}"
 TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}"
@@ -19022,7 +19022,7 @@
 
 
 
-CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
+EXTRA_CC_SWITCHES="${EXTRA_CC_SWITCHES} ${CPPFLAGS}"; CPPFLAGS=""
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
diff -Nurd -x'*~' tcltk-8.5.15.orig/tcl8.5.15/unix/tclUnixNotfy.c tcltk-8.5.15/tcl8.5.15/unix/tclUnixNotfy.c
--- tcltk-8.5.15.orig/tcl8.5.15/unix/tclUnixNotfy.c	2013-08-30 11:58:40.000000000 -0400
+++ tcltk-8.5.15/tcl8.5.15/unix/tclUnixNotfy.c	2013-10-09 12:06:39.000000000 -0400
@@ -202,7 +202,7 @@
 
 #ifdef TCL_THREADS
 static void	NotifierThreadProc(ClientData clientData);
-#ifdef HAVE_PTHREAD_ATFORK
+#if defined(HAVE_PTHREAD_ATFORK) && !defined(__APPLE__)
 static int	atForkInit = 0;
 static void	AtForkPrepare(void);
 static void	AtForkParent(void);
@@ -282,7 +282,7 @@
      */
 
     Tcl_MutexLock(&notifierMutex);
-#ifdef HAVE_PTHREAD_ATFORK
+#if defined(HAVE_PTHREAD_ATFORK) && !defined(__APPLE__)
     /*
      * Install pthread_atfork handlers to reinitialize the notifier in the
      * child of a fork.
@@ -296,7 +296,7 @@
 	}
 	atForkInit = 1;
     }
-#endif
+#endif /* HAVE_PTHREAD_ATFORK */
     /*
      * Check if my process id changed, e.g. I was forked
      * In this case, restart the notifier thread and close the
@@ -1273,7 +1273,7 @@
     TclpThreadExit (0);
 }
 
-#ifdef HAVE_PTHREAD_ATFORK
+#if defined(HAVE_PTHREAD_ATFORK) && !defined(__APPLE__)
 /*
  *----------------------------------------------------------------------
  *
diff -Nurd -x'*~' tcltk-8.5.15.orig/tcl8.5.15/unix/tclUnixTest.c tcltk-8.5.15/tcl8.5.15/unix/tclUnixTest.c
--- tcltk-8.5.15.orig/tcl8.5.15/unix/tclUnixTest.c	2013-08-30 11:58:40.000000000 -0400
+++ tcltk-8.5.15/tcl8.5.15/unix/tclUnixTest.c	2013-10-09 12:07:26.000000000 -0400
@@ -574,8 +574,8 @@
                 "Cannot fork", NULL);
         return TCL_ERROR;
     }
-#if !defined(HAVE_PTHREAD_ATFORK) || defined(MAC_OSX_TCL)
-    /* Only needed when pthread_atfork is not present or on OSX. */
+#if !defined(HAVE_PTHREAD_ATFORK)
+    /* Only needed when pthread_atfork is not present. */
     if (pid==0) {
 	Tcl_InitNotifier();
     }
diff -Nurd -x'*~' tcltk-8.5.15.orig/tk8.5.15/unix/Makefile.in tcltk-8.5.15/tk8.5.15/unix/Makefile.in
--- tcltk-8.5.15.orig/tk8.5.15/unix/Makefile.in	2013-09-16 12:45:24.000000000 -0400
+++ tcltk-8.5.15/tk8.5.15/unix/Makefile.in	2013-10-09 12:06:39.000000000 -0400
@@ -147,7 +147,7 @@
 # X11 include files accessible (the configure script will try to
 # set this value, and will cause it to be an empty string if the
 # include files are accessible via /usr/include).
-X11_INCLUDES		= @XINCLUDES@
+X11_INCLUDES		= $(XFT_CFLAGS) @XINCLUDES@
 
 AQUA_INCLUDES		= -I$(MAC_OSX_DIR) -I$(XLIB_DIR)
 
@@ -322,18 +322,18 @@
 
 CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
 -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} -I${TCL_GENERIC_DIR} \
--I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} ${AC_FLAGS} \
+-I${TCL_PLATFORM_DIR} ${AC_FLAGS} \
 ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \
-${NO_DEPRECATED_FLAGS} @EXTRA_CC_SWITCHES@
+${NO_DEPRECATED_FLAGS} @EXTRA_CC_SWITCHES@ ${@TK_WINDOWINGSYSTEM@_INCLUDES}
 
 CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) ${TCL_STUB_FLAGS}
 
 APP_CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @EXTRA_APP_CC_SWITCHES@
 
 DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \
--I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} \
+-I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} \
 ${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \
-${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@
+${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@ ${@TK_WINDOWINGSYSTEM@_INCLUDES}
 
 WISH_OBJS = tkAppInit.o
 
@@ -1161,7 +1161,7 @@
 
 # NB: tkUnixRFont.o uses nondefault CFLAGS
 tkUnixRFont.o: $(UNIX_DIR)/tkUnixRFont.c
-	$(CC) -c $(CC_SWITCHES) $(XFT_CFLAGS) $(UNIX_DIR)/tkUnixRFont.c
+	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixRFont.c
 
 tkUnixInit.o: $(UNIX_DIR)/tkUnixInit.c tkConfig.sh
 	$(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" \
diff -Nurd -x'*~' tcltk-8.5.15.orig/tk8.5.15/unix/configure tcltk-8.5.15/tk8.5.15/unix/configure
--- tcltk-8.5.15.orig/tk8.5.15/unix/configure	2013-09-16 12:45:24.000000000 -0400
+++ tcltk-8.5.15/tk8.5.15/unix/configure	2013-10-09 12:06:39.000000000 -0400
@@ -10547,19 +10547,14 @@
 	echo "$as_me:$LINENO: result: $enable_xft" >&5
 echo "${ECHO_T}$enable_xft" >&6
     else
-	found_xft="yes"
-			XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no"
-	XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no"
-	if test "$found_xft" = "no" ; then
 	    found_xft=yes
 	    XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no"
 	    XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no"
-	fi
 	echo "$as_me:$LINENO: result: $found_xft" >&5
 echo "${ECHO_T}$found_xft" >&6
 		if test "$found_xft" = "yes" ; then
 	    tk_oldCFlags=$CFLAGS
-	    CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS"
+	    CFLAGS="$CFLAGS $XFT_CFLAGS $XINCLUDES"
 	    tk_oldLibs=$LIBS
 	    LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW"
 	    echo "$as_me:$LINENO: checking for X11/Xft/Xft.h" >&5
@@ -10624,7 +10619,7 @@
 	fi
 		if test "$found_xft" = "yes" ; then
 	    tk_oldCFlags=$CFLAGS
-	    CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS"
+	    CFLAGS="$CFLAGS $XFT_CFLAGS $XINCLUDES"
 	    tk_oldLibs=$LIBS
 	    LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW"
 
@@ -11451,7 +11446,7 @@
 	else
 	    TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`"
 	fi
-	TK_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_LIB_FLAG}"
+	TK_BUILD_LIB_SPEC="`pwd`/${TK_LIB_FILE}"
     fi
     TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
 fi
@@ -11471,7 +11466,7 @@
     TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`"
 fi
 
-TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
+TK_BUILD_STUB_LIB_SPEC="`pwd`/${TK_STUB_LIB_FILE}"
 TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}"
 TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}"
 TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}"
@@ -11660,7 +11655,7 @@
 LTLIBOBJS=$ac_ltlibobjs
 
 
-CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
+EXTRA_CC_SWITCHES="${EXTRA_CC_SWITCHES} ${CPPFLAGS}"; CPPFLAGS=""
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
diff -Nurd -x'*~' tcltk-8.5.15.orig/tk8.5.15/unix/tkConfig.sh.in tcltk-8.5.15/tk8.5.15/unix/tkConfig.sh.in
--- tcltk-8.5.15.orig/tk8.5.15/unix/tkConfig.sh.in	2013-09-16 12:45:24.000000000 -0400
+++ tcltk-8.5.15/tk8.5.15/unix/tkConfig.sh.in	2013-10-09 12:06:39.000000000 -0400
@@ -32,7 +32,7 @@
 TK_LIB_FILE='@TK_LIB_FILE@'
 
 # Additional libraries to use when linking Tk.
-TK_LIBS='@XLIBSW@ @XFT_LIBS@ @LIBS@ @TCL_LIBS@'
+TK_LIBS='@XFT_LIBS@ @XLIBSW@ @LIBS@ @TCL_LIBS@'
 
 # Top-level directory in which Tk's platform-independent files are
 # installed.
