Index: include/Makefile.in
--- include/Makefile.in.orig	2009-01-02 16:59:11 +0100
+++ include/Makefile.in	2009-01-20 23:36:32 +0100
@@ -406,14 +406,14 @@
 			my_getopt.h sslopt-longopts.h my_dir.h \
 			sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
 			m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \
-			$(HEADERS_GEN_MAKE)
+			rijndael.h sha1.h sha2.h my_aes.h $(HEADERS_GEN_MAKE)
 
 noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
 			heap.h maria.h myisamchk.h my_bitmap.h my_uctype.h \
 			myisam.h myisampack.h myisammrg.h ft_global.h\
 			mysys_err.h my_base.h help_start.h help_end.h \
-			my_nosys.h my_alarm.h queues.h rijndael.h sha1.h sha2.h \
-			my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
+			my_nosys.h my_alarm.h queues.h \
+			my_tree.h my_trie.h hash.h thr_alarm.h \
 			thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
 			my_handler.h my_time.h \
 			my_vle.h my_user.h my_atomic.h atomic/nolock.h \
Index: sql/Makefile.in
--- sql/Makefile.in.orig	2009-01-02 16:59:18 +0100
+++ sql/Makefile.in	2009-01-20 23:19:54 +0100
@@ -595,7 +595,7 @@
 			$(top_builddir)/strings/libmystringslt.la
 
 mysqld_DEPENDENCIES = @mysql_plugin_libs@ $(SUPPORTING_LIBS) backup/libbackup.la libndb.la
-LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
+LDADD = $(SUPPORTING_LIBS)
 mysqld_LDADD = libndb.la \
 			@MYSQLD_EXTRA_LDFLAGS@ \
 			@pstack_libs@ $(libevent_libs) \
Index: storage/falcon/BigInt.cpp
--- storage/falcon/BigInt.cpp.orig	2009-01-02 16:50:16 +0100
+++ storage/falcon/BigInt.cpp	2009-01-20 23:19:54 +0100
@@ -18,11 +18,7 @@
 //////////////////////////////////////////////////////////////////////
 
 #include <stdio.h>
-#if defined(__APPLE__) || defined(__FreeBSD__)
 #include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
 #include <string.h>
 #include "Engine.h"
 #include "BigInt.h"
Index: storage/falcon/Configuration.cpp
--- storage/falcon/Configuration.cpp.orig	2009-01-02 16:50:17 +0100
+++ storage/falcon/Configuration.cpp	2009-01-20 23:19:54 +0100
@@ -350,7 +350,7 @@
 	availableMemory = (uint64) availableMem;
 	totalMemory = (uint64) physMem;
 
-#else
+#elif defined(__linux__)
 	int64 pageSize		= (int64)sysconf(_SC_PAGESIZE);
 	int64 physPages		= (int64)sysconf(_SC_PHYS_PAGES);
 	int64 avPhysPages	= (int64)sysconf(_SC_AVPHYS_PAGES);
Index: storage/falcon/MemMgr.cpp
--- storage/falcon/MemMgr.cpp.orig	2009-01-02 16:50:21 +0100
+++ storage/falcon/MemMgr.cpp	2009-01-20 23:19:54 +0100
@@ -20,12 +20,7 @@
 
 #include <stdio.h>
 #include <string.h>
-#if defined(__APPLE__) || defined(__FreeBSD__)
 #include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
-#include <memory.h>
 #include "Engine.h"
 #include "MemMgr.h"
 #include "Sync.h"
Index: storage/falcon/Stream.cpp
--- storage/falcon/Stream.cpp.orig	2009-01-02 16:50:29 +0100
+++ storage/falcon/Stream.cpp	2009-01-20 23:19:54 +0100
@@ -19,11 +19,7 @@
 
 #include <memory.h>
 #include <string.h>
-#if defined(__APPLE__) || defined(__FreeBSD__)
 #include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
 #include <stdio.h>
 #include <stdarg.h>
 #include "Engine.h"
