aboutsummaryrefslogtreecommitdiff
path: root/mmoc
diff options
context:
space:
mode:
authorTomas Junnonen <tomas.junnonen@nokia.com>2010-06-02 17:09:33 +0300
committerTomas Junnonen <tomas.junnonen@nokia.com>2010-06-02 17:09:33 +0300
commitc9c2d9acc360cb2ffd95eba6057ffb38b4219fdc (patch)
tree2ce4841d0e6a601a1bb2fe42122021f4026df244 /mmoc
parent8b43ab81cd30eb2d3cf3f86426179bb791046c2c (diff)
Revert "Fixes: NB#171747 - mmoc native binary does not work with qemu - causes build failures"
This reverts commit 7c274d807830f9b5c19829b8a96476edc6a3a35d. Break out-of-source build (i.e. debian packaging)
Diffstat (limited to 'mmoc')
-rwxr-xr-xmmoc/mmoc.pl218
-rw-r--r--mmoc/mmoc.pro13
2 files changed, 0 insertions, 231 deletions
diff --git a/mmoc/mmoc.pl b/mmoc/mmoc.pl
deleted file mode 100755
index c3eb00d4..00000000
--- a/mmoc/mmoc.pl
+++ /dev/null
@@ -1,218 +0,0 @@
-#! /usr/bin/perl
-
-use English;
-
-# common regular expressions
-# these have to be before exift command
-# (otherwise they will not get any value)
-$::spaces = "\\s*";
-$::comma = ",";
-$::colon = ":";
-$::parenO = "\\(";
-$::parenC = "\\)";
-$::emptyParen = "\\(\\)";
-$::angleO = "<";
-$::angleC = ">";
-$::braceO = "\\{";
-$::nameSpace = "(?:\\w+::)";
-$::typeName = "\\w+";
-$::pointer = "\\*";
-$::templateName = "\\w+";
-$::plainParam = "(\\w+)";
-$::boolParam = "(true|false)";
-$::anyParam = "(.+)";
-
-$::QT_MOC_PATH = find_moc ();
-
-if (! -x $::QT_MOC_PATH) {
- print "Unable to find moc, or is not executable\n";
- if ( "MSWin32" ne "$OSNAME" ) {
- exit (1);
- }
-}
-
-chomp( $::QT_MOC_PATH );
-
-exit main( @ARGV );
-
-sub find_moc
-{
- my $mocpath;
-
- if ($ENV{"QTDIR"} && -x "$ENV{\"QTDIR\"}/bin/moc")
- {
- return "$ENV{\"QTDIR\"}/bin/moc";
- }
-
- # here we need to do things differently for windows
- if ( "MSWin32" ne "$OSNAME" )
- {
- $mocpath = `which moc 2>/dev/null`;
- if ($? == 0) {
- chomp $mocpath;
- return $mocpath;
- }
-
- $mocpath = `which moc-qt4 2>/dev/null`;
- if ($? == 0) {
- chomp $mocpath;
- return $mocpath;
- }
- } else {
- return "moc";
- }
-}
-
-sub main
-{
- my @argv = @_;
-
- my @commandLineParameters = ( $::QT_MOC_PATH );
-
- my $filename = "";
- my $type = "";
-
- for ( my $i=0; $i<@argv; ++$i ) {
- if ( $argv[$i] =~ /style.h$/ ) {
- $type = "Style";
- $filename = $argv[$i];
- } elsif ( $argv[$i] =~ /model.h$/ ) {
- $type = "Model";
- $filename = $argv[$i];
- } else {
- push @commandLineParameters, $argv[$i];
- }
- }
-
- if ( $filename eq "" ) {
- system( @commandLineParameters );
- } else {
- push @commandLineParameters, "-f".$filename;
-
- if ( $type eq "Model" ) {
- runModelMoc( $filename, @commandLineParameters );
- } elsif ( $type eq "Style" ) {
- runStyleMoc( $filename, @commandLineParameters );
- }
- }
-
- return 0;
-}
-
-sub runStyleMoc
-{
- my ($header, @arguments) = @_;
-
- my $commandLine = join( " ", @arguments );
-
- open( INF, "<$header" ) || die( "Could not open $header for reading : $!" );
-
- open( MOC, "|$commandLine" ) || die( "Could not run command $commandLine : $!" );
-
- while ( <INF> ) {
- chomp;
- my $line = $_;
-
- $line =~ s/\s*M_STYLE_ATTRIBUTE\s*\(\s*(\w+\:*\w*)\s*,\s*(\w+)\s*,\s*(\w+)\s*\)\s*/ Q_PROPERTY($1 $2 READ $2 WRITE set$3)/;
- $line =~ s/\s*M_STYLE_PTR_ATTRIBUTE\s*\(\s*(\w+\:*\w*\s*\*+)\s*,\s*(\w+)\s*,\s*(\w+)\s*\)\s*/ Q_PROPERTY(const $1 $2 READ $2 WRITE set$3)/;
-
- print MOC "$line\n";
- }
-
- close( MOC );
-
- close( INF );
-}
-
-sub runModelMoc
-{
- my ($header, @arguments) = @_;
-
- my $commandLine = join( " ", @arguments );
-
- my @pattern = (
- $::spaces.
- "M_MODEL_PROPERTY".
- $::spaces.$::parenO.$::spaces.
- "(".
- "(?:".
- $::nameSpace."?".
- $::typeName.
- $::spaces.
- $::pointer."?".
- ")".
- "|".
- "(?:".
- $::templateName.
- $::angleO.
- $::spaces.
- $::typeName.
- $::spaces.
- $::pointer."?".
- $::spaces.
- $::angleC.
- ")".
- ")".
- $::spaces.$::comma.$::spaces.
- $::plainParam.
- $::spaces.$::comma.$::spaces.
- $::plainParam.
- $::spaces.$::comma.$::spaces.
- $::plainParam.
- $::spaces.$::comma.$::spaces.
- $::anyParam.
- $::spaces.$::parenC.$::spaces,
-
- $::spaces.
- "M_MODEL_PTR_PROPERTY".
- $::spaces.$::parenO.$::spaces.
- "(".
- "(?:".
- $::nameSpace."?".
- $::typeName.
- $::spaces.
- $::pointer."?".
- $::spaces.
- ")".
- "|".
- "(?:".
- $::templateName.
- $::angleO.
- $::spaces.
- $::typeName.
- $::spaces.
- $::pointer."?".
- $::spaces.
- $::angleC.
- ")".
- ")".
- $::spaces.$::comma.$::spaces.
- $::plainParam.
- $::spaces.$::comma.$::spaces.
- $::plainParam.
- $::spaces.$::comma.$::spaces.
- $::boolParam.
- $::spaces.$::comma.$::spaces.
- $::anyParam.
- $::spaces.$::parenC.$::spaces,
-
- );
-
- open( INF, "<$header" ) || die( "Could not open header file for reading : $!" );
-
- open( MOC, "|$commandLine" ) || die( "Could not run command $commandLine : $!" );
-
- while ( <INF> ) {
- chomp;
- my $line = $_;
-
- $line =~ s/$pattern[0]/ Q_PROPERTY($1 $2 READ $2 WRITE set$3)/;
- $line =~ s/$pattern[1]/ Q_PROPERTY($1 $2 READ $2 WRITE set$3)/;
-
- print MOC "$line\n";
- }
-
- close( MOC );
-
- close( INF );
-}
diff --git a/mmoc/mmoc.pro b/mmoc/mmoc.pro
index 8f60b5f2..b9daccc2 100644
--- a/mmoc/mmoc.pro
+++ b/mmoc/mmoc.pro
@@ -27,12 +27,9 @@ SOURCES += \
HEADERS += \
-mmoc_perl.files += mmoc.pl
-mmoc_perl.path = $$M_INSTALL_BIN
INSTALLS += \
target\
- mmoc_perl
win32: {
DEFINES += QT_MOC_PATH=\\\"\"moc.exe\"\\\"
@@ -40,16 +37,6 @@ win32: {
DEFINES += QT_MOC_PATH=\'$$quote(\"$$QMAKE_MOC\")\'
}
-win32 {
- !exists ($$M_BUILD_TREE\mmoc\mmoc.pl) {
- system (copy $$M_SOURCE_TREE\mmoc\mmoc.pl $$M_BUILD_TREE\mmoc\mmoc.pl)
- }
-} else {
- !exists ($$M_BUILD_TREE/mmoc/mmoc.pl) {
- system (cp -f $$M_SOURCE_TREE/mmoc/mmoc.pl $$M_BUILD_TREE/mmoc/mmoc.pl)
- }
-}
-
QMAKE_EXTRA_TARGETS += check
check.depends = $${TARGET}
check.commands = $$system(true)