2008-07-25 Simon Hausmann <hausmann@webkit.org>
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jul 2008 10:55:33 +0000 (10:55 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jul 2008 10:55:33 +0000 (10:55 +0000)
        Discussed with and rubber-stamped by Lars.

        Fix the build system for the Qt port.

        Recent JavaScriptCore changes require the addition of JavaScriptCore/API to the
        include search path. With a build process that combines JavaScriptCore and
        WebCore in one build process/Makefile the existance of
        JavaScriptCore/API/Node.h and WebCore/dom/Node.h causes include conflicts.

        This commit solves this by introducing a separate build of JavaScriptCore into
        a static library.

        As a result of the split-up a race-condition due to broken dependencies of
        regular source files to header files of generated sources showed up very
        frequently when doing parallel builds (which the buildbot does). This commit at
        the same time tries to address the dependency problem by making the
        addExtraCompiler() function also generate a pseudo extra compiler that
        represents the header file output, so that qmake is aware of the creation of
        the header file for dependency calculation.

        At the same time I removed a lot of cruft from the pro files to ease maintenance.

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

ChangeLog
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.pri
JavaScriptCore/JavaScriptCore.pro [new file with mode: 0644]
JavaScriptCore/kjs/jsc.pro
WebCore/ChangeLog
WebCore/WebCore.pro
WebKit.pri
WebKit.pro

index 9408debb97ca5fa4e394eb31afe5e7f63ccfcfff..a9f59746b141e3655ac638a10a0ca1b2bfc0bf76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2008-07-25  Simon Hausmann  <hausmann@webkit.org>
+
+        Discussed with and rubber-stamped by Lars.
+
+        Fix the build system for the Qt port.
+
+        Recent JavaScriptCore changes require the addition of JavaScriptCore/API to the
+        include search path. With a build process that combines JavaScriptCore and
+        WebCore in one build process/Makefile the existance of
+        JavaScriptCore/API/Node.h and WebCore/dom/Node.h causes include conflicts.
+
+        This commit solves this by introducing a separate build of JavaScriptCore into
+        a static library.
+
+        As a result of the split-up a race-condition due to broken dependencies of
+        regular source files to header files of generated sources showed up very
+        frequently when doing parallel builds (which the buildbot does). This commit at
+        the same time tries to address the dependency problem by making the
+        addExtraCompiler() function also generate a pseudo extra compiler that
+        represents the header file output, so that qmake is aware of the creation of
+        the header file for dependency calculation.
+
+        At the same time I removed a lot of cruft from the pro files to ease maintenance.
+
+        * WebKit.pri:
+        * WebKit.pro:
+
 2008-06-18  Marco Barisione  <marco.barisione@collabora.co.uk>
 
         Reviewed by Alp Toker.
index 66c725a24e2153fa266df24322116264dd02e825..472df983ff190bafa33b45c91eadc3a33a4d8bf6 100644 (file)
@@ -1,3 +1,31 @@
+2008-07-25  Simon Hausmann  <hausmann@webkit.org>
+
+        Discussed with and rubber-stamped by Lars.
+
+        Fix the build system for the Qt port.
+
+        Recent JavaScriptCore changes require the addition of JavaScriptCore/API to the
+        include search path. With a build process that combines JavaScriptCore and
+        WebCore in one build process/Makefile the existance of
+        JavaScriptCore/API/Node.h and WebCore/dom/Node.h causes include conflicts.
+
+        This commit solves this by introducing a separate build of JavaScriptCore into
+        a static library.
+
+        As a result of the split-up a race-condition due to broken dependencies of
+        regular source files to header files of generated sources showed up very
+        frequently when doing parallel builds (which the buildbot does). This commit at
+        the same time tries to address the dependency problem by making the
+        addExtraCompiler() function also generate a pseudo extra compiler that
+        represents the header file output, so that qmake is aware of the creation of
+        the header file for dependency calculation.
+
+        At the same time I removed a lot of cruft from the pro files to ease maintenance.
+
+        * JavaScriptCore.pri:
+        * JavaScriptCore.pro: Added.
+        * kjs/jsc.pro:
+
 2008-07-24  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Maciej Stachowiak.
index b35fa954026e888300fff405d9244ab99a863cc0..726569c9120e74e53aa684d7daab17abadf3b75b 100644 (file)
@@ -2,14 +2,14 @@
 VPATH += $$PWD
 
 INCLUDEPATH += tmp
-INCLUDEPATH += $$PWD $$PWD/kjs $$PWD/wtf $$PWD/wtf/unicode $$PWD/VM $$PWD/profiler
-DEPENDPATH += $$PWD $$PWD/kjs $$PWD/wtf $$PWD/wtf/unicode $$PWD/VM $$PWD/profiler
-DEFINES -= KJS_IDENTIFIER_HIDE_GLOBALS 
+INCLUDEPATH += $$PWD $$PWD/kjs $$PWD/wtf $$PWD/wtf/unicode $$PWD/VM $$PWD/profiler $$PWD/API $$PWD/.. \
+               $$PWD/ForwardingHeaders
 DEFINES += BUILDING_QT__
 
-win32-msvc*: INCLUDEPATH += $$PWD/os-win32
-
 isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = tmp
+GENERATED_SOURCES_DIR_SLASH = $$GENERATED_SOURCES_DIR/
+win32-*: GENERATED_SOURCES_DIR_SLASH ~= s|/|\|
+
 
 include(pcre/pcre.pri)
 
@@ -142,16 +142,6 @@ SOURCES += \
     wtf/ThreadingQt.cpp \
     wtf/qt/MainThreadQt.cpp
 
-!CONFIG(QTDIR_build) {
-    defineTest(addExtraCompiler) {
-        QMAKE_EXTRA_COMPILERS += $$1
-        generated_files.depends += compiler_$${1}_make_all
-        export(QMAKE_EXTRA_COMPILERS)
-        export(generated_files.depends)
-        return(true)
-    }
-}
-
 # GENERATOR 1-A: LUT creator
 lut.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.lut.h
 lut.commands = perl $$PWD/kjs/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
@@ -176,5 +166,4 @@ kjsbison.input = KJSBISON
 kjsbison.variable_out = GENERATED_SOURCES
 kjsbison.dependency_type = TYPE_C
 kjsbison.CONFIG = target_predeps
-kjsbison.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR}${QMAKE_FILE_BASE}.h
-addExtraCompiler(kjsbison)
+addExtraCompilerWithHeader(kjsbison)
diff --git a/JavaScriptCore/JavaScriptCore.pro b/JavaScriptCore/JavaScriptCore.pro
new file mode 100644 (file)
index 0000000..6f2ede7
--- /dev/null
@@ -0,0 +1,65 @@
+# -*- Mode:makefile -*-
+# JavaScriptCore - qmake build info
+CONFIG += building-libs
+include($$PWD/../WebKit.pri)
+
+TEMPLATE = lib
+CONFIG += staticlib
+TARGET = JavaScriptCore
+
+CONFIG += depend_includepath
+
+contains(QT_CONFIG, embedded):CONFIG += embedded
+
+CONFIG(QTDIR_build) {
+    GENERATED_SOURCES_DIR = $$PWD/generated
+    OLDDESTDIR = $$DESTDIR
+    include($$QT_SOURCE_TREE/src/qbase.pri)
+    DESTDIR = $$OLDDESTDIR
+    PRECOMPILED_HEADER = $$PWD/../WebKit/qt/WebKit_pch.h
+    DEFINES *= NDEBUG
+}
+
+isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = tmp
+GENERATED_SOURCES_DIR_SLASH = $$GENERATED_SOURCES_DIR/
+win32-*: GENERATED_SOURCES_DIR_SLASH ~= s|/|\|
+
+INCLUDEPATH += $$GENERATED_SOURCES_DIR
+
+!CONFIG(QTDIR_build) {
+     OBJECTS_DIR = tmp
+}
+
+include($$OUTPUT_DIR/config.pri)
+
+CONFIG -= warn_on
+*-g++*:QMAKE_CXXFLAGS += -Wreturn-type -fno-strict-aliasing
+#QMAKE_CXXFLAGS += -Wall -Wno-undef -Wno-unused-parameter
+
+CONFIG(release):!CONFIG(QTDIR_build) {
+    contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
+    unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
+}
+
+linux-*: DEFINES += HAVE_STDINT_H
+freebsd-*: DEFINES += HAVE_PTHREAD_NP_H
+
+DEFINES += BUILD_WEBKIT
+
+# Pick up 3rdparty libraries from INCLUDE/LIB just like with MSVC
+win32-g++ {
+    TMPPATH            = $$quote($$(INCLUDE))
+    QMAKE_INCDIR_POST += $$split(TMPPATH,";")
+    TMPPATH            = $$quote($$(LIB))
+    QMAKE_LIBDIR_POST += $$split(TMPPATH,";")
+}
+
+DEFINES += WTF_USE_JAVASCRIPTCORE_BINDINGS=1
+
+DEFINES += WTF_CHANGES=1
+
+include(JavaScriptCore.pri)
+
+QMAKE_EXTRA_TARGETS += generated_files
+
+linux-icc*:QMAKE_CXXFLAGS_RELEASE ~= s/-O2/-O0/
index bdc1387f637cba9ff58ad2fef33efb3fe5d011a2..9da22474a1950fc5e9a72f034dfb0f3c9fac1e51 100644 (file)
@@ -3,7 +3,6 @@ TARGET = jsc
 DESTDIR = ..
 SOURCES = Shell.cpp
 QT -= gui
