2010-04-29 Yaar Schnitman <yaar@chromium.org>
[WebKit-https.git] / GNUmakefile.am
index 89260ad..699a5ff 100644 (file)
 srcdir = @srcdir@
 VPATH = @srcdir@
 
+DISTCHECK_CONFIGURE_FLAGS = \
+       --enable-introspection  \
+       --enable-gtk-doc
+
 # Directory for autogenerated sources
 GENSOURCES := $(top_builddir)/DerivedSources
+GENSOURCESWEBKITDOM := $(top_builddir)/DerivedSources/webkit
 GENPROGRAMS := $(top_builddir)/Programs
 
 # Script for creating hash tables
@@ -44,6 +49,7 @@ GTESTER_REPORT = gtester-report
 bin_PROGRAMS :=
 noinst_PROGRAMS :=
 noinst_HEADERS :=
+noinst_LTLIBRARIES :=
 lib_LIBRARIES :=
 IDL_BINDINGS :=
 TEST_PROGS :=
@@ -74,11 +80,21 @@ global_cflags :=
 global_cxxflags :=
 corekit_cflags :=
 corekit_cppflags :=
+JSCORE_GIRSOURCES :=
+WEBKIT_GIRSOURCES :=
+typelibsdir :=
+typelibs_DATA :=
+EXTRA_DIST :=
 BUILT_SOURCES :=
 CLEANFILES :=
 DISTCLEANFILES :=
 MAINTAINERCLEANFILES :=
 
+webcoregtk_cppflags += \
+       -I$(top_builddir)/DerivedSources/webkit \
+       -I$(srcdir)/WebCore/bindings \
+       -I$(srcdir)/WebCore/bindings/gobject
+
 # CFLAGS/CXXFLAGS used by WebCore and WebKit
 #
 # gtk+.pc already include glib, cairo, freetype and pango CFLAGS
@@ -132,6 +148,7 @@ global_cxxflags += \
 # It breaks the build on other platforms, so we use it conditionally
 if OS_WIN32
 no_undefined = -no-undefined
+version_script = -export-symbols-regex "^(webkit_|JS).*"
 endif
 
 if OS_GNU
@@ -143,15 +160,16 @@ lib_LTLIBRARIES = \
        libwebkit-1.0.la
 
 # Convenience libraries
-noinst_LTLIBRARIES = \
-       libJavaScriptCore.la \
-       libWebCore.la
+noinst_LTLIBRARIES += \
+       libJavaScriptCore.la
 
 # JavaScriptCore
 javascriptcore_cppflags += \
        -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
        -I$(srcdir)/JavaScriptCore/parser \
        -I$(srcdir)/JavaScriptCore/wtf \
+       -I$(srcdir)/JavaScriptCore/wtf/gtk \
+       -I$(srcdir)/JavaScriptCore/wtf/gobject \
        -I$(top_builddir)/DerivedSources
 
 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
@@ -186,30 +204,12 @@ libJavaScriptCore_la_CPPFLAGS = \
        $(global_cppflags) \
        $(javascriptcore_cppflags)
 
-# WebCore
-nodist_EXTRA_libWebCore_la_SOURCES = \
+# WebKit
+nodist_EXTRA_libwebkit_1_0_la_SOURCES = \
        $(webcore_built_nosources)
 
-nodist_libWebCore_la_SOURCES = \
-       $(webcore_built_sources)
-
-libWebCore_la_SOURCES = \
-       $(webcore_sources) \
-       $(webcoregtk_sources)
-
-libWebCore_la_CXXFLAGS = \
-       $(global_cxxflags) \
-       $(corekit_cflags)
-
-libWebCore_la_CFLAGS = \
-       $(global_cflags) \
-       $(corekit_cflags)
-
-libWebCore_la_CPPFLAGS = \
-       $(corekit_cppflags)
-
-# WebKit
 nodist_libwebkit_1_0_la_SOURCES = \
+       $(webcore_built_sources) \
        $(webkitgtk_built_sources)
 
 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
@@ -218,6 +218,8 @@ libwebkit_1_0_la_HEADERS = \
        WebKit/gtk/webkit/webkitenumtypes.h
 
 libwebkit_1_0_la_SOURCES = \
+       $(webcore_sources) \
+       $(webcoregtk_sources) \
        $(webkitgtk_sources)
 
 libwebkit_1_0_la_CXXFLAGS = \
@@ -241,8 +243,8 @@ libwebkit_1_0_la_LDFLAGS = \
 libwebkit_1_0_la_LIBADD = \
        -lpthread \
        libJavaScriptCore.la \
