~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to projectbuilders/makebuilder/outputfilters.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright 1999-2001 Bernd Gehrmann <bernd@kdevelop.org>               *
 
3
 *   Copyright 2007 Dukju Ahn <dukjuahn@gmail.com>                         *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 ***************************************************************************/
 
11
 
 
12
#include "outputfilters.h"
 
13
 
 
14
#include <klocale.h>
 
15
 
 
16
// @todo could get these from emacs compile.el
 
17
QList<ErrorFormat> ErrorFormat::errorFormats = QList<ErrorFormat>()
 
18
    // GCC - another case, eg. for #include "pixmap.xpm" which does not exists
 
19
    << ErrorFormat( "([^: \t]+):([0-9]+):(?:[0-9]+):([^0-9]+)", 1, 2, 3 )
 
20
    // GCC
 
21
    << ErrorFormat( "([^: \t]+):([0-9]+):([^0-9]+)", 1, 2, 3 )
 
22
    // ICC
 
23
    << ErrorFormat( "([^: \\t]+)\\(([0-9]+)\\):([^0-9]+)", 1, 2, 3, "intel" )
 
24
    //libtool link
 
25
    << ErrorFormat( "(libtool):( link):( warning): ", 0, 0, 0 )
 
26
    // ld
 
27
    << ErrorFormat( "undefined reference", 0, 0, 0 )
 
28
    << ErrorFormat( "undefined symbol", 0, 0, 0 )
 
29
    << ErrorFormat( "ld: cannot find", 0, 0, 0 )
 
30
    << ErrorFormat( "No such file", 0, 0, 0 )
 
31
    // make
 
32
    << ErrorFormat( "No rule to make target", 0, 0, 0 )
 
33
    // Fortran
 
34
    << ErrorFormat( "\"(.*)\", line ([0-9]+):(.*)", 1, 2, 3 )
 
35
    // Jade
 
36
    << ErrorFormat( "[a-zA-Z]+:([^: \t]+):([0-9]+):[0-9]+:[a-zA-Z]:(.*)", 1, 2, 3 )
 
37
    // ifort
 
38
    << ErrorFormat( "fortcom: Error: (.*), line ([0-9]+):(.*)", 1, 2, 3, "intel" )
 
39
    // PGI
 
40
    << ErrorFormat( "PGF9(.*)-(.*)-(.*)-(.*) \\((.*): ([0-9]+)\\)", 5, 6, 4, "pgi" )
 
41
    // PGI (2)
 
42
    << ErrorFormat( "PGF9(.*)-(.*)-(.*)-Symbol, (.*) \\((.*)\\)", 5, 5, 4, "pgi" );
 
43
 
 
44
QList<ActionFormat> ActionFormat::actionFormats = QList<ActionFormat>()
 
45
    //     << ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*`[^`]*`(?:[^/\\s;]*/)*([^/\\s;]+)");
 
46
    //     << ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*-o (?:\\S* )(?:[^/;]*/)*([^/\\s;]+)");
 
47
    //     << ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*(?:[^/]*/)*([^/\\s;]*)");
 
48
    << ActionFormat( i18n("compiling"), 1, 2, "(?:^|[^=])\\b(gcc|CC|cc|distcc|c\\+\\+|"
 
49
                     "g\\+\\+|icc|icpc)\\s+.*-c.*[/ '\\\\]+(\\w+\\.(?:cpp|CPP|c|C|cxx|CXX|cs|"
 
50
                     "java|hpf|f|F|f90|F90|f95|F95))")
 
51
    //moc and uic
 
52
    << ActionFormat( i18n("generating"), 1, 2, "/(moc|uic)\\b.*\\s-o\\s([^\\s;]+)")
 
53
    //libtool linking
 
54
    << ActionFormat( i18nc("Linking object files into a library or executable", "linking"),
 
55
                     "libtool", "/bin/sh\\s.*libtool.*--mode=link\\s.*\\s-o\\s([^\\s;]+)", 1 )
 
56
    //unsermake
 
57
    << ActionFormat( i18n("compiling"), 1, 1, "^compiling (.*)" )
 
58
    << ActionFormat( i18n("generating"), 1, 2, "^generating (.*)" )
 
59
    << ActionFormat( i18nc("Linking object files into a library or executable",
 
60
                     "linking"), 1, 2, "(gcc|cc|c\\+\\+|g\\+\\+|icc|icpc)\\S* (?:\\S* )*-o ([^\\s;]+)")
 
61
    << ActionFormat( i18nc("Linking object files into a library or executable",
 
62
                     "linking"), 1, 2, "^linking (.*)" )
 
63
    //cmake
 
64
    << ActionFormat( i18n("built"), -1, 1, "\\[.+%\\] Built target (.*)" )
 
65
    << ActionFormat( i18n("compiling"), -1, 1, "\\[.+%\\] Building .* object (.*)" )
 
66
    << ActionFormat( i18n("generating"), -1, 1, "\\[.+%\\] Generating (.*)" )
 
67
    << ActionFormat( i18nc("Linking object files into a library or executable",
 
68
                     "linking"), -1, 1, "^Linking (.*)" )
 
69
    << ActionFormat( i18n("installing"), -1, 1, "-- Installing (.*)" )
 
70
    //libtool install
 
71
    << ActionFormat( i18n("creating"), "", "/(?:bin/sh\\s.*mkinstalldirs).*\\s([^\\s;]+)",
 
72
 1 )
 
73
    << ActionFormat( i18n("installing"), "", "/(?:usr/bin/install|bin/sh\\s.*mkinstalldirs"
 
74
                     "|bin/sh\\s.*libtool.*--mode=install).*\\s([^\\s;]+)", 1 )
 
75
    //dcop
 
76
    << ActionFormat( i18n("generating"), "dcopidl", "dcopidl .* > ([^\\s;]+)", 1 )
 
77
    << ActionFormat( i18n("compiling"), "dcopidl2cpp", "dcopidl2cpp (?:\\S* )*([^\\s;]+)",
 
78
 1 )
 
79
    // match against Entering directory to update current build dir
 
80
    << ActionFormat( "cd", "", "make[^:]*: Entering directory `([^']+)'", 1);
 
81
 
 
82
ErrorFormat::ErrorFormat( const QString& regExp, int file, int line, int text )
 
83
    : expression( regExp )
 
84
    , fileGroup( file )
 
85
    , lineGroup( line )
 
86
    , textGroup( text )
 
87
{}
 
88
 
 
89
ErrorFormat::ErrorFormat( const QString& regExp, int file, int line, int text, const QString& comp )
 
90
    : expression( regExp )
 
91
    , fileGroup( file )
 
92
    , lineGroup( line )
 
93
    , textGroup( text )
 
94
    , compiler( comp )
 
95
{}
 
96
 
 
97
ActionFormat::ActionFormat( const QString& _action, const QString& _tool, const QString& regExp, int file )
 
98
    : action( _action )
 
99
    , expression( regExp )
 
100
    , tool( _tool )
 
101
    , toolGroup(-1)
 
102
    , fileGroup( file )
 
103
{
 
104
}
 
105
 
 
106
ActionFormat::ActionFormat( const QString& _action, int tool, int file, const QString& regExp)
 
107
    : action( _action )
 
108
    , expression( regExp )
 
109
    , toolGroup( tool )
 
110
    , fileGroup( file )
 
111
{
 
112
}
 
113