2010-07-23 Rafael Antognolli <antognolli@profusion.mobi>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Jul 2010 01:48:39 +0000 (01:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Jul 2010 01:48:39 +0000 (01:48 +0000)
        Reviewed by Antonio Gomes.

        [EFL] Cleanup glib support (make it optional)
        https://bugs.webkit.org/show_bug.cgi?id=42480

        Fixing support for compiling EFL port without glib.

        * cmake/FindGthread.cmake: Added.
        * cmake/OptionsEfl.cmake:
2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>

        Reviewed by Antonio Gomes.

        [EFL] Cleanup glib support (make it optional)
        https://bugs.webkit.org/show_bug.cgi?id=42480

        Remove gobject/GRefPtr.cpp if not using soup/glib.

        * wtf/CMakeListsEfl.txt:
2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>

        Reviewed by Antonio Gomes.

        [EFL] Cleanup glib support (make it optional)
        https://bugs.webkit.org/show_bug.cgi?id=42480

        No new tests, no new features added.
        Just add flags and directories for glib if necessary.
        Put some ifdefs on glib calls.

        * CMakeListsEfl.txt:
        * platform/graphics/cairo/FontPlatformDataCairo.cpp:
        (WebCore::FontPlatformData::FontPlatformData):
2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>

        Reviewed by Antonio Gomes.

        [EFL] Cleanup glib support (make it optional)
        https://bugs.webkit.org/show_bug.cgi?id=42480

        Just add glib flags and directories if necessary.

        * CMakeListsEfl.txt:
2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>

        Reviewed by Antonio Gomes.

        [EFL] Cleanup glib support (make it optional)
        https://bugs.webkit.org/show_bug.cgi?id=42480

        Put some ifdefs on glib calls.

        * ewk/ewk_main.cpp:
        (ewk_init):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@64005 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
ChangeLog
JavaScriptCore/ChangeLog
JavaScriptCore/wtf/CMakeListsEfl.txt
WebCore/CMakeListsEfl.txt
WebCore/ChangeLog
WebCore/platform/efl/FileSystemEfl.cpp
WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp
WebKit/CMakeListsEfl.txt
WebKit/ChangeLog
WebKit/efl/ChangeLog
WebKit/efl/ewk/ewk_cookies.cpp
WebKit/efl/ewk/ewk_main.cpp
cmake/FindGthread.cmake [new file with mode: 0644]
cmake/OptionsEfl.cmake

index e672caa..00b437e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
 
         Reviewed by Antonio Gomes.
 
+        [EFL] Cleanup glib support (make it optional)
+        https://bugs.webkit.org/show_bug.cgi?id=42480
+
+        Fixing support for compiling EFL port without glib.
+
+        * cmake/FindGthread.cmake: Added.
+        * cmake/OptionsEfl.cmake:
+
+2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>
+
+        Reviewed by Antonio Gomes.
+
         [EFL] Add support for using libcurl network backend.
         https://bugs.webkit.org/show_bug.cgi?id=42286
 
index 3ccd9c1..badb677 100644 (file)
@@ -1,3 +1,14 @@
+2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>
+
+        Reviewed by Antonio Gomes.
+
+        [EFL] Cleanup glib support (make it optional)
+        https://bugs.webkit.org/show_bug.cgi?id=42480
+
+        Remove gobject/GRefPtr.cpp if not using soup/glib.
+
+        * wtf/CMakeListsEfl.txt:
+
 2010-07-23  Patrick Gansterer  <paroga@paroga.com>
 
         Reviewed by Adam Roben.
index 3e128be..3cd3c8e 100644 (file)
@@ -3,15 +3,19 @@ ADD_DEFINITIONS(-DUSE_SYSTEM_MALLOC=1)
 LIST(APPEND WTF_SOURCES
     efl/MainThreadEfl.cpp
 
-    gobject/GOwnPtr.cpp
-    gobject/GRefPtr.cpp
-
     ThreadIdentifierDataPthreads.cpp
     ThreadingPthreads.cpp
 
     unicode/icu/CollatorICU.cpp
 )
 
+IF (ENABLE_GLIB_SUPPORT)
+  LIST(APPEND WTF_SOURCES
+    gobject/GOwnPtr.cpp
+    gobject/GRefPtr.cpp
+  )
+ENDIF ()
+
 LIST(APPEND WTF_LIBRARIES
     pthread
     ${ICU_LIBRARIES}
index 7ec5c74..0837b02 100644 (file)
@@ -125,9 +125,6 @@ LIST(APPEND WebCore_LIBRARIES
   ${EFLDEPS_LIBRARIES}
   ${EVAS_LIBRARIES}
   ${Freetype_LIBRARIES}
-  ${GDK_LIBRARIES}
-  ${Glib_LIBRARIES}
-  ${GTK_LIBRARIES}
   ${ICU_LIBRARIES}
   ${LIBXML2_LIBRARIES}
   ${LIBXSLT_LIBRARIES}
@@ -153,9 +150,6 @@ LIST(APPEND WebCore_INCLUDE_DIRECTORIES
   ${EFLDEPS_INCLUDE_DIRS}
   ${EVAS_INCLUDE_DIRS}
   ${Freetype_INCLUDE_DIRS}
-  ${GDK_INCLUDE_DIRS}
-  ${Glib_INCLUDE_DIRS}
-  ${GTK_INCLUDE_DIRS}
   ${ICU_INCLUDE_DIRS}
   ${LIBXML2_INCLUDE_DIR}
   ${LIBXSLT_INCLUDE_DIRS}
@@ -163,6 +157,17 @@ LIST(APPEND WebCore_INCLUDE_DIRECTORIES
   ${SQLITE_INCLUDE_DIRS}
 )
 
+IF (ENABLE_GLIB_SUPPORT)
+  LIST(APPEND WebCore_LIBRARIES
+    ${GDK_LIBRARIES}
+    ${Glib_LIBRARIES}
+  )
+  LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+    ${GDK_INCLUDE_DIRS}
+    ${Glib_INCLUDE_DIRS}
+  )
+ENDIF ()
+
 IF (WTF_USE_SOUP)
   LIST(APPEND WebCore_INCLUDE_DIRECTORIES
     ${LIBSOUP24_INCLUDE_DIRS}
index 5cb83b9..4d3b58d 100644 (file)
@@ -1,3 +1,18 @@
+2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>
+
+        Reviewed by Antonio Gomes.
+
+        [EFL] Cleanup glib support (make it optional)
+        https://bugs.webkit.org/show_bug.cgi?id=42480
+
+        No new tests, no new features added.
+        Just add flags and directories for glib if necessary.
+        Put some ifdefs on glib calls.
+
+        * CMakeListsEfl.txt:
+        * platform/graphics/cairo/FontPlatformDataCairo.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+
 2010-07-23  James Robinson  <jamesr@chromium.org>
 
         Reviewed by Dimitri Glazkov.
index 680d557..cb117bc 100644 (file)
@@ -42,7 +42,9 @@
 #include <dlfcn.h>
 #include <errno.h>
 #include <fnmatch.h>
+#if ENABLE(GLIB_SUPPORT)
 #include <glib.h> // TODO: remove me after following TODO is solved.
+#endif
 #include <limits.h>
 #include <stdio.h>
 #include <sys/stat.h>
index 974c195..1f94f5a 100644 (file)
@@ -32,7 +32,9 @@
 #include <cairo-ft.h>
 #include <cairo.h>
 #include <fontconfig/fcfreetype.h>
+#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT)
 #include <gdk/gdk.h>
+#endif
 
 namespace WebCore {
 
@@ -109,8 +111,10 @@ FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const
     cairo_matrix_init_scale(&fontMatrix, fontDescription.computedPixelSize(), fontDescription.computedPixelSize());
     cairo_matrix_init_identity(&ctm);
 
+#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT)
     if (GdkScreen* screen = gdk_screen_get_default())
         options = gdk_screen_get_font_options(screen);
+#endif
 
     // gdk_screen_get_font_options() returns NULL if no default options are
     // set, so we always have to check.
@@ -149,8 +153,10 @@ FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, float size, bool
     static const cairo_font_options_t* defaultOptions = cairo_font_options_create();
     const cairo_font_options_t* options = NULL;
 
+#if !PLATFORM(EFL) || ENABLE(GLIB_SUPPORT)
     if (GdkScreen* screen = gdk_screen_get_default())
         options = gdk_screen_get_font_options(screen);
+#endif
 
     // gdk_screen_get_font_options() returns NULL if no default options are
     // set, so we always have to check.
index 46a95a0..0701d22 100644 (file)
@@ -15,8 +15,6 @@ LIST(APPEND WebKit_INCLUDE_DIRECTORIES
     ${EDJE_INCLUDE_DIRS}
     ${EFLDEPS_INCLUDE_DIRS}
     ${EVAS_INCLUDE_DIRS}
-    ${Gdk_INCLUDE_DIRS}
-    ${Glib_INCLUDE_DIRS}
     ${LIBXML2_INCLUDE_DIRS}
     ${LIBXSLT_INCLUDE_DIRS}
     ${SQLITE_INCLUDE_DIRS}
@@ -47,14 +45,22 @@ LIST(APPEND WebKit_LIBRARIES
     ${ECORE_X_LIBRARIES}
     ${EFLDEPS_LIBRARIES}
     ${Freetype_LIBRARIES}
-    ${Gdk_LIBRARIES}
-    ${Glib_LIBRARIES}
-    ${Gtk_LIBRARIES}
     ${LIBXML2_LIBRARIES}
     ${Pango_LIBRARIES}
     ${SQLITE_LIBRARIES}
 )
 
+IF (ENABLE_GLIB_SUPPORT)
+  LIST(APPEND WebKit_INCLUDE_DIRECTORIES
+    ${Gdk_INCLUDE_DIRS}
+    ${Glib_INCLUDE_DIRS}
+  )
+  LIST(APPEND WebKit_LIBRARIES
+    ${Glib_LIBRARIES}
+    ${Gdk_LIBRARIES}
+  )
+ENDIF ()
+
 IF (WTF_USE_SOUP)
   LIST(APPEND WebKit_INCLUDE_DIRECTORIES ${LIBSOUP24_INCLUDE_DIRS})
   LIST(APPEND WebKit_LIBRARIES ${LIBSOUP24_LIBRARIES})
@@ -86,8 +92,6 @@ SET(EWebLauncher_LIBRARIES
     ${EDJE_LIBRARIES}
     ${EFLDEPS_LIBRARIES}
     ${EVAS_LIBRARIES}
-    ${Gdk_LIBRARIES}
-    ${Glib_LIBRARIES}
     ${LIBXML2_LIBRARIES}
     ${LIBXSLT_LIBRARIES}
     ${SQLITE_LIBRARIES}
@@ -100,6 +104,14 @@ SET(EWebLauncher_LINK_FLAGS
     ${EVAS_LDFLAGS}
 )
 
+IF (ENABLE_GLIB_SUPPORT)
+  LIST(APPEND EWebLauncher_LIBRARIES
+    ${Gdk_LIBRARIES}
+    ${Glib_LIBRARIES}
+    ${GTHREAD_LIBRARIES}
+  )
+ENDIF ()
+
 IF (WTF_USE_SOUP)
   LIST(APPEND EWebLauncher_LIBRARIES ${LIBSOUP24_LIBRARIES})
   LIST(APPEND EWebLauncher_LINK_FLAGS ${LIBSOUP24_LDFLAGS})
index a4fa9ba..ba7e36a 100644 (file)
@@ -2,6 +2,17 @@
 
         Reviewed by Antonio Gomes.
 
+        [EFL] Cleanup glib support (make it optional)
+        https://bugs.webkit.org/show_bug.cgi?id=42480
+
+        Just add glib flags and directories if necessary.
+
+        * CMakeListsEfl.txt:
+
+2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>
+
+        Reviewed by Antonio Gomes.
+
         [EFL] Add support for using libcurl network backend.
         https://bugs.webkit.org/show_bug.cgi?id=42286
 
index 8149f51..fc940d8 100644 (file)
@@ -2,6 +2,18 @@
 
         Reviewed by Antonio Gomes.
 
+        [EFL] Cleanup glib support (make it optional)
+        https://bugs.webkit.org/show_bug.cgi?id=42480
+
+        Put some ifdefs on glib calls.
+
+        * ewk/ewk_main.cpp:
+        (ewk_init):
+
+2010-07-23  Rafael Antognolli  <antognolli@profusion.mobi>
+
+        Reviewed by Antonio Gomes.
+
         [EFL] Add support for using libcurl network backend.
         https://bugs.webkit.org/show_bug.cgi?id=42286
 
index 913cf12..421f8dc 100644 (file)
@@ -29,8 +29,8 @@
 
 #include <Eina.h>
 #include <eina_safety_checks.h>
-#include <glib.h>
 #ifdef WTF_USE_SOUP
+#include <glib.h>
 #include <libsoup/soup.h>
 #endif
 #include <wtf/text/CString.h>
index 206f70c..5742766 100644 (file)
@@ -37,7 +37,7 @@
 #include <Evas.h>
 #include <stdlib.h>
 
-#ifdef ENABLE_GLIB_SUPPORT
+#if ENABLE(GLIB_SUPPORT)
 #include <glib-object.h>
 #include <glib.h>
 
@@ -90,7 +90,7 @@ int ewk_init(void)
         goto error_edje;
     }
 
-#ifdef ENABLE_GLIB_SUPPORT
+#if ENABLE(GLIB_SUPPORT)
     g_type_init();
 
     if (!g_thread_supported())
diff --git a/cmake/FindGthread.cmake b/cmake/FindGthread.cmake
new file mode 100644 (file)
index 0000000..7dabbee
--- /dev/null
@@ -0,0 +1,21 @@
+# Find include and libraries for GTHREAD library
+# GTHREAD_INCLUDE     Directories to include to use GTHREAD
+# GTHREAD_INCLUDE-I   Directories to include to use GTHREAD (with -I)
+# GTHREAD_LIBRARIES   Libraries to link against to use GTHREAD
+# GTHREAD_FOUND       GTHREAD was found
+
+IF (UNIX)
+    INCLUDE (UsePkgConfig)
+    PKGCONFIG (gthread-2.0 GTHREAD_include_dir GTHREAD_link_dir GTHREAD_libraries GTHREAD_include)
+    IF (GTHREAD_include AND GTHREAD_libraries)
+        SET (GTHREAD_FOUND TRUE)
+        EXEC_PROGRAM ("echo"
+            ARGS "${GTHREAD_include} | sed 's/[[:blank:]]*-I/;/g'"
+            OUTPUT_VARIABLE GTHREAD_INCLUDE
+        )
+        SET (GTHREAD_INCLUDE-I ${GTHREAD_include})
+        SET (GTHREAD_LIBRARIES ${GTHREAD_libraries})
+    ELSE (GTHREAD_include AND GTHREAD_libraries)
+        SET (GTHREAD_FOUND FALSE)
+    ENDIF (GTHREAD_include AND GTHREAD_libraries)
+ENDIF (UNIX)
index c9d5120..6390f9f 100644 (file)
@@ -17,8 +17,6 @@ SET(NETWORK_BACKEND "soup" CACHE STRING "choose which network backend to use (on
 FIND_PACKAGE(Cairo 1.6 REQUIRED)
 FIND_PACKAGE(EFL REQUIRED)
 FIND_PACKAGE(Freetype 9.0 REQUIRED)
-FIND_PACKAGE(GDK 2.10 REQUIRED)
-FIND_PACKAGE(Glib REQUIRED)
 FIND_PACKAGE(Sqlite REQUIRED)
 FIND_PACKAGE(LibXml2 2.6 REQUIRED)
 FIND_PACKAGE(LibXslt 1.1.7 REQUIRED)
@@ -111,4 +109,10 @@ ELSE ()
   ADD_DEFINITIONS(-DWTF_USE_CURL=1)
 ENDIF ()
 
+IF (ENABLE_GLIB_SUPPORT)
+  FIND_PACKAGE(GDK 2.10 REQUIRED)
+  FIND_PACKAGE(Glib REQUIRED)
+  FIND_PACKAGE(Gthread REQUIRED)
+ENDIF ()
+
 SET(CPACK_SOURCE_GENERATOR TBZ2)