-       libWebCore.la \
        libWebCoreJS.la \
+       libgdom.la \
        $(webcore_ldflags) \
        $(CAIRO_LIBS) \
        $(COVERAGE_LDFLAGS) \
@@ -264,6 +266,10 @@ libwebkit_1_0_la_LIBADD = \
        $(UNICODE_LIBS) \
        $(XT_LIBS)
 
+libgdom_ladir = $(prefix)/include/webkit-1.0/webkit
+libgdom_la_HEADERS = \
+       $(libgdom_h_api)
+
 #
 # Extra checks and flags
 global_cppflags += \
@@ -277,16 +283,8 @@ global_cppflags += \
 endif
 
 if USE_GLIB_UNICODE
-# https://bugs.webkit.org/show_bug.cgi?id=15914
-# In patch 1/4 we are compiling a hybrid version of GLib WTF Unicode
-# functionality mixed with ICU-based text codecs and TextBreakIterator.
-# For the transition, introducing an interim HYBRID macro.
-# This macro is required for compiling WTF with GLib Unicode backend,
-# but at the same time keeping ICU dependency for codecs and break iterator.
-# It will be removed with patch 3/4 of the above bug.
 global_cppflags += \
-       -DWTF_USE_GLIB_UNICODE=1 \
-       -DWTF_USE_GLIB_ICU_UNICODE_HYBRID=1
+       -DWTF_USE_GLIB_UNICODE=1
 endif
 
 if !ENABLE_FAST_MALLOC
@@ -333,6 +331,7 @@ webkitgtk_h_api += \
        $(srcdir)/WebKit/gtk/webkit/webkitwebinspector.h \
        $(srcdir)/WebKit/gtk/webkit/webkitwebnavigationaction.h \
        $(srcdir)/WebKit/gtk/webkit/webkitwebpolicydecision.h \
+       $(srcdir)/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h \
        $(srcdir)/WebKit/gtk/webkit/webkitwebresource.h \
        $(srcdir)/WebKit/gtk/webkit/webkitwebsettings.h \
        $(srcdir)/WebKit/gtk/webkit/webkitwebwindowfeatures.h \
@@ -343,6 +342,7 @@ webkitgtk_h_api += \
 
 webkitgtk_built_sources += \
        DerivedSources/webkitenumtypes.cpp \
+       DerivedSources/webkitdomenumtypes.cpp \
        DerivedSources/webkitmarshal.cpp \
        DerivedSources/webkitmarshal.h \
        WebKit/gtk/webkit/webkitenumtypes.h
@@ -381,6 +381,7 @@ webkitgtk_sources += \
        WebKit/gtk/webkit/webkitwebinspector.cpp \
        WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
        WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
+       WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \
        WebKit/gtk/webkit/webkitwebresource.cpp \
        WebKit/gtk/webkit/webkitwebdatabase.cpp \
        WebKit/gtk/webkit/webkitsecurityorigin.cpp \
@@ -396,7 +397,8 @@ webkitgtk_cppflags += \
        -I$(srcdir)/WebKit/gtk \
        -I$(srcdir)/WebKit/gtk/WebCoreSupport \
        -I$(srcdir)/WebKit/gtk/webkit \
-       -I$(top_builddir)/WebKit/gtk/webkit
+       -I$(top_builddir)/WebKit/gtk/webkit \
+       -I$(GENSOURCESWEBKITDOM)
 
 webkitgtk_cleanfiles += \
        $(top_builddir)/stamp-webkitmarshal.cpp \
@@ -413,29 +415,16 @@ webkitgtk_cleanfiles += \
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
 
