Index: admin/acinclude.m4.in
===================================================================
RCS file: /home/kde/kde-common/admin/acinclude.m4.in,v
retrieving revision 2.485
diff -u -r2.485 acinclude.m4.in
--- admin/acinclude.m4.in	26 Nov 2004 11:59:46 -0000	2.485
+++ admin/acinclude.m4.in	3 Dec 2004 14:42:14 -0000
@@ -773,6 +773,9 @@
    # darwin requires a poll emulation library
    AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
 
+   # for some image handling on Mac OS X
+   AC_CHECK_HEADERS(Carbon/Carbon.h)
+
    # CoreAudio framework
    AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
      AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
@@ -884,6 +887,9 @@
   kde_use_qt_mac=no
 )
 
+# used to disable x11-specific stuff on special platforms
+AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
+
 if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
 
 AC_MSG_CHECKING(for X)
Index: admin/ltmain.sh
===================================================================
RCS file: /home/kde/kde-common/admin/ltmain.sh,v
retrieving revision 1.65
diff -u -r1.65 ltmain.sh
--- admin/ltmain.sh	15 Jun 2004 16:47:06 -0000	1.65
+++ admin/ltmain.sh	3 Dec 2004 14:42:17 -0000
@@ -1149,6 +1149,19 @@
 	  finalize_command="$finalize_command $qarg"
 	  continue
 	  ;;
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+	        *" $qarg.ltframework "*) ;;
+		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+		   ;;
+              esac
+              ;;
+   	  esac
+	  prev=
+	  continue
+	  ;;
 	*)
 	  eval "$prev=\"\$arg\""
 	  prev=
@@ -1276,7 +1289,7 @@
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
-	    deplibs="$deplibs -framework System"
+	    deplibs="$deplibs System.ltframework"
 	    continue
 	  esac
 	elif test "X$arg" = "X-lc_r"; then
@@ -1466,6 +1479,11 @@
 	continue
 	;;
 
+      -framework)
+        prev=framework
+	continue
+	;;
+
       # Some other compiler flag.
       -* | +*)
 	# Unknown arguments in both finalize_command and compile_command need
@@ -1883,6 +1901,18 @@
 	    fi
 	  fi
 	  ;; # -l
+	*.ltframework)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test "$linkmode" = lib ; then
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	  fi
+	  continue
+	  ;;
 	-L*)
 	  case $linkmode in
 	  lib)
@@ -2011,6 +2041,13 @@
 	*) . ./$lib ;;
 	esac
 
+	case $host in
+	*-*-darwin*)
+	  # Convert "-framework foo" to "foo.ltframework" in dependency_libs
+	  test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  ;;
+	esac
+
 	if test "$linkmode,$pass" = "lib,link" ||
 	   test "$linkmode,$pass" = "prog,scan" ||
 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
@@ -2617,6 +2654,15 @@
 		*) continue ;;
 		esac  		  
 		;;
+
+	      *.ltframework)
+		case $host in
+		  *-*-darwin*)
+		    depdepl="$deplib"
+		    ;;
+		esac
+		;;
+
 	      *) continue ;;
 	      esac
 	      case " $deplibs " in
@@ -3130,7 +3176,7 @@
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C library is in the System framework
-	    deplibs="$deplibs -framework System"
+	    deplibs="$deplibs System.ltframework"
 	    ;;
 	  *-*-netbsd*)
 	    # Don't link with libc until the a.out ld.so is fixed.
@@ -3429,7 +3475,7 @@
 	case $host in
 	*-*-rhapsody* | *-*-darwin1.[012])
 	  # On Rhapsody replace the C library is the System framework
-	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 	  ;;
 	esac
 
@@ -3475,6 +3521,13 @@
 	    fi
 	  fi
 	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	case $host in
+	  *-*-darwin*)
+	    newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	    dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	    ;;
+	esac
 	# Done checking deplibs!
 	deplibs=$newdeplibs
       fi
@@ -4057,18 +4110,21 @@
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
 	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
-	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 	;;
       esac
 
       case $host in
-      *darwin*)
+      *-*-darwin*)
         # Don't allow lazy linking, it breaks C++ global constructors
         if test "$tagname" = CXX ; then
         compile_command="$compile_command ${wl}-bind_at_load"
         finalize_command="$finalize_command ${wl}-bind_at_load"
         fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
         ;;
       esac
 
Index: libltdl/ltdl.m4
===================================================================
RCS file: /home/kde/kdelibs/libltdl/ltdl.m4,v
retrieving revision 1.11
diff -u -r1.11 ltdl.m4
--- libltdl/ltdl.m4	2 Apr 2004 13:48:27 -0000	1.11
+++ libltdl/ltdl.m4	3 Dec 2004 14:42:17 -0000
@@ -91,6 +91,9 @@
 	cygwin*)
 	  libltdl_cv_sys_dlopen_deplibs=yes
 	  ;;
+	darwin*)
+	  libltdl_cv_sys_dlopen_deplibs=yes
+	  ;;
 	linux*)
 	  libltdl_cv_sys_dlopen_deplibs=yes
 	  ;;
Index: x11/Makefile.am
===================================================================
RCS file: /home/kde/arts/x11/Makefile.am,v
retrieving revision 1.17
diff -u -r1.17 Makefile.am
--- x11/Makefile.am	18 Nov 2004 12:02:16 -0000	1.17
+++ x11/Makefile.am	3 Dec 2004 14:42:18 -0000
@@ -1,3 +1,5 @@
+if include_x11
+
 INCLUDES = -I$(top_srcdir)/mcop -I$(top_builddir)/mcop $(all_includes)
 
 lib_LTLIBRARIES = libx11globalcomm.la
@@ -23,3 +25,5 @@
 
 mcoptypedir = $(libdir)/mcop
 mcoptype_DATA = x11globalcomm.mcoptype x11globalcomm.mcopclass
+
+endif