-DEFINES -= KJS_IDENTIFIER_HIDE_GLOBALS 
 INCLUDEPATH += $$PWD/.. \
     $$PWD \
     $$PWD/../bindings \
@@ -17,6 +16,8 @@ CONFIG(release) {
     DEFINES += NDEBUG USE_SYSTEM_MALLOC
 }
 
+include($$PWD/../../WebKit.pri)
+
 CONFIG += link_pkgconfig
 
 QMAKE_RPATHDIR += $$OUTPUT_DIR/lib
@@ -28,17 +29,6 @@ OBJECTS_DIR_WTR = $$OBJECTS_DIR/
 win32-*: OBJECTS_DIR_WTR ~= s|/|\|
 include($$PWD/../JavaScriptCore.pri)
 
-# Hack!  Fix this.
-SOURCES -= API/JSBase.cpp \
-    API/JSCallbackConstructor.cpp \
-    API/JSCallbackFunction.cpp \
-    API/JSCallbackObject.cpp \
-    API/JSClassRef.cpp \
-    API/JSContextRef.cpp \
-    API/JSObjectRef.cpp \
-    API/JSStringRef.cpp \
-    API/JSValueRef.cpp
-
 lessThan(QT_MINOR_VERSION, 4) {
     DEFINES += QT_BEGIN_NAMESPACE="" QT_END_NAMESPACE=""
 }
