gedit r6628 - in branches/gnome-2-24: . gedit gedit/smclient



Author: jessevdk
Date: Thu Nov 27 08:53:26 2008
New Revision: 6628
URL: http://svn.gnome.org/viewvc/gedit?rev=6628&view=rev

Log:
	* configure.ac:
	* gedit/Makefile.am:
	* gedit/gedit.c:
	* gedit/smclient/eggsmclient-win32.c:
	* gedit/smclient/eggsmclient-osx.c:
	* gedit/smclient/Makefile.am:

	Merged revision 6625:6627 from trunk:
	Fixed some small things to make gedit compile on OS X. Use 
	GDK_WINDOWING_X11 instead of PLATFORM_OSX to check for including 
	gdkx.h.


Added:
   branches/gnome-2-24/gedit/smclient/eggsmclient-osx.c
      - copied unchanged from r6626, /trunk/gedit/smclient/eggsmclient-osx.c
   branches/gnome-2-24/gedit/smclient/eggsmclient-win32.c
      - copied unchanged from r6626, /trunk/gedit/smclient/eggsmclient-win32.c
Modified:
   branches/gnome-2-24/   (props changed)
   branches/gnome-2-24/ChangeLog
   branches/gnome-2-24/configure.ac
   branches/gnome-2-24/gedit/Makefile.am
   branches/gnome-2-24/gedit/gedit.c
   branches/gnome-2-24/gedit/smclient/Makefile.am

Modified: branches/gnome-2-24/configure.ac
==============================================================================
--- branches/gnome-2-24/configure.ac	(original)
+++ branches/gnome-2-24/configure.ac	Thu Nov 27 08:53:26 2008
@@ -45,7 +45,7 @@
 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
 
 dnl check for win32 platform
-AC_MSG_CHECKING([for some Win32 platform])
+AC_MSG_CHECKING([for Win32 platform])
 case "$host" in
   *-*-mingw*|*-*-cygwin*)
     platform_win32=yes
@@ -57,6 +57,23 @@
 AC_MSG_RESULT([$platform_win32])
 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
 
+dnl check for osx platform
+AC_MSG_CHECKING([for Mac OS X platform])
+case "$host" in
+  *-*-darwin*)
+    platform_osx=yes
+    ;;
+  *)
+    platform_osx=no
+    ;;
+esac
+AC_MSG_RESULT([$platform_osx])
+AM_CONDITIONAL(PLATFORM_OSX, test "$platform_osx" = "yes")
+
+if test "$platform_osx" = "yes"; then
+	AC_DEFINE([PLATFORM_OSX],[1],[Defined if platform is Mac OSX])
+fi
+
 dnl ===============================================================
 dnl Expanded dirs
 dnl ===============================================================