-# Files that will be distributed
-EXTRA_DIST = \
-       $(srcdir)/gtk-doc.make \
-       WebKit/LICENSE \
-       $(javascriptcore_dist) \
-       $(webcore_dist) \
-       $(srcdir)/autotools/symbols.filter \
-       $(srcdir)/WebKit/gtk/ChangeLog \
-       $(srcdir)/WebKit/gtk/NEWS \
-       $(srcdir)/WebKit/gtk/webkitmarshal.list \
-       $(srcdir)/WebKit/gtk/docs/GNUmakefile.* \
-       $(srcdir)/WebKit/gtk/docs/webkitenvironment.xml \
-       $(srcdir)/WebKit/gtk/docs/webkitgtk-docs.sgml \
-       $(srcdir)/WebKit/gtk/docs/webkitgtk-sections.txt \
-       $(srcdir)/WebKit/gtk/docs/version.xml.in \
-       $(srcdir)/WebKit/gtk/po/* \
-       $(srcdir)/WebKit/gtk/resources/*
-
 if ENABLE_INTROSPECTION
-JSCORE_GIRSOURCES = $(srcdir)/WebKit/gtk/JSCore-1.0.gir # JSCore-1.0.gir is handwritten
-WEBKIT_GIRSOURCES = WebKit-1.0.gir
+JSCORE_GIRSOURCES += JSCore-1.0.gir
+WEBKIT_GIRSOURCES += WebKit-1.0.gir
+
+# JSCore-1.0.gir is handwritten - this is a hack to make the typelib
+# generation work during make dist
+JSCore-1.0.gir: $(srcdir)/WebKit/gtk/JSCore-1.0.gir
+       cp $(srcdir)/WebKit/gtk/JSCore-1.0.gir $(builddir)/
 
-$(WEBKIT_GIRSOURCES): $(JSCORE_GIRSOURCES) $(G_IR_SCANNER)
+$(WEBKIT_GIRSOURCES): $(JSCORE_GIRSOURCES) $(G_IR_SCANNER) libwebkit-1.0.la
        $(AM_V_GEN)$(G_IR_SCANNER) -v --namespace WebKit --nsversion=1.0 \
             --include=GObject-2.0 \
             --include=Gtk-2.0 \
@@ -445,7 +434,9 @@ $(WEBKIT_GIRSOURCES): $(JSCORE_GIRSOURCES) $(G_IR_SCANNER)
             --libtool="$(LIBTOOL)" \
             --pkg gobject-2.0 \
             --pkg gtk+-2.0 \
+            --pkg libsoup-2.4 \
             --output $@ \
+            --add-include-path $(top_srcdir)/WebKit/gtk \
             -I$(top_srcdir)/WebKit/gtk \
             -I$(top_builddir)/WebKit/gtk \
             -I$(top_srcdir)/JavaScriptCore/ForwardingHeaders \
@@ -455,17 +446,18 @@ $(WEBKIT_GIRSOURCES): $(JSCORE_GIRSOURCES) $(G_IR_SCANNER)
 girdir = $(GIRDIR)
 gir_DATA = $(WEBKIT_GIRSOURCES) $(JSCORE_GIRSOURCES)
 
-typelibsdir = $(GIRTYPELIBDIR)
-typelibs_DATA = $(JSCORE_GIRSOURCES:.gir=.typelib) $(WEBKIT_GIRSOURCES:.gir=.typelib)
+typelibsdir += $(GIRTYPELIBDIR)
+typelibs_DATA += $(JSCORE_GIRSOURCES:.gir=.typelib) $(WEBKIT_GIRSOURCES:.gir=.typelib)
 
 %.typelib: %.gir $(G_IR_COMPILER)
-       $(AM_V_GEN)$(G_IR_COMPILER) $< -o $@
+       $(AM_V_GEN)$(G_IR_COMPILER) --includedir $(top_srcdir)/WebKit/gtk $< -o $@
 
-EXTRA_DIST += $(JSCORE_GIRSOURCES)
-CLEANFILES += $(WEBKIT_GIRSOURCES) $(typelibs_DATA)
+CLEANFILES += $(JSCORE_GIRSOURCES) $(WEBKIT_GIRSOURCES) $(typelibs_DATA)
 
 endif
 
+EXTRA_DIST += WebKit/gtk/JSCore-1.0.gir
+
 WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
 WEBKIT_MARSHAL_LIST = $(top_srcdir)/WebKit/gtk/webkitmarshal.list
 
@@ -528,6 +520,69 @@ DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
        && cp xgen-gtc $@ \
        && rm -f xgen-gtc
 
+WebKit/gtk/webkit/webkitdomenumtypes.h: stamp-webkitdomenumtypes.h
+       @true
+stamp-webkitdomenumtypes.h: $(libgdom_h_api) GNUmakefile
+       $(AM_V_GEN)glib-mkenums \
+                       --fhead "#ifndef WEBKIT_DOM_ENUM_TYPES_H\n" \
+                       --fhead "#define WEBKIT_DOM_ENUM_TYPES_H\n\n" \
+                       --fhead "#include <glib-object.h>\n\n" \
+                       --fhead "G_BEGIN_DECLS\n\n" \
+                       --ftail "G_END_DECLS\n\n" \
+                       --ftail "#endif\n" \
+                       --fprod "#include <webkit/@basename@>\n\n" \
+                       --eprod "#define WEBKIT_DOM_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
+                       --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);n\n" \
+                       $(libgdom_h_api) | \
+               sed 's,web_kit,webkit_dom,' | \
+               sed 's,WEBKIT_DOM_TYPE_KIT,WEBKIT_DOM_TYPE,' \
+               > xgen-cgth \
+       && (cmp -s xgen-cgth WebKit/gtk/webkit/webkitdomenumtypes.h || cp xgen-cgth WebKit/gtk/webkit/webkitdomenumtypes.h) \
+       && rm -f xgen-cgth \
+       && echo timestamp > $(@F)
+
+DerivedSources/webkitdomenumtypes.cpp: $(top_builddir)/WebKit/gtk/webkit/webkitdomenumtypes.h $(libgdom_h_api) GNUmakefile
+       $(AM_V_GEN)glib-mkenums \
+                       --fhead "#include <config.h>\n" \
+                       --fhead "#include <glib-object.h>\n" \
+                       --fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitdomenumtypes.h\"\n\n" \
+                       --fhead "extern \"C\" {\n\n" \
+                       --fprod "\n/* enumerations from \"@filename@\" */" \
+                       --vhead "static const G@Type@Value _@enum_name@_values] = {" \
+                       --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
+                       --vtail "    { 0, NULL, NULL }\n};\n\n" \
+                       --vtail "GType @enum_name@_get_type(void)\n{\n" \
+                       --vtail "    static GType type = 0;\n\n" \
+                       --vtail "    if (!type)\n" \
+                       --vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
+                       --vtail "    return type;\n}\n\n" \
+                       --ftail "}\n" \
+               $(libgdom_h_api) | \
+               sed 's,web_kit,webkitdom,' \
+               > xgen-cgtc \
+       && cp xgen-cgtc $@ \
+       && rm -f xgen-cgtc
+
+# Files that will be distributed
+EXTRA_DIST += \
+       $(srcdir)/gtk-doc.make \
+       WebKit/LICENSE \
+       $(javascriptcore_dist) \
+       $(webcore_dist) \
+       $(srcdir)/autotools/symbols.filter \
+       $(srcdir)/WebKit/gtk/ChangeLog \
+       $(srcdir)/WebKit/gtk/NEWS \
+       $(srcdir)/WebKit/gtk/webkitmarshal.list \
+       $(srcdir)/WebKit/gtk/docs/GNUmakefile.* \
+       $(srcdir)/WebKit/gtk/docs/webkitenvironment.xml \
+       $(srcdir)/WebKit/gtk/docs/webkitgtk-docs.sgml \
+       $(srcdir)/WebKit/gtk/docs/webkitgtk-sections.txt \
+       $(srcdir)/WebKit/gtk/docs/version.xml.in \
+       $(srcdir)/WebKit/gtk/po/* \
+       $(srcdir)/WebKit/gtk/resources/* \
+       $(srcdir)/WebKit/gtk/tests/resources/* \
+       $(srcdir)/WebKit/gtk/tests/test_utils.h
+
 # extra resource files
 resourcesdir = ${datadir}/webkit-1.0/resources
 dist_resources_DATA = \
@@ -549,6 +604,9 @@ webkit_tests_cflags = \
        -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
        -I$(srcdir)/WebKit/gtk \
        -I$(top_builddir)/WebKit/gtk \
+       -I$(top_builddir)/DerivedSources \
+       -I$(top_srcdir)/WebCore/bindings \
+       -I$(top_srcdir)/WebCore/bindings/gobject \
        $(global_cflags) \
        $(GLIB_CFLAGS) \
        $(GTK_CFLAGS) \
@@ -564,8 +622,12 @@ webkit_tests_ldflags = \
        -no-install \
        -no-fast-install
 
-TEST_PROGS += Programs/unittests/testhttpbackend \
+TEST_PROGS += \
+       Programs/unittests/testdomdocument \
+       Programs/unittests/testhttpbackend \
        Programs/unittests/testloading \
+       Programs/unittests/testglobals \
+       Programs/unittests/testmimehandling \
        Programs/unittests/testnetworkrequest \
        Programs/unittests/testnetworkresponse \
        Programs/unittests/testwebframe \
@@ -574,23 +636,40 @@ TEST_PROGS += Programs/unittests/testhttpbackend \
        Programs/unittests/testwindow \
        Programs/unittests/testdownload \
        Programs/unittests/testatk \
+       Programs/unittests/testatkroles \
        Programs/unittests/testhittestresult \
        Programs/unittests/testwebsettings \
        Programs/unittests/testwebresource \
        Programs/unittests/testwebdatasource \
+       Programs/unittests/testwebview \
        Programs/unittests/testkeyevents
 
 # Add additional tests here
+Programs_unittests_testdomdocument_SOURCES = WebKit/gtk/tests/testdomdocument.c
+Programs_unittests_testdomdocument_CFLAGS = $(webkit_tests_cflags)
+Programs_unittests_testdomdocument_LDADD = $(webkit_tests_ldadd)
+Programs_unittests_testdomdocument_LDFLAGS = $(webkit_tests_ldflags)
+
 Programs_unittests_testhttpbackend_SOURCES = WebKit/gtk/tests/testhttpbackend.c
 Programs_unittests_testhttpbackend_CFLAGS = $(webkit_tests_cflags)
 Programs_unittests_testhttpbackend_LDADD = $(webkit_tests_ldadd)
 Programs_unittests_testhttpbackend_LDFLAGS = $(webkit_tests_ldflags)
 
+Programs_unittests_testglobals_SOURCES = WebKit/gtk/tests/testglobals.c
+Programs_unittests_testglobals_CFLAGS = $(webkit_tests_cflags)
+Programs_unittests_testglobals_LDADD = $(webkit_tests_ldadd)
+Programs_unittests_testglobals_LDFLAGS = $(webkit_tests_ldflags)
+
 Programs_unittests_testloading_SOURCES = WebKit/gtk/tests/testloading.c
 Programs_unittests_testloading_CFLAGS = $(webkit_tests_cflags)
 Programs_unittests_testloading_LDADD = $(webkit_tests_ldadd)
 Programs_unittests_testloading_LDFLAGS = $(webkit_tests_ldflags)
 
+Programs_unittests_testmimehandling_SOURCES = WebKit/gtk/tests/testmimehandling.c WebKit/gtk/tests/test_utils.c
+Programs_unittests_testmimehandling_CFLAGS = $(webkit_tests_cflags)
+Programs_unittests_testmimehandling_LDADD = $(webkit_tests_ldadd)
+Programs_unittests_testmimehandling_LDFLAGS = $(webkit_tests_ldflags)
+
 Programs_unittests_testnetworkrequest_SOURCES = WebKit/gtk/tests/testnetworkrequest.c
 Programs_unittests_testnetworkrequest_CFLAGS = $(webkit_tests_cflags)
 Programs_unittests_testnetworkrequest_LDADD = $(webkit_tests_ldadd)
@@ -631,6 +710,11 @@ Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags)
 Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd)
 Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags)
 
+Programs_unittests_testatkroles_SOURCES = WebKit/gtk/tests/testatkroles.c
+Programs_unittests_testatkroles_CFLAGS = $(webkit_tests_cflags)
+Programs_unittests_testatkroles_LDADD = $(webkit_tests_ldadd)
+Programs_unittests_testatkroles_LDFLAGS = $(webkit_tests_ldflags)
+
 Programs_unittests_testwebsettings_SOURCES = WebKit/gtk/tests/testwebsettings.c
 Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags)
 Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd)
@@ -644,6 +728,11 @@ Programs_unittests_testwebdatasource_SOURCES = WebKit/gtk/tests/testwebdatasourc
 Programs_unittests_testwebdatasource_CFLAGS = $(webkit_tests_cflags)
 Programs_unittests_testwebdatasource_LDADD = $(webkit_tests_ldadd)
 
+Programs_unittests_testwebview_SOURCES = WebKit/gtk/tests/testwebview.c WebKit/gtk/tests/test_utils.c
+Programs_unittests_testwebview_CFLAGS = $(webkit_tests_cflags)
+Programs_unittests_testwebview_LDADD = $(webkit_tests_ldadd)
+Programs_unittests_testwebview_LDFLAGS = $(webkit_tests_ldflags)
+
 Programs_unittests_testhittestresult_SOURCES = WebKit/gtk/tests/testhittestresult.c
 Programs_unittests_testhittestresult_CFLAGS = $(webkit_tests_cflags)
 Programs_unittests_testhittestresult_LDADD = $(webkit_tests_ldadd)
@@ -660,7 +749,8 @@ BUILT_SOURCES += \
        $(webcore_built_sources) \
        $(webcore_built_nosources) \
        $(webkitgtk_built_sources) \
-       $(webkitgtk_built_nosources)
+       $(webkitgtk_built_nosources) \
+       $(gdom_built_nosources)
 
 # Project-wide clean rules
 # Files that will be cleaned