index 0cbc35521108cb44cc830b7c9d106cd8f42f7bc9..e2756c9757f8b9fee1b6ffdf05aaae48afca3c8e 100644 (file)
@@ -1,3 +1,29 @@
+2008-07-25  Simon Hausmann  <hausmann@webkit.org>
+
+        Discussed with and rubber-stamped by Lars.
+
+        Fix the build system for the Qt port.
+
+        Recent JavaScriptCore changes require the addition of JavaScriptCore/API to the
+        include search path. With a build process that combines JavaScriptCore and
+        WebCore in one build process/Makefile the existance of
+        JavaScriptCore/API/Node.h and WebCore/dom/Node.h causes include conflicts.
+
+        This commit solves this by introducing a separate build of JavaScriptCore into
+        a static library.
+
+        As a result of the split-up a race-condition due to broken dependencies of
+        regular source files to header files of generated sources showed up very
+        frequently when doing parallel builds (which the buildbot does). This commit at
+        the same time tries to address the dependency problem by making the
+        addExtraCompiler() function also generate a pseudo extra compiler that
+        represents the header file output, so that qmake is aware of the creation of
+        the header file for dependency calculation.
+
+        At the same time I removed a lot of cruft from the pro files to ease maintenance.
+
+        * WebCore.pro:
+
 2008-07-24  kevino  <kevino@theolliviers.com>
 
         wx build fix on Win for plugins coode.
index a087ab5522b45ea6782620808a5522df1099da57..4eb35a2523ec4ab3c6d7ea3adfb4c3c95dc07974 100644 (file)
@@ -1,9 +1,7 @@
 # -*- Mode:makefile -*-
 # WebCore - qmake build info
 CONFIG += building-libs
