diff -Naur xbmc-30122/configure.in xbmc-30122.patch/configure.in
--- xbmc-30122/configure.in	2010-05-13 22:16:11.524199498 +0200
+++ xbmc-30122.patch/configure.in	2010-05-13 22:23:00.332323274 +0200
@@ -58,6 +58,8 @@
 external_liba52_disabled="== Use of external liba52 disabled. =="
 external_libdts_enabled="== Use of external libdts enabled. =="
 external_libdts_disabled="== Use of external libdts disabled. =="
+external_libz_enabled="== Use of external libz enabled. =="
+external_libz_disabled="== Use of external libz disabled. =="
 external_python_enabled="== Use of external python enabled. =="
 external_python_disabled="== Use of external python disabled. =="
 ffmpeg_vdpau_not_supported="== External ffmpeg doesn't support VDPAU. VDPAU support disabled. =="
@@ -282,6 +284,12 @@
             [use_external_libdts=$enableval],
             [use_external_libdts=$use_external_libraries])
 
+AC_ARG_ENABLE([external-libz],
+            [AS_HELP_STRING([--enable-external-libz],
+            [enable use of external libz library (default is no)])],
+            [use_external_libz=$enableval],
+            [use_external_libz=no])
+
 AC_ARG_ENABLE([external-python],
             [AS_HELP_STRING([--enable-external-python],
             [enable use of external python library (default is no) 'Linux only'])],
@@ -721,6 +729,18 @@
   USE_EXTERNAL_LIBDTS=0
 fi
 
+# External libz
+if test "$use_external_libraries" = "yes" || test "$use_external_libz" = "yes"; then
+  AC_CHECK_LIB([z],          [main],, AC_MSG_ERROR($missing_library))
+  AC_CHECK_HEADERS([zlib.h],, AC_MSG_ERROR([$missing_headers]))
+  AC_MSG_NOTICE($external_libz_enabled)
+  USE_EXTERNAL_LIBZ=1
+  AC_DEFINE([USE_EXTERNAL_LIBZ], [1], [Whether to use external libz library/zlib.])
+else
+  AC_MSG_NOTICE($external_libz_disabled)
+  USE_EXTERNAL_LIBZ=0
+fi
+
 # External Python
 if test "$use_external_python" = "yes"; then
   AC_CHECK_LIB([python2.6], [main],
@@ -1195,6 +1215,11 @@
     final_message="$final_message\n  External libdts:\tNo"
   fi
 fi
+if test "$use_external_libz" = "yes"; then
+  final_message="$final_message\n  External zlib:\tYes"
+else
+  final_message="$final_message\n  External zlib:\tNo"
+fi
 if test "$use_external_python" = "yes"; then
   final_message="$final_message\n  External Python:\tYes"
 else
@@ -1627,7 +1652,7 @@
     CFLAGS="-fPIC -fno-common -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
     ./configure
   fi
-], [0])
+], [$USE_EXTERNAL_LIBZ])
 
 XB_CONFIG_MODULE([lib/libass], [
   if test "$host_vendor" = "apple" ; then