@@ -176,7 +193,6 @@
 dnl ================================================================
 
 PKG_CHECK_MODULES(GEDIT, [
-	sm >= 1.0.0
 	libxml-2.0 >= 2.5.0
 	glib-2.0 >= 2.13.0
 	gthread-2.0 >= 2.13.0
@@ -189,6 +205,18 @@
 AC_SUBST(GEDIT_LIBS)
 AC_SUBST(GEDIT_CFLAGS)
 
+if test "$platform_osx" = "no"; then
+	PKG_CHECK_MODULES(EGG_SMCLIENT, [
+		sm >= 1.0.0
+	])
+	SM_LIBS="${EGG_SMCLIENT_LIBS}"
+else
+	EGG_SMCLIENT_CFLAGS=
+	EGG_SM_CLIENT_LIBS=
+fi
+
+AC_SUBST(EGG_SMCLIENT_CFLAGS)
+AC_SUBST(EGG_SMCLIENT_LIBS)
 
 dnl ================================================================
 dnl GConf related settings

Modified: branches/gnome-2-24/gedit/Makefile.am
==============================================================================
--- branches/gnome-2-24/gedit/Makefile.am	(original)
+++ branches/gnome-2-24/gedit/Makefile.am	Thu Nov 27 08:53:26 2008
@@ -28,7 +28,7 @@
 endif
 
 gedit_SOURCES = gedit.c
-gedit_LDADD = libgedit.la $(GEDIT_LIBS)
+gedit_LDADD = libgedit.la $(GEDIT_LIBS) $(EGG_SMCLIENT_LIBS)
  
 if PLATFORM_WIN32
 gedit_LDFLAGS = -Wl,--export-all-symbols -Wl,--out-implib,libgedit-$(GEDIT_API_VERSION).a
@@ -36,6 +36,10 @@
 gedit_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
 endif
 
+if PLATFORM_OSX
+gedit_LDFLAGS += -framework Carbon
+endif
+
 libgedit_la_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
 
 libgedit_la_LIBADD = \

Modified: branches/gnome-2-24/gedit/gedit.c
==============================================================================
--- branches/gnome-2-24/gedit/gedit.c	(original)
+++ branches/gnome-2-24/gedit/gedit.c	Thu Nov 27 08:53:26 2008
@@ -39,7 +39,10 @@
 
 #include <glib/gi18n.h>
 #include <glib/goption.h>
+
+#ifdef GDK_WINDOWING_X11
 #include <gdk/gdkx.h>
+#endif
 
 #include "gedit-app.h"
 #include "gedit-commands.h"
@@ -325,11 +328,13 @@
 	if (!GTK_WIDGET_REALIZED (window))
 		gtk_widget_realize (GTK_WIDGET (window));
 
+#ifndef GDK_WINDOWING_X11
 	if (startup_timestamp <= 0)
 		startup_timestamp = gdk_x11_get_server_time (GTK_WIDGET (window)->window);
 
 	gdk_x11_window_set_user_time (GTK_WIDGET (window)->window,
 				      startup_timestamp);
+#endif
 
 	gtk_window_present (GTK_WINDOW (window));
 
@@ -526,7 +531,9 @@
 					   GEDIT_ICONDIR);
 
 	/* Set the associated .desktop file */
+#ifndef PLATFORM_OSX
 	egg_set_desktop_file (DATADIR "/applications/gedit.desktop");
+#endif
 
 	/* Load user preferences */
 	gedit_debug_message (DEBUG_APP, "Init prefs manager");

Modified: branches/gnome-2-24/gedit/smclient/Makefile.am
==============================================================================
--- branches/gnome-2-24/gedit/smclient/Makefile.am	(original)
+++ branches/gnome-2-24/gedit/smclient/Makefile.am	Thu Nov 27 08:53:26 2008
@@ -1,23 +1,36 @@
+if PLATFORM_WIN32
+platform_sources = eggsmclient-win32.c
+platform_logout_test_ldflags = -mwindows
+else
+if PLATFORM_OSX
+platform_defines = -xobjective-c
+platform_ldflags = -framework Carbon
+platform_sources = eggsmclient-osx.c
+else
 platform_defines = -DEGG_SM_CLIENT_BACKEND_XSMP
-platform_ltlibraries = libeggdesktopfile.la
 platform_libs = libeggdesktopfile.la -lSM -lICE
+platform_ltlibraries = libeggdesktopfile.la
 platform_sources = eggsmclient-xsmp.c
-platform_app_ldflags =
-platform_programs = egg-launch
+endif
+endif
 
 INCLUDES =                               \
 	-DG_LOG_DOMAIN=\""EggSMClient"\" \
+	$(GEDIT_CFLAGS)			 \
 	$(platform_defines)              \
-	$(GEDIT_CFLAGS)
+	$(EGG_SMCLIENT_CFLAGS)
 
 noinst_LTLIBRARIES =                     \
 	libeggsmclient.la                \
 	$(platform_ltlibraries)
 
 libeggsmclient_la_LIBADD =               \
-	$(GEDIT_LIBS)                    \
+	$(EGG_SMCLIENT_LIBS)             \
 	$(platform_libs)
 
+libeggsmclient_la_LDFLAGS =              \
+	$(platform_ldflags)
+
 libeggsmclient_la_SOURCES =              \
 	eggsmclient.c                    \
 	eggsmclient.h                    \
@@ -25,11 +38,13 @@
 	$(platform_sources)
 
 libeggdesktopfile_la_LIBADD =            \
-	$(GEDIT_LIBS)
+	$(EGG_LIBS)
 
 libeggdesktopfile_la_SOURCES =           \
 	eggdesktopfile.c                 \
 	eggdesktopfile.h
 
 EXTRA_DIST =                             \
+	eggsmclient-osx.c                \
+	eggsmclient-win32.c              \
 	eggsmclient-xsmp.c



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]