-# do not use implicit rules in nmake Makefiles to avoid the clash
-# of API/Node.c and dom/Node.cpp
-CONFIG += no_batch
+CONFIG += depend_includepath
 include($$PWD/../WebKit.pri)
 
 TEMPLATE = lib
@@ -22,17 +20,11 @@ isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = tmp
 GENERATED_SOURCES_DIR_SLASH = $$GENERATED_SOURCES_DIR/
 win32-*: GENERATED_SOURCES_DIR_SLASH ~= s|/|\|
 
-INCLUDEPATH += $$GENERATED_SOURCES_DIR
-
 !CONFIG(QTDIR_build) {
      OBJECTS_DIR = tmp
      DESTDIR = $$OUTPUT_DIR/lib
 }
 
-DEPENDPATH += css dom loader editing history html \
-    loader/icon page platform platform/graphics platform/graphics/filters platform/network platform/text plugins rendering rendering/style xml \
-    bindings/js bridge bridge/c bridge/qt
-
 include($$OUTPUT_DIR/config.pri)
 
 CONFIG -= warn_on
@@ -88,43 +80,22 @@ DEFINES += WTF_USE_JAVASCRIPTCORE_BINDINGS=1
 
 DEFINES += WTF_CHANGES=1
 
-#
-# For builds inside Qt we interpret the output rule and the input of each extra compiler manually
-# and add the resulting sources to the SOURCES variable, because the build inside Qt contains already
-# all the generated files. We do not need to generate any extra compiler rules in that case.
-#
-# In addition this function adds a new target called 'generated_files' that allows manually calling
-# all the extra compilers to generate all the necessary files for the build using 'make generated_files'
-#
-defineTest(addExtraCompiler) {
-    CONFIG(QTDIR_build) {
-        outputRule = $$eval($${1}.output)
-
-        input = $$eval($${1}.input)
-        input = $$eval($$input)
+INCLUDEPATH += $$PWD/../JavaScriptCore $$PWD/../JavaScriptCore/ForwardingHeaders \
+               $$PWD/../JavaScriptCore/VM \
+               $$PWD/../JavaScriptCore/kjs \
+               $$PWD/../JavaScriptCore/bindings \
+               $$PWD/../JavaScriptCore/wtf
 
-        for(file,input) {
-            base = $$basename(file)
-            base ~= s/\..+//
-            newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
-            SOURCES += $$newfile
-        }
-
-        export(SOURCES)
+contains(CONFIG, debug_and_release_target) {
+    CONFIG(debug, debug|release) {
+        LIBS+=-L../JavaScriptCore/debug
     } else {
-        QMAKE_EXTRA_COMPILERS += $$1
-        generated_files.depends += compiler_$${1}_make_all
-        export(QMAKE_EXTRA_COMPILERS)
-        export(generated_files.depends)
+        LIBS+=-L../JavaScriptCore/release
     }
-    return(true)
+} else {
+    LIBS += -L../JavaScriptCore
 }
 
-include($$PWD/../JavaScriptCore/JavaScriptCore.pri)
-
-#INCLUDEPATH += $$PWD/../JavaScriptCore
-#LIBS += -L$$OUTPUT_DIR/lib -lJavaScriptCore
-
 RESOURCES += \
     $$PWD/../WebCore/page/inspector/WebKit.qrc \
     $$PWD/../WebCore/Resources/WebKitResources.qrc \
@@ -141,9 +112,6 @@ INCLUDEPATH += \
     $$PWD/../WebKit/qt/Api \
     $$PWD/bridge/qt
 
-DEPENDPATH += editing/qt history/qt loader/qt page/qt \
-    platform/graphics/qt ../WebKit/qt/Api ../WebKit/qt/WebCoreSupport
-
 # Make sure storage/ appears before JavaScriptCore/kjs. Both provide LocalStorage.h
 # but the header from the former include path is included across directories while
 # kjs/LocalStorage.h is included only from files within the same directory
@@ -152,10 +120,6 @@ INCLUDEPATH = $$PWD/storage $$INCLUDEPATH
 INCLUDEPATH +=  $$PWD \
                 $$PWD/ForwardingHeaders \
                 $$PWD/.. \
-                $$PWD/../JavaScriptCore/VM \
-                $$PWD/../JavaScriptCore/kjs \
-                $$PWD/../JavaScriptCore/bindings \
-                $$PWD/../JavaScriptCore/wtf \
                 $$PWD/platform \
                 $$PWD/platform/network \
                 $$PWD/platform/graphics \
@@ -184,7 +148,8 @@ INCLUDEPATH +=  $$PWD \
                 $$PWD/plugins \
                 $$PWD/bridge \
                 $$PWD/bridge/c \
-                $$PWD/bridge/qt
+                $$PWD/bridge/qt \
+                $$GENERATED_SOURCES_DIR
 
 QT += network
 lessThan(QT_MINOR_VERSION, 4): QT += xml
@@ -1259,9 +1224,6 @@ contains(DEFINES, ENABLE_XBL=1) {
 contains(DEFINES, ENABLE_SVG=1) {
     FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG=1
 
-    DEPENDPATH += svg svg/graphics
-    DEPENDPATH += svg/graphics/qt
-
     SVG_NAMES = $$PWD/svg/svgtags.in
 
     XLINK_NAMES = $$PWD/svg/xlinkattrs.in
@@ -1620,24 +1582,28 @@ SOURCES += \
         svgnames_a.dependency_type = TYPE_C
         svgnames_a.CONFIG = target_predeps
         svgnames_a.variable_out = GENERATED_SOURCES
-        svgnames_a.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}SVGNames.h
-        addExtraCompiler(svgnames_a)
+        addExtraCompilerWithHeader(svgnames_a)
         svgnames_b.output = $$GENERATED_SOURCES_DIR/SVGElementFactory.cpp
         svgnames_b.commands = @echo -n ''
         svgnames_b.input = SVG_NAMES
         svgnames_b.depends = $$GENERATED_SOURCES_DIR/SVGNames.cpp
         svgnames_b.CONFIG = target_predeps
         svgnames_b.variable_out = GENERATED_SOURCES
-        svgnames_b.clean += ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}SVGElementFactory.h ${QMAKE_FILE_OUT}
-        addExtraCompiler(svgnames_b)
-        svgnames_c.output = $$GENERATED_SOURCES_DIR/JSSVGElementWrapperFactory.cpp
-        svgnames_c.commands = @echo -n ''
-        svgnames_c.input = SVG_NAMES
-        svgnames_c.depends = $$GENERATED_SOURCES_DIR/SVGNames.cpp
-        svgnames_c.CONFIG = target_predeps
-        svgnames_c.variable_out = GENERATED_SOURCES
-        svgnames_c.clean += ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}JSSVGElementWrapperFactory.h ${QMAKE_FILE_OUT}
-        addExtraCompiler(svgnames_c)
+        addExtraCompilerWithHeader(svgnames_b)
+        svgelementwrapper.output = $$GENERATED_SOURCES_DIR/JSSVGElementWrapperFactory.cpp
+        svgelementwrapper.commands = @echo -n ''
+        svgelementwrapper.input = SVG_NAMES
+        svgelementwrapper.depends = $$GENERATED_SOURCES_DIR/SVGNames.cpp
+        svgelementwrapper.CONFIG = target_predeps
+        svgelementwrapper.variable_out = GENERATED_SOURCES
+        addExtraCompiler(svgelementwrapper)
+        svgelementwrapper_header.output = $$GENERATED_SOURCES_DIR/JSSVGElementWrapperFactory.h
+        svgelementwrapper_header.commands = @echo -n ''
+        svgelementwrapper_header.input = SVG_NAMES
+        svgelementwrapper_header.depends = $$GENERATED_SOURCES_DIR/SVGNames.cpp
+        svgelementwrapper_header.CONFIG = target_predeps
+        svgelementwrapper_header.variable_out = GENERATED_FILES
+        addExtraCompiler(svgelementwrapper_header)
 
         # GENERATOR 5-D:
         xlinknames.output = $$GENERATED_SOURCES_DIR/XLinkNames.cpp
@@ -1646,8 +1612,7 @@ SOURCES += \
         xlinknames.dependency_type = TYPE_C
         xlinknames.CONFIG = target_predeps
         xlinknames.variable_out = GENERATED_SOURCES
-        xlinknames.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}XLinkNames.h
-        addExtraCompiler(xlinknames)
+        addExtraCompilerWithHeader(xlinknames)
 
     # GENERATOR 6-A:
     cssprops.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.cpp
@@ -1655,8 +1620,7 @@ SOURCES += \
     cssprops.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $$DASHBOARDSUPPORTCSSPROPERTIES $$SVGCSSPROPERTIES > $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.in && cd $$GENERATED_SOURCES_DIR && perl $$PWD/css/makeprop.pl && $(DEL_FILE) ${QMAKE_FILE_BASE}.strip ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
     cssprops.CONFIG = target_predeps no_link
     cssprops.depend = ${QMAKE_FILE_NAME} DASHBOARDSUPPORTCSSPROPERTIES SVGCSSPROPERTIES
-    cssprops.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}${QMAKE_FILE_BASE}.h
-    addExtraCompiler(cssprops)
+    addExtraCompilerWithHeader(cssprops)
 
     # GENERATOR 6-B:
     cssvalues.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.c
@@ -1664,8 +1628,7 @@ SOURCES += \
     cssvalues.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $$SVGCSSVALUES > $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.in && cd $$GENERATED_SOURCES_DIR && perl $$PWD/css/makevalues.pl && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.strip ${QMAKE_FILE_BASE}.gperf
     cssvalues.CONFIG = target_predeps no_link
     cssvalues.depend = ${QMAKE_FILE_NAME} SVGCSSVALUES
-    cssvalues.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}${QMAKE_FILE_BASE}.h
-    addExtraCompiler(cssvalues)
+    addExtraCompilerWithHeader(cssvalues)
 } else {
     # GENERATOR 6-A:
     cssprops.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.c
@@ -1673,8 +1636,7 @@ SOURCES += \
     cssprops.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $$DASHBOARDSUPPORTCSSPROPERTIES > $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.in && cd $$GENERATED_SOURCES_DIR && perl $$PWD/css/makeprop.pl && $(DEL_FILE) ${QMAKE_FILE_BASE}.strip ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
     cssprops.CONFIG = target_predeps no_link
     cssprops.depend = ${QMAKE_FILE_NAME} DASHBOARDSUPPORTCSSPROPERTIES
-    cssprops.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}${QMAKE_FILE_BASE}.h
-    addExtraCompiler(cssprops)
+    addExtraCompilerWithHeader(cssprops)
 
     # GENERATOR 6-B:
     cssvalues.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.c
@@ -1692,16 +1654,15 @@ idl.variable_out = GENERATED_SOURCES
 idl.input = IDL_BINDINGS
 idl.commands = perl -I$$PWD/bindings/scripts $$PWD/bindings/scripts/generate-bindings.pl --defines \"$${FEATURE_DEFINES_JAVASCRIPT}\" --generator JS --include $$PWD/dom --include $$PWD/html --include $$PWD/xml --include $$PWD/svg --outputdir $$GENERATED_SOURCES_DIR --preprocessor \"$${QMAKE_MOC} -E\" ${QMAKE_FILE_NAME}
 idl.CONFIG += target_predeps
-idl.clean = ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}JS${QMAKE_FILE_BASE}.h ${QMAKE_FILE_OUT}
-addExtraCompiler(idl)
+addExtraCompilerWithHeader(idl)
 
 # GENERATOR 2-A: LUT creator
-#lut.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.lut.h
-#lut.commands = perl $$PWD/../JavaScriptCore/kjs/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
-#lut.depend = ${QMAKE_FILE_NAME}
-#lut.input = LUT_FILES
-#lut.CONFIG += no_link
-#QMAKE_EXTRA_COMPILERS += lut
+lut.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.lut.h
+lut.commands = perl $$PWD/../JavaScriptCore/kjs/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
+lut.depend = ${QMAKE_FILE_NAME}
+lut.input = LUT_FILES
+lut.CONFIG += no_link
+addExtraCompiler(lut)
 
 # GENERATOR 2-B: like JavaScriptCore/LUT Generator, but rename output
 luttable.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}Table.cpp
@@ -1728,12 +1689,7 @@ cssbison.input = CSSBISON
 cssbison.CONFIG = target_predeps
 cssbison.dependency_type = TYPE_C
 cssbison.variable_out = GENERATED_SOURCES
-cssbison.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}${QMAKE_FILE_BASE}.h
-addExtraCompiler(cssbison)
-#PRE_TARGETDEPS += $$GENERATED_SOURCES_DIR/CSSGrammar.cpp
-grammar_h_dep.target = tmp/CSSParser.o
-grammar_h_dep.depends = $$GENERATED_SOURCES_DIR/CSSGrammar.cpp $$GENERATED_SOURCES_DIR/HTMLNames.cpp
-QMAKE_EXTRA_TARGETS += grammar_h_dep
+addExtraCompilerWithHeader(cssbison)
 
 # GENERATOR 5-A:
 htmlnames.output = $$GENERATED_SOURCES_DIR/HTMLNames.cpp
@@ -1742,16 +1698,16 @@ htmlnames.input = HTML_NAMES
 htmlnames.dependency_type = TYPE_C
 htmlnames.CONFIG = target_predeps
 htmlnames.variable_out = GENERATED_SOURCES
-htmlnames.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}HTMLNames.h
-addExtraCompiler(htmlnames)
-htmlnames_a.output = $$GENERATED_SOURCES_DIR/JSHTMLElementWrapperFactory.cpp
-htmlnames_a.commands = @echo -n ''
-htmlnames_a.input = HTML_NAMES
-htmlnames_a.depends = $$GENERATED_SOURCES_DIR/HTMLNames.cpp
-htmlnames_a.CONFIG = target_predeps
-htmlnames_a.variable_out = GENERATED_SOURCES
-htmlnames_a.clean += ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}JSHTMLElementWrapperFactory.h ${QMAKE_FILE_OUT}
-addExtraCompiler(htmlnames_a)
+addExtraCompilerWithHeader(htmlnames)
+
+elementwrapperfactory.output = $$GENERATED_SOURCES_DIR/JSHTMLElementWrapperFactory.cpp
+elementwrapperfactory.commands = @echo -n ''
+elementwrapperfactory.input = HTML_NAMES
+elementwrapperfactory.depends = $$GENERATED_SOURCES_DIR/HTMLNames.cpp
+elementwrapperfactory.CONFIG = target_predeps
+elementwrapperfactory.variable_out = GENERATED_SOURCES
+elementwrapperfactory.clean += ${QMAKE_FILE_OUT}
+addExtraCompilerWithHeader(elementwrapperfactory)
 
 # GENERATOR 5-B:
 xmlnames.output = $$GENERATED_SOURCES_DIR/XMLNames.cpp
@@ -1760,8 +1716,7 @@ xmlnames.input = XML_NAMES
 xmlnames.dependency_type = TYPE_C
 xmlnames.CONFIG = target_predeps
 xmlnames.variable_out = GENERATED_SOURCES
-xmlnames.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}XMLNames.h
-addExtraCompiler(xmlnames)
+addExtraCompilerWithHeader(xmlnames)
 
 # GENERATOR 8-A:
 entities.output = $$GENERATED_SOURCES_DIR/HTMLEntityNames.c
@@ -1795,7 +1750,7 @@ stylesheets.input = STYLESHEETS_EMBED
 stylesheets.CONFIG = target_predeps
 stylesheets.variable_out = GENERATED_SOURCES
 stylesheets.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}UserAgentStyleSheets.h
-addExtraCompiler(stylesheets)
+addExtraCompilerWithHeader(stylesheets, $$GENERATED_SOURCES_DIR/UserAgentStyleSheets.h)
 
 # GENERATOR 10: XPATH grammar
 xpathbison.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.cpp
@@ -1805,8 +1760,7 @@ xpathbison.input = XPATHBISON
 xpathbison.CONFIG = target_predeps
 xpathbison.dependency_type = TYPE_C
 xpathbison.variable_out = GENERATED_SOURCES
-xpathbison.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR_SLASH}${QMAKE_FILE_BASE}.h
-addExtraCompiler(xpathbison)
+addExtraCompilerWithHeader(xpathbison)
 
 !CONFIG(QTDIR_build) {
     target.path = $$[QT_INSTALL_LIBS]
index 19c818a1cb6b6b7308da7ee356f104bb62a9b95c..a8699062886b238374df90dc7e41bc371c8e6bfb 100644 (file)
@@ -7,7 +7,9 @@ isEmpty(OUTPUT_DIR) {
 }
 
 DEFINES += BUILDING_QT__=1
-!building-libs {
+building-libs {
+    win32-msvc*: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
+} else {
     QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
     LIBS += -lQtWebKit
     DEPENDPATH += $$PWD/WebKit/qt/Api
@@ -19,27 +21,69 @@ CONFIG(release) {
 }
 
 BASE_DIR = $$PWD
-INCLUDEPATH += \
-    $$PWD/WebKit/qt/Api \
-    $$BASE_DIR/JavaScriptCore/ \
-    $$BASE_DIR/JavaScriptCore/kjs \
-    $$BASE_DIR/JavaScriptCore/bindings \
-    $$BASE_DIR/JavaScriptCore/bindings/c \
-    $$BASE_DIR/JavaScriptCore/wtf \
-    $$BASE_DIR/JavaScriptCore/ForwardingHeaders \
-    $$BASE_DIR/WebCore \
-    $$BASE_DIR/WebCore/ForwardingHeaders \
-    $$BASE_DIR/WebCore/platform \
-    $$BASE_DIR/WebCore/platform/network \
-    $$BASE_DIR/WebCore/platform/graphics \
-    $$BASE_DIR/WebCore/loader \
-    $$BASE_DIR/WebCore/page \
-    $$BASE_DIR/WebCore/css \
-    $$BASE_DIR/WebCore/dom \
-    $$BASE_DIR/WebCore/bridge \
-    $$BASE_DIR/WebCore/editing \
-    $$BASE_DIR/WebCore/rendering \
-    $$BASE_DIR/WebCore/history \
-    $$BASE_DIR/WebCore/xml \
-    $$BASE_DIR/WebCore/html \
-    $$BASE_DIR/WebCore/plugins
+INCLUDEPATH += $$PWD/WebKit/qt/Api
+
+#
+# For builds inside Qt we interpret the output rule and the input of each extra compiler manually
+# and add the resulting sources to the SOURCES variable, because the build inside Qt contains already
+# all the generated files. We do not need to generate any extra compiler rules in that case.
+#
+# In addition this function adds a new target called 'generated_files' that allows manually calling
+# all the extra compilers to generate all the necessary files for the build using 'make generated_files'
+#
+defineTest(addExtraCompiler) {
+    CONFIG(QTDIR_build) {
+        outputRule = $$eval($${1}.output)
+
+        input = $$eval($${1}.input)
+        input = $$eval($$input)
+
+        for(file,input) {
+            base = $$basename(file)
+            base ~= s/\..+//
+            newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
+            SOURCES += $$newfile
+        }
+
+        export(SOURCES)
+    } else {
+        QMAKE_EXTRA_COMPILERS += $$1
+        generated_files.depends += compiler_$${1}_make_all
+        export(QMAKE_EXTRA_COMPILERS)
+        export(generated_files.depends)
+    }
+    return(true)
+}
+
+defineTest(addExtraCompilerWithHeader) {
+    addExtraCompiler($$1)
+
+    eval(headerFile = $${2})
+    isEmpty(headerFile) {
+        eval($${1}_header.output = $$eval($${1}.output))
+        eval($${1}_header.output ~= s/\.cpp/.h/)
+        eval($${1}_header.output ~= s/\.c/.h/)
+    } else {
+        eval($${1}_header.output = $$headerFile)
+    }
+
+    eval($${1}_header.input = $$eval($${1}.input))
+    eval($${1}_header.commands = @echo -n '')
+    eval($${1}_header.depends = compiler_$${1}_make_all)
+    eval($${1}_header.variable_out = GENERATED_FILES)
+
+    export($${1}_header.output)
+    export($${1}_header.input)
+    export($${1}_header.commands)
+    export($${1}_header.depends)
+    export($${1}_header.variable_out)
+
+    !CONFIG(QTDIR_build): QMAKE_EXTRA_COMPILERS += $${1}_header
+
+    export(QMAKE_EXTRA_COMPILERS)
+    export(generated_files.depends)
+    export(SOURCES)
+
+    return(true)
+}
+
index 319792238366d7dfaf081baa51ea3049d8bb58d3..8c36b6228f8dd9955e0d5e62314617be1bdb6bf2 100644 (file)
@@ -2,6 +2,7 @@ TEMPLATE = subdirs
 CONFIG += ordered
 
 SUBDIRS += \
+        JavaScriptCore \
         WebCore \
         JavaScriptCore/kjs/jsc.pro \
         WebKit/qt/QtLauncher