diff options
176 files changed, 2416 insertions, 2616 deletions
diff --git a/bin/qtmodule-configtests b/bin/qtmodule-configtests index 965a3e556b..c6ebe2fafd 100755 --- a/bin/qtmodule-configtests +++ b/bin/qtmodule-configtests @@ -57,7 +57,6 @@ use File::Path 'mkpath'; use File::Spec::Functions qw/ :ALL /; use File::Temp qw/ :POSIX /; use Cwd; -use Cwd 'abs_path'; use Config; # Which file to look for the %configtests variable in @@ -77,9 +76,8 @@ my $generator = $ARGV[3]; our %configtests; -my $absOutDir = abs_path($out_basedir); -my $qmakeCachePath = catfile($absOutDir, '.qmake.cache'); -my $configLogPath = catfile($absOutDir, 'config.log'); +my $qmakeCachePath = catfile($out_basedir, '.qmake.cache'); +my $configLogPath = catfile($out_basedir, 'config.log'); my $QMAKE = catfile($qtbasedir, "bin", ($^O =~ /win32/i) ? 'qmake.exe' : 'qmake'); if (!-x $QMAKE) { @@ -241,13 +239,13 @@ sub executeTest { my @QMAKEARGS = ('CONFIG-=debug_and_release', 'CONFIG-=app_bundle'); - my $testOutDir = catdir($absOutDir, 'config.tests', $testName); + my $testOutDir = catdir($out_basedir, 'config.tests', $testName); # Since we might be cross compiling, look for barename (Linux) and .exe (Win32/Symbian) my $testOutFile1 = catfile($testOutDir, "$testName.exe"); my $testOutFile2 = catfile($testOutDir, $testName); - if (abs_path($basedir) eq abs_path($out_basedir)) { + if ($basedir eq $out_basedir) { chdir $testOutDir or die "\nUnable to change to config test directory ($testOutDir): $!\n"; } else { # shadow build if (! -e $testOutDir) { @@ -315,7 +313,7 @@ loadConfigTests(); # Only do this step for modules that have config tests # (qtbase doesn't). We try to preserve existing contents (and furthermore # only write to .qmake.cache if the tests change) -if (abs_path($out_basedir) ne abs_path($qtbasedir)) { +if ($out_basedir ne $qtbasedir) { # Read any existing content my $existingContents = fileContents($qmakeCachePath); my %oldTestResults; diff --git a/bin/syncqt b/bin/syncqt index 3581e31d84..5f8bbe248a 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -47,6 +47,7 @@ # use packages ------------------------------------------------------- use File::Basename; use File::Path; +use File::Spec; use Cwd; use Cwd 'abs_path'; use Config; @@ -82,16 +83,11 @@ our $quoted_basedir; # Make sure we use Windows line endings for chomp and friends on Windows. $INPUT_RECORD_SEPARATOR = "\r\n" if ($^O eq "msys"); -# try to figure out where QtBase is located -# normally the script location should be enough, if not fall back to -# QTDIR environment variable. If that doesn't work, later ask the -# user to use the -qtdir option explicitly. -my $qtbasedir = $ENV{"QTDIR"}; -$qtbasedir = dirname(dirname($0)) if (!$qtbasedir); +my $qtbasedir = dirname(dirname($0)); normalizePath(\$qtbasedir) if (defined $qtbasedir); # will be defined based on the modules sync.profile -our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %mastercontent, %modulepris, %explicitheaders, %deprecatedheaders); +our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %modulepris, %explicitheaders, %deprecatedheaders); # global variables (modified by options) my $isunix = 0; @@ -106,10 +102,7 @@ my $copy_headers = 0; my $create_uic_class_map = 0; my $create_private_headers = 1; my $module_fwd = ""; -my $cache_module_fwd = 0; my $developer_build = 0; -my $no_module_version_header = 0; -my $makefile_generator = ""; my @modules_to_sync ; $force_relative = 1 if ( -d "/System/Library/Frameworks" ); @@ -144,13 +137,8 @@ sub showUsage print " -private Force copy private headers (default: " . ($create_private_headers ? "yes" : "no") . ")\n"; print " -module-fwd <PATH> Create fwd includes for module pri files in the given\n"; print " path (default: none)\n"; - print " -cache-module-fwd Create a .qmake.cache file to cache the location of the\n"; - print " fwd includes\n"; print " -developer-build Point libraries and binaries to a common directory for\n"; print " easy development\n"; - print " -no-module-version-header\n"; - print " Don't create module version header file\n"; - print " -generator <PATH> Specify the makefile generator setting (e.g. 'UNIX')\n"; print " -help This help\n"; exit 0; } @@ -189,30 +177,6 @@ sub checkRelative { } ###################################################################### -# Syntax: shouldMasterInclude(iheader) -# Params: iheader, string, filename to verify inclusion -# -# Purpose: Determines if header should be in the master include file. -# Returns: 0 if file contains "#pragma qt_no_master_include" or not -# able to open, else 1. -###################################################################### -sub shouldMasterInclude { - my ($iheader) = @_; - return 0 if(basename($iheader) =~ /_/); - return 0 if(basename($iheader) =~ /qconfig/); - if(open(F, "<$iheader")) { - while(<F>) { - chomp; - return 0 if(/^\#pragma qt_no_master_include$/); - } - close(F); - } else { - return 0; - } - return 1; -} - -###################################################################### # Syntax: classNames(iheader) # Params: iheader, string, filename to parse for classname "symlinks" # @@ -391,50 +355,20 @@ sub syncHeader { # Purpose: file is made relative (if possible) of dir. # Returns: String with the above applied conversion. ###################################################################### + +sub cleanupPath { + my ($file) = @_; + normalizePath(\$file); + while ($file =~ s,/[^/]+/\.\./,/,) {} + return $file; +} + sub fixPaths { my ($file, $dir) = @_; - normalizePath(\$file); - normalizePath(\$dir); - #setup - my $ret = $file; - $ret =~ s,/cygdrive/([a-zA-Z])/,$1:/,g; - my $file_dir = dirname($file); - if($file_dir eq ".") { - $file_dir = getcwd(); - normalizePath(\$file_dir); - } - $file_dir =~ s,/cygdrive/([a-zA-Z])/,$1:/,g; - if($dir eq ".") { - $dir = getcwd(); - normalizePath(\$dir); - } - $dir =~ s,/cygdrive/([a-zA-Z])/,$1:/,g; - return basename($file) if($file_dir eq $dir); - - #guts - while ($file_dir =~ s,/[^/]+/\.\./,/,) {} - while ($dir =~ s,/[^/]+/\.\./,/,) {} - my $match_dir = 0; - for(my $i = 1; $i < length($file_dir); $i++) { - my $slash = index($file_dir, "/", $i); - last if($slash == -1); - my $tmp = substr($file_dir, 0, $slash); - last unless($dir =~ m,^\Q$tmp\E/,); - $match_dir = $tmp; - $i = $slash; - } - if($match_dir) { - my $after = substr($dir, length($match_dir)); - my $count = ($after =~ tr,/,,); - my $dots = ""; - for(my $i = 0; $i < $count; $i++) { - $dots .= "../"; - } - $ret =~ s,^\Q$match_dir\E,$dots,; - } - $ret =~ s,/+,/,g; - return $ret; + my $out = File::Spec->abs2rel(cleanupPath($file), cleanupPath($dir)); + $out =~ s,\\,/,g; + return $out; } ###################################################################### @@ -625,6 +559,18 @@ sub loadSyncProfile { return $result; } +sub basePrettify { + my ($arg) = @_; + $$arg =~ s,^\Q$basedir\E,<srcbase>,; + $$arg =~ s,^\Q$out_basedir\E,<outbase>,; +} + +sub cleanPath { + my ($arg) = @_; + while ($arg =~ s,[^/]+/\.\.(/|$),,) {} + return $arg; +} + sub locateSyncProfile { my ($directory) = @_; @@ -672,15 +618,9 @@ while ( @ARGV ) { } elsif($arg eq "-module-fwd") { $var = "module_fwd"; $val = shift @ARGV; - } elsif($arg eq "-cache-module-fwd") { - $var = "cache_module_fwd"; - $val = "yes"; } elsif($arg eq "-developer-build") { $var = "developer_build"; $val = "yes"; - } elsif($arg eq "-no-module-version-header") { - $var = "no_module_version_header"; - $val = "yes"; } elsif($arg =~ /^-no-(.*)$/) { $var = $1; $val = "no"; @@ -712,9 +652,6 @@ while ( @ARGV ) { } elsif($arg eq "-qtdir") { $var = "qtdir"; $val = shift @ARGV; - } elsif($arg eq "-generator") { - $var = "makefile_generator"; - $val = shift @ARGV; } elsif($arg =~/^-/) { print "Unknown option: $arg\n\n" if(!$var); showUsage(); @@ -794,14 +731,8 @@ while ( @ARGV ) { } } elsif ($var eq "module_fwd") { $module_fwd = $val; - } elsif ($var eq "cache_module_fwd") { - $cache_module_fwd = 1; } elsif ($var eq "developer_build") { $developer_build = 1; - } elsif ($var eq "makefile_generator") { - $makefile_generator = $val; - } elsif ($var eq "no_module_version_header") { - $no_module_version_header = 1; } elsif ($var eq "output") { my $outdir = $val; if(checkRelative($outdir)) { @@ -830,8 +761,7 @@ our @ignore_for_include_check = (); our @ignore_for_qt_begin_header_check = (); our @ignore_for_qt_begin_namespace_check = (); our @ignore_for_qt_module_check = (); -my %colliding_headers = (); -my %inject_headers = ( "$basedir/src/corelib/global" => ( "qconfig.h" ) ); # all from build dir +our %inject_headers = (); # load the module's sync.profile here, before we can loadSyncProfile(\$basedir, \$out_basedir); @@ -842,15 +772,24 @@ my %allmoduleheadersprivate = map { $_ => 1 } @allmoduleheadersprivate; $isunix = checkUnix; #cache checkUnix +my $qt_version = fileContents($qtbasedir."/mkspecs/qconfig.pri"); +if (length($qt_version)) { + $qt_version =~ s,.*^QT_VERSION\h*=\h*(\S+).*,$1,sm; +} else { + $qt_version = fileContents($basedir."/src/corelib/global/qglobal.h"); + $qt_version =~ s,.*^#\h*define\h+QT_VERSION_STR\h+"([^"]+)".*,$1,sm; +} foreach my $lib (@modules_to_sync) { #iteration info my $dir = $modules{$lib}; - my $module_version = ""; - my $module_major_version = 0; - my $module_minor_version = 0; - my $module_patch_version = 0; - if (-e "$modulepris{$lib}") { + my $project = $dir; + $project =~ s,/([^/]+)$,/$1/$1.pro,; + my $module_version = fileContents($project); + $module_version = $qt_version unless ($module_version =~ s,.*^VERSION\h*=\h*(\S+).*,$1,sm); + + # Backwards compatibility for modules with checked in .pri files. + if (defined $modulepris{$lib} and -e "$modulepris{$lib}") { my $content = fileContents($modulepris{$lib}); my @version_rows = grep(/QT\..*\.VERSION/, split('\n', $content)); if(@version_rows) { @@ -859,16 +798,8 @@ foreach my $lib (@modules_to_sync) { chomp $module_version; $module_version =~ s/^\s*QT\..*\.VERSION\s*=\s*([^#]+).*$/$1/; $module_version =~ s/\s+$//; - my @versions = split(/\./, $module_version); - $module_major_version = int($versions[0]); - chomp $module_major_version; - $module_minor_version = int($versions[1]); - chomp $module_minor_version; - $module_patch_version = int($versions[2]); - chomp $module_patch_version; } } - print "$lib: WARNING: Module\'s pri missing QT.<module>.VERSION variable! Private headers not versioned!\n" if (!$module_version); my $pathtoheaders = ""; $pathtoheaders = $moduleheaders{$lib} if ($moduleheaders{$lib}); @@ -882,29 +813,20 @@ foreach my $lib (@modules_to_sync) { my $pri_install_pfiles = ""; my $pri_install_qpafiles = ""; - my $libcapitals = $lib; - $libcapitals =~ y/a-z/A-Z/; - my $master_contents = "#ifndef QT_".$libcapitals."_MODULE_H\n#define QT_".$libcapitals."_MODULE_H\n"; - - #get dependencies - if(-e "$dir/" . basename($dir) . ".pro") { - if(open(F, "<$dir/" . basename($dir) . ".pro")) { - while(my $line = <F>) { - chomp $line; - if($line =~ /^ *QT *\+?= *([^\r\n]*)/) { - foreach(split(/ /, $1)) { - $_ =~ s/-private$//; - my $content = $mastercontent{$_}; - $master_contents .= $content if ($content); - } - } - } - close(F); - } - } + push @{$inject_headers{$dir}}, lc($lib)."version.h"; + $classnames{lc($lib)."version.h"} = $lib."Version"; #remove the old files if($remove_stale) { + my %injections = (); + for my $p (keys %inject_headers) { + next unless ($p =~ /^\Q$dir\E(\/|$)/); + my $sp = $p; + $sp =~ s,^\Q$basedir\E/,$out_basedir/,; + for my $n (@{$inject_headers{$p}}) { + $injections{$sp."/".$n} = 1; + } + } my @subdirs = ("$out_basedir/include/$lib"); foreach my $subdir (@subdirs) { if (opendir DIR, $subdir) { @@ -923,7 +845,7 @@ foreach my $lib (@modules_to_sync) { if($line =~ /^\#include \"([^\"]*)\"$/) { my $include = $1; $include = $subdir . "/" . $include unless(substr($include, 0, 1) eq "/"); - $remove_file = 1 unless(-e $include); + $remove_file = 1 unless(-e $include or defined $injections{cleanPath($include)}); } else { $remove_file = 0; last; @@ -941,32 +863,6 @@ foreach my $lib (@modules_to_sync) { } } - # create the version header files for each module - unless ($no_module_version_header) { - my $modulepri = $modulepris{$lib}; - if (-e $modulepri) { - my $modulepriname = basename($modulepri); - # FIXME: this creates a file in the source location for shadow-builds - my $moduleversionheader = "$modules{$lib}/" . lc($lib) . "version.h"; - my $modulehexstring = sprintf("0x%02X%02X%02X", $module_major_version, $module_minor_version, $module_patch_version); - open MODULE_VERSION_HEADER_FILE, ">$moduleversionheader" or die "Can't open $moduleversionheader for writing"; - print MODULE_VERSION_HEADER_FILE "/* This file was generated by syncqt with the info from sync.profile. */\n"; - print MODULE_VERSION_HEADER_FILE "#ifndef QT_". uc($lib) . "_VERSION_H\n"; - print MODULE_VERSION_HEADER_FILE "#define QT_". uc($lib) . "_VERSION_H\n"; - print MODULE_VERSION_HEADER_FILE "\n"; - print MODULE_VERSION_HEADER_FILE "#define " .uc($lib) . "_VERSION_STR \"" . $module_version . "\"\n"; - print MODULE_VERSION_HEADER_FILE "\n"; - print MODULE_VERSION_HEADER_FILE "#define " .uc($lib) . "_VERSION $modulehexstring\n", ; - print MODULE_VERSION_HEADER_FILE "\n"; - print MODULE_VERSION_HEADER_FILE "#endif // QT_". uc($lib) . "_VERSION_H\n"; - close MODULE_VERSION_HEADER_FILE; - $moduleversionheader = "<srcbase>" . substr($moduleversionheader, length($basedir)) if ($verbose_level < 2); - print "$lib: created version header $moduleversionheader\n" if($verbose_level); - } elsif ($modulepri) { - print "$lib: WARNING: Module\'s pri file '$modulepri' not found.\n$lib: Skipped creating module version header.\n"; - } - } - #create the new ones foreach my $current_dir (split(/;/, $dir)) { my @headers_paths = split(/;/, $pathtoheaders); @@ -997,7 +893,7 @@ foreach my $lib (@modules_to_sync) { foreach my $subdir (@subdirs) { my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0); if (defined $inject_headers{$subdir}) { - foreach my $if ($inject_headers{$subdir}) { + foreach my $if (@{$inject_headers{$subdir}}) { @headers = grep(!/^\Q$if\E$/, @headers); #in case we configure'd previously push @headers, "*".$if; } @@ -1066,17 +962,9 @@ foreach my $lib (@modules_to_sync) { } } elsif ($create_private_headers && !$qpa_header) { - if ($module_version) { - @headers = ( "$out_basedir/include/$lib/$module_version/$lib/private/$header" ); - } else { - @headers = ( "$out_basedir/include/$lib/private/$header" ); - } + @headers = ( "$out_basedir/include/$lib/$module_version/$lib/private/$header" ); } elsif ($create_private_headers) { - if ($module_version) { - @headers = ( "$out_basedir/include/$lib/$module_version/$lib/qpa/$header" ); - } else { - @headers = ( "$out_basedir/include/$lib/qpa/$header" ); - } + @headers = ( "$out_basedir/include/$lib/$module_version/$lib/qpa/$header" ); } foreach(@headers) { #sync them @@ -1084,9 +972,6 @@ foreach my $lib (@modules_to_sync) { } if($public_header) { - #put it into the master file - $master_contents .= "#include \"$public_header\"\n" if(shouldMasterInclude($iheader)); - #deal with the install directives if($public_header) { my $pri_install_iheader = fixPaths($iheader, $current_dir); @@ -1120,7 +1005,7 @@ foreach my $lib (@modules_to_sync) { if ($verbose_level && $header_copies) { my $new_header_dirname = dirname($iheader); - $new_header_dirname = "<srcbase>" . substr($new_header_dirname, length($basedir)) if ($new_header_dirname && $verbose_level < 2); + basePrettify(\$new_header_dirname) if ($new_header_dirname && $verbose_level < 2); my $header_base = basename($iheader); if ($verbose_level < 3) { my $line_prefix = ","; @@ -1133,7 +1018,7 @@ foreach my $lib (@modules_to_sync) { } print "$line_prefix $header_base ($header_copies)"; } else { # $verbose_level >= 3 - $iheader = "<srcbase>" . substr($iheader, length($basedir)) if ($verbose_level == 3); + basePrettify(\$iheader) if ($verbose_level == 3); print "$lib: created $header_copies fwd-include headers for $iheader\n"; } } @@ -1144,9 +1029,6 @@ foreach my $lib (@modules_to_sync) { } } - # close the master include: - $master_contents .= "#endif\n"; - unless($showonly) { # create deprecated headers my $first = 1; @@ -1157,11 +1039,7 @@ foreach my $lib (@modules_to_sync) { my $header_path = "$out_basedir/include/$lib/"; unless ($public_header) { - if ($module_version) { - $header_path .= "$module_version/$lib/private/"; - } else { - $header_path .= "private/"; - } + $header_path .= "$module_version/$lib/private/"; } $header_path .= "$header"; @@ -1213,30 +1091,9 @@ foreach my $lib (@modules_to_sync) { print " }\n" unless ($first); } - my @master_includes; - push @master_includes, "$out_basedir/include/$lib/$lib"; - push @master_includes, "$out_basedir/include/phonon_compat/Phonon/Phonon" if ($lib eq "phonon"); - foreach my $master_include (@master_includes) { - #generate the "master" include file - my @tmp = split(/;/,$modules{$lib}); - $pri_install_files .= fixPaths($master_include, $tmp[0]) . " "; #get the master file installed too - if($master_include && -e $master_include) { - open MASTERINCLUDE, "<$master_include"; - local $/; - binmode MASTERINCLUDE; - my $oldmaster = <MASTERINCLUDE>; - close MASTERINCLUDE; - $oldmaster =~ s/\r//g; # remove \r's , so comparison is ok on all platforms - $master_include = 0 if($oldmaster eq $master_contents); - } - if($master_include && $master_contents) { - my $master_dir = dirname($master_include); - make_path($master_dir, $lib, $verbose_level); - open MASTERINCLUDE, ">$master_include"; - print MASTERINCLUDE $master_contents; - close MASTERINCLUDE; - print "$lib: created header (master) file\n" if($verbose_level); - } + # KDE-Compat master header for Phonon + if ($lib eq "phonon") { + syncHeader($lib, "$out_basedir/include/phonon_compat/Phonon/Phonon", "$out_basedir/include/phonon/phonon", 0); } #handle the headers.pri for each module @@ -1255,7 +1112,7 @@ foreach my $lib (@modules_to_sync) { $old_headers_pri_contents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms $headers_pri_file = 0 if($old_headers_pri_contents eq $headers_pri_contents); } - if($headers_pri_file && $master_contents) { + if($headers_pri_file) { my $headers_pri_dir = dirname($headers_pri_file); make_path($headers_pri_dir, $lib, $verbose_level); open HEADERS_PRI_FILE, ">$headers_pri_file"; @@ -1267,7 +1124,7 @@ foreach my $lib (@modules_to_sync) { # create forwarding module pri in qtbase/mkspecs/modules if ($module_fwd) { my $modulepri = $modulepris{$lib}; - if (-e $modulepri) { + if (defined $modulepri and -e $modulepri) { my $modulepriname = basename($modulepri); make_path($module_fwd, $lib, $verbose_level); my $moduleprifwd = "$module_fwd/$modulepriname"; @@ -1283,17 +1140,6 @@ foreach my $lib (@modules_to_sync) { print MODULE_PRI_FILE "include($modulepri)\n"; close MODULE_PRI_FILE; utime(time, (stat($modulepri))[9], $moduleprifwd); - if ($cache_module_fwd) { - my $cacheStatement = "QMAKE_EXTRA_MODULE_FORWARDS = \"$module_fwd\""; - my $cacheFile = "$out_basedir/.qmake.cache"; - my $existingQmakeCache = fileContents($cacheFile); - # Skip if it's already there. - if ($existingQmakeCache !~ $cacheStatement) { - open QMAKE_CACHE_FILE, ">>$cacheFile" or die("Could not open $cacheFile for writing"); - print QMAKE_CACHE_FILE "$cacheStatement\n"; - close(QMAKE_CACHE_FILE); - } - } } elsif ($modulepri) { print "$lib: WARNING: Module\'s pri file '$modulepri' not found.\n$lib: Skipped creating forwarding pri.\n"; } @@ -1441,21 +1287,4 @@ if($check_includes) { } } -# Do configure tests now (pass some things along) -# fatal tests have a non zero return -# If the generator is not set (e.g. someone invoking syncqt as part of configure etc, then don't run tests either) -unless ($showonly || $makefile_generator eq '') { - my $configtests = dirname($0)."/qtmodule-configtests"; - if (! -f $configtests) { - $configtests = $qtbasedir."/bin/qtmodule-configtests"; - } - if (! -f $configtests) { - warn "Unable to locate qtmodule-configtests script - config tests disabled.\n"; - } else { - if (system($EXECUTABLE_NAME, $configtests, $basedir, $out_basedir, $qtbasedir, $makefile_generator)) { - die "$configtests exited with status $?"; - } - } -} - exit 0; @@ -919,19 +919,8 @@ while [ "$#" -gt 0 ]; do VAR=`echo $1 | sed "s,^-no-\(.*\),\1,"` VAL=no ;; - #Qt style yes options - -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-directfb|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-pkg-config|-force-pkg-config|-icu|-force-asserts|-testcocoon|-c++11) - VAR=`echo $1 | sed "s,^-\(.*\),\1,"` - VAL=yes - ;; #Qt style options that pass an argument - -qconfig) - CFG_QCONFIG="$VAL" - VAR=`echo $1 | sed "s,^-\(.*\),\1,"` - shift - VAL=$1 - ;; - -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa) + -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` shift VAL="$1" @@ -1068,9 +1057,10 @@ while [ "$#" -gt 0 ]; do VAR="add_warn" VAL="$1" ;; + #General options, including Qt style yes options -*) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` - VAL="unknown" + VAL="yes" ;; *) UNKNOWN_ARG=yes @@ -3491,8 +3481,9 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H" #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured - rm -rf mkspecs/default + rm -rf mkspecs/default mkspecs/default-host ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default + ln -s `echo $QMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default-host mkdir -p "$outpath/qmake" || exit # fix makefiles for mkfile in GNUmakefile Makefile; do @@ -3607,6 +3598,16 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; fi # Build qmake #------------------------------------------------------------------------------- +# create a qt.conf for the Qt build tree itself +#------------------------------------------------------------------------------- + +QTCONFFILE="$outpath/bin/qt.conf" +cat > "$QTCONFFILE" <<EOF +[EffectivePaths] +Prefix=.. +EOF + +#------------------------------------------------------------------------------- # Detect pkg-config #------------------------------------------------------------------------------- if [ -z "$PKG_CONFIG" ]; then @@ -5895,10 +5896,6 @@ QT_SOURCE_TREE = \$\$quote($relpath) QT_BUILD_TREE = \$\$quote($outpath) QT_BUILD_PARTS = $CFG_BUILD_PARTS -#local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR -QMAKE_INCDIR_QT = \$\$QT_BUILD_TREE/include -QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib - include(\$\$PWD/mkspecs/qmodule.pri) CONFIG += dylib depend_includepath fix_output_dirs no_private_qt_headers_warning QTDIR_build @@ -5906,9 +5903,14 @@ EOF #dump the qmake spec if [ -d "$outpath/mkspecs/$XPLATFORM" ]; then - echo "QMAKESPEC = \$\$QT_BUILD_TREE/mkspecs/$XPLATFORM" >> "$CACHEFILE.tmp" + echo "XQMAKESPEC = \$\$QT_BUILD_TREE/mkspecs/$XPLATFORM" >> "$CACHEFILE.tmp" +else + echo "XQMAKESPEC = $XPLATFORM" >> "$CACHEFILE.tmp" +fi +if [ -d "$outpath/mkspecs/$PLATFORM" ]; then + echo "QMAKESPEC = \$\$QT_BUILD_TREE/mkspecs/$PLATFORM" >> "$CACHEFILE.tmp" else - echo "QMAKESPEC = $XPLATFORM" >> "$CACHEFILE.tmp" + echo "QMAKESPEC = $PLATFORM" >> "$CACHEFILE.tmp" fi # replace .qmake.cache if it differs from the newly created temp file @@ -6119,231 +6121,48 @@ EXEC="" # build makefiles based on the configuration #------------------------------------------------------------------------------- -echo "Finding project files. Please wait..." if [ "$CFG_NOPROCESS" != "yes" ]; then - "$outpath/bin/qmake" -prl -r "${relpath}/qtbase.pro" - if [ -f "${relpath}/qtbase.pro" ]; then - mkfile="${outpath}/Makefile" - [ -f "$mkfile" ] && chmod +w "$mkfile" - QTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" "${relpath}/qtbase.pro" -o "$mkfile" - fi -fi - -# .projects -> projects to process -# .projects.1 -> qt and moc -# .projects.2 -> subdirs and libs -# .projects.3 -> the rest -rm -f .projects .projects.1 .projects.2 .projects.3 - -QMAKE_PROJECTS=`find "$relpath/." -name '*.pro' -print | sed 's-/\./-/-'` -if [ -z "$AWK" ]; then - for p in `echo $QMAKE_PROJECTS`; do - echo "$p" >> .projects - done -else - cat >projects.awk <<EOF -BEGIN { - files = 0 - target_file = "" - input_file = "" - - first = "./.projects.1.tmp" - second = "./.projects.2.tmp" - third = "./.projects.3.tmp" -} - -FNR == 1 { - if ( input_file ) { - if ( ! target_file ) - target_file = third - print input_file >target_file - } - - matched_target = 0 - template_lib = 0 - input_file = FILENAME - target_file = "" -} - -/^(TARGET.*=)/ { - if ( \$3 == "moc" || \$3 ~ /^Qt/ ) { - target_file = first - matched_target = 1 - } else if ( \$3 == "lrelease" || \$3 == "qm_phony_target" ) { - target_file = second - matched_target = 1 - } -} - -matched_target == 0 && /^(TEMPLATE.*=)/ { - if ( \$3 == "subdirs" ) - target_file = second - else if ( \$3 == "lib" ) - template_lib = 1 - else - target_file = third -} - -matched_target == 0 && template_lib == 1 && /^(CONFIG.*=)/ { - if ( \$0 ~ /plugin/ ) - target_file = third - else - target_file = second -} - -END { - if ( input_file ) { - if ( ! target_file ) - target_file = third - print input_file >>target_file - } -} - -EOF - - rm -f .projects.all - for p in `echo $QMAKE_PROJECTS`; do - echo "$p" >> .projects.all - done - - # if you get errors about the length of the command line to awk, change the -l arg - # to split below - split -l 100 .projects.all .projects.all. - for p in .projects.all.*; do - "$AWK" -f projects.awk `cat $p` - [ -f .projects.1.tmp ] && cat .projects.1.tmp >> .projects.1 - [ -f .projects.2.tmp ] && cat .projects.2.tmp >> .projects.2 - [ -f .projects.3.tmp ] && cat .projects.3.tmp >> .projects.3 - rm -f .projects.1.tmp .projects.2.tmp .projects.3.tmp $p - done - rm -f .projects.all* projects.awk - - [ -f .projects.1 ] && cat .projects.1 >>.projects - [ -f .projects.2 ] && cat .projects.2 >>.projects - rm -f .projects.1 .projects.2 - if [ -f .projects.3 ] && [ "$OPT_FAST" = "no" ]; then - cat .projects.3 >>.projects - rm -f .projects.3 - fi -fi -# don't sort Qt and MOC in with the other project files -# also work around a segfaulting uniq(1) -if [ -f .sorted.projects.2 ]; then - sort .sorted.projects.2 > .sorted.projects.2.new - mv -f .sorted.projects.2.new .sorted.projects.2 - cat .sorted.projects.2 >> .sorted.projects.1 -fi -[ -f .sorted.projects.1 ] && sort .sorted.projects.1 >> .sorted.projects -rm -f .sorted.projects.2 .sorted.projects.1 - -NORM_PROJECTS=0 -FAST_PROJECTS=0 -if [ -f .projects ]; then - uniq .projects >.tmp - mv -f .tmp .projects - NORM_PROJECTS=`cat .projects | wc -l | sed -e "s, ,,g"` -fi -if [ -f .projects.3 ]; then - uniq .projects.3 >.tmp - mv -f .tmp .projects.3 - FAST_PROJECTS=`cat .projects.3 | wc -l | sed -e "s, ,,g"` -fi -echo " `expr $NORM_PROJECTS + $FAST_PROJECTS` projects found." -echo - -PART_ROOTS= -for part in $CFG_BUILD_PARTS; do - case "$part" in - tools) PART_ROOTS="$PART_ROOTS tools" ;; - libs) PART_ROOTS="$PART_ROOTS src" ;; - translations) PART_ROOTS="$PART_ROOTS translations" ;; - examples) PART_ROOTS="$PART_ROOTS examples" ;; - *) ;; - esac -done - -if [ "$CFG_DEV" = "yes" ]; then - PART_ROOTS="$PART_ROOTS tests" -fi - -echo "Creating makefiles. Please wait..." -for file in .projects .projects.3; do - [ '!' -f "$file" ] && continue - for a in `cat $file`; do - IN_ROOT=no - for r in $PART_ROOTS; do - if echo "$a" | grep "^$r" >/dev/null 2>&1 || echo "$a" | grep "^$relpath/$r" >/dev/null 2>&1; then - IN_ROOT=yes - break - fi - done - [ "$IN_ROOT" = "no" ] && continue - - case $a in - *winmain/winmain.pro) - if [ "$CFG_NOPROCESS" = "yes" ] || [ "$XPLATFORM_MINGW" != "yes" ]; then - continue - fi - SPEC=$XQMAKESPEC ;; - */qmake/qmake.pro) continue ;; - *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*tools/qdoc*|*tools/qdbusxml2cpp*|*tools/qdbuscpp2xml*) SPEC=$QMAKESPEC ;; - *) if [ "$CFG_NOPROCESS" = "yes" ]; then - continue - else - SPEC=$XQMAKESPEC - fi;; - esac - dir=`dirname "$a" | sed -e "s;$sepath;.;g"` - test -d "$dir" || mkdir -p "$dir" - OUTDIR="$outpath/$dir" - if [ -f "${OUTDIR}/Makefile" ] && [ "$OPT_FAST" = "yes" ]; then - # fast configure - the makefile exists, skip it - # since the makefile exists, it was generated by qmake, which means we - # can skip it, since qmake has a rule to regenerate the makefile if the .pro - # file changes... - [ "$OPT_VERBOSE" = "yes" ] && echo " skipping $a" - continue; - fi - QMAKE_SPEC_ARGS="-spec $SPEC" - echo $ECHO_N " for $a$ECHO_C" - - QMAKE="$outpath/bin/qmake" - QMAKE_ARGS="$QMAKE_SWITCHES $QMAKE_SPEC_ARGS" - if [ "$file" = ".projects.3" ]; then - echo " (fast)" - - cat >"${OUTDIR}/Makefile" <<EOF -# ${OUTDIR}/Makefile: generated by configure + echo "Creating makefiles. Please wait..." + "$outpath/bin/qmake" -r ${OPT_FAST+CONFIG+=fast} "$relpath" + echo "Done" + + if [ "$OPT_FAST" = "yes" ]; then + PART_ROOTS= + for part in $CFG_BUILD_PARTS; do + case "$part" in + examples|tests) PART_ROOTS="$PART_ROOTS $part" ;; + esac + done + if [ "x$PART_ROOTS" != "x" ]; then + echo + echo "Creating stub makefiles. Please wait..." + QMAKE="$outpath/bin/qmake" + [ "$CFG_DEBUG_RELEASE" = "no" ] && first_tgt="first_target: first" || first_tgt= + (cd "$relpath" && find $PART_ROOTS -name '*.pro') | grep -v /testdata/ | while read p; do + d=${p%/*} + test -f "$outpath/$d/Makefile" && continue + echo " for $relpath/$p" + + mkdir -p "$outpath/$d" || exit + cat > "$outpath/$d/Makefile" <<EOF || exit +# $outpath/$d/Makefile: generated by configure # # WARNING: This makefile will be replaced with a real makefile. # All changes made to this file will be lost. -EOF - [ "$CFG_DEBUG_RELEASE" = "no" ] && echo "first_target: first" >>${OUTDIR}/Makefile - cat >>"${OUTDIR}/Makefile" <<EOF QMAKE = "$QMAKE" + +$first_tgt all clean install qmake first Makefile: FORCE - \$(QMAKE) $QMAKE_ARGS -o "$OUTDIR" "$a" - cd "$OUTDIR" + \$(QMAKE) $QMAKE_SWITCHES "$relpath/$p" \$(MAKE) \$@ - FORCE: - EOF - else - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " (`basename $SPEC`)" - echo "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a" - else - echo - fi - - [ -f "${OUTDIR}/Makefile" ] && chmod +w "${OUTDIR}/Makefile" - QTDIR="$outpath" "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a" - fi - done -done -rm -f .projects .projects.3 + done || exit + echo "Done" + fi + fi +fi #------------------------------------------------------------------------------- # check for platforms that we don't yet know about diff --git a/mkspecs/aix-g++-64/qmake.conf b/mkspecs/aix-g++-64/qmake.conf index 8c878265b4..14bfd8e5e6 100644 --- a/mkspecs/aix-g++-64/qmake.conf +++ b/mkspecs/aix-g++-64/qmake.conf @@ -40,8 +40,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib @@ -70,14 +68,5 @@ QMAKE_AR = ar -X64 cq QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = ranlib -X64 -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/aix-g++/qmake.conf b/mkspecs/aix-g++/qmake.conf index 0651564357..cf3266f1b9 100644 --- a/mkspecs/aix-g++/qmake.conf +++ b/mkspecs/aix-g++/qmake.conf @@ -40,8 +40,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib @@ -70,14 +68,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/aix-xlc-64/qmake.conf b/mkspecs/aix-xlc-64/qmake.conf index ed98a0152f..49c976ea41 100644 --- a/mkspecs/aix-xlc-64/qmake.conf +++ b/mkspecs/aix-xlc-64/qmake.conf @@ -41,8 +41,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -69,14 +67,5 @@ QMAKE_AR = ar -X64 cq QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = ranlib -X64 -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/aix-xlc/qmake.conf b/mkspecs/aix-xlc/qmake.conf index 6b4364873f..3897e611ac 100644 --- a/mkspecs/aix-xlc/qmake.conf +++ b/mkspecs/aix-xlc/qmake.conf @@ -41,8 +41,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -70,14 +68,5 @@ QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = ranlib -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf index 4c88e41cfd..bfb4b2b154 100644 --- a/mkspecs/common/linux.conf +++ b/mkspecs/common/linux.conf @@ -9,8 +9,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL @@ -51,19 +49,8 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_INSTALL_FILE = install -m 644 -p QMAKE_INSTALL_PROGRAM = install -m 755 -p diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf index 6ba55325e8..cb67462b53 100644 --- a/mkspecs/common/mac.conf +++ b/mkspecs/common/mac.conf @@ -7,8 +7,6 @@ QMAKE_RESOURCE = /Developer/Tools/Rez QMAKE_EXTENSION_SHLIB = dylib QMAKE_LIBDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /System/Library/Frameworks/OpenGL.framework/Headers \ /System/Library/Frameworks/AGL.framework/Headers/ @@ -24,17 +22,4 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cq QMAKE_RANLIB = ranlib -s -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $$QMAKE_COPY -QMAKE_COPY_DIR = $$QMAKE_COPY -R -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p - - include(unix.conf) diff --git a/mkspecs/common/qcc-base-qnx.conf b/mkspecs/common/qcc-base-qnx.conf index d7c2f9f340..175ef0d52b 100644 --- a/mkspecs/common/qcc-base-qnx.conf +++ b/mkspecs/common/qcc-base-qnx.conf @@ -45,9 +45,6 @@ QMAKE_INCDIR = $${QNX_DIR}/usr/include $${QNX_DIR}/usr/include/freety QMAKE_LIBDIR = $${QNX_DIR}/$${QNX_CPUDIR}/lib $${QNX_DIR}/$${QNX_CPUDIR}/usr/lib QMAKE_LFLAGS = -Wl,-rpath-link,$${QNX_DIR}/$${QNX_CPUDIR}/lib -Wl,-rpath-link,$${QNX_DIR}/$${QNX_CPUDIR}/usr/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] - QMAKE_CXX = $$QMAKE_CC -lang-c++ QMAKE_LINK_C = $$QMAKE_CC @@ -56,17 +53,4 @@ QMAKE_LINK_C_SHLIB = $$QMAKE_CC QMAKE_LINK = $$QMAKE_CXX QMAKE_LINK_SHLIB = $$QMAKE_CXX -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p diff --git a/mkspecs/common/shell-unix.conf b/mkspecs/common/shell-unix.conf new file mode 100644 index 0000000000..17c3612fdc --- /dev/null +++ b/mkspecs/common/shell-unix.conf @@ -0,0 +1,14 @@ +QMAKE_TAR = tar -cf +QMAKE_GZIP = gzip -9f + +QMAKE_COPY = cp -f +QMAKE_COPY_FILE = $$QMAKE_COPY +QMAKE_COPY_DIR = $$QMAKE_COPY -R +QMAKE_MOVE = mv -f +QMAKE_DEL_FILE = rm -f +QMAKE_DEL_DIR = rmdir +QMAKE_CHK_DIR_EXISTS = test -d +QMAKE_CHK_FILE_EXISTS = test -f +QMAKE_CHK_EXISTS_GLUE = "|| " +QMAKE_MKDIR = mkdir -p +QMAKE_STREAM_EDITOR = sed diff --git a/mkspecs/common/shell-win32.conf b/mkspecs/common/shell-win32.conf new file mode 100644 index 0000000000..3b2ace7c90 --- /dev/null +++ b/mkspecs/common/shell-win32.conf @@ -0,0 +1,11 @@ +QMAKE_ZIP = zip -r -9 + +QMAKE_COPY = copy /y +QMAKE_COPY_DIR = xcopy /s /q /y /i +QMAKE_MOVE = move +QMAKE_DEL_FILE = del +QMAKE_DEL_DIR = rmdir +QMAKE_CHK_DIR_EXISTS = if not exist +QMAKE_CHK_FILE_EXISTS = if not exist +QMAKE_CHK_EXISTS_GLUE = +QMAKE_MKDIR = mkdir diff --git a/mkspecs/common/unix.conf b/mkspecs/common/unix.conf index c480ba4407..9ee626562b 100644 --- a/mkspecs/common/unix.conf +++ b/mkspecs/common/unix.conf @@ -12,3 +12,5 @@ QMAKE_YACC_SOURCE = $base.tab.c QMAKE_PREFIX_SHLIB = lib QMAKE_PREFIX_STATICLIB = lib QMAKE_EXTENSION_STATICLIB = a + +include(shell-unix.conf) diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf index 6b7a2d71fe..e76a67552f 100644 --- a/mkspecs/common/wince/qmake.conf +++ b/mkspecs/common/wince/qmake.conf @@ -45,8 +45,6 @@ QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -EHs-c- QMAKE_INCDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$obj $src QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $< @@ -74,15 +72,7 @@ QMAKE_IDL = midl QMAKE_LIB = lib QMAKE_RC = rc -QMAKE_ZIP = zip -r -9 - -QMAKE_COPY = copy /y -QMAKE_COPY_DIR = xcopy /s /q /y /i -QMAKE_MOVE = move -QMAKE_DEL_FILE = del -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = if not exist -QMAKE_MKDIR = mkdir +include(../shell-win32.conf) VCPROJ_EXTENSION = .vcproj VCSOLUTION_EXTENSION = .sln diff --git a/mkspecs/cygwin-g++/qmake.conf b/mkspecs/cygwin-g++/qmake.conf index 286f8ea1d6..35f504e682 100644 --- a/mkspecs/cygwin-g++/qmake.conf +++ b/mkspecs/cygwin-g++/qmake.conf @@ -41,8 +41,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib @@ -75,13 +73,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p +include(../common/shell-unix.conf) load(qt_config) diff --git a/mkspecs/darwin-g++/qmake.conf b/mkspecs/darwin-g++/qmake.conf index 3f6793ffb6..5a6c6a9298 100644 --- a/mkspecs/darwin-g++/qmake.conf +++ b/mkspecs/darwin-g++/qmake.conf @@ -49,8 +49,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib @@ -81,18 +79,6 @@ QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = ranlib -s -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $$QMAKE_COPY -QMAKE_COPY_DIR = $$QMAKE_COPY -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p - QMAKE_PCH_OUTPUT_EXT = .gch QMAKE_CXXFLAGS_PRECOMPILE += -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf new file mode 100644 index 0000000000..651f0ad256 --- /dev/null +++ b/mkspecs/features/configure.prf @@ -0,0 +1,90 @@ +equals(MAKEFILE_GENERATOR, UNIX): \ + QMAKE_MAKE = make +else:equals(MAKEFILE_GENERATOR, MINGW): \ + QMAKE_MAKE = mingw32-make +else:if(equals(MAKEFILE_GENERATOR, MSVC.NET)|equals(MAKEFILE_GENERATOR, MSBUILD)): \ + QMAKE_MAKE = nmake +else: \ + error("Configure tests are not supported with the $$MAKEFILE_GENERATOR Makefile generator.") + +# Ensure that a cache is present. If none was found on startup, this will create +# one in the build directory of the project which loads this feature. +cache() + +QMAKE_CONFIG_LOG = $$dirname(_QMAKE_CACHE_)/config.log +QMAKE_CONFIG_TESTS_DIR = $$_PRO_FILE_PWD_/config.tests + +defineTest(qtRunLoggedCommand) { + msg = "+ $$1" + write_file($$QMAKE_CONFIG_LOG, msg, append) + system("$$1 >> \"$$QMAKE_CONFIG_LOG\" 2>&1")|return(false) + return(true) +} + +# Try to build the test project in $$QMAKE_CONFIG_TESTS_DIR/$$1 +# ($$_PRO_FILE_PWD_/config.tests/$$1 by default). +# +# If the test passes, config_$$1 will be added to CONFIG. +# The result is automatically cached. Use of cached results +# can be suppressed by passing CONFIG+=recheck to qmake. +# +# Returns: true iff the test passes +defineTest(qtCompileTest) { + positive = config_$$1 + done = done_config_$$1 + + $$done:!recheck { + $$positive:return(true) + return(false) + } + + log("Checking for $${1}... ") + msg = "executing config test $$1" + write_file($$QMAKE_CONFIG_LOG, msg, append) + + test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$1 + test_out_dir = $$shadowed($$test_dir) + test_cmd_base = "cd $$shell_quote($$native_path($$test_out_dir)) &&" + + # Disable qmake features which are typically counterproductive for tests + qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\"" + + # Clean up after previous run + exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean") + + mkpath($$test_out_dir)|error("Aborting.") + + qtRunLoggedCommand("$$test_cmd_base $$shell_quote($$native_path($$QMAKE_QMAKE)) $$qmake_configs $$shell_quote($$test_dir)") { + qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE") { + log("yes$$escape_expand(\\n)") + msg = "test $$1 succeeded" + write_file($$QMAKE_CONFIG_LOG, msg, append) + + !$$positive { + CONFIG += $$positive + cache(CONFIG, add, positive) + } + !$$done { + CONFIG += $$done + cache(CONFIG, add, done) + } + export(CONFIG) + return(true) + } + } + + log("no$$escape_expand(\\n)") + msg = "test $$1 FAILED" + write_file($$QMAKE_CONFIG_LOG, msg, append) + + $$positive { + CONFIG -= $$positive + cache(CONFIG, sub, positive) + } + !$$done { + CONFIG += $$done + cache(CONFIG, add, done) + } + export(CONFIG) + return(false) +} diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index 0593e458d3..c56729a70d 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -1,6 +1,10 @@ +contains(TEMPLATE, ".*(lib|app)"):CONFIG += have_target + +!have_target:!force_qt: CONFIG -= qt + QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH) !isEmpty(QT_BREAKPAD_ROOT_PATH): \ # quick test first whether requested ... - !staticlib:!static:CONFIG(release, debug|release):contains(TEMPLATE, .*(app|lib)): \ # is it applicable? + !staticlib:!static:CONFIG(release, debug|release):have_target: \ # is it applicable? !contains(TARGET, .*phony_target.*): \ # monster hack, you don't really see this here, right? ;) system($$QT_BREAKPAD_ROOT_PATH/qtbreakpadsymbols --breakpad-exists) { # do we really have it? CONFIG += breakpad diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf index 2876e7d29e..65bd1da7c1 100644 --- a/mkspecs/features/default_pre.prf +++ b/mkspecs/features/default_pre.prf @@ -1,45 +1,24 @@ load(exclusive_builds) -### Qt 5: remove "uic" and "resources" - or add "qt" -CONFIG = lex yacc warn_on debug uic resources exceptions $$CONFIG +CONFIG = lex yacc warn_on debug exceptions $$CONFIG !build_pass:exists($$_PRO_FILE_PWD_/sync.profile) { - PRO_BASENAME = $$basename(_PRO_FILE_) - - # Try to detect proper QTDIR path. We require QTDIR, as syncqt uses that to create qt_module.pri - # forwarding files. If we don't find QTDIR, we avoid creating the fwd files, since you then need - # to do a 'make install;' before you can use the module - # (ie. we don't use QT_INSTALL_DATA for fwd includes. This path needs a full copy) - isEmpty(QTDIR) { - QTDIR = $$(QTDIR) - isEmpty(QTDIR):QTDIR = $$QT_BUILD_TREE - isEmpty(QTDIR) { # figure out QTDIR based on qmake binary - QMAKE_BASED_QTDIR = $$dirname(QMAKE_QMAKE) - QTDIR = $$dirname(QMAKE_BASED_QTDIR) - unset(QMAKE_BASED_QTDIR) - } - } - - QTFWD = -module-fwd $$OUT_PWD/module-paths/modules -cache-module-fwd - !isEmpty(QTDIR):exists($$QTDIR/.qmake.cache) { - # Only if QTDIR points to an actual build directory - # and this build directory is the install directory - # can we tell syncqt to do a -developer-build - win32 { - CMP_QDIR = $$upper($$QTDIR) - CMP_INSTALL_PREFIX = $$upper($$[QT_HOST_PREFIX]) - } else { - CMP_QDIR = $$QTDIR - CMP_INSTALL_PREFIX = $$[QT_HOST_PREFIX] - } - contains(CMP_QDIR, $$CMP_INSTALL_PREFIX):QTFWD = -qtdir $$QTDIR -module-fwd $$QTDIR/mkspecs/modules -developer-build - unset(CMP_QDIR) - unset(CMP_INSTALL_PREFIX) + # If the install directory is a build directory, we tell syncqt to do a -developer-build. + QTDIR = $$[QT_HOST_DATA] + exists($$QTDIR/.qmake.cache) { + QTFWD = -module-fwd $$QTDIR/mkspecs/modules -developer-build + } else { + isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$OUT_PWD + modpath = $$MODULE_QMAKE_OUTDIR/mkspecs/modules + QTFWD = -module-fwd $$modpath + !isEmpty(_QMAKE_SUPER_CACHE_):!contains(QMAKEMODULES, $$modpath): \ + cache(QMAKEMODULES, add super, modpath) + unset(modpath) } qtPrepareTool(QMAKE_SYNCQT, syncqt) - isEmpty(QMAKE_SYNCQT_OUTDIR): QMAKE_SYNCQT_OUTDIR = $$OUT_PWD - MSG = $$quote($$QMAKE_SYNCQT $$QTFWD -generator $$MAKEFILE_GENERATOR -outdir $$QMAKE_SYNCQT_OUTDIR $$_PRO_FILE_PWD_) + isEmpty(MODULE_BASE_OUTDIR): MODULE_BASE_OUTDIR = $$OUT_PWD + MSG = $$quote($$QMAKE_SYNCQT -qtdir $$[QT_HOST_DATA/get] $$QTFWD -outdir $$MODULE_BASE_OUTDIR $$_PRO_FILE_PWD_) !silent:message($$MSG) system($$MSG) { # success! Nothing to do @@ -47,11 +26,10 @@ CONFIG = lex yacc warn_on debug uic resources exceptions $$CONFIG error("Failed to run: $$MSG") } - # Let qmake know about the unexpectedly appearing cache file. - exists($$QMAKE_SYNCQT_OUTDIR/.qmake.cache):_QMAKE_CACHE_ = $$QMAKE_SYNCQT_OUTDIR/.qmake.cache + # Do configure tests now. Fatal tests have a non zero return. + system("perl $$[QT_HOST_BINS/get]/qtmodule-configtests $$_PRO_FILE_PWD_ $$OUT_PWD $$[QT_HOST_PREFIX/get] $$MAKEFILE_GENERATOR")|error("Aborting.") unset(QTFWD) - unset(PRO_BASENAME) } # Populate the installdir which will be passed to qdoc in the default_post.prf diff --git a/mkspecs/features/designer.prf b/mkspecs/features/designer.prf deleted file mode 100644 index a03f14640e..0000000000 --- a/mkspecs/features/designer.prf +++ /dev/null @@ -1,6 +0,0 @@ -QT += xml -!isEmpty(QT.script.name): QT += script -!isEmpty(QT.designer.name): QT += designer -qt:load(qt) - -plugin:DEFINES += QDESIGNER_EXPORT_WIDGETS diff --git a/mkspecs/features/designer_defines.prf b/mkspecs/features/designer_defines.prf new file mode 100644 index 0000000000..443f2d7dc1 --- /dev/null +++ b/mkspecs/features/designer_defines.prf @@ -0,0 +1 @@ +plugin:DEFINES += QDESIGNER_EXPORT_WIDGETS diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf index ccf13b5166..4377542cb7 100644 --- a/mkspecs/features/device_config.prf +++ b/mkspecs/features/device_config.prf @@ -1,35 +1,13 @@ # Load generated qdevice.pri -exists($$_QMAKE_CACHE_) { - # set in default_pre, so it's the first place to check for qdevice.pri - DIR = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE) - !isEmpty(DIR):DEVICE_PRI = $$DIR/mkspecs/qdevice.pri -} - -isEmpty(DEVICE_PRI) { - # OUTDIR environ is set by configure (arch detection) and compile.test - DIR = $$(OUTDIR) - !isEmpty(DIR):DEVICE_PRI = $$DIR/mkspecs/qdevice.pri -} - -isEmpty(DEVICE_PRI) { - DIR = $$[QT_HOST_DATA] - !isEmpty(DIR):DEVICE_PRI = $$DIR/mkspecs/qdevice.pri -} - -isEmpty(DEVICE_PRI) { - error(Could not locate qdevice.pri) -} - +DEVICE_PRI = $$[QMAKE_HOST_DATA/get]/mkspecs/qdevice.pri exists($$DEVICE_PRI):include($$DEVICE_PRI) +unset(DEVICE_PRI) isEmpty(CROSS_COMPILE) { #this variable can be persisted via qmake -set CROSS_COMPILE /foo CROSS_COMPILE = $$[CROSS_COMPILE] } -unset(DEVICE_PRI) -unset(DIR) - # Provide a function to be used by mkspecs defineTest(deviceSanityCheckCompiler) { # Check if the binary exists with an absolute path. Do this check diff --git a/mkspecs/features/help.prf b/mkspecs/features/help.prf deleted file mode 100644 index 25533ded46..0000000000 --- a/mkspecs/features/help.prf +++ /dev/null @@ -1,3 +0,0 @@ -QT += sql - -qtAddModule(help, true) diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index 94f8100f88..cf19c6596c 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -86,13 +86,6 @@ contains(QMAKE_HOST.os,Windows):moc_dir_short ~= s,^.:,/, contains(moc_dir_short, ^[/\\\\].*):INCLUDEPATH += $$MOC_DIR else:INCLUDEPATH += $$OUT_PWD/$$MOC_DIR -# Backwards compatibility: Make shadow builds with default MOC_DIR work -# if the user did not add the source dir explicitly. -equals(MOC_DIR, .) { - CONFIG -= include_source_dir - CONFIG = include_source_dir $$CONFIG -} - #auto depend on moc unix:!no_mocdepend { moc_source.depends += $$first(QMAKE_MOC) diff --git a/mkspecs/features/module.prf b/mkspecs/features/module.prf index d95c7a418d..699277d961 100644 --- a/mkspecs/features/module.prf +++ b/mkspecs/features/module.prf @@ -1,7 +1 @@ -!isEmpty(MODULE_PRI) { - pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules - pritarget.files = $$MODULE_PRI - INSTALLS += pritarget -} else { - warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects") -} +warning("CONFIG+=module is obsolete. load(qt_module_config) is sufficient.") diff --git a/mkspecs/features/qdbus.prf b/mkspecs/features/qdbus.prf deleted file mode 100644 index 1d8704d3d5..0000000000 --- a/mkspecs/features/qdbus.prf +++ /dev/null @@ -1,2 +0,0 @@ -qtAddLibrary(QtDBus) -CONFIG += dbusadaptors dbusinterfaces diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 8511c84f62..c65be4c456 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -1,4 +1,4 @@ -CONFIG *= moc thread +CONFIG *= thread #handle defines win32 { @@ -37,9 +37,6 @@ plugin { #Qt plugins } } -#handle includes -INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picking up "stale" includes - QT_PLUGIN_VERIFY = QTPLUGIN DEPLOYMENT_PLUGIN for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) { for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) { @@ -101,7 +98,7 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) { # Only link against plugin in static builds isEqual(QT_CURRENT_VERIFY, QTPLUGIN): { - !isEmpty(QT_PLUGINPATH): LIBS *= -L$$[QT_INSTALL_PLUGINS]/$$QT_PLUGINPATH + !isEmpty(QT_PLUGINPATH): LIBS *= -L$$[QT_INSTALL_PLUGINS/get]/$$QT_PLUGINPATH LIBS += $$QT_LINKAGE # if the plugin is linked statically there is no need to deploy it DEPLOYMENT_PLUGIN -= $$QT_CURRENT_VERIFY @@ -111,7 +108,7 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) { CONFIG(debug, debug|release): QT_ITEM = $${QTPLUG}d4.dll else: QT_ITEM = $${QTPLUG}4.dll - eval(qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS]/$${QT_PLUGINPATH}/$${QT_ITEM}) + eval(qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS/get]/$${QT_PLUGINPATH}/$${QT_ITEM}) eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH}) DEPLOYMENT *= qt_additional_plugin_$${QTPLUG} @@ -119,11 +116,26 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) { } } - - -#specific module settings -!isEmpty(QT_BUILD_TREE):QMAKE_LIBDIR = $$QT_BUILD_TREE/lib $$QMAKE_LIBDIR #as above, prepending prevents us from picking up "stale" libs -QMAKE_LIBDIR += $$QMAKE_LIBDIR_QT +qtestlib { + warning("CONFIG+=qtestlib is deprecated. Use QT+=testlib instead.") + QT += testlib +} +qdbus { + warning("CONFIG+=qdbus is deprecated. Use QT+=dbus instead.") + QT += dbus +} +help { + warning("CONFIG+=help is deprecated. Use QT+=help instead.") + QT += help-private # sic! +} +designer { + warning("CONFIG+=desiger is deprecated. Use QT+=designer instead.") + QT += designer +} +uitools { + warning("CONFIG+=uitools is deprecated. Use QT+=uitools instead.") + QT += uitools +} # Figure out from which modules we're wanting to use the private headers unset(using_privates) @@ -134,16 +146,18 @@ for(QTLIB, QT) { want_var = QT.$${QTLIBRAW}.want_private $$want_var = UsePrivate using_privates = true + NEWQT += $$eval(QT.$${QTLIBRAW}.private_depends) } NEWQT += $$QTLIBRAW } # Topological resolution of modules based on their QT.<module>.depends variable QT = $$resolve_depends(NEWQT, "QT.") # Finally actually add the modules +unset(BAD_QT) for(QTLIB, QT) { QTLIBNAME = $$eval(QT.$${QTLIB}.name) isEmpty(QTLIBNAME) { - message("Warning: unknown QT module: $$QTLIB") + BAD_QT += $$QTLIB next() } @@ -154,6 +168,7 @@ for(QTLIB, QT) { qtAddModule($$QTLIB, $$eval(QT.$${QTLIB}.want_private)) } +!isEmpty(BAD_QT):error("Unknown module(s) in QT: $$BAD_QT") !isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) { message("This project is using private headers and will therefore be tied to this specific Qt module build version.") @@ -161,12 +176,6 @@ for(QTLIB, QT) { message("This is not a bug, but a result of using Qt internals. You have been warned!") } -qt_compat { - !qt_compat_no_warning:QTDIR_build:warning(***USE of COMPAT inside of QTDIR!**) #just for us - INCLUDEPATH *= $$QT.core.includes - DEFINES *= QT_COMPAT -} - wince*:static:gui { QTLIB += qmenu_wce.res } diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf new file mode 100644 index 0000000000..3f48a20a56 --- /dev/null +++ b/mkspecs/features/qt_build_config.prf @@ -0,0 +1,32 @@ +!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) { + QMAKE_QT_MODULE = $$[QT_HOST_DATA/get]/mkspecs/qmodule.pri + !exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) { + error("Cannot load qmodule.pri!") + } else { + debug(1, "Loaded qmodule.pri from ($$QMAKE_QT_MODULE)") + } +} else { + debug(1, "Not loading qmodule.pri twice") +} + +mac { + !isEmpty(QMAKE_RPATHDIR){ + CONFIG += absolute_library_soname + } +} + +# Qt modules get compiled without exceptions enabled by default +CONFIG += exceptions_off + +#SIMD defines: +sse2:DEFINES += QT_COMPILER_SUPPORTS_SSE2 +sse3:DEFINES += QT_COMPILER_SUPPORTS_SSE3 +ssse3:DEFINES += QT_COMPILER_SUPPORTS_SSSE3 +sse4_1:DEFINES += QT_COMPILER_SUPPORTS_SSE4_1 +sse4_2:DEFINES += QT_COMPILER_SUPPORTS_SSE4_2 +avx:DEFINES += QT_COMPILER_SUPPORTS_AVX +avx2:DEFINES += QT_COMPILER_SUPPORTS_AVX2 +iwmmxt:DEFINES += QT_COMPILER_SUPPORTS_IWMMXT +neon:DEFINES += QT_COMPILER_SUPPORTS_NEON +mips_dsp:DEFINES += QT_COMPILER_SUPPORTS_MIPS_DSP +mips_dspr2:DEFINES += QT_COMPILER_SUPPORTS_MIPS_DSPR2 diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf index 8d0dcce92c..07fd988fb5 100644 --- a/mkspecs/features/qt_config.prf +++ b/mkspecs/features/qt_config.prf @@ -1,24 +1,16 @@ -# This file is loaded by the mkspecs, before .qmake.cache has been loaded. -# Consequently, we have to do some stunts to get values out of the cache. - -exists($$_QMAKE_CACHE_) { - QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QMAKE_QT_CONFIG) - QMAKE_EXTRA_MODULE_FORWARDS = $$fromfile($$_QMAKE_CACHE_, QMAKE_EXTRA_MODULE_FORWARDS) -} -isEmpty(QMAKE_QT_CONFIG)|!exists($$QMAKE_QT_CONFIG) { - !isEmpty(QT_BUILD_TREE):QMAKE_QT_CONFIG = $$QT_BUILD_TREE - else:exists($$_QMAKE_CACHE_):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE) - isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$[QT_HOST_DATA] - QMAKE_QT_CONFIG = $$QMAKE_QT_CONFIG/mkspecs/qconfig.pri -} +QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri !exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) { debug(1, "Cannot load qconfig.pri!") } else { debug(1, "Loaded .qconfig.pri from ($$QMAKE_QT_CONFIG)") - for(dir, $$list($$unique($$list($$replace($$list($$dirname(QMAKE_QT_CONFIG) \ - $$replace($$list($$split($$list($$(QMAKEPATH)), $$DIRLIST_SEPARATOR)), $, /mkspecs)), \ - $, /modules) \ - $$QMAKE_EXTRA_MODULE_FORWARDS)))) { + QMAKE_MODULE_PATH = $$split($$list($$(QMAKEMODULES)), $$DIRLIST_SEPARATOR) + QMAKE_MODULE_PATH += $$QMAKEMODULES + QMAKE_MODULE_PATH += $$split($$list($$[QMAKEMODULES]), $$DIRLIST_SEPARATOR) + QMAKE_MODULE_PATH += $$replace($$list($$split($$list($$[QMAKE_MKSPECS]), $$DIRLIST_SEPARATOR)), \ + \$, /modules) + QMAKE_MODULE_PATH = $$unique(QMAKE_MODULE_PATH) + QMAKE_MODULE_PATH = $$reverse(QMAKE_MODULE_PATH) + for(dir, QMAKE_MODULE_PATH) { debug(1, "Loading modules from $${dir}") for(mod, $$list($$files($$dir/qt_*.pri))) { # For installed Qt these paths will be common for all modules diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index ee1647f481..dcd374b2ad 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -22,53 +22,17 @@ defineReplace(qtLibraryTarget) { } defineTest(qtAddLibrary) { - INCLUDEPATH -= $$QMAKE_INCDIR_QT/$$1 - INCLUDEPATH = $$QMAKE_INCDIR_QT/$$1 $$INCLUDEPATH - - LIB_NAME = $$1 - unset(LINKAGE) - mac { - CONFIG(qt_framework, qt_framework|qt_no_framework) { #forced - QMAKE_FRAMEWORKPATH *= $${QMAKE_LIBDIR_QT} - FRAMEWORK_INCLUDE = $$QMAKE_LIBDIR_QT/$${LIB_NAME}.framework/Headers - !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { - INCLUDEPATH -= $$FRAMEWORK_INCLUDE - INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH - } - LINKAGE = -framework $${LIB_NAME}$${QT_LIBINFIX} - } else:!qt_no_framework { #detection - for(frmwrk_dir, $$list($$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH) /Library/Frameworks)) { - exists($${frmwrk_dir}/$${LIB_NAME}.framework) { - QMAKE_FRAMEWORKPATH *= $${frmwrk_dir} - FRAMEWORK_INCLUDE = $$frmwrk_dir/$${LIB_NAME}.framework/Headers - !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { - INCLUDEPATH -= $$FRAMEWORK_INCLUDE - INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH - } - LINKAGE = -framework $${LIB_NAME} - break() - } - } - } - } - isEmpty(LINKAGE) { - if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { - win32:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}d - mac:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug - } - isEmpty(LINKAGE):LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX} - } - !isEmpty(QMAKE_LSB) { - QMAKE_LFLAGS *= --lsb-libpath=$$$$QMAKE_LIBDIR_QT - QMAKE_LFLAGS *= -L/opt/lsb/lib - QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME}$${QT_LIBINFIX} + warning("qtAddLibrary() is deprecated. Use qtAddModule() or QT+= instead.") + + # Reverse-engineer the module name from the library name. + for(var, $$list($$find($$list($$enumerate_vars()), ^QT\\.[^.]+\\.name$))) { + isEqual($$var, $$1) { + var ~= s,^QT\\.([^.]+)\\.name$,\\1, + qtAddModule($$var):return(true):break() + return(false):break() # Yes, the break is insanity. But necessary. + } } - LIBS += $$LINKAGE - export(LIBS) - export(INCLUDEPATH) - export(QMAKE_FRAMEWORKPATH) - export(QMAKE_LFLAGS) - return(true) + error("No module matching library '$$1' found.") } defineTest(qtAddModule) { @@ -81,8 +45,12 @@ defineTest(qtAddModule) { CONFIG += $$eval(QT.$${1}.CONFIG) DEFINES += $$eval(QT.$${1}.DEFINES) - INCLUDEPATH -= $$MODULE_INCLUDES - INCLUDEPATH = $$MODULE_INCLUDES $$INCLUDEPATH + unix { + MODULE_INCLUDES -= /usr/include /usr/local/include + MODULE_LIBS -= /usr/lib /usr/local/lib + } + + INCLUDEPATH *= $$MODULE_INCLUDES isEqual(2, UsePrivate) { # Tests function parameter 2 ($$2) being equal to 'UsePrivate' # This adds both # <module privates include path>/ @@ -90,33 +58,17 @@ defineTest(qtAddModule) { # since we have code using both #include <QtCore/private/foo> and #include <private/foo> # Both need to be supported with the new private includes structure MODULE_INCLUDES_PRIVATES = $$eval(QT.$${1}.private_includes) - INCLUDEPATH -= $$MODULE_INCLUDES_PRIVATES $$MODULE_INCLUDES_PRIVATES/$$MODULE_NAME - INCLUDEPATH = $$MODULE_INCLUDES_PRIVATES $$MODULE_INCLUDES_PRIVATES/$$MODULE_NAME $$INCLUDEPATH + INCLUDEPATH += $$MODULE_INCLUDES_PRIVATES $$MODULE_INCLUDES_PRIVATES/$$MODULE_NAME } unset(LINKAGE) mac { !contains(MODULE_CONFIG,staticlib):CONFIG(qt_framework, qt_framework|qt_no_framework) { #forced QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS} - FRAMEWORK_INCLUDE = $$MODULE_INCLUDES.framework/Headers - !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { - INCLUDEPATH -= $$FRAMEWORK_INCLUDE - INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH - } + FRAMEWORK_INCLUDE = $${MODULE_LIBS}.framework/Headers + !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE): \ + INCLUDEPATH *= $$FRAMEWORK_INCLUDE LINKAGE = -framework $${MODULE_NAME}$${QT_LIBINFIX} - } else:!qt_no_framework { #detection - for(frmwrk_dir, $$list($$MODULE_LIBS $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH) /Library/Frameworks)) { - exists($${frmwrk_dir}/$${MODULE_NAME}.framework) { - QMAKE_FRAMEWORKPATH *= $${frmwrk_dir} - FRAMEWORK_INCLUDE = $$frmwrk_dir/$${MODULE_NAME}.framework/Headers - !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { - INCLUDEPATH -= $$FRAMEWORK_INCLUDE - INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH - } - LINKAGE = -framework $${MODULE_NAME} - break() - } - } } } @@ -131,10 +83,10 @@ defineTest(qtAddModule) { } isEmpty(LINKAGE) { - # Make sure we can link to uninstalled libraries !isEmpty(MODULE_LIBS) { - !isEqual(MODULE_LIBS, $$[QT_INSTALL_LIBS]) { ### XXX - QMAKE_LIBDIR *= $$MODULE_LIBS + QMAKE_LIBDIR *= $$MODULE_LIBS + !isEqual(MODULE_LIBS, $$[QT_INSTALL_LIBS]) { + # Make sure we can link to uninstalled libraries unix:!mac:QMAKE_LFLAGS *= "-Wl,-rpath-link,$$MODULE_LIBS" } } @@ -166,8 +118,7 @@ defineTest(qtAddModule) { # variable, default defineTest(qtPrepareTool) { - MODBASE = $$[QT_HOST_BINS] - !isEmpty(QT_BUILD_TREE):MODBASE = $$QT_BUILD_TREE/bin + MODBASE = $$[QT_HOST_BINS/get] count(ARGS, 2, greaterThan) { isEmpty(QT.$${3}.bins):warning("No QT.$${3}.bins, module path ignored for qtPrepareTool($$1, $$2, $$3)") else:MODBASE = $$eval(QT.$${3}.bins) diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf index 45c0957a49..100ad59c66 100644 --- a/mkspecs/features/qt_installs.prf +++ b/mkspecs/features/qt_installs.prf @@ -1,18 +1,16 @@ -#always install the library -win32 { - dlltarget.path=$$[QT_INSTALL_BINS] - INSTALLS += dlltarget +#library +!qt_no_install_library { + win32 { + dlltarget.path = $$[QT_INSTALL_BINS] + INSTALLS += dlltarget + } + target.path = $$[QT_INSTALL_LIBS] + INSTALLS += target } -target.path=$$[QT_INSTALL_LIBS] -INSTALLS += target #headers qt_install_headers { INSTALL_HEADERS = $$SYNCQT.HEADER_FILES - equals(TARGET, QtCore) { - #headers created by configure - INSTALL_HEADERS *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h - } equals(TARGET, phonon) { class_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET @@ -39,3 +37,13 @@ qt_install_headers { INSTALLS += qpa_headers } +#module +qt_install_module { + !isEmpty(MODULE_PRI) { + pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules + pritarget.files = $$MODULE_PRI + INSTALLS += pritarget + } else { + warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects.") + } +} diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index b6b865ba5e..71411bd427 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -1,46 +1,2 @@ -# This file is loaded on-demand, before any .qmake.cache (sometimes *in* .qmake.cache), to loaded -# important settings for modules, such as paths to QtBase, settings etc. -# Consequently, we have to do some stunts to figure out where to find qmodule.pri. - -isEmpty(QMAKE_QT_MODULE)|!exists($$QMAKE_QT_MODULE) { - exists($$QTDIR/mkspecs/qmodule.pri):QMAKE_QT_MODULE = $$QTDIR/mkspecs/qmodule.pri - QMAKE_CACHE_DIR = $$dirname(_QMAKE_CACHE_) - !exists($$QMAKE_QT_MODULE):exists($$QMAKE_CACHE_DIR/mkspecs/qmodule.pri):QMAKE_QT_MODULE = $$QMAKE_CACHE_DIR/mkspecs/qmodule.pri - !exists($$QMAKE_QT_MODULE):exists($$QMAKE_CACHE_DIR/qtbase/mkspecs/qmodule.pri):QMAKE_QT_MODULE = $$QMAKE_CACHE_DIR/qtbase/mkspecs/qmodule.pri - !exists($$QMAKE_QT_MODULE):if(!isEmpty(QT_BUILD_TREE) & exists($$QT_BUILD_TREE/mkspecs/qmodule.pri)):QMAKE_QT_MODULE = $$QT_BUILD_TREE/mkspecs/qmodule.pri - !exists($$QMAKE_QT_MODULE):exists($$[QT_HOST_DATA]/mkspecs/qmodule.pri):QMAKE_QT_MODULE = $$[QT_HOST_DATA]/mkspecs/qmodule.pri -} - -!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) { - !exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) { - error("Cannot load qmodule.pri!") - } else { - QMAKE_QT_MODULE_PRI_LOADED = 1 - debug(1, "Loaded qmodule.pri from ($$QMAKE_QT_MODULE)") - } -} else { - QMAKE_QT_MODULE_PRI_LOADED = 1 # covers 'preloading' from .qmake.cache - debug(1, "Not loading qmodule.pri twice") -} - -mac { - !isEmpty(QMAKE_RPATHDIR){ - CONFIG += absolute_library_soname - } -} - -# Qt modules get compiled without exceptions enabled by default -CONFIG += exceptions_off - -#SIMD defines: -sse2:DEFINES += QT_COMPILER_SUPPORTS_SSE2 -sse3:DEFINES += QT_COMPILER_SUPPORTS_SSE3 -ssse3:DEFINES += QT_COMPILER_SUPPORTS_SSSE3 -sse4_1:DEFINES += QT_COMPILER_SUPPORTS_SSE4_1 -sse4_2:DEFINES += QT_COMPILER_SUPPORTS_SSE4_2 -avx:DEFINES += QT_COMPILER_SUPPORTS_AVX -avx2:DEFINES += QT_COMPILER_SUPPORTS_AVX2 -iwmmxt:DEFINES += QT_COMPILER_SUPPORTS_IWMMXT -neon:DEFINES += QT_COMPILER_SUPPORTS_NEON -mips_dsp:DEFINES += QT_COMPILER_SUPPORTS_MIPS_DSP -mips_dspr2:DEFINES += QT_COMPILER_SUPPORTS_MIPS_DSPR2 +warning("Use load(qt_build_config) instead of load(qt_module).") +load(qt_build_config) diff --git a/mkspecs/features/qt_module_config.prf b/mkspecs/features/qt_module_config.prf index 06c5512a40..fc53b8aa6c 100644 --- a/mkspecs/features/qt_module_config.prf +++ b/mkspecs/features/qt_module_config.prf @@ -1,38 +1,107 @@ -!no_qt_module_warning:if(!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\\\.pri)|isEmpty(QMAKE_QT_MODULE_PRI_LOADED)) { +!no_qt_module_warning:!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) { QMAKE_ACTUAL_PRO_FILE = $$basename(_PRO_FILE_) isEmpty(QMAKE_ACTUAL_PRO_FILE): QMAKE_ACTUAL_PRO_FILE=.pro - warning("You should probably load(qt_module) first in $$QMAKE_ACTUAL_PRO_FILE for $$TARGET, as it also load()s qt_module_config.") + warning("You should probably load(qt_build_config) first in $$QMAKE_ACTUAL_PRO_FILE for $$TARGET, as the latter also load()s qt_module_config.") message("Not doing so may lead to qt_module_config.prf overriding compiler/linker options in your .pro file.") message("Ignore this warning with CONFIG+=no_qt_module_warning if you know what you are doing.") unset(QMAKE_ACTUAL_PRO_FILE) } -load(qt_module) # loads qmodule.pri if hasn't been loaded already +load(qt_build_config) # loads qmodule.pri if hasn't been loaded already isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0) isEmpty(TARGET):error("You must set TARGET before include()'ing $${_FILE_}") +isEmpty(VERSION):VERSION = $$QT_VERSION + +ucmodule = $$upper($$MODULE) + +MODULE_DEPENDS = $$replace(QT, -private$, ) + +# Find the module's source root dir. +MODULE_PROFILE_DIR = $$_PRO_FILE_PWD_ +for(ever) { + exists($$MODULE_PROFILE_DIR/sync.profile):break() + nmpri = $$dirname(MODULE_PROFILE_DIR) + equals(nmpri, $$MODULE_PROFILE_DIR):error("No sync.profile found. This does not look like a Qt module source tree.") + MODULE_PROFILE_DIR = $$nmpri + unset(nmpri) +} + +isEmpty(MODULE_BASE_DIR): MODULE_BASE_DIR = $$MODULE_PROFILE_DIR +MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_DIR) +isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR + +# This check will be removed soon. Weird indentation to avoid reindenting the code later. +!isEmpty(MODULE_PRI) { + !build_pass:warning("$$_PRO_FILE_ still sets MODULE_PRI. Not auto-generating module .pri file.") + MODULE_PRI = $$absolute_path($$MODULE_PRI, $$_PRO_FILE_PWD_) + exists($$MODULE_PRI)|error("Specified module pri file $$MODULE_PRI does not exist.") +} else { + +MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_$${MODULE}.pri + +!build_pass { + + # Create a module .pri file + !isEmpty(QT_PRIVATE) { + contains(QT_PRIVATE, .*-private$):error("QT_PRIVATE may not contain *-private.") + module_privdep = "QT.$${MODULE}.private_depends = $$QT_PRIVATE" + } else { + module_privdep = + } + staticlib: \ + module_build_type = "QT.$${MODULE}.module_config = staticlib" + else:mac:!static:contains(QT_CONFIG, qt_framework): \ + module_build_type = "QT.$${MODULE}.module_config = lib_bundle" + else: \ + module_build_type = + !isEmpty(MODULE_CONFIG): \ + module_config = "QT.$${MODULE}.CONFIG = $$MODULE_CONFIG" + else: \ + module_config = + contains(TARGET, QtAddOn.*): \ + MODULE_DEFINE = QT_ADDON_$${ucmodule}_LIB + else: \ + MODULE_DEFINE = QT_$${ucmodule}_LIB + MODULE_DEFINES = $$MODULE_DEFINE $$MODULE_DEFINES + MODULE_PRI_CONT = \ + "QT.$${MODULE}.VERSION = $${VERSION}" \ + "QT.$${MODULE}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \ + "QT.$${MODULE}.MINOR_VERSION = $$section(VERSION, ., 1, 1)" \ + "QT.$${MODULE}.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \ + "" \ + "QT.$${MODULE}.name = $$TARGET" \ + "QT.$${MODULE}.bins = \$\$QT_MODULE_BIN_BASE" \ + "QT.$${MODULE}.includes = \$\$QT_MODULE_INCLUDE_BASE \$\$QT_MODULE_INCLUDE_BASE/$$TARGET" \ + "QT.$${MODULE}.private_includes = \$\$QT_MODULE_INCLUDE_BASE/$$TARGET/\$\$QT.$${MODULE}.VERSION" \ + "QT.$${MODULE}.sources = $$val_escape(_PRO_FILE_PWD_)" \ + "QT.$${MODULE}.libs = \$\$QT_MODULE_LIB_BASE" \ + "QT.$${MODULE}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \ + "QT.$${MODULE}.imports = \$\$QT_MODULE_IMPORT_BASE" \ + "QT.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \ + $$module_privdep \ + $$module_build_type \ + $$module_config \ + "QT.$${MODULE}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting + "" \ + "QT_CONFIG += $$MODULE" # this is obsolete, but some code still depends on it + write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.") + +} # !build_pass + +} # isEmpty(MODULE_PRI) + +load(qt_module_fwdpri) MODULE_INCLUDES = $$eval(QT.$${MODULE}.includes) MODULE_PRIVATE_INCLUDES = $$eval(QT.$${MODULE}.private_includes) +INCLUDEPATH *= $$MODULE_INCLUDES INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES/$$TARGET -INCLUDEPATH *= $$MODULE_INCLUDES $$MODULE_INCLUDES/.. #just for today to have some compat -!isEmpty(RCC_DIR): INCLUDEPATH += $$RCC_DIR -TEMPLATE = lib -isEmpty(QT_MAJOR_VERSION) { - VERSION=5.0.0 -} else { - VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} -} -#load up the headers info -CONFIG += qt_install_headers -#headers.pri is loaded from the last include path -LAST_MODULE_INCLUDE=$$MODULE_INCLUDES -for(include_path, MODULE_INCLUDES):LAST_MODULE_INCLUDE=$${include_path} -HEADERS_PRI = $$LAST_MODULE_INCLUDE/headers.pri -include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) +load(qt_module_headers) #other +TEMPLATE = lib DESTDIR = $$eval(QT.$${MODULE}.libs) win32:!wince*:DLLDESTDIR = $$[QT_INSTALL_PREFIX]/bin @@ -48,8 +117,16 @@ if(win32|mac):!wince*:!macx-xcode { linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF +QT += $$QT_PRIVATE +unset(QT_PRIVATE) + !isEmpty(DESTDIR):CONFIG += create_cmake +contains(TARGET, QtAddOn.*): \ + DEFINES += QT_BUILD_ADDON_$${ucmodule}_LIB +else: \ + DEFINES += QT_BUILD_$${ucmodule}_LIB + contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions contains(QT_CONFIG, largefile):CONFIG += largefile @@ -67,12 +144,6 @@ mac:!static:contains(QT_CONFIG, qt_framework) { FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES FRAMEWORK_HEADERS.path = Headers - equals(TARGET, QtCore) { - #headers generated by configure - !contains(FRAMEWORK_HEADERS.files, .*/qconfig.h) { - FRAMEWORK_HEADERS.files *= $$QT_BUILD_TREE/src/corelib/global/qconfig.h - } - } } QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS } @@ -106,15 +177,6 @@ aix-g++* { QMAKE_CXXFLAGS += -mminimal-toc } -embedded { - EMBEDDED_H = $$EMBEDDED_CPP -} - -DEPENDPATH += ;$$NETWORK_H;$$KERNEL_H;$$WIDGETS_H;$$SQL_H;$$TABLE_H;$$DIALOGS_H; -DEPENDPATH += $$ICONVIEW_H;$$OPENGL_H;$$THREAD_H;$$TOOLS_H;$$CODECS_H; -DEPENDPATH += $$WORKSPACE_H;$$XML_H;$$STYLES_H;$$COMPAT_H -embedded:DEPENDPATH += ;$$EMBEDDED_H - !static:PRL_EXPORT_DEFINES += QT_SHARED #install directives @@ -126,9 +188,9 @@ unix|win32-g++* { QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]/$$TARGET QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS/raw] QMAKE_PKGCONFIG_DESTDIR = pkgconfig - include_replace.match = $$QMAKE_INCDIR_QT + include_replace.match = $$[QT_INSTALL_HEADERS/get] include_replace.replace = $$[QT_INSTALL_HEADERS/raw] - lib_replace.match = $$QMAKE_LIBDIR_QT + lib_replace.match = $$[QT_INSTALL_LIBS/get] lib_replace.replace = $$[QT_INSTALL_LIBS/raw] prefix_replace.match = $$QT_BUILD_TREE prefix_replace.replace = $$[QT_INSTALL_PREFIX/raw] @@ -143,6 +205,12 @@ unix { QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace } +unix|win32-g++* { + for(i, QT):QMAKE_PKGCONFIG_REQUIRES += $$eval(QT.$${i}.name) + isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \ + QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module +} + contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE DEFINES *= QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS DEFINES *= QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code @@ -151,29 +219,6 @@ DEFINES *= QT_DEPRECATED_WARNINGS TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end -qtPrepareTool(QMAKE_MOC, moc) -qtPrepareTool(QMAKE_UIC, uic) -qtPrepareTool(QMAKE_RCC, rcc) -qtPrepareTool(QMAKE_LUPDATE, lupdate) -qtPrepareTool(QMAKE_LRELEASE, lrelease) - -moc_dir.name = moc_location -moc_dir.variable = QMAKE_MOC - -uic_dir.name = uic_location -uic_dir.variable = QMAKE_UIC - -rcc_dir.name = rcc_location -rcc_dir.variable = QMAKE_RCC - -lupdate_dir.name = lupdate_location -lupdate_dir.variable = QMAKE_LUPDATE - -lrelease_dir.name = lrelease_location -lrelease_dir.variable = QMAKE_LRELEASE - -QMAKE_PKGCONFIG_VARIABLES += moc_dir uic_dir rcc_dir lupdate_dir lrelease_dir - load(qt_targets) win32:DEFINES+=_USE_MATH_DEFINES diff --git a/mkspecs/features/qt_module_fwdpri.prf b/mkspecs/features/qt_module_fwdpri.prf new file mode 100644 index 0000000000..9de255fc91 --- /dev/null +++ b/mkspecs/features/qt_module_fwdpri.prf @@ -0,0 +1,52 @@ +!build_pass { + + QTDIR = $$[QT_HOST_PREFIX] + exists($$QTDIR/.qmake.cache) { + mod_component_base = $$QTDIR + mod_qmake_base = $$QTDIR + } else { + mod_component_base = $$MODULE_BASE_OUTDIR + mod_qmake_base = $$MODULE_QMAKE_OUTDIR + } + # Permit modules to enforce being built outside QTDIR. + force_independent: mod_component_base = $$MODULE_BASE_OUTDIR + + # This check will be removed soon. Weird indentation to avoid reindenting the code later. + syncprofile = $$cat($$MODULE_PROFILE_DIR/sync.profile, lines) + contains(syncprofile, "^%modulepris.*") { + MODULE_FWD_PRI = $$mod_qmake_base/mkspecs/modules/$$replace(MODULE_PRI, ^.*/,) + } else { + + MODULE_FWD_PRI = $$mod_qmake_base/mkspecs/modules/qt_$${MODULE}.pri + + # Create a forwarding module .pri file + MODULE_FWD_PRI_CONT = \ + "QT_MODULE_BASE = $$MODULE_BASE_DIR" \ + "QT_MODULE_BIN_BASE = $$mod_component_base/bin" \ + "QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_OUTDIR/include" \ + "QT_MODULE_IMPORT_BASE = $$mod_component_base/imports" \ + "QT_MODULE_LIB_BASE = $$mod_component_base/lib" \ + "QT_MODULE_PLUGIN_BASE = $$mod_component_base/plugins" \ + "include($$MODULE_PRI)" + write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.") + touch($$MODULE_FWD_PRI, $$MODULE_PRI) + + } # create forwarding module pris + + # Then, inject the new module into the current cache state + !contains(QMAKE_INTERNAL_INCLUDED_FILES, $$MODULE_PRI) { # before the actual include()! + added = $$MODULE_PRI $$MODULE_FWD_PRI + cache(QMAKE_INTERNAL_INCLUDED_FILES, add transient, added) + unset(added) + } + include($$MODULE_FWD_PRI) + for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \ + name depends private_depends module_config CONFIG DEFINES sources \ + includes private_includes bins libs plugins imports \ + )):defined(QT.$${MODULE}.$$var, var):cache(QT.$${MODULE}.$$var, transient) + cache(QT_CONFIG, transient) + +} # !build_pass + +# Schedule the regular .pri file for installation +CONFIG += qt_install_module diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf new file mode 100644 index 0000000000..6a1854a771 --- /dev/null +++ b/mkspecs/features/qt_module_headers.prf @@ -0,0 +1,61 @@ +#load up the headers info +include($$MODULE_BASE_OUTDIR/include/$$TARGET/headers.pri, "", true) + +lctarget = $$lower($$TARGET) +uctarget = $$upper($$TARGET) + +defineTest(shouldMasterInclude) { + bn = $$basename(1) + contains(bn, .*_.*):return(false) + contains(bn, ^qconfig.*):return(false) + lines = $$cat($$_PRO_FILE_PWD_/$$1, lines) + contains(lines, $${LITERAL_HASH}pragma qt_no_master_include):return(false) + return(true) +} + +# Create module version header +MODULE_VERSION_HEADER = $$find(SYNCQT.HEADER_FILES, (^|/)$${lctarget}version\\.h$) +count(MODULE_VERSION_HEADER, 1) { + MODULE_VERSION_HEADER = $$absolute_path($$MODULE_VERSION_HEADER, $$_PRO_FILE_PWD_) + + !build_pass { + majorhexstr = $$format_number($$section(VERSION, ., 0, 0), width=2 zeropad obase=16) + minorhexstr = $$format_number($$section(VERSION, ., 1, 1), width=2 zeropad obase=16) + patchhexstr = $$format_number($$section(VERSION, ., 2, 2), width=2 zeropad obase=16) + modulehexstring = 0x$${majorhexstr}$${minorhexstr}$${patchhexstr} + MODULE_VERSION_HEADER_CONT = \ + "/* This file was generated by qmake with the info from $${_PRO_FILE_}. */" \ + "$${LITERAL_HASH}ifndef QT_$${uctarget}_VERSION_H" \ + "$${LITERAL_HASH}define QT_$${uctarget}_VERSION_H" \ + "" \ + "$${LITERAL_HASH}define $${uctarget}_VERSION_STR \"$$VERSION\"" \ + "" \ + "$${LITERAL_HASH}define $${uctarget}_VERSION $$modulehexstring" \ + "" \ + "$${LITERAL_HASH}endif // QT_$${uctarget}_VERSION_H" + write_file($$MODULE_VERSION_HEADER, MODULE_VERSION_HEADER_CONT)|error("Aborting.") + } + + HEADERS += $$MODULE_VERSION_HEADER +} + +# Create a module master header +MODULE_MASTER_HEADER = $$MODULE_BASE_OUTDIR/include/$$TARGET/$$TARGET +!build_pass { + MODULE_MASTER_HEADER_CONT = \ + "/* This file was generated by qmake with the info from $${_PRO_FILE_}. */" \ + "$${LITERAL_HASH}ifndef QT_$${ucmodule}_MODULE_H" \ + "$${LITERAL_HASH}define QT_$${ucmodule}_MODULE_H" + for(dep, MODULE_DEPENDS) { + depname = $$eval(QT.$${dep}.name) + MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>" + } + for(hdr, SYNCQT.HEADER_FILES): \ + shouldMasterInclude($$hdr): \ + MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include \"$$replace(hdr, .*/, )\"" + MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}endif" + write_file($$MODULE_MASTER_HEADER, MODULE_MASTER_HEADER_CONT)|error("Aborting.") +} +SYNCQT.HEADER_FILES += $$MODULE_MASTER_HEADER + +CONFIG += qt_install_headers diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf index 32994f39f1..d2826822c3 100644 --- a/mkspecs/features/qt_plugin.prf +++ b/mkspecs/features/qt_plugin.prf @@ -1,9 +1,5 @@ TEMPLATE = lib -isEmpty(QT_MAJOR_VERSION) { - VERSION=5.0.0 -} else { - VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} -} +isEmpty(VERSION):VERSION = $$QT_VERSION CONFIG += qt plugin if(win32|mac):!wince*:!macx-xcode { diff --git a/mkspecs/features/qtestlib.prf b/mkspecs/features/qtestlib.prf deleted file mode 100644 index 0b1fbee622..0000000000 --- a/mkspecs/features/qtestlib.prf +++ /dev/null @@ -1,4 +0,0 @@ - -CONFIG += console - -qtAddLibrary(QtTest) diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index 47e718807e..dfded30e28 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -1,4 +1,3 @@ -defined(qtPrepareTool)|load(qt_functions) ### Qt 5: see default_pre.prf qtPrepareTool(QMAKE_RCC, rcc) isEmpty(RCC_DIR):RCC_DIR = . diff --git a/mkspecs/features/static_and_shared.prf b/mkspecs/features/static_and_shared.prf index f586bddcc4..47c68e50a0 100644 --- a/mkspecs/features/static_and_shared.prf +++ b/mkspecs/features/static_and_shared.prf @@ -1,3 +1,3 @@ -!contains(TEMPLATE, subdirs):!macx-xcode { +have_target:!macx-xcode { addExclusiveBuilds(static, Static, shared, Shared) } diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index ea7b5200c5..62b201faec 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -1,4 +1,4 @@ -!contains(TEMPLATE,subdirs) { +have_target { check.files = check.path = . @@ -128,7 +128,7 @@ contains(INSTALLS, target) { } } -} +} # have_target defineTest(installTestHelperApp) { # args: relativeSource, relativeDestination, targetName diff --git a/mkspecs/features/testlib_defines.prf b/mkspecs/features/testlib_defines.prf new file mode 100644 index 0000000000..59540689d3 --- /dev/null +++ b/mkspecs/features/testlib_defines.prf @@ -0,0 +1 @@ +DEFINES += QT_TESTCASE_BUILDDIR=\\\"$$OUT_PWD\\\" diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index 74a26833a4..9cb0773b8d 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -1,4 +1,3 @@ -defined(qtPrepareTool)|load(qt_functions) ### Qt 5: see default_pre.prf qtPrepareTool(QMAKE_UIC3, uic3) qtPrepareTool(QMAKE_UIC, uic) @@ -34,13 +33,6 @@ isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_ else:INCLUDEPATH += $$OUT_PWD/$$UI_HEADERS_DIR } -# Backwards compatibility: Make shadow builds with default UI_DIR work -# if the user did not add the source dir explicitly. -equals(UI_DIR, .) { - CONFIG -= include_source_dir - CONFIG = include_source_dir $$CONFIG -} - uic3 { isEmpty(FORMS3) { UIC3_FORMS = FORMS diff --git a/mkspecs/features/uitools.prf b/mkspecs/features/uitools.prf deleted file mode 100644 index 50c4c60697..0000000000 --- a/mkspecs/features/uitools.prf +++ /dev/null @@ -1,13 +0,0 @@ -QT += xml -qt:load(qt) - -# Include the correct version of the UiLoader library -QTUITOOLS_LINKAGE = -lQtUiTools$${QT_LIBINFIX} - -CONFIG(debug, debug|release) { - mac: QTUITOOLS_LINKAGE = -lQtUiTools$${QT_LIBINFIX}_debug - win32: QTUITOOLS_LINKAGE = -lQtUiTools$${QT_LIBINFIX}d -} -LIBS += $$QTUITOOLS_LINKAGE - -INCLUDEPATH = $$QT.uitools.includes $$INCLUDEPATH diff --git a/mkspecs/features/unix/gdb_dwarf_index.prf b/mkspecs/features/unix/gdb_dwarf_index.prf index e3f79cdac6..9a7a8e01bc 100644 --- a/mkspecs/features/unix/gdb_dwarf_index.prf +++ b/mkspecs/features/unix/gdb_dwarf_index.prf @@ -1,4 +1,4 @@ -!CONFIG(separate_debug_info):CONFIG(debug, debug|release):!staticlib:!static:!contains(TEMPLATE, subdirs):!isEmpty(QMAKE_OBJCOPY) { +!CONFIG(separate_debug_info):CONFIG(debug, debug|release):have_target:!staticlib:!static:!isEmpty(QMAKE_OBJCOPY) { contains(TEMPLATE, "lib") { QMAKE_GDB_INDEX = { test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\"; } && diff --git a/mkspecs/features/unix/separate_debug_info.prf b/mkspecs/features/unix/separate_debug_info.prf index 8843c6d2a8..2e36dd25f5 100644 --- a/mkspecs/features/unix/separate_debug_info.prf +++ b/mkspecs/features/unix/separate_debug_info.prf @@ -1,5 +1,5 @@ -!separate_debug_info_nocopy:!staticlib:!static:!contains(TEMPLATE, subdirs):!isEmpty(QMAKE_OBJCOPY) { +!separate_debug_info_nocopy:have_target:!staticlib:!static:!isEmpty(QMAKE_OBJCOPY) { QMAKE_SEPARATE_DEBUG_INFO = test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\" ; targ=`basename $(TARGET)`; $$QMAKE_OBJCOPY --only-keep-debug \"\$\$targ\" \"\$\$targ.debug\" && $$QMAKE_OBJCOPY --strip-debug \"\$\$targ\" && $$QMAKE_OBJCOPY --add-gnu-debuglink=\"\$\$targ.debug\" \"\$\$targ\" && chmod -x \"\$\$targ.debug\" QMAKE_INSTALL_SEPARATE_DEBUG_INFO = test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\" ; $(INSTALL_FILE) `basename $(TARGET)`.debug $(INSTALL_ROOT)/\$\$target_path/ diff --git a/mkspecs/features/win32/qaxserver.prf b/mkspecs/features/win32/qaxserver.prf index 678c2ccb83..fafd8680b8 100644 --- a/mkspecs/features/win32/qaxserver.prf +++ b/mkspecs/features/win32/qaxserver.prf @@ -9,9 +9,9 @@ isEmpty(ACTIVEQT_VERSION):ACTIVEQT_VERSION = 1.0 DEFINES += QAXSERVER INCLUDEPATH += $$QT.activeqt.includes +qtPrepareTool(QMAKE_IDC, idc, activeqt) contains(TEMPLATE, "vc.*") { - ACTIVEQT_IDC = $${QMAKE_IDC} ### Qt5: remove me - qtPrepareTool(ACTIVEQT_IDC, idc) + ACTIVEQT_IDC = $${QMAKE_IDC} ACTIVEQT_IDL = $${QMAKE_IDL} ACTIVEQT_TARGET = "$(TargetPath)" win32-msvc { diff --git a/mkspecs/freebsd-g++/qmake.conf b/mkspecs/freebsd-g++/qmake.conf index 35501d52ad..a8c6bf659c 100644 --- a/mkspecs/freebsd-g++/qmake.conf +++ b/mkspecs/freebsd-g++/qmake.conf @@ -17,8 +17,6 @@ QMAKE_INCDIR = /usr/local/include QMAKE_LIBDIR = /usr/local/lib QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib @@ -35,15 +33,6 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf) diff --git a/mkspecs/freebsd-g++46/qmake.conf b/mkspecs/freebsd-g++46/qmake.conf index 8cff625b89..9d9213a75c 100644 --- a/mkspecs/freebsd-g++46/qmake.conf +++ b/mkspecs/freebsd-g++46/qmake.conf @@ -17,8 +17,6 @@ QMAKE_INCDIR = /usr/local/include QMAKE_LIBDIR = /usr/local/lib QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib @@ -35,15 +33,6 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf) diff --git a/mkspecs/freebsd-icc/qmake.conf b/mkspecs/freebsd-icc/qmake.conf index 7ad34275c4..5de842f0c5 100644 --- a/mkspecs/freebsd-icc/qmake.conf +++ b/mkspecs/freebsd-icc/qmake.conf @@ -66,8 +66,6 @@ QMAKE_INCDIR = /usr/local/include QMAKE_LIBDIR = /usr/local/lib QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib @@ -93,14 +91,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/hpux-acc-64/qmake.conf b/mkspecs/hpux-acc-64/qmake.conf index 65120d3bb2..0831df60ab 100644 --- a/mkspecs/hpux-acc-64/qmake.conf +++ b/mkspecs/hpux-acc-64/qmake.conf @@ -83,8 +83,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/include/X11R6 QMAKE_LIBDIR_X11 = /usr/lib/X11R6/pa20_64 -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /opt/graphics/OpenGL/include /usr/contrib/X11R6/include QMAKE_LIBDIR_OPENGL = /opt/graphics/OpenGL/lib/pa20_64 /usr/contrib/X11R6/lib/pa20_64 @@ -114,14 +112,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/hpux-acc-o64/qmake.conf b/mkspecs/hpux-acc-o64/qmake.conf index 370be040c9..d8d780e8ea 100644 --- a/mkspecs/hpux-acc-o64/qmake.conf +++ b/mkspecs/hpux-acc-o64/qmake.conf @@ -81,8 +81,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/include/X11R6 QMAKE_LIBDIR_X11 = /usr/lib/X11R6 -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /opt/graphics/OpenGL/include /usr/contrib/X11R6/include QMAKE_LIBDIR_OPENGL = /opt/graphics/OpenGL/lib /usr/contrib/X11R6/lib @@ -112,14 +110,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/hpux-acc/qmake.conf b/mkspecs/hpux-acc/qmake.conf index 367e9a618b..87b67f0c4e 100644 --- a/mkspecs/hpux-acc/qmake.conf +++ b/mkspecs/hpux-acc/qmake.conf @@ -62,8 +62,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/include/X11R6 QMAKE_LIBDIR_X11 = /usr/lib/X11R6 -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /opt/graphics/OpenGL/include /usr/contrib/X11R6/include QMAKE_LIBDIR_OPENGL = /opt/graphics/OpenGL/lib /usr/contrib/X11R6/lib @@ -93,14 +91,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/hpux-g++-64/qmake.conf b/mkspecs/hpux-g++-64/qmake.conf index bfa71b6d67..0323baae0b 100644 --- a/mkspecs/hpux-g++-64/qmake.conf +++ b/mkspecs/hpux-g++-64/qmake.conf @@ -43,8 +43,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = /usr/lib/pa20_64 QMAKE_INCDIR_X11 = /usr/include/X11R6 QMAKE_LIBDIR_X11 = /usr/lib/X11R6/pa20_64 -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /opt/Mesa/include /usr/contrib/X11R6/include QMAKE_LIBDIR_OPENGL = /opt/Mesa/lib/pa20_64 /usr/contrib/X11R6/lib/pa20_64 @@ -76,14 +74,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/hpux-g++/qmake.conf b/mkspecs/hpux-g++/qmake.conf index 19dea829c4..b7040b7b4e 100644 --- a/mkspecs/hpux-g++/qmake.conf +++ b/mkspecs/hpux-g++/qmake.conf @@ -43,8 +43,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = /usr/lib/X11R6 -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /opt/Mesa/include /usr/contrib/X11R6/include QMAKE_LIBDIR_OPENGL = /opt/Mesa/lib /usr/contrib/X11R6/lib @@ -76,14 +74,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/hpuxi-acc-32/qmake.conf b/mkspecs/hpuxi-acc-32/qmake.conf index 54295deadc..c17bda14d2 100644 --- a/mkspecs/hpuxi-acc-32/qmake.conf +++ b/mkspecs/hpuxi-acc-32/qmake.conf @@ -39,8 +39,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/include/X11R6 QMAKE_LIBDIR_X11 = /usr/lib/hpux32/X11R6 -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /opt/graphics/OpenGL/include /usr/contrib/X11R6/include QMAKE_LIBDIR_OPENGL = /opt/graphics/OpenGL/lib/hpux32 /usr/contrib/X11R6/lib/hpux32 @@ -68,14 +66,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/hpuxi-acc-64/qmake.conf b/mkspecs/hpuxi-acc-64/qmake.conf index 06749cd341..7505cc732a 100644 --- a/mkspecs/hpuxi-acc-64/qmake.conf +++ b/mkspecs/hpuxi-acc-64/qmake.conf @@ -82,8 +82,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/include/X11R6 QMAKE_LIBDIR_X11 = /usr/lib/hpux64/X11R6 -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /opt/graphics/OpenGL/include /usr/contrib/X11R6/include QMAKE_LIBDIR_OPENGL = /opt/graphics/OpenGL/lib/hpux64 /usr/contrib/X11R6/lib/hpux64 @@ -111,14 +109,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/hpuxi-g++-64/qmake.conf b/mkspecs/hpuxi-g++-64/qmake.conf index b9d04590f5..01d39fa025 100644 --- a/mkspecs/hpuxi-g++-64/qmake.conf +++ b/mkspecs/hpuxi-g++-64/qmake.conf @@ -48,8 +48,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = /usr/lib/hpux64 QMAKE_INCDIR_X11 = /usr/include/X11R6 QMAKE_LIBDIR_X11 = /usr/lib/hpux64/X11R6 -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /opt/graphics/OpenGL/include /usr/contrib/X11R6/include QMAKE_LIBDIR_OPENGL = /opt/graphics/OpenGL/lib/hpux64 /usr/contrib/X11R6/lib/hpux64 @@ -79,14 +77,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/hurd-g++/qmake.conf b/mkspecs/hurd-g++/qmake.conf index fda7ff2bf4..aeeac6565e 100644 --- a/mkspecs/hurd-g++/qmake.conf +++ b/mkspecs/hurd-g++/qmake.conf @@ -16,8 +16,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL @@ -45,19 +43,8 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_INSTALL_FILE = install -m 644 -p QMAKE_INSTALL_PROGRAM = install -m 755 -p diff --git a/mkspecs/irix-cc-64/qmake.conf b/mkspecs/irix-cc-64/qmake.conf index db824ad481..af102a0b67 100644 --- a/mkspecs/irix-cc-64/qmake.conf +++ b/mkspecs/irix-cc-64/qmake.conf @@ -75,8 +75,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -106,14 +104,5 @@ QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)so_locations $(OBJECTS_DIR)ii_files -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/irix-cc/qmake.conf b/mkspecs/irix-cc/qmake.conf index f11faa5627..684e2cf1cd 100644 --- a/mkspecs/irix-cc/qmake.conf +++ b/mkspecs/irix-cc/qmake.conf @@ -75,8 +75,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -106,14 +104,5 @@ QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)so_locations $(OBJECTS_DIR)ii_files -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/irix-g++-64/qmake.conf b/mkspecs/irix-g++-64/qmake.conf index dc1f127c72..915e3f6007 100644 --- a/mkspecs/irix-g++-64/qmake.conf +++ b/mkspecs/irix-g++-64/qmake.conf @@ -41,8 +41,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -76,14 +74,5 @@ QMAKE_RANLIB = QMAKE_CLEAN = so_locations -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/irix-g++/qmake.conf b/mkspecs/irix-g++/qmake.conf index 674ae6ec7e..2a7d964c16 100644 --- a/mkspecs/irix-g++/qmake.conf +++ b/mkspecs/irix-g++/qmake.conf @@ -41,8 +41,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -76,14 +74,5 @@ QMAKE_RANLIB = QMAKE_CLEAN = so_locations -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/linux-cxx/qmake.conf b/mkspecs/linux-cxx/qmake.conf index 87b361ca25..2c0eb68f13 100644 --- a/mkspecs/linux-cxx/qmake.conf +++ b/mkspecs/linux-cxx/qmake.conf @@ -40,8 +40,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -65,14 +63,5 @@ QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_AR = ar cqs QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/linux-ecc-64/qmake.conf b/mkspecs/linux-ecc-64/qmake.conf index d9b5772cbf..01c11ccd52 100644 --- a/mkspecs/linux-ecc-64/qmake.conf +++ b/mkspecs/linux-ecc-64/qmake.conf @@ -42,8 +42,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -72,14 +70,5 @@ QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)/ti_files -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index 5eb0650fbf..d29d4a5b73 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -49,8 +49,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -81,16 +79,6 @@ QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)/ti_files -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p - # pch support CONFIG += icc_pch_style QMAKE_PCH_OUTPUT_EXT = .pchi diff --git a/mkspecs/linux-kcc/qmake.conf b/mkspecs/linux-kcc/qmake.conf index 5326348c6a..5a484358e9 100644 --- a/mkspecs/linux-kcc/qmake.conf +++ b/mkspecs/linux-kcc/qmake.conf @@ -51,8 +51,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -81,14 +79,5 @@ QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)ti_files -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/linux-pgcc/qmake.conf b/mkspecs/linux-pgcc/qmake.conf index fe9e560692..dfe7f19a43 100644 --- a/mkspecs/linux-pgcc/qmake.conf +++ b/mkspecs/linux-pgcc/qmake.conf @@ -42,8 +42,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -70,14 +68,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/lynxos-g++/qmake.conf b/mkspecs/lynxos-g++/qmake.conf index 78d0b0019c..1b29b0966d 100644 --- a/mkspecs/lynxos-g++/qmake.conf +++ b/mkspecs/lynxos-g++/qmake.conf @@ -43,8 +43,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /usr/include/X11 QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/include/GL QMAKE_LIBDIR_OPENGL = @@ -73,16 +71,8 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p + include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/macx-xlc/qmake.conf b/mkspecs/macx-xlc/qmake.conf index 77c300a4ae..6e3639caa6 100644 --- a/mkspecs/macx-xlc/qmake.conf +++ b/mkspecs/macx-xlc/qmake.conf @@ -45,8 +45,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /System/Library/Frameworks/OpenGL.framework/Headers \ /System/Library/Frameworks/AGL.framework/Headers/ QMAKE_LIBDIR_OPENGL = @@ -81,16 +79,5 @@ QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = ranlib -s -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $$QMAKE_COPY -QMAKE_COPY_DIR = $$QMAKE_COPY -R -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/netbsd-g++/qmake.conf b/mkspecs/netbsd-g++/qmake.conf index f32ab5ff9c..9ca9f16b60 100644 --- a/mkspecs/netbsd-g++/qmake.conf +++ b/mkspecs/netbsd-g++/qmake.conf @@ -40,8 +40,6 @@ QMAKE_INCDIR = /usr/local/include QMAKE_LIBDIR = /usr/local/lib QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib @@ -71,14 +69,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = ranlib -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/openbsd-g++/qmake.conf b/mkspecs/openbsd-g++/qmake.conf index 5fba495b7c..8bb5515186 100644 --- a/mkspecs/openbsd-g++/qmake.conf +++ b/mkspecs/openbsd-g++/qmake.conf @@ -40,8 +40,6 @@ QMAKE_INCDIR = /usr/local/include QMAKE_LIBDIR = /usr/local/lib QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib @@ -72,14 +70,5 @@ QMAKE_AR = ar q QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = ranlib -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/sco-cc/qmake.conf b/mkspecs/sco-cc/qmake.conf index 45dac485fb..afa578122e 100644 --- a/mkspecs/sco-cc/qmake.conf +++ b/mkspecs/sco-cc/qmake.conf @@ -41,8 +41,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = /usr/X/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -66,14 +64,5 @@ QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/sco-g++/qmake.conf b/mkspecs/sco-g++/qmake.conf index b4839eb571..a9b6713d0b 100644 --- a/mkspecs/sco-g++/qmake.conf +++ b/mkspecs/sco-g++/qmake.conf @@ -40,8 +40,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -68,14 +66,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/solaris-cc-64/qmake.conf b/mkspecs/solaris-cc-64/qmake.conf index ab8a847175..a3a12e64ee 100644 --- a/mkspecs/solaris-cc-64/qmake.conf +++ b/mkspecs/solaris-cc-64/qmake.conf @@ -61,8 +61,6 @@ QMAKE_INCDIR = /usr/sfw/include QMAKE_LIBDIR = /usr/sfw/lib/64 QMAKE_INCDIR_X11 = /usr/openwin/include QMAKE_LIBDIR_X11 = /usr/openwin/lib/64 -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/openwin/include QMAKE_LIBDIR_OPENGL = /usr/openwin/lib/64 @@ -93,14 +91,5 @@ QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)Templates.DB $(OBJECTS_DIR)SunWS_cache -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/solaris-cc/qmake.conf b/mkspecs/solaris-cc/qmake.conf index aa3fb0df40..aef26477f6 100644 --- a/mkspecs/solaris-cc/qmake.conf +++ b/mkspecs/solaris-cc/qmake.conf @@ -44,8 +44,6 @@ QMAKE_INCDIR = /usr/sfw/include QMAKE_LIBDIR = /usr/sfw/lib QMAKE_INCDIR_X11 = /usr/openwin/include QMAKE_LIBDIR_X11 = /usr/openwin/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/openwin/include QMAKE_LIBDIR_OPENGL = /usr/openwin/lib @@ -76,14 +74,5 @@ QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)Templates.DB $(OBJECTS_DIR)SunWS_cache -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/solaris-g++-64/qmake.conf b/mkspecs/solaris-g++-64/qmake.conf index 71b235b001..59b0eeb9bd 100644 --- a/mkspecs/solaris-g++-64/qmake.conf +++ b/mkspecs/solaris-g++-64/qmake.conf @@ -63,8 +63,6 @@ QMAKE_INCDIR = /usr/sfw/include QMAKE_LIBDIR = /usr/sfw/lib/64 QMAKE_INCDIR_X11 = /usr/openwin/include QMAKE_LIBDIR_X11 = /usr/openwin/lib/64 -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/openwin/include QMAKE_LIBDIR_OPENGL = /usr/openwin/lib/64 @@ -95,14 +93,5 @@ QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/solaris-g++/qmake.conf b/mkspecs/solaris-g++/qmake.conf index 762d792ede..a080111471 100644 --- a/mkspecs/solaris-g++/qmake.conf +++ b/mkspecs/solaris-g++/qmake.conf @@ -46,8 +46,6 @@ QMAKE_INCDIR = /usr/sfw/include QMAKE_LIBDIR = /usr/sfw/lib QMAKE_INCDIR_X11 = /usr/openwin/include QMAKE_LIBDIR_X11 = /usr/openwin/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/openwin/include QMAKE_LIBDIR_OPENGL = /usr/openwin/lib @@ -78,14 +76,5 @@ QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/tru64-cxx/qmake.conf b/mkspecs/tru64-cxx/qmake.conf index 6854f24d0c..f2f5403d66 100644 --- a/mkspecs/tru64-cxx/qmake.conf +++ b/mkspecs/tru64-cxx/qmake.conf @@ -40,8 +40,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -67,14 +65,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/tru64-g++/qmake.conf b/mkspecs/tru64-g++/qmake.conf index a914ba1771..ff53757d71 100644 --- a/mkspecs/tru64-g++/qmake.conf +++ b/mkspecs/tru64-g++/qmake.conf @@ -40,8 +40,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -69,14 +67,5 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/unixware-cc/qmake.conf b/mkspecs/unixware-cc/qmake.conf index 45af184450..8300a044e9 100644 --- a/mkspecs/unixware-cc/qmake.conf +++ b/mkspecs/unixware-cc/qmake.conf @@ -43,8 +43,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = /usr/X/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -72,14 +70,5 @@ QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/unixware-g++/qmake.conf b/mkspecs/unixware-g++/qmake.conf index a1b0061852..f827be04bf 100644 --- a/mkspecs/unixware-g++/qmake.conf +++ b/mkspecs/unixware-g++/qmake.conf @@ -42,8 +42,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = /usr/X/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -71,14 +69,5 @@ QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p include(../common/unix.conf) load(qt_config) diff --git a/mkspecs/unsupported/integrity-ghs/qmake.conf b/mkspecs/unsupported/integrity-ghs/qmake.conf index f3d9e943e5..12891d5489 100644 --- a/mkspecs/unsupported/integrity-ghs/qmake.conf +++ b/mkspecs/unsupported/integrity-ghs/qmake.conf @@ -30,8 +30,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = @@ -52,14 +50,6 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cqs QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p +include(../../common/shell-unix.conf) load(qt_config) diff --git a/mkspecs/unsupported/linux-host-g++/qmake.conf b/mkspecs/unsupported/linux-host-g++/qmake.conf index ba3a1704bc..e791291e30 100644 --- a/mkspecs/unsupported/linux-host-g++/qmake.conf +++ b/mkspecs/unsupported/linux-host-g++/qmake.conf @@ -82,8 +82,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = QMAKE_LIBDIR_X11 = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = QMAKE_LIBDIR_OPENGL = QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL @@ -111,19 +109,8 @@ QMAKE_AR = host-ar cqs QMAKE_OBJCOPY = host-objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir QMAKE_STRIP = host-strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_INSTALL_FILE = install -m 644 -p QMAKE_INSTALL_PROGRAM = install -m 755 -p diff --git a/mkspecs/unsupported/qnx-X11-g++/qmake.conf b/mkspecs/unsupported/qnx-X11-g++/qmake.conf index 048f0f0ab8..6c87839d65 100644 --- a/mkspecs/unsupported/qnx-X11-g++/qmake.conf +++ b/mkspecs/unsupported/qnx-X11-g++/qmake.conf @@ -22,8 +22,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = /opt/X11R6/include QMAKE_LIBDIR_X11 = /opt/X11R6/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /opt/X11R6/include QMAKE_LIBDIR_OPENGL = /opt/X11R6/lib @@ -39,19 +37,7 @@ QMAKE_LIBS_NETWORK = -lsocket QMAKE_AR = ar cqs QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p + load(qt_config) diff --git a/mkspecs/unsupported/qws/qnx-641/qmake.conf b/mkspecs/unsupported/qws/qnx-641/qmake.conf index 0636ca7347..1d078b105f 100644 --- a/mkspecs/unsupported/qws/qnx-641/qmake.conf +++ b/mkspecs/unsupported/qws/qnx-641/qmake.conf @@ -66,9 +66,6 @@ QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD QMAKE_INCDIR = QMAKE_LIBDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] - QMAKE_LIBS = -lm -lz QMAKE_LIBS_DYNLOAD = @@ -79,19 +76,7 @@ QMAKE_LIBS_GUI += -lsocket QMAKE_AR = ntox86-ar cqs QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p + load(qt_config) diff --git a/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf b/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf index 608da6948e..512d37f76e 100644 --- a/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf +++ b/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf @@ -68,8 +68,6 @@ QMAKE_CXXFLAGS_THREAD = $$QMAKE_CLFAGS_THREAD QMAKE_INCDIR = QMAKE_LIBDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] #QMAKE_LIBS = -lunix QMAKE_LIBS = @@ -81,19 +79,7 @@ QMAKE_LIBS_GUI += -lsocket QMAKE_AR = ar cqs QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p + load(qt_config) diff --git a/mkspecs/unsupported/qws/qnx-i386-g++/qmake.conf b/mkspecs/unsupported/qws/qnx-i386-g++/qmake.conf index 395f4fe3bf..00a6a263e6 100644 --- a/mkspecs/unsupported/qws/qnx-i386-g++/qmake.conf +++ b/mkspecs/unsupported/qws/qnx-i386-g++/qmake.conf @@ -64,8 +64,6 @@ QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD QMAKE_INCDIR = QMAKE_LIBDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] #QMAKE_LIBS = -lunix QMAKE_LIBS = @@ -77,19 +75,7 @@ QMAKE_LIBS_GUI += -lsocket QMAKE_AR = ar cqs QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p + load(qt_config) diff --git a/mkspecs/unsupported/qws/qnx-ppc-g++/qmake.conf b/mkspecs/unsupported/qws/qnx-ppc-g++/qmake.conf index 433b09161f..23e326197a 100644 --- a/mkspecs/unsupported/qws/qnx-ppc-g++/qmake.conf +++ b/mkspecs/unsupported/qws/qnx-ppc-g++/qmake.conf @@ -64,8 +64,6 @@ QMAKE_CXXFLAGS_THREAD = $$QMAKE_CLFAGS_THREAD QMAKE_INCDIR = QMAKE_LIBDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] #QMAKE_LIBS = -lunix QMAKE_LIBS = @@ -77,19 +75,7 @@ QMAKE_LIBS_GUI += -lsocket QMAKE_AR = ar cqs QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p + load(qt_config) diff --git a/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf b/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf index 2bd6c005cd..41bdfb03c2 100644 --- a/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf +++ b/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf @@ -68,8 +68,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = $(WIND_HOME)/GSS/include QMAKE_LIBDIR_X11 = $(WIND_HOME)/GSS/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = $$QMAKE_INCDIR_X11 QMAKE_LIBDIR_OPENGL = $$QMAKE_LIBDIR_X11 @@ -87,19 +85,8 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_INSTALL_FILE = install -m 644 -p QMAKE_INSTALL_PROGRAM = install -m 755 -p diff --git a/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf b/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf index 3ed5190b90..69146423cc 100644 --- a/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf +++ b/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf @@ -68,8 +68,6 @@ QMAKE_INCDIR = QMAKE_LIBDIR = QMAKE_INCDIR_X11 = $(WIND_HOME)/GSS/include QMAKE_LIBDIR_X11 = $(WIND_HOME)/GSS/lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = $$QMAKE_INCDIR_X11 QMAKE_LIBDIR_OPENGL = $$QMAKE_LIBDIR_X11 @@ -86,19 +84,8 @@ QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_RANLIB = -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f - -QMAKE_COPY = cp -f -QMAKE_COPY_FILE = $(COPY) -QMAKE_COPY_DIR = $(COPY) -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p QMAKE_INSTALL_FILE = install -m 644 -p QMAKE_INSTALL_PROGRAM = install -m 755 -p diff --git a/mkspecs/unsupported/win32-borland/qmake.conf b/mkspecs/unsupported/win32-borland/qmake.conf index c1aa7e46ad..14835eb861 100644 --- a/mkspecs/unsupported/win32-borland/qmake.conf +++ b/mkspecs/unsupported/win32-borland/qmake.conf @@ -42,8 +42,6 @@ QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -x- QMAKE_INCDIR = QMAKE_LIBDIR = $(BCB)\\lib -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o$obj $src QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o$@ $< @@ -73,14 +71,5 @@ QMAKE_IDL = midl QMAKE_LIB = tlib /C /P256 QMAKE_RC = brcc32 -dQ_CC_BOR -QMAKE_ZIP = zip -r -9 - -QMAKE_COPY = copy /y -QMAKE_COPY_DIR = xcopy /s /q /y /i -QMAKE_MOVE = move -QMAKE_DEL_FILE = del -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = if not exist -QMAKE_MKDIR = mkdir - +include(../../common/shell-win32.conf) load(qt_config) diff --git a/mkspecs/unsupported/win32-g++-cross/qmake.conf b/mkspecs/unsupported/win32-g++-cross/qmake.conf index e057af2777..cc486f7a17 100644 --- a/mkspecs/unsupported/win32-g++-cross/qmake.conf +++ b/mkspecs/unsupported/win32-g++-cross/qmake.conf @@ -51,8 +51,6 @@ QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions QMAKE_INCDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< @@ -83,24 +81,14 @@ QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2 QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain QMAKE_SH = bash - MINGW_IN_SHELL = 1 -QMAKE_DIR_SEP = / -QMAKE_COPY = cp -QMAKE_STREAM_EDITOR = sed -QMAKE_COPY_DIR = cp -R -QMAKE_MOVE = mv -QMAKE_DEL_FILE = rm -f -QMAKE_MKDIR = mkdir -p -QMAKE_DEL_DIR = rmdir -QMAKE_SYMBOLIC_LINK = ln -s -QMAKE_CHK_DIR_EXISTS = test -d +include(../../common/shell-unix.conf) QMAKE_LIB = i686-pc-mingw32-ar -ru QMAKE_RC = i686-pc-mingw32-windres -QMAKE_ZIP = zip -r -9 QMAKE_STRIP = i686-pc-mingw32-strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded PKG_CONFIG = i686-pc-mingw32-pkg-config + load(qt_config) diff --git a/mkspecs/unsupported/win32-msvc2003/qmake.conf b/mkspecs/unsupported/win32-msvc2003/qmake.conf index 29681c1034..4eb1bb5bbf 100644 --- a/mkspecs/unsupported/win32-msvc2003/qmake.conf +++ b/mkspecs/unsupported/win32-msvc2003/qmake.conf @@ -40,8 +40,6 @@ QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc QMAKE_CXXFLAGS_EXCEPTIONS_OFF = QMAKE_INCDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$obj $src QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $< @@ -71,15 +69,7 @@ QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO QMAKE_RC = rc -QMAKE_ZIP = zip -r -9 - -QMAKE_COPY = copy /y -QMAKE_COPY_DIR = xcopy /s /q /y /i -QMAKE_MOVE = move -QMAKE_DEL_FILE = del -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = if not exist -QMAKE_MKDIR = mkdir +include(../../common/shell-win32.conf) VCPROJ_EXTENSION = .vcproj VCSOLUTION_EXTENSION = .sln diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index 1e98789d9d..de50a15e3a 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -51,8 +51,6 @@ QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions QMAKE_INCDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< @@ -85,29 +83,14 @@ QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain !isEmpty(QMAKE_SH) { MINGW_IN_SHELL = 1 QMAKE_DIR_SEP = / - QMAKE_QMAKE ~= s,\\\\,/, - QMAKE_COPY = cp - QMAKE_STREAM_EDITOR = sed - QMAKE_COPY_DIR = cp -r - QMAKE_MOVE = mv - QMAKE_DEL_FILE = rm - QMAKE_MKDIR = mkdir -p - QMAKE_DEL_DIR = rmdir - QMAKE_CHK_DIR_EXISTS = test -d + include(../common/shell-unix.conf) } else { - QMAKE_COPY = copy /y - QMAKE_COPY_DIR = xcopy /s /q /y /i - QMAKE_MOVE = move - QMAKE_DEL_FILE = del - QMAKE_MKDIR = mkdir - QMAKE_DEL_DIR = rmdir - QMAKE_CHK_DIR_EXISTS = if not exist + include(../common/shell-win32.conf) } QMAKE_IDL = midl QMAKE_LIB = ar -ru QMAKE_RC = windres -QMAKE_ZIP = zip -r -9 QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf index 8a7260aca0..58043e4717 100644 --- a/mkspecs/win32-icc/qmake.conf +++ b/mkspecs/win32-icc/qmake.conf @@ -40,8 +40,6 @@ QMAKE_CXXFLAGS_EXCEPTIONS_ON = -GX QMAKE_CXXFLAGS_EXCEPTIONS_OFF = QMAKE_INCDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$obj $src QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $< @@ -71,15 +69,7 @@ QMAKE_IDL = midl QMAKE_LIB = xilib /NOLOGO QMAKE_RC = rc -QMAKE_ZIP = zip -r -9 - -QMAKE_COPY = copy /y -QMAKE_COPY_DIR = xcopy /s /q /y /i -QMAKE_MOVE = move -QMAKE_DEL_FILE = del -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = if not exist -QMAKE_MKDIR = mkdir +include(../common/shell-win32.conf) DSP_EXTENSION = .dsp load(qt_config) diff --git a/mkspecs/win32-msvc11/qmake.conf b/mkspecs/win32-msvc11/qmake.conf index 0603c10f0c..2f663c69ab 100644 --- a/mkspecs/win32-msvc11/qmake.conf +++ b/mkspecs/win32-msvc11/qmake.conf @@ -85,15 +85,7 @@ QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO QMAKE_RC = rc -QMAKE_ZIP = zip -r -9 - -QMAKE_COPY = copy /y -QMAKE_COPY_DIR = xcopy /s /q /y /i -QMAKE_MOVE = move -QMAKE_DEL_FILE = del -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = if not exist -QMAKE_MKDIR = mkdir +include(../common/shell-win32.conf) VCPROJ_EXTENSION = .vcxproj VCSOLUTION_EXTENSION = .sln diff --git a/mkspecs/win32-msvc2005/qmake.conf b/mkspecs/win32-msvc2005/qmake.conf index e093ddfffb..01cfe0561d 100644 --- a/mkspecs/win32-msvc2005/qmake.conf +++ b/mkspecs/win32-msvc2005/qmake.conf @@ -47,8 +47,6 @@ QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc QMAKE_CXXFLAGS_EXCEPTIONS_OFF = QMAKE_INCDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$obj $src QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $< @@ -81,15 +79,7 @@ QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO QMAKE_RC = rc -QMAKE_ZIP = zip -r -9 - -QMAKE_COPY = copy /y -QMAKE_COPY_DIR = xcopy /s /q /y /i -QMAKE_MOVE = move -QMAKE_DEL_FILE = del -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = if not exist -QMAKE_MKDIR = mkdir +include(../common/shell-win32.conf) VCPROJ_EXTENSION = .vcproj VCSOLUTION_EXTENSION = .sln diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf index 71969ab6a2..904b57a4e8 100644 --- a/mkspecs/win32-msvc2008/qmake.conf +++ b/mkspecs/win32-msvc2008/qmake.conf @@ -49,8 +49,6 @@ QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc QMAKE_CXXFLAGS_EXCEPTIONS_OFF = QMAKE_INCDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$obj $src QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $< @@ -83,15 +81,7 @@ QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO QMAKE_RC = rc -QMAKE_ZIP = zip -r -9 - -QMAKE_COPY = copy /y -QMAKE_COPY_DIR = xcopy /s /q /y /i -QMAKE_MOVE = move -QMAKE_DEL_FILE = del -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = if not exist -QMAKE_MKDIR = mkdir +include(../common/shell-win32.conf) VCPROJ_EXTENSION = .vcproj VCSOLUTION_EXTENSION = .sln diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf index 9499cab729..3047146057 100644 --- a/mkspecs/win32-msvc2010/qmake.conf +++ b/mkspecs/win32-msvc2010/qmake.conf @@ -51,8 +51,6 @@ QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc QMAKE_CXXFLAGS_EXCEPTIONS_OFF = QMAKE_INCDIR = -QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$obj $src QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $< @@ -85,15 +83,7 @@ QMAKE_IDL = midl QMAKE_LIB = lib /NOLOGO QMAKE_RC = rc -QMAKE_ZIP = zip -r -9 - -QMAKE_COPY = copy /y -QMAKE_COPY_DIR = xcopy /s /q /y /i -QMAKE_MOVE = move -QMAKE_DEL_FILE = del -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = if not exist -QMAKE_MKDIR = mkdir +include(../common/shell-win32.conf) VCPROJ_EXTENSION = .vcxproj VCSOLUTION_EXTENSION = .sln diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index ad430e2930..b1df49aab3 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -13,7 +13,7 @@ OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \ mingw_make.o option.o winmakefile.o projectgenerator.o \ meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ borland_bmake.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o \ - gbuild.o + gbuild.o cesdkhandler.o #qt code QOBJS=qtextcodec.o qutfcodec.o qstring.o qstringbuilder.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \ @@ -36,7 +36,7 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge generators/mac/pbuilder_pbx.cpp generators/mac/xmloutput.cpp generators/metamakefile.cpp \ generators/makefiledeps.cpp option.cpp generators/win32/mingw_make.cpp generators/makefile.cpp \ generators/win32/msvc_vcproj.cpp generators/win32/msvc_vcxproj.cpp generators/win32/msvc_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp generators/win32/msvc_nmake.cpp generators/win32/borland_bmake.cpp \ - generators/integrity/gbuild.cpp \ + generators/integrity/gbuild.cpp generators/win32/cesdkhandler.cpp \ $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp \ $(SOURCE_PATH)/src/corelib/tools/qstring.cpp $(SOURCE_PATH)/src/corelib/io/qfile.cpp \ $(SOURCE_PATH)/src/corelib/io/qfiledevice.cpp \ @@ -160,6 +160,9 @@ msvc_vcxproj.o: $(QMKSRC)/generators/win32/msvc_vcxproj.cpp msvc_nmake.o: $(QMKSRC)/generators/win32/msvc_nmake.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< +cesdkhandler.o: $(QMKSRC)/generators/win32/cesdkhandler.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + pbuilder_pbx.o: $(QMKSRC)/generators/mac/pbuilder_pbx.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 029546f69d..ad6d4448d7 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -61,7 +61,7 @@ OBJS = project.obj main.obj makefile.obj unixmake.obj unixmake2.obj mingw makefiledeps.obj metamakefile.obj xmloutput.obj pbuilder_pbx.obj \ borland_bmake.obj msvc_nmake.obj msvc_vcproj.obj msvc_vcxproj.obj \ msvc_objectmodel.obj msbuild_objectmodel.obj registry.obj \ - gbuild.obj + gbuild.obj cesdkhandler.obj !IFDEF QMAKE_OPENSOURCE_EDITION CFLAGS = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index 1966a8bbbc..d06d958ca3 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -64,7 +64,8 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \ option.o winmakefile.o projectgenerator.o property.o meta.o \ makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ borland_bmake.o msvc_nmake.o msvc_vcproj.o msvc_vcxproj.o \ - msvc_objectmodel.o msbuild_objectmodel.o registry.o gbuild.o + msvc_objectmodel.o msbuild_objectmodel.o registry.o gbuild.o \ + cesdkhandler.o ifdef QMAKE_OPENSOURCE_EDITION CFLAGS += -DQMAKE_OPENSOURCE_EDITION diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index d37089ee35..83354b9114 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -93,17 +93,12 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const { - QString ret = "@$(CHK_DIR_EXISTS) "; + QString ret = "@" + chkdir + " "; if(escape) ret += escapeFilePath(dir); else ret += dir; - ret += " "; - if(isWindowsShell()) - ret += "$(MKDIR)"; - else - ret += "|| $(MKDIR)"; - ret += " "; + ret += " " + chkglue + "$(MKDIR) "; if(escape) ret += escapeFilePath(dir); else @@ -198,12 +193,12 @@ MakefileGenerator::initOutPaths() QHash<QString, QStringList> &v = project->variables(); //for shadow builds if(!v.contains("QMAKE_ABSOLUTE_SOURCE_PATH")) { - if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty() && + if (Option::mkfile::do_cache && !project->cacheFile().isEmpty() && v.contains("QMAKE_ABSOLUTE_SOURCE_ROOT")) { QString root = v["QMAKE_ABSOLUTE_SOURCE_ROOT"].first(); root = QDir::fromNativeSeparators(root); if(!root.isEmpty()) { - QFileInfo fi = fileInfo(Option::mkfile::cachefile); + QFileInfo fi = fileInfo(project->cacheFile()); if(!fi.makeAbsolute()) { QString cache_r = fi.path(), pwd = Option::output_dir; if(pwd.startsWith(cache_r) && !pwd.startsWith(root)) { @@ -431,6 +426,15 @@ MakefileGenerator::init() init_already = true; QHash<QString, QStringList> &v = project->variables(); + + chkdir = v["QMAKE_CHK_DIR_EXISTS"].join(" "); + chkfile = v["QMAKE_CHK_FILE_EXISTS"].join(" "); + if (chkfile.isEmpty()) // Backwards compat with Qt4 specs + chkfile = isWindowsShell() ? "if not exist" : "test -f"; + chkglue = v["QMAKE_CHK_EXISTS_GLUE"].join(" "); + if (chkglue.isEmpty()) // Backwards compat with Qt4 specs + chkglue = isWindowsShell() ? "" : "|| "; + QStringList &quc = v["QMAKE_EXTRA_COMPILERS"]; //make sure the COMPILERS are in the correct input/output chain order @@ -853,8 +857,8 @@ MakefileGenerator::init() } // escape qmake command - QStringList &qmk = project->values("QMAKE_QMAKE"); - qmk = escapeFilePaths(qmk); + project->values("QMAKE_QMAKE") = + escapeFilePaths(QStringList(Option::fixPathToTargetOS(Option::qmake_abslocation, false))); } bool @@ -1771,10 +1775,6 @@ MakefileGenerator::writeExtraTargets(QTextStream &t) if(!cmd.isEmpty()) t << "\n\t" << cmd; t << endl << endl; - - project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(targ); - project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(targ)) << deps.split(" ", QString::SkipEmptyParts); - project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(targ)) << cmd; } } @@ -1973,17 +1973,13 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QString cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList(tmp_out)); t << escapeDependencyPath(tmp_out) << ":"; - project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(tmp_out); // compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies if(project->values((*it) + ".CONFIG").indexOf("explicit_dependencies") != -1) { t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, Option::output_dir, Option::output_dir))); - project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << tmp_dep; } else { t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(escapeDependencyPaths(deps)); - project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << inputs << deps; } t << "\n\t" << cmd << endl << endl; - project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(tmp_out)) << cmd; continue; } for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { @@ -2087,9 +2083,6 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } t << escapeDependencyPath(out) << ": " << valList(escapeDependencyPaths(deps)) << "\n\t" << cmd << endl << endl; - project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(out); - project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(out)) << deps; - project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(out)) << cmd; } } t << "compiler_clean: " << clean_targets << endl << endl; @@ -2193,7 +2186,9 @@ QString MakefileGenerator::buildArgs(const QString &outdir) if(!Option::mkfile::do_dep_heuristics) ret += " -nodependheuristics"; if(!Option::mkfile::qmakespec_commandline.isEmpty()) - ret += " -spec " + specdir(outdir); + ret += " -spec " + specdir(outdir, 1); + if (!Option::mkfile::xqmakespec_commandline.isEmpty()) + ret += " -xspec " + specdir(outdir, 0); if (Option::target_mode_overridden) { if (Option::target_mode == Option::TARG_MACX_MODE) ret += " -macx"; @@ -2307,7 +2302,7 @@ MakefileGenerator::findSubDirsSubTargets() const if(!project->isEmpty(fixedSubdir + ".makefile")) { st->makefile = project->first(fixedSubdir + ".makefile"); } else { - st->makefile = "$(MAKEFILE)"; + st->makefile = "Makefile"; if(!st->profile.isEmpty()) { QString basename = st->in_directory; int new_slsh = basename.lastIndexOf(Option::dir_sep); @@ -2360,7 +2355,7 @@ void MakefileGenerator::writeSubDirs(QTextStream &t) { QList<SubTarget*> targets = findSubDirsSubTargets(); - t << "first: make_default" << endl; + t << "first: make_first" << endl; int flags = SubTargetInstalls; if(project->isActiveConfig("ordered")) flags |= SubTargetOrdered; @@ -2377,6 +2372,22 @@ void MakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &callPref } void +MakefileGenerator::writeSubTargetCall(QTextStream &t, + const QString &in_directory, const QString &in, const QString &out_directory, const QString &out, + const QString &out_directory_cdin, const QString &makefilein, const QString &out_directory_cdout) +{ + QString pfx; + if (!in.isEmpty()) { + if (!in_directory.isEmpty()) + t << "\n\t" << mkdir_p_asstring(out_directory); + pfx = "( " + chkfile + " " + out + " " + chkglue + + "$(QMAKE) " + in + buildArgs(in_directory) + " -o " + out + + " ) && "; + } + writeSubMakeCall(t, out_directory_cdin + pfx, makefilein, out_directory_cdout); +} + +void MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubTarget*> targets, int flags) { // blasted includes @@ -2405,8 +2416,6 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; t << "MOVE = " << var("QMAKE_MOVE") << endl; - t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl; - t << "MKDIR = " << var("QMAKE_MKDIR") << endl; t << "SUBTARGETS = "; // subtargets are sub-directory for(int target = 0; target < targets.size(); ++target) t << " \\\n\t\t" << targets.at(target)->target; @@ -2417,11 +2426,13 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT QStringList targetSuffixes; const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH"); if (!(flags & SubTargetSkipDefaultTargets)) { - targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean" + targetSuffixes << "make_first" << "all" << "clean" << "distclean" << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install") << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall"); } + bool dont_recurse = project->isActiveConfig("dont_recurse"); + // generate target rules for(int target = 0; target < targets.size(); ++target) { SubTarget *subtarget = targets.at(target); @@ -2434,11 +2445,6 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT if(!abs_source_path.isEmpty() && out_directory.startsWith(abs_source_path)) out_directory = Option::output_dir + out_directory.mid(abs_source_path.length()); - QString mkfile = subtarget->makefile; - if(!in_directory.isEmpty()) - mkfile.prepend(out_directory); - - QString in_directory_cdin, in_directory_cdout, out_directory_cdin, out_directory_cdout; #define MAKE_CD_IN_AND_OUT(directory) \ if(!directory.isEmpty()) { \ if(project->isActiveConfig("cd_change_global")) { \ @@ -2459,25 +2465,28 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT } else { \ directory ## _cdin = "\n\t"; \ } - MAKE_CD_IN_AND_OUT(in_directory); + + QString out_directory_cdin, out_directory_cdout; MAKE_CD_IN_AND_OUT(out_directory); + QString makefilein = " -f " + subtarget->makefile; + //qmake it + QString out; + QString in; if(!subtarget->profile.isEmpty()) { - QString out = subtarget->makefile; - QString in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute)); + out = subtarget->makefile; + in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute)); if(out.startsWith(in_directory)) out = out.mid(in_directory.length()); - t << mkfile << ": " << "\n\t"; - if(!in_directory.isEmpty()) { - t << mkdir_p_asstring(out_directory) - << out_directory_cdin - << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out - << in_directory_cdout << endl; + t << subtarget->target << "-qmake_all: "; + if (flags & SubTargetOrdered) { + if (target) + t << targets.at(target - 1)->target << "-qmake_all"; } else { - t << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out << endl; + if (!subtarget->depends.isEmpty()) + t << valGlue(subtarget->depends, QString(), "-qmake_all ", "-qmake_all"); } - t << subtarget->target << "-qmake_all: "; if(project->isEmpty("QMAKE_NOFORCE")) t << " FORCE"; t << "\n\t"; @@ -2485,21 +2494,24 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT t << mkdir_p_asstring(out_directory) << out_directory_cdin << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out - << in_directory_cdout << endl; + << out_directory_cdout; } else { - t << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out << endl; + t << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out; } + if (!dont_recurse) + writeSubMakeCall(t, out_directory_cdin, makefilein + " qmake_all", out_directory_cdout); + else + t << endl; } - QString makefilein = " -f " + subtarget->makefile; - { //actually compile - t << subtarget->target << ": " << mkfile; + t << subtarget->target << ":"; if(!subtarget->depends.isEmpty()) t << " " << valList(subtarget->depends); if(project->isEmpty("QMAKE_NOFORCE")) t << " FORCE"; - writeSubMakeCall(t, out_directory_cdin, makefilein, out_directory_cdout); + writeSubTargetCall(t, in_directory, in, out_directory, out, + out_directory_cdin, makefilein, out_directory_cdout); } for(int suffix = 0; suffix < targetSuffixes.size(); ++suffix) { @@ -2509,34 +2521,31 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT else if(s == "uninstall_subtargets") s = "uninstall"; else if(s == "make_first") - s = "first"; - else if(s == "make_default") s = QString(); if(flags & SubTargetOrdered) { - t << subtarget->target << "-" << targetSuffixes.at(suffix) << "-ordered: " << mkfile; + t << subtarget->target << "-" << targetSuffixes.at(suffix) << "-ordered:"; if(target) t << " " << targets.at(target-1)->target << "-" << targetSuffixes.at(suffix) << "-ordered "; if(project->isEmpty("QMAKE_NOFORCE")) t << " FORCE"; - writeSubMakeCall(t, out_directory_cdin, makefilein + " " + s, out_directory_cdout); + writeSubTargetCall(t, in_directory, in, out_directory, out, + out_directory_cdin, makefilein + " " + s, out_directory_cdout); } - t << subtarget->target << "-" << targetSuffixes.at(suffix) << ": " << mkfile; + t << subtarget->target << "-" << targetSuffixes.at(suffix) << ":"; if(!subtarget->depends.isEmpty()) t << " " << valGlue(subtarget->depends, QString(), "-" + targetSuffixes.at(suffix) + " ", "-"+targetSuffixes.at(suffix)); if(project->isEmpty("QMAKE_NOFORCE")) t << " FORCE"; - writeSubMakeCall(t, out_directory_cdin, makefilein + " " + s, out_directory_cdout); + writeSubTargetCall(t, in_directory, in, out_directory, out, + out_directory_cdin, makefilein + " " + s, out_directory_cdout); } } t << endl; if (!(flags & SubTargetSkipDefaultTargets)) { - if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1) - project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all"); - - writeMakeQmake(t); + writeMakeQmake(t, true); t << "qmake_all:"; if(!targets.isEmpty()) { @@ -2560,7 +2569,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT t << suffix << ":"; for(int target = 0; target < targets.size(); ++target) { SubTarget *subTarget = targets.at(target); - if((suffix == "make_first" || suffix == "make_default") + if (suffix == "make_first" && project->values(subTarget->name + ".CONFIG").indexOf("no_default_target") != -1) { continue; } @@ -2629,28 +2638,31 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT if(!recurse.contains(subtarget->name)) continue; - QString mkfile = subtarget->makefile; - if(!in_directory.isEmpty()) { - if(!out_directory.endsWith(Option::dir_sep)) - mkfile.prepend(out_directory + Option::dir_sep); - else - mkfile.prepend(out_directory); - } + QString out_directory_cdin, out_directory_cdout; MAKE_CD_IN_AND_OUT(out_directory); QString makefilein = " -f " + subtarget->makefile; + QString out; + QString in; + if (!subtarget->profile.isEmpty()) { + out = subtarget->makefile; + in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute)); + if (out.startsWith(in_directory)) + out = out.mid(in_directory.length()); + } + //write the rule/depends if(flags & SubTargetOrdered) { const QString dep = subtarget->target + "-" + (*qut_it) + "_ordered"; - t << dep << ": " << mkfile; + t << dep << ":"; if(target) t << " " << targets.at(target-1)->target << "-" << (*qut_it) << "_ordered "; deps += " " + dep; } else { const QString dep = subtarget->target + "-" + (*qut_it); - t << dep << ": " << mkfile; + t << dep << ":"; if(!subtarget->depends.isEmpty()) t << " " << valGlue(subtarget->depends, QString(), "-" + (*qut_it) + " ", "-" + (*qut_it)); deps += " " + dep; @@ -2661,12 +2673,8 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT sub_targ = project->first((*qut_it) + ".recurse_target"); //write the commands - if(!out_directory.isEmpty()) { - writeSubMakeCall(t, out_directory_cdin, makefilein + " " + sub_targ, - out_directory_cdout); - } else { - writeSubMakeCall(t, "\n\t", makefilein + " " + sub_targ, QString()); - } + writeSubTargetCall(t, in_directory, in, out_directory, out, + out_directory_cdin, makefilein + " " + sub_targ, out_directory_cdout); } } if(project->isEmpty("QMAKE_NOFORCE") && @@ -2688,7 +2696,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT } void -MakefileGenerator::writeMakeQmake(QTextStream &t) +MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll) { QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) { @@ -2702,8 +2710,12 @@ MakefileGenerator::writeMakeQmake(QTextStream &t) QString qmake = build_args(); if(!ofile.isEmpty() && !project->isActiveConfig("no_autoqmake")) { t << escapeFilePath(ofile) << ": " << escapeDependencyPath(fileFixify(pfile)) << " "; - if(Option::mkfile::do_cache) - t << escapeDependencyPath(fileFixify(Option::mkfile::cachefile)) << " "; + if (Option::mkfile::do_cache) { + if (!project->confFile().isEmpty()) + t << escapeDependencyPath(fileFixify(project->confFile())) << " "; + if (!project->cacheFile().isEmpty()) + t << escapeDependencyPath(fileFixify(project->cacheFile())) << " "; + } if(!specdir().isEmpty()) { if(exists(Option::fixPathToLocalOS(specdir()+QDir::separator()+"qmake.conf"))) t << escapeDependencyPath(specdir() + Option::dir_sep + "qmake.conf") << " "; @@ -2718,11 +2730,18 @@ MakefileGenerator::writeMakeQmake(QTextStream &t) } } if(project->first("QMAKE_ORIG_TARGET") != "qmake") { - t << "qmake: " << - project->values("QMAKE_INTERNAL_QMAKE_DEPS").join(" \\\n\t\t"); + t << "qmake:"; if(project->isEmpty("QMAKE_NOFORCE")) t << " FORCE"; t << "\n\t" << "@" << qmake << endl << endl; + if (!noDummyQmakeAll) { + t << "qmake_all:"; + if (project->isEmpty("QMAKE_NOFORCE")) + t << " FORCE"; + if (project->isActiveConfig("no_empty_targets")) + t << "\n\t" << "@cd ."; + t << endl << endl; + } } } } @@ -3046,13 +3065,14 @@ QStringList } QString -MakefileGenerator::specdir(const QString &outdir) +MakefileGenerator::specdir(const QString &outdir, int host_build) { #if 0 if(!spec.isEmpty()) return spec; #endif - spec = fileFixify(Option::mkfile::qmakespec, outdir); + spec = fileFixify((host_build >= 0 ? bool(host_build) : project->isHostBuild()) + ? Option::mkfile::qmakespec : Option::mkfile::xqmakespec, outdir); return spec; } @@ -3142,7 +3162,7 @@ MakefileGenerator::pkgConfigPrefix() const { if(!project->isEmpty("QMAKE_PKGCONFIG_PREFIX")) return project->first("QMAKE_PKGCONFIG_PREFIX"); - return QLibraryInfo::rawLocation(QLibraryInfo::PrefixPath); + return QLibraryInfo::rawLocation(QLibraryInfo::PrefixPath, QLibraryInfo::FinalPaths); } QString diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 5b64ea68fb..33602dcf80 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -81,6 +81,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo QString spec; bool init_opath_already, init_already, no_io; QHash<QString, bool> init_compiler_already; + QString chkdir, chkfile, chkglue; QString build_args(const QString &outdir=QString()); void checkMultipleDefinition(const QString &, const QString &); @@ -97,7 +98,7 @@ protected: void writeInstalls(QTextStream &t, const QString &installs, bool noBuild=false); void writeHeader(QTextStream &t); void writeSubDirs(QTextStream &t); - void writeMakeQmake(QTextStream &t); + void writeMakeQmake(QTextStream &t, bool noDummyQmakeAll = false); void writeExtraVariables(QTextStream &t); void writeExtraTargets(QTextStream &t); void writeExtraCompilerTargets(QTextStream &t); @@ -127,6 +128,9 @@ protected: SubTargetsNoFlags=0x00 }; QList<MakefileGenerator::SubTarget*> findSubDirsSubTargets() const; + void writeSubTargetCall(QTextStream &t, + const QString &in_directory, const QString &in, const QString &out_directory, const QString &out, + const QString &out_directory_cdin, const QString &makefilein, const QString &out_directory_cdout); virtual void writeSubMakeCall(QTextStream &t, const QString &outDirectory_cdin, const QString &makeFileIn, const QString &outDirectory_cdout); void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags); @@ -187,7 +191,7 @@ protected: //subclasses can use these to query information about how the generator was "run" QString buildArgs(const QString &outdir=QString()); - QString specdir(const QString &outdir=QString()); + QString specdir(const QString &outdir = QString(), int host_build = -1); virtual QStringList &findDependencies(const QString &file); virtual bool doDepends() const { return Option::mkfile::do_deps; } diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index c69d5a5812..a1ab4ada75 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -300,6 +300,8 @@ SubdirsMetaMakefileGenerator::init() bool recurse = Option::recursive == Option::QMAKE_RECURSIVE_YES || (Option::recursive == Option::QMAKE_RECURSIVE_DEFAULT && project->isRecursive()); + if (recurse && project->isActiveConfig("dont_recurse")) + recurse = false; if(recurse) { QString old_output_dir = Option::output_dir; QString old_output = Option::output.fileName(); @@ -336,7 +338,7 @@ SubdirsMetaMakefileGenerator::init() printf(" "); sub->input_dir = subdir.absolutePath(); if(subdir.isRelative() && old_output_dir != oldpwd) { - sub->output_dir = old_output_dir + "/" + subdir.path(); + sub->output_dir = old_output_dir + (subdir.path() != "." ? "/" + subdir.path() : QString()); printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData()); } else { //what about shadow builds? sub->output_dir = sub->input_dir; diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 856bf371a7..b8b4f1bbc5 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -103,8 +103,6 @@ UnixMakefileGenerator::init() MakefileGenerator::init(); if(project->isEmpty("MAKEFILE")) project->values("MAKEFILE").append("Makefile"); - if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1) - project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all"); return; /* subdirs is done */ } diff --git a/qmake/generators/win32/cesdkhandler.cpp b/qmake/generators/win32/cesdkhandler.cpp new file mode 100644 index 0000000000..de6a55112b --- /dev/null +++ b/qmake/generators/win32/cesdkhandler.cpp @@ -0,0 +1,127 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "cesdkhandler.h" + +#include <QtCore/QFile> +#include <QtCore/QDebug> +#include <QtCore/QXmlStreamReader> + +QT_BEGIN_NAMESPACE + +CeSdkInfo::CeSdkInfo() : m_major(0) , m_minor(0) +{ +} + +CeSdkHandler::CeSdkHandler() +{ +} + +bool CeSdkHandler::parse() +{ + // look at the file at %VCInstallDir%/vcpackages/WCE.VCPlatform.config + // and scan through all installed sdks... + m_list.clear(); + m_vcInstallDir = QString::fromLatin1(qgetenv("VCInstallDir")); + if (m_vcInstallDir.isEmpty()) + return false; + + QDir vStudioDir(m_vcInstallDir); + if (!vStudioDir.cd(QLatin1String("vcpackages"))) + return false; + + QFile configFile(vStudioDir.absoluteFilePath(QLatin1String("WCE.VCPlatform.config"))); + if (!configFile.open(QIODevice::ReadOnly)) + return false; + + QString currentElement; + CeSdkInfo currentItem; + QXmlStreamReader xml(&configFile); + while (!xml.atEnd()) { + xml.readNext(); + if (xml.isStartElement()) { + currentElement = xml.name().toString(); + if (currentElement == QLatin1String("Platform")) { + currentItem = CeSdkInfo(); + } else if (currentElement == QLatin1String("Directories")) { + QXmlStreamAttributes attr = xml.attributes(); + currentItem.m_include = fixPaths(attr.value(QLatin1String("Include")).toString()); + currentItem.m_lib = fixPaths(attr.value(QLatin1String("Library")).toString()); + currentItem.m_bin = fixPaths(attr.value(QLatin1String("Path")).toString()); + } + } else if (xml.isEndElement()) { + if (xml.name().toString() == QLatin1String("Platform")) + m_list.append(currentItem); + } else if (xml.isCharacters() && !xml.isWhitespace()) { + if (currentElement == QLatin1String("PlatformName")) + currentItem.m_name = xml.text().toString(); + else if (currentElement == QLatin1String("OSMajorVersion")) + currentItem.m_major = xml.text().toString().toInt(); + else if (currentElement == QLatin1String("OSMinorVersion")) + currentItem.m_minor = xml.text().toString().toInt(); + } + } + + if (xml.error() && xml.error() != QXmlStreamReader::PrematureEndOfDocumentError) { + qWarning() << "XML ERROR:" << xml.lineNumber() << ": " << xml.errorString(); + return false; + } + + return m_list.size() > 0 ? true : false; +} + +QString CeSdkHandler::fixPaths(QString path) const +{ + QRegExp searchStr(QLatin1String("(\\$\\(\\w+\\))")); + QString fixedString = path; + for (int index = fixedString.indexOf(searchStr, 0); + index >= 0; + index = fixedString.indexOf(searchStr, index)) { + const QString capture = searchStr.cap(0); + fixedString.replace(index, capture.length(), capture.toUpper()); + index += capture.length(); // don't count the zero terminator + fixedString.insert(index, '\\'); // the configuration file lacks a directory separator for env vars + ++index; + } + return fixedString; +} + +QT_END_NAMESPACE diff --git a/qmake/generators/win32/cesdkhandler.h b/qmake/generators/win32/cesdkhandler.h new file mode 100644 index 0000000000..8d35694e5d --- /dev/null +++ b/qmake/generators/win32/cesdkhandler.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CE_SDK_HANDLER_INCL +#define CE_SDK_HANDLER_INCL + +#include <QStringList> +#include <QDir> + +QT_BEGIN_NAMESPACE + +class CeSdkInfo +{ +public: + CeSdkInfo(); + inline QString name() const { return m_name; } + inline QString binPath() const { return m_bin; } + inline QString includePath() const { return m_include; } + inline QString libPath() const { return m_lib; } + inline bool isValid() const; + inline int majorVersion() const { return m_major; } + inline int minorVersion() const { return m_minor; } + inline bool isSupported() const { return m_major >= 5; } +private: + friend class CeSdkHandler; + QString m_name; + QString m_bin; + QString m_include; + QString m_lib; + int m_major; + int m_minor; +}; + +bool CeSdkInfo::isValid() const +{ + return !m_name.isEmpty() && + !m_bin.isEmpty() && + !m_include.isEmpty() && + !m_lib.isEmpty(); +} + +class CeSdkHandler +{ +public: + CeSdkHandler(); + bool parse(); + inline QList<CeSdkInfo> listAll() const { return m_list; } +private: + inline QString fixPaths(QString path) const; + QList<CeSdkInfo> m_list; + QString m_vcInstallDir; +}; + +QT_END_NAMESPACE + +#endif diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index db6651cb88..adf8883b01 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -41,6 +41,7 @@ #include "msvc_nmake.h" #include "option.h" +#include "cesdkhandler.h" #include <qregexp.h> #include <qhash.h> #include <qdir.h> @@ -76,6 +77,30 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) if(Option::mkfile::do_stub_makefile) return MakefileGenerator::writeStubMakefile(t); #endif + if (!project->isHostBuild()) { + const QHash<QString, QStringList> &variables = project->variables(); + if (variables.contains("XQMAKESPEC") + && !variables["XQMAKESPEC"].isEmpty() + && variables["XQMAKESPEC"].first().contains("wince", Qt::CaseInsensitive)) { + CeSdkHandler sdkhandler; + sdkhandler.parse(); + const QString sdkName = variables["CE_SDK"].join(" ") + + " (" + variables["CE_ARCH"].join(" ") + ")"; + const QList<CeSdkInfo> sdkList = sdkhandler.listAll(); + CeSdkInfo sdk; + foreach (const CeSdkInfo &info, sdkList) { + if (info.name().compare(sdkName, Qt::CaseInsensitive ) == 0) { + sdk = info; + break; + } + } + if (sdk.isValid()) { + t << "\nINCLUDE = " << sdk.includePath(); + t << "\nLIB = " << sdk.libPath(); + t << "\nPATH = " << sdk.binPath() << "\n"; + } + } + } writeNmakeParts(t); return MakefileGenerator::writeMakefile(t); } diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 951784ec28..b228917692 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -649,12 +649,15 @@ nextfile: t << _slnProjConfBeg; for(QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { QString platform = is64Bit ? "x64" : "Win32"; + QString xplatform = platform; if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) - platform = project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; - t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag1).arg(platform) << platform; - t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag2).arg(platform) << platform; - t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag1).arg(platform) << platform; - t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag2).arg(platform) << platform; + xplatform = project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; + if (!project->isHostBuild()) + platform = xplatform; + t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag1).arg(xplatform) << platform; + t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag2).arg(xplatform) << platform; + t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag1).arg(xplatform) << platform; + t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag2).arg(xplatform) << platform; } t << _slnProjConfEnd; t << _slnExtSections; @@ -858,7 +861,7 @@ void VcprojGenerator::initProject() } vcProject.Keyword = project->first("VCPROJ_KEYWORD"); - if (project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { + if (project->isHostBuild() || project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { vcProject.PlatformName = (is64Bit ? "x64" : "Win32"); } else { vcProject.PlatformName = project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; @@ -922,7 +925,7 @@ void VcprojGenerator::initConfiguration() if (conf.Name.isEmpty()) conf.Name = isDebug ? "Debug" : "Release"; conf.ConfigurationName = conf.Name; - if (project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { + if (project->isHostBuild() || project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { conf.Name += (is64Bit ? "|x64" : "|Win32"); } else { conf.Name += "|" + project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; @@ -948,7 +951,7 @@ void VcprojGenerator::initConfiguration() initPreBuildEventTools(); initPostBuildEventTools(); // Only deploy for CE projects - if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) + if (!project->isHostBuild() && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) initDeploymentTool(); initPreLinkEventTools(); @@ -1084,7 +1087,7 @@ void VcprojGenerator::initPostBuildEventTools() QString signature = !project->isEmpty("SIGNATURE_FILE") ? var("SIGNATURE_FILE") : var("DEFAULT_SIGNATURE"); bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") && - !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); + !project->isHostBuild() && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); if (useSignature) { conf.postBuild.CommandLine.prepend( QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\"")); @@ -1574,21 +1577,6 @@ QString VcprojGenerator::fixFilename(QString ofile) const return ofile; } -QString VcprojGenerator::findTemplate(QString file) -{ - QString ret; - if(!exists((ret = file)) && - !exists((ret = QString(Option::mkfile::qmakespec + "/" + file))) && - !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::HostDataPath) + "/win32-msvc.net/" + file))) && - !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::HostDataPath) + "/win32-msvc2002/" + file))) && - !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::HostDataPath) + "/win32-msvc2003/" + file))) && - !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::HostDataPath) + "/win32-msvc2005/" + file))) && - !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::HostDataPath) + "/win32-msvc2008/" + file)))) - return ""; - debug_msg(1, "Generator: MSVC.NET: Found template \'%s\'", ret.toLatin1().constData()); - return ret; -} - void VcprojGenerator::outputVariables() { #if 0 diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 30b149f8f5..416e233614 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -63,7 +63,6 @@ class VcprojGenerator : public Win32MakefileGenerator bool writeMakefile(QTextStream &); bool writeProjectMakefile(); - QString findTemplate(QString file); void init(); public: diff --git a/qmake/main.cpp b/qmake/main.cpp index 985afaa8e8..45672c67ee 100644 --- a/qmake/main.cpp +++ b/qmake/main.cpp @@ -163,10 +163,7 @@ int runQMake(int argc, char **argv) fn = fn.right(fn.length() - di - 1); } - if (!Option::prepareProject(fn)) { - exit_val = 3; - break; - } + Option::prepareProject(fn); // read project.. if(!project.read(fn)) { diff --git a/qmake/option.cpp b/qmake/option.cpp index b2a1e6982f..6eeddfd154 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -54,7 +54,6 @@ QT_BEGIN_NAMESPACE //convenience const char *Option::application_argv0 = 0; QString Option::prf_ext; -QString Option::js_ext; QString Option::prl_ext; QString Option::libtool_ext; QString Option::pkgcfg_ext; @@ -68,7 +67,6 @@ QString Option::obj_ext; QString Option::lex_ext; QString Option::yacc_ext; QString Option::pro_ext; -QString Option::mmp_ext; QString Option::dir_sep; QString Option::dirlist_sep; QString Option::h_moc_mod; @@ -107,6 +105,7 @@ QStringList Option::projfile::project_dirs; //QMAKE_GENERATE_MAKEFILE stuff QString Option::mkfile::qmakespec; +QString Option::mkfile::xqmakespec; int Option::mkfile::cachefile_depth = -1; bool Option::mkfile::do_deps = true; bool Option::mkfile::do_mocs = true; @@ -114,11 +113,12 @@ bool Option::mkfile::do_dep_heuristics = true; bool Option::mkfile::do_preprocess = false; bool Option::mkfile::do_stub_makefile = false; bool Option::mkfile::do_cache = true; -QString Option::mkfile::project_root; -QString Option::mkfile::project_build_root; +QString Option::mkfile::source_root; +QString Option::mkfile::build_root; QString Option::mkfile::cachefile; QStringList Option::mkfile::project_files; QString Option::mkfile::qmakespec_commandline; +QString Option::mkfile::xqmakespec_commandline; static Option::QMAKE_MODE default_mode(QString progname) { @@ -329,6 +329,9 @@ Option::parseCommandLine(int argc, char **argv, int skip) } else if(opt == "platform" || opt == "spec") { Option::mkfile::qmakespec = cleanSpec(argv[++x]); Option::mkfile::qmakespec_commandline = argv[x]; + } else if (opt == "xplatform" || opt == "xspec") { + Option::mkfile::xqmakespec = cleanSpec(argv[++x]); + Option::mkfile::xqmakespec_commandline = argv[x]; } else { fprintf(stderr, "***Unknown option -%s\n", opt.toLatin1().constData()); return Option::QMAKE_CMDLINE_SHOW_USAGE | Option::QMAKE_CMDLINE_ERROR; @@ -383,6 +386,9 @@ Option::parseCommandLine(int argc, char **argv, int skip) if (!user_configs.isEmpty()) Option::before_user_vars += "CONFIG += " + user_configs.join(" "); + if (Option::mkfile::xqmakespec.isEmpty()) + Option::mkfile::xqmakespec = Option::mkfile::qmakespec; + return Option::QMAKE_CMDLINE_SUCCESS; } @@ -414,7 +420,6 @@ Option::init(int argc, char **argv) Option::libtool_ext = ".la"; Option::pkgcfg_ext = ".pc"; Option::prf_ext = ".prf"; - Option::js_ext = ".js"; Option::ui_ext = ".ui"; Option::h_ext << ".h" << ".hpp" << ".hh" << ".hxx"; Option::c_ext << ".c"; @@ -430,7 +435,6 @@ Option::init(int argc, char **argv) Option::lex_ext = ".l"; Option::yacc_ext = ".y"; Option::pro_ext = ".pro"; - Option::mmp_ext = ".mmp"; #ifdef Q_OS_WIN Option::dirlist_sep = ";"; Option::shellPath = detectShellPath(); @@ -538,8 +542,13 @@ Option::init(int argc, char **argv) //last chance for defaults if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE || Option::qmake_mode == Option::QMAKE_GENERATE_PRL) { - if(Option::mkfile::qmakespec.isNull() || Option::mkfile::qmakespec.isEmpty()) + if (Option::mkfile::xqmakespec.isEmpty()) + Option::mkfile::xqmakespec = QString::fromLocal8Bit(qgetenv("XQMAKESPEC").constData()); + if (Option::mkfile::qmakespec.isEmpty()) { Option::mkfile::qmakespec = QString::fromLocal8Bit(qgetenv("QMAKESPEC").constData()); + if (Option::mkfile::xqmakespec.isEmpty()) + Option::mkfile::xqmakespec = Option::mkfile::qmakespec; + } //try REALLY hard to do it for them, lazy.. if(Option::mkfile::project_files.isEmpty()) { @@ -583,106 +592,27 @@ void Option::applyHostMode() } } -QStringList Option::mkspecPaths() -{ - QStringList ret; - const QString concat = QLatin1String("/mkspecs"); - - QByteArray qmakepath = qgetenv("QMAKEPATH"); - if (!qmakepath.isEmpty()) { - const QStringList lst = splitPathList(QString::fromLocal8Bit(qmakepath)); - for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it) - ret << ((*it) + concat); - } - if (!Option::mkfile::project_build_root.isEmpty()) - ret << Option::mkfile::project_build_root + concat; - if (!Option::mkfile::project_root.isEmpty()) - ret << Option::mkfile::project_root + concat; - ret << QLibraryInfo::location(QLibraryInfo::HostDataPath) + concat; - ret.removeDuplicates(); - return ret; -} - -bool Option::resolveSpec(QString *spec) +void Option::prepareProject(const QString &pfile) { - QString qmakespec = fixEnvVariables(*spec); - if (qmakespec.isEmpty()) - qmakespec = "default"; - if (QDir::isRelativePath(qmakespec)) { - QStringList mkspec_roots = mkspecPaths(); - debug_msg(2, "Looking for mkspec %s in (%s)", qmakespec.toLatin1().constData(), - mkspec_roots.join("::").toLatin1().constData()); - for (QStringList::ConstIterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { - QString mkspec = (*it) + QLatin1Char('/') + qmakespec; - if (QFile::exists(mkspec)) { - *spec = mkspec; - return true; - } - } - fprintf(stderr, "Could not find mkspecs for your QMAKESPEC(%s) after trying:\n\t%s\n", - qmakespec.toLatin1().constData(), mkspec_roots.join("\n\t").toLatin1().constData()); - return false; - } - return true; -} - -bool Option::prepareProject(const QString &pfile) -{ - mkfile::project_build_root.clear(); - if (mkfile::do_cache) { - if (mkfile::cachefile.isEmpty()) { //find it as it has not been specified - QDir dir(output_dir); - while (!dir.exists(QLatin1String(".qmake.cache"))) - if (dir.isRoot() || !dir.cdUp()) - goto no_cache; - mkfile::cachefile = dir.filePath(QLatin1String(".qmake.cache")); - mkfile::project_build_root = dir.path(); - } else { - QFileInfo fi(mkfile::cachefile); - mkfile::cachefile = QDir::cleanPath(fi.absoluteFilePath()); - mkfile::project_build_root = QDir::cleanPath(fi.absolutePath()); - } - - if (mkfile::qmakespec.isEmpty()) { - QMakeProject cproj; - if (!cproj.read(mkfile::cachefile, QMakeProject::ReadProFile)) - return false; - mkfile::qmakespec = cproj.first(QLatin1String("QMAKESPEC")); - } - } - no_cache: - QString srcpath = (pfile != "-") ? QDir::cleanPath(QFileInfo(pfile).absolutePath()) : qmake_getpwd(); - if (srcpath != output_dir || mkfile::project_build_root.isEmpty()) { - QDir srcdir(srcpath); - QDir dstdir(output_dir); - do { - if (!mkfile::project_build_root.isEmpty()) { - // If we already know the build root, just match up the source root with it. - if (dstdir.path() == mkfile::project_build_root) { - mkfile::project_root = srcdir.path(); - break; - } - } else { - // Look for mkspecs/ in source and build. First to win determines the root. - if (dstdir.exists("mkspecs") || srcdir.exists("mkspecs")) { - mkfile::project_build_root = dstdir.path(); - mkfile::project_root = srcdir.path(); - if (mkfile::project_root == mkfile::project_build_root) - mkfile::project_root.clear(); - break; - } - } - } while (!srcdir.isRoot() && srcdir.cdUp() && !dstdir.isRoot() && dstdir.cdUp()); + if (srcpath != output_dir) { + if (!srcpath.endsWith(QLatin1Char('/'))) + srcpath += QLatin1Char('/'); + QString dstpath = output_dir; + if (!dstpath.endsWith(QLatin1Char('/'))) + dstpath += QLatin1Char('/'); + int srcLen = srcpath.length(); + int dstLen = dstpath.length(); + int lastSl = 0; + while (++lastSl, srcpath.at(--srcLen) == dstpath.at(--dstLen)) + if (srcpath.at(srcLen) == QLatin1Char('/')) + lastSl = 1; + mkfile::source_root = srcpath.left(srcLen + lastSl); + mkfile::build_root = dstpath.left(dstLen + lastSl); } else { - mkfile::project_root.clear(); + mkfile::source_root.clear(); } - - if (!resolveSpec(&Option::mkfile::qmakespec)) - return false; - - return true; } bool Option::postProcessProject(QMakeProject *project) diff --git a/qmake/option.h b/qmake/option.h index 23384877fd..7b86d56e89 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -72,7 +72,6 @@ void warn_msg(QMakeWarn t, const char *fmt, ...); struct Option { //simply global convenience - static QString js_ext; static QString libtool_ext; static QString pkgcfg_ext; static QString prf_ext; @@ -94,7 +93,6 @@ struct Option static QString dirlist_sep; static QString sysenv_mod; static QString pro_ext; - static QString mmp_ext; static QString res_ext; static char field_sep; static const char *application_argv0; @@ -109,8 +107,7 @@ struct Option //both of these must be called.. static int init(int argc=0, char **argv=0); //parse cmdline static void applyHostMode(); - static QStringList mkspecPaths(); - static bool prepareProject(const QString &pfile); + static void prepareProject(const QString &pfile); static bool postProcessProject(QMakeProject *); enum StringFixFlags { @@ -198,27 +195,28 @@ struct Option //QMAKE_GENERATE_MAKEFILE options struct mkfile { static QString qmakespec; + static QString xqmakespec; static bool do_cache; static bool do_deps; static bool do_mocs; static bool do_dep_heuristics; static bool do_preprocess; static bool do_stub_makefile; - static QString project_root; - static QString project_build_root; + static QString source_root; + static QString build_root; static QString cachefile; static int cachefile_depth; static QStringList project_files; static QString qmakespec_commandline; + static QString xqmakespec_commandline; }; private: static int parseCommandLine(int, char **, int=0); - static bool resolveSpec(QString *spec); }; inline QString fixEnvVariables(const QString &x) { return Option::fixString(x, Option::FixEnvVars); } -inline QStringList splitPathList(const QString &paths) { return paths.split(Option::dirlist_sep); } +inline QStringList splitPathList(const QString &paths) { return paths.isEmpty() ? QStringList() : paths.split(Option::dirlist_sep); } QT_END_NAMESPACE diff --git a/qmake/project.cpp b/qmake/project.cpp index 3df80bc00d..3a34aef1a9 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -54,7 +54,11 @@ #include <qstack.h> #include <qdebug.h> #ifdef Q_OS_UNIX +#include <time.h> +#include <utime.h> +#include <errno.h> #include <unistd.h> +#include <sys/stat.h> #include <sys/utsname.h> #elif defined(Q_OS_WIN32) #include <windows.h> @@ -74,10 +78,12 @@ QT_BEGIN_NAMESPACE //expand functions enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST, - E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION, - E_FIND, E_SYSTEM, E_UNIQUE, E_QUOTE, E_ESCAPE_EXPAND, - E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_REPLACE, - E_SIZE, E_SORT_DEPENDS, E_RESOLVE_DEPENDS }; + E_SPRINTF, E_FORMAT_NUMBER, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION, + E_FIND, E_SYSTEM, E_UNIQUE, E_REVERSE, E_QUOTE, E_ESCAPE_EXPAND, + E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_VAL_ESCAPE, E_REPLACE, + E_SIZE, E_SORT_DEPENDS, E_RESOLVE_DEPENDS, E_ENUMERATE_VARS, + E_SHADOWED, E_ABSOLUTE_PATH, E_RELATIVE_PATH, E_CLEAN_PATH, E_NATIVE_PATH, + E_SHELL_QUOTE }; QHash<QString, ExpandFunc> qmake_expandFunctions() { static QHash<QString, ExpandFunc> *qmake_expand_functions = 0; @@ -92,6 +98,7 @@ QHash<QString, ExpandFunc> qmake_expandFunctions() qmake_expand_functions->insert("eval", E_EVAL); qmake_expand_functions->insert("list", E_LIST); qmake_expand_functions->insert("sprintf", E_SPRINTF); + qmake_expand_functions->insert("format_number", E_FORMAT_NUMBER); qmake_expand_functions->insert("join", E_JOIN); qmake_expand_functions->insert("split", E_SPLIT); qmake_expand_functions->insert("basename", E_BASENAME); @@ -100,17 +107,26 @@ QHash<QString, ExpandFunc> qmake_expandFunctions() qmake_expand_functions->insert("find", E_FIND); qmake_expand_functions->insert("system", E_SYSTEM); qmake_expand_functions->insert("unique", E_UNIQUE); + qmake_expand_functions->insert("reverse", E_REVERSE); qmake_expand_functions->insert("quote", E_QUOTE); qmake_expand_functions->insert("escape_expand", E_ESCAPE_EXPAND); qmake_expand_functions->insert("upper", E_UPPER); qmake_expand_functions->insert("lower", E_LOWER); qmake_expand_functions->insert("re_escape", E_RE_ESCAPE); + qmake_expand_functions->insert("val_escape", E_VAL_ESCAPE); qmake_expand_functions->insert("files", E_FILES); qmake_expand_functions->insert("prompt", E_PROMPT); qmake_expand_functions->insert("replace", E_REPLACE); qmake_expand_functions->insert("size", E_SIZE); qmake_expand_functions->insert("sort_depends", E_SORT_DEPENDS); qmake_expand_functions->insert("resolve_depends", E_RESOLVE_DEPENDS); + qmake_expand_functions->insert("enumerate_vars", E_ENUMERATE_VARS); + qmake_expand_functions->insert("shadowed", E_SHADOWED); + qmake_expand_functions->insert("absolute_path", E_ABSOLUTE_PATH); + qmake_expand_functions->insert("relative_path", E_RELATIVE_PATH); + qmake_expand_functions->insert("clean_path", E_CLEAN_PATH); + qmake_expand_functions->insert("native_path", E_NATIVE_PATH); + qmake_expand_functions->insert("shell_quote", E_SHELL_QUOTE); } return *qmake_expand_functions; } @@ -118,8 +134,9 @@ QHash<QString, ExpandFunc> qmake_expandFunctions() enum TestFunc { T_REQUIRES=1, T_GREATERTHAN, T_LESSTHAN, T_EQUALS, T_EXISTS, T_EXPORT, T_CLEAR, T_UNSET, T_EVAL, T_CONFIG, T_SYSTEM, T_RETURN, T_BREAK, T_NEXT, T_DEFINED, T_CONTAINS, T_INFILE, - T_COUNT, T_ISEMPTY, T_INCLUDE, T_LOAD, T_DEBUG, T_ERROR, - T_MESSAGE, T_WARNING, T_IF, T_OPTION }; + T_COUNT, T_ISEMPTY, T_INCLUDE, T_LOAD, + T_DEBUG, T_ERROR, T_MESSAGE, T_WARNING, T_LOG, + T_IF, T_OPTION, T_CACHE, T_MKPATH, T_WRITE_FILE, T_TOUCH }; QHash<QString, TestFunc> qmake_testFunctions() { static QHash<QString, TestFunc> *qmake_test_functions = 0; @@ -153,7 +170,12 @@ QHash<QString, TestFunc> qmake_testFunctions() qmake_test_functions->insert("error", T_ERROR); qmake_test_functions->insert("message", T_MESSAGE); qmake_test_functions->insert("warning", T_WARNING); + qmake_test_functions->insert("log", T_LOG); qmake_test_functions->insert("option", T_OPTION); + qmake_test_functions->insert("cache", T_CACHE); + qmake_test_functions->insert("mkpath", T_MKPATH); + qmake_test_functions->insert("write_file", T_WRITE_FILE); + qmake_test_functions->insert("touch", T_TOUCH); } return *qmake_test_functions; } @@ -164,6 +186,21 @@ struct parser_info { bool from_file; } parser; +static QString cached_source_root; +static QString cached_build_root; +static QStringList cached_qmakepath; +static QStringList cached_qmakefeatures; + +static QStringList *all_feature_roots[2] = { 0, 0 }; + +static void +invalidateFeatureRoots() +{ + for (int i = 0; i < 2; i++) + if (all_feature_roots[i]) + all_feature_roots[i]->clear(); +} + static QString remove_quotes(const QString &arg) { const ushort SINGLEQUOTE = '\''; @@ -528,7 +565,7 @@ static void qmake_error_msg(const QString &msg) 1) features/(unix|win32|macx)/ 2) features/ */ -QStringList qmake_feature_paths(QMakeProperty *prop=0) +QStringList qmake_feature_paths(QMakeProperty *prop, bool host_build) { const QString mkspecs_concat = QLatin1String("/mkspecs"); const QString base_concat = QLatin1String("/features"); @@ -551,36 +588,26 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0) concat << base_concat; } - QStringList feature_roots; - QByteArray mkspec_path = qgetenv("QMAKEFEATURES"); - if(!mkspec_path.isNull()) - feature_roots += splitPathList(QString::fromLocal8Bit(mkspec_path)); + QStringList feature_roots = splitPathList(QString::fromLocal8Bit(qgetenv("QMAKEFEATURES"))); + feature_roots += cached_qmakefeatures; if(prop) feature_roots += splitPathList(prop->value("QMAKEFEATURES")); - if(!Option::mkfile::cachefile.isEmpty()) { - QString path; - int last_slash = Option::mkfile::cachefile.lastIndexOf(QLatin1Char('/')); - if(last_slash != -1) - path = Option::normalizePath(Option::mkfile::cachefile.left(last_slash), false); + if (!cached_build_root.isEmpty()) for(QStringList::Iterator concat_it = concat.begin(); concat_it != concat.end(); ++concat_it) - feature_roots << (path + (*concat_it)); - } - QByteArray qmakepath = qgetenv("QMAKEPATH"); - if (!qmakepath.isNull()) { - const QStringList lst = splitPathList(QString::fromLocal8Bit(qmakepath)); - for(QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it) { - for(QStringList::Iterator concat_it = concat.begin(); - concat_it != concat.end(); ++concat_it) - feature_roots << ((*it) + mkspecs_concat + (*concat_it)); - } - } - if(!Option::mkfile::qmakespec.isEmpty()) { + feature_roots << (cached_build_root + (*concat_it)); + QStringList qmakepath = splitPathList(QString::fromLocal8Bit(qgetenv("QMAKEPATH"))); + qmakepath += cached_qmakepath; + foreach (const QString &path, qmakepath) + foreach (const QString &cat, concat) + feature_roots << (path + mkspecs_concat + cat); + QString *specp = host_build ? &Option::mkfile::qmakespec : &Option::mkfile::xqmakespec; + if (!specp->isEmpty()) { // The spec is already platform-dependent, so no subdirs here. - feature_roots << Option::mkfile::qmakespec + base_concat; + feature_roots << *specp + base_concat; // Also check directly under the root directory of the mkspecs collection - QFileInfo specfi(Option::mkfile::qmakespec); + QFileInfo specfi(*specp); QDir specrootdir(specfi.absolutePath()); while (!specrootdir.isRoot()) { const QString specrootpath = specrootdir.path(); @@ -596,26 +623,37 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0) } for(QStringList::Iterator concat_it = concat.begin(); concat_it != concat.end(); ++concat_it) - feature_roots << (QLibraryInfo::location(QLibraryInfo::HostDataPath) + + feature_roots << (QLibraryInfo::rawLocation(QLibraryInfo::HostDataPath, + QLibraryInfo::EffectivePaths) + mkspecs_concat + (*concat_it)); feature_roots.removeDuplicates(); return feature_roots; } +QStringList qmake_mkspec_paths() +{ + QStringList ret; + const QString concat = QLatin1String("/mkspecs"); + + QStringList qmakepath = splitPathList(QString::fromLocal8Bit(qgetenv("QMAKEPATH"))); + qmakepath += cached_qmakepath; + foreach (const QString &path, qmakepath) + ret << (path + concat); + if (!cached_build_root.isEmpty()) + ret << cached_build_root + concat; + if (!cached_source_root.isEmpty()) + ret << cached_source_root + concat; + ret << QLibraryInfo::rawLocation(QLibraryInfo::HostDataPath, QLibraryInfo::EffectivePaths) + concat; + ret.removeDuplicates(); + + return ret; +} + QMakeProject::~QMakeProject() { if(own_prop) delete prop; - for(QHash<QString, FunctionBlock*>::iterator it = replaceFunctions.begin(); it != replaceFunctions.end(); ++it) { - if(!it.value()->deref()) - delete it.value(); - } - replaceFunctions.clear(); - for(QHash<QString, FunctionBlock*>::iterator it = testFunctions.begin(); it != testFunctions.end(); ++it) { - if(!it.value()->deref()) - delete it.value(); - } - testFunctions.clear(); + cleanup(); } @@ -630,14 +668,29 @@ QMakeProject::init(QMakeProperty *p) own_prop = false; } recursive = false; + host_build = false; reset(); } +void +QMakeProject::cleanup() +{ + for (QHash<QString, FunctionBlock*>::iterator it = replaceFunctions.begin(); it != replaceFunctions.end(); ++it) + if (!it.value()->deref()) + delete it.value(); + replaceFunctions.clear(); + for (QHash<QString, FunctionBlock*>::iterator it = testFunctions.begin(); it != testFunctions.end(); ++it) + if (!it.value()->deref()) + delete it.value(); + testFunctions.clear(); +} + // Duplicate project. It is *not* allowed to call the complex read() functions on the copy. QMakeProject::QMakeProject(QMakeProject *p, const QHash<QString, QStringList> *_vars) { init(p->properties()); vars = _vars ? *_vars : p->variables(); + host_build = p->host_build; for(QHash<QString, FunctionBlock*>::iterator it = p->replaceFunctions.begin(); it != p->replaceFunctions.end(); ++it) { it.value()->ref(); replaceFunctions.insert(it.key(), it.value()); @@ -657,6 +710,7 @@ QMakeProject::reset() iterator = 0; function = 0; backslashWarned = false; + need_restart = false; } bool @@ -1164,8 +1218,6 @@ QMakeProject::parse(const QString &t, QHash<QString, QStringList> &place, int nu } if(var == "REQUIRES") // special case to get communicated to backends! doProjectCheckReqs(vallist, place); - else if (var == "_QMAKE_CACHE_") - Option::mkfile::cachefile = varlist.isEmpty() ? QString() : varlist.at(0); } return true; } @@ -1205,6 +1257,8 @@ QMakeProject::read(QTextStream &file, QHash<QString, QStringList> &place) } s = ""; numLines = 0; + if (need_restart) + break; } } } @@ -1250,7 +1304,7 @@ QMakeProject::read(const QString &file, QHash<QString, QStringList> &place) if(!using_stdin) qfile.close(); } - if(scope_blocks.count() != 1) { + if (!need_restart && scope_blocks.count() != 1) { qmake_error_msg("Unterminated conditional block at end of file"); ret = false; } @@ -1269,6 +1323,7 @@ QMakeProject::read(const QString &project, uchar cmd) bool QMakeProject::read(uchar cmd) { + again: if ((cmd & ReadSetup) && base_vars.isEmpty()) { // hack to get the Option stuff in there base_vars["QMAKE_EXT_CPP"] = Option::cpp_ext; @@ -1278,13 +1333,147 @@ QMakeProject::read(uchar cmd) if(!Option::user_template_prefix.isEmpty()) base_vars["TEMPLATE_PREFIX"] = QStringList(Option::user_template_prefix); + QString superdir; + QString project_root; + QString project_build_root; + QStringList qmakepath; + QStringList qmakefeatures; if (Option::mkfile::do_cache) { // parse the cache - if (Option::output_dir.startsWith(Option::mkfile::project_build_root)) + QHash<QString, QStringList> cache; + QString rdir = Option::output_dir; + forever { + QFileInfo qfi(rdir, QLatin1String(".qmake.super")); + if (qfi.exists()) { + superfile = qfi.filePath(); + if (!read(superfile, cache)) + return false; + superdir = rdir; + break; + } + QFileInfo qdfi(rdir); + if (qdfi.isRoot()) + break; + rdir = qdfi.path(); + } + if (Option::mkfile::cachefile.isEmpty()) { //find it as it has not been specified + QString sdir = qmake_getpwd(); + QString dir = Option::output_dir; + forever { + QFileInfo qsfi(sdir, QLatin1String(".qmake.conf")); + if (qsfi.exists()) { + conffile = qsfi.filePath(); + if (!read(conffile, cache)) + return false; + } + QFileInfo qfi(dir, QLatin1String(".qmake.cache")); + if (qfi.exists()) { + cachefile = qfi.filePath(); + if (!read(cachefile, cache)) + return false; + } + if (!conffile.isEmpty() || !cachefile.isEmpty()) { + project_root = sdir; + project_build_root = dir; + break; + } + if (dir == superdir) + goto no_cache; + QFileInfo qsdfi(sdir); + QFileInfo qdfi(dir); + if (qsdfi.isRoot() || qdfi.isRoot()) + goto no_cache; + sdir = qsdfi.path(); + dir = qdfi.path(); + } + } else { + QFileInfo fi(Option::mkfile::cachefile); + cachefile = QDir::cleanPath(fi.absoluteFilePath()); + if (!read(cachefile, cache)) + return false; + project_build_root = QDir::cleanPath(fi.absolutePath()); + // This intentionally bypasses finding a source root, + // as the result would be more or less arbitrary. + } + + if (Option::mkfile::xqmakespec.isEmpty() && !cache["XQMAKESPEC"].isEmpty()) + Option::mkfile::xqmakespec = cache["XQMAKESPEC"].first(); + if (Option::mkfile::qmakespec.isEmpty() && !cache["QMAKESPEC"].isEmpty()) { + Option::mkfile::qmakespec = cache["QMAKESPEC"].first(); + if (Option::mkfile::xqmakespec.isEmpty()) + Option::mkfile::xqmakespec = Option::mkfile::qmakespec; + } + qmakepath = cache.value(QLatin1String("QMAKEPATH")); + qmakefeatures = cache.value(QLatin1String("QMAKEFEATURES")); + + if (Option::output_dir.startsWith(project_build_root)) Option::mkfile::cachefile_depth = - Option::output_dir.mid(Option::mkfile::project_build_root.length()).count('/'); + Option::output_dir.mid(project_build_root.length()).count('/'); + } + no_cache: + + // Look for mkspecs/ in source and build. First to win determines the root. + QString sdir = qmake_getpwd(); + QString dir = Option::output_dir; + while (dir != project_build_root) { + if ((dir != sdir && QFileInfo(sdir, QLatin1String("mkspecs")).isDir()) + || QFileInfo(dir, QLatin1String("mkspecs")).isDir()) { + if (dir != sdir) + project_root = sdir; + project_build_root = dir; + break; + } + if (dir == superdir) + break; + QFileInfo qsdfi(sdir); + QFileInfo qdfi(dir); + if (qsdfi.isRoot() || qdfi.isRoot()) + break; + sdir = qsdfi.path(); + dir = qdfi.path(); + } + + if (qmakepath != cached_qmakepath || qmakefeatures != cached_qmakefeatures + || project_build_root != cached_build_root) { // No need to check source dir, as it goes in sync + cached_source_root = project_root; + cached_build_root = project_build_root; + cached_qmakepath = qmakepath; + cached_qmakefeatures = qmakefeatures; + invalidateFeatureRoots(); } + { // parse mkspec - QString qmakespec = Option::mkfile::qmakespec; + QString *specp = host_build ? &Option::mkfile::qmakespec : &Option::mkfile::xqmakespec; + QString qmakespec = *specp; + if (qmakespec.isEmpty()) + qmakespec = host_build ? "default-host" : "default"; + if (QDir::isRelativePath(qmakespec)) { + QStringList mkspec_roots = qmake_mkspec_paths(); + debug_msg(2, "Looking for mkspec %s in (%s)", qmakespec.toLatin1().constData(), + mkspec_roots.join("::").toLatin1().constData()); + bool found_mkspec = false; + for (QStringList::ConstIterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { + QString mkspec = (*it) + QLatin1Char('/') + qmakespec; + if (QFile::exists(mkspec)) { + found_mkspec = true; + *specp = qmakespec = mkspec; + break; + } + } + if (!found_mkspec) { + fprintf(stderr, "Could not find mkspecs for your QMAKESPEC(%s) after trying:\n\t%s\n", + qmakespec.toLatin1().constData(), mkspec_roots.join("\n\t").toLatin1().constData()); + return false; + } + } + + // We do this before reading the spec, so it can use module and feature paths from + // here without resorting to tricks. This is the only planned use case anyway. + if (!superfile.isEmpty()) { + debug_msg(1, "Project super cache file: reading %s", superfile.toLatin1().constData()); + read(superfile, base_vars); + } + + // parse qmake configuration while(qmakespec.endsWith(QLatin1Char('/'))) qmakespec.truncate(qmakespec.length()-1); QString spec = qmakespec + QLatin1String("/qmake.conf"); @@ -1295,9 +1484,13 @@ QMakeProject::read(uchar cmd) } validateModes(); - if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty()) { - debug_msg(1, "QMAKECACHE file: reading %s", Option::mkfile::cachefile.toLatin1().constData()); - read(Option::mkfile::cachefile, base_vars); + if (!conffile.isEmpty()) { + debug_msg(1, "Project config file: reading %s", conffile.toLatin1().constData()); + read(conffile, base_vars); + } + if (!cachefile.isEmpty()) { + debug_msg(1, "QMAKECACHE file: reading %s", cachefile.toLatin1().constData()); + read(cachefile, base_vars); } } } @@ -1347,6 +1540,11 @@ QMakeProject::read(uchar cmd) pfile += Option::pro_ext; if(!read(pfile, vars)) return false; + if (need_restart) { + base_vars.clear(); + cleanup(); + goto again; + } } if (cmd & ReadSetup) { @@ -1443,7 +1641,7 @@ QMakeProject::resolveSpec(QString *spec, const QString &qmakespec) { if (spec->isEmpty()) { *spec = QFileInfo(qmakespec).fileName(); - if (*spec == "default") { + if (*spec == "default" || *spec == "default-host") { #ifdef Q_OS_UNIX char buffer[1024]; int l = readlink(qmakespec.toLatin1().constData(), buffer, 1023); @@ -1492,9 +1690,14 @@ QMakeProject::isActiveConfig(const QString &x, bool regex, QHash<QString, QStrin return Option::target_mode == Option::TARG_WIN_MODE; } + if (x == "host_build") + return host_build ? "true" : "false"; + //mkspecs - static QString spec; - resolveSpec(&spec, Option::mkfile::qmakespec); + static QString hspec, xspec; + resolveSpec(&hspec, Option::mkfile::qmakespec); + resolveSpec(&xspec, Option::mkfile::xqmakespec); + const QString &spec = host_build ? hspec : xspec; QRegExp re(x, Qt::CaseSensitive, QRegExp::Wildcard); if((regex && re.exactMatch(spec)) || (!regex && spec == x)) return true; @@ -1546,17 +1749,18 @@ QMakeProject::doProjectTest(QString func, const QString ¶ms, QMakeProject::IncludeStatus QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QStringList> &place) { - enum { UnknownFormat, ProFormat, JSFormat } format = UnknownFormat; if(flags & IncludeFlagFeature) { if(!file.endsWith(Option::prf_ext)) file += Option::prf_ext; validateModes(); // init dir_sep if(file.indexOf(QLatin1Char('/')) == -1 || !QFile::exists(file)) { - static QStringList *feature_roots = 0; + QStringList *&feature_roots = all_feature_roots[host_build]; if(!feature_roots) { - feature_roots = new QStringList(qmake_feature_paths(prop)); + feature_roots = new QStringList; qmakeAddCacheClear(qmakeDeleteCacheClear<QStringList>, (void**)&feature_roots); } + if (feature_roots->isEmpty()) + *feature_roots = qmake_feature_paths(prop, host_build); debug_msg(2, "Looking for feature '%s' in (%s)", file.toLatin1().constData(), feature_roots->join("::").toLatin1().constData()); int start_root = 0; @@ -1576,18 +1780,13 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString } for(int root = start_root; root < feature_roots->size(); ++root) { QString prf(feature_roots->at(root) + QLatin1Char('/') + file); - if(QFile::exists(prf + Option::js_ext)) { - format = JSFormat; - file = prf + Option::js_ext; - break; - } else if(QFile::exists(prf)) { - format = ProFormat; + if (QFile::exists(prf)) { file = prf; - break; + goto foundf; } } - if(format == UnknownFormat) - return IncludeNoExist; + return IncludeNoExist; + foundf: ; } if(place["QMAKE_INTERNAL_INCLUDED_FEATURES"].indexOf(file) != -1) return IncludeFeatureAlreadyLoaded; @@ -1605,19 +1804,13 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString testName += file; if(QFile::exists(testName)) { file = testName; - break; + goto foundi; } } - } - if(format == UnknownFormat) { - if(QFile::exists(file)) { - if(file.endsWith(Option::js_ext)) - format = JSFormat; - else - format = ProFormat; - } else { - return IncludeNoExist; - } + return IncludeNoExist; + foundi: ; + } else if (!QFile::exists(file)) { + return IncludeNoExist; } if(Option::mkfile::do_preprocess) //nice to see this first.. fprintf(stderr, "#switching file %s(%s) - %s:%d\n", (flags & IncludeFlagFeature) ? "load" : "include", @@ -1637,10 +1830,7 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString } bool parsed = false; parser_info pi = parser; - if(format == JSFormat) { - warn_msg(WarnParser, "%s:%d: QtScript support disabled for %s.", - pi.file.toLatin1().constData(), pi.line_no, orig_file.toLatin1().constData()); - } else { + { if(flags & (IncludeFlagNewProject|IncludeFlagNewParser)) { // The "project's variables" are used in other places (eg. export()) so it's not // possible to use "place" everywhere. Instead just set variables and grab them later @@ -1675,6 +1865,199 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString return IncludeSuccess; } +static void +subAll(QStringList *val, const QStringList &diffval) +{ + foreach (const QString &dv, diffval) + val->removeAll(dv); +} + +inline static +bool isSpecialChar(ushort c) +{ + // Chars that should be quoted (TM). This includes: +#ifdef Q_OS_WIN + // - control chars & space + // - the shell meta chars "&()<>^| + // - the potential separators ,;= + static const uchar iqm[] = { + 0xff, 0xff, 0xff, 0xff, 0x45, 0x13, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10 + }; +#else + static const uchar iqm[] = { + 0xff, 0xff, 0xff, 0xff, 0xdf, 0x07, 0x00, 0xd8, + 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x78 + }; // 0-32 \'"$`<>|;&(){}*?#!~[] +#endif + + return (c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7))); +} + +inline static +bool hasSpecialChars(const QString &arg) +{ + for (int x = arg.length() - 1; x >= 0; --x) + if (isSpecialChar(arg.unicode()[x].unicode())) + return true; + return false; +} + +static QString +shellQuote(const QString &arg) +{ + if (!arg.length()) + return QString::fromLatin1("\"\""); + + QString ret(arg); + if (hasSpecialChars(ret)) { +#ifdef Q_OS_WIN + // Quotes are escaped and their preceding backslashes are doubled. + // It's impossible to escape anything inside a quoted string on cmd + // level, so the outer quoting must be "suspended". + ret.replace(QRegExp(QLatin1String("(\\\\*)\"")), QLatin1String("\"\\1\\1\\^\"\"")); + // The argument must not end with a \ since this would be interpreted + // as escaping the quote -- rather put the \ behind the quote: e.g. + // rather use "foo"\ than "foo\" + int i = ret.length(); + while (i > 0 && ret.at(i - 1) == QLatin1Char('\\')) + --i; + ret.insert(i, QLatin1Char('"')); + ret.prepend(QLatin1Char('"')); +#else // Q_OS_WIN + ret.replace(QLatin1Char('\''), QLatin1String("'\\''")); + ret.prepend(QLatin1Char('\'')); + ret.append(QLatin1Char('\'')); +#endif // Q_OS_WIN + } + return ret; +} + +static QString +quoteValue(const QString &val) +{ + QString ret; + ret.reserve(val.length()); + bool quote = val.isEmpty(); + bool escaping = false; + for (int i = 0, l = val.length(); i < l; i++) { + QChar c = val.unicode()[i]; + ushort uc = c.unicode(); + if (uc < 32) { + if (!escaping) { + escaping = true; + ret += QLatin1String("$$escape_expand("); + } + switch (uc) { + case '\r': + ret += QLatin1String("\\\\r"); + break; + case '\n': + ret += QLatin1String("\\\\n"); + break; + case '\t': + ret += QLatin1String("\\\\t"); + break; + default: + ret += QString::fromLatin1("\\\\x%1").arg(uc, 2, 16, QLatin1Char('0')); + break; + } + } else { + if (escaping) { + escaping = false; + ret += QLatin1Char(')'); + } + switch (uc) { + case '\\': + ret += QLatin1String("\\\\"); + break; + case '"': + ret += QLatin1String("\\\""); + break; + case '\'': + ret += QLatin1String("\\'"); + break; + case '$': + ret += QLatin1String("\\$"); + break; + case '#': + ret += QLatin1String("$${LITERAL_HASH}"); + break; + case 32: + quote = true; + // fallthrough + default: + ret += c; + break; + } + } + } + if (escaping) + ret += QLatin1Char(')'); + if (quote) { + ret.prepend(QLatin1Char('"')); + ret.append(QLatin1Char('"')); + } + return ret; +} + +static bool +writeFile(const QString &name, QIODevice::OpenMode mode, const QString &contents, QString *errStr) +{ + QByteArray bytes = contents.toLocal8Bit(); + QFile cfile(name); + if (!(mode & QIODevice::Append) && cfile.open(QIODevice::ReadOnly | QIODevice::Text)) { + if (cfile.readAll() == bytes) + return true; + cfile.close(); + } + if (!cfile.open(mode | QIODevice::WriteOnly | QIODevice::Text)) { + *errStr = cfile.errorString(); + return false; + } + cfile.write(bytes); + cfile.close(); + if (cfile.error() != QFile::NoError) { + *errStr = cfile.errorString(); + return false; + } + return true; +} + +static QByteArray +getCommandOutput(const QString &args) +{ + QByteArray out; + if (FILE *proc = QT_POPEN(args.toLatin1().constData(), "r")) { + while (!feof(proc)) { + char buff[10 * 1024]; + int read_in = int(fread(buff, 1, sizeof(buff), proc)); + if (!read_in) + break; + out += QByteArray(buff, read_in); + } + QT_PCLOSE(proc); + } + return out; +} + +#ifdef Q_OS_WIN +static QString windowsErrorCode() +{ + wchar_t *string = 0; + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPWSTR)&string, + 0, + NULL); + QString ret = QString::fromWCharArray(string); + LocalFree((HLOCAL)string); + return ret; +} +#endif + QStringList QMakeProject::doProjectExpand(QString func, const QString ¶ms, QHash<QString, QStringList> &place) @@ -1818,19 +2201,33 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, } else { QString file = Option::normalizePath(args[0]); + bool blob = false; + bool lines = false; bool singleLine = true; - if(args.count() > 1) - singleLine = (args[1].toLower() == "true"); - + if (args.count() > 1) { + if (!args.at(1).compare(QLatin1String("false"), Qt::CaseInsensitive)) + singleLine = false; + else if (!args.at(1).compare(QLatin1String("blob"), Qt::CaseInsensitive)) + blob = true; + else if (!args.at(1).compare(QLatin1String("lines"), Qt::CaseInsensitive)) + lines = true; + } QFile qfile(file); if(qfile.open(QIODevice::ReadOnly)) { QTextStream stream(&qfile); - while(!stream.atEnd()) { - ret += split_value_list(stream.readLine().trimmed()); - if(!singleLine) - ret += "\n"; + if (blob) { + ret += stream.readAll(); + } else { + while (!stream.atEnd()) { + if (lines) { + ret += stream.readLine(); + } else { + ret += split_value_list(stream.readLine().trimmed()); + if (!singleLine) + ret += "\n"; + } + } } - qfile.close(); } } break; } @@ -1897,6 +2294,79 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, ret = split_value_list(tmp); } break; } + case E_FORMAT_NUMBER: + if (args.count() > 2) { + fprintf(stderr, "%s:%d: format_number(number[, options...]) requires one or two arguments.\n", + parser.file.toLatin1().constData(), parser.line_no); + } else { + int ibase = 10; + int obase = 10; + int width = 0; + bool zeropad = false; + bool leftalign = false; + enum { DefaultSign, PadSign, AlwaysSign } sign = DefaultSign; + if (args.count() >= 2) { + foreach (const QString &opt, split_value_list(args.at(1))) { + if (opt.startsWith(QLatin1String("ibase="))) { + ibase = opt.mid(6).toInt(); + } else if (opt.startsWith(QLatin1String("obase="))) { + obase = opt.mid(6).toInt(); + } else if (opt.startsWith(QLatin1String("width="))) { + width = opt.mid(6).toInt(); + } else if (opt == QLatin1String("zeropad")) { + zeropad = true; + } else if (opt == QLatin1String("padsign")) { + sign = PadSign; + } else if (opt == QLatin1String("alwayssign")) { + sign = AlwaysSign; + } else if (opt == QLatin1String("leftalign")) { + leftalign = true; + } else { + fprintf(stderr, "%s:%d: format_number(): invalid format option %s.\n", + parser.file.toLatin1().constData(), parser.line_no, + opt.toLatin1().constData()); + goto formfail; + } + } + } + if (args.at(0).contains(QLatin1Char('.'))) { + fprintf(stderr, "%s:%d: format_number(): floats are currently not supported.\n", + parser.file.toLatin1().constData(), parser.line_no); + break; + } + bool ok; + qlonglong num = args.at(0).toLongLong(&ok, ibase); + if (!ok) { + fprintf(stderr, "%s:%d: format_number(): malformed number %s for base %d.\n", + parser.file.toLatin1().constData(), parser.line_no, + args.at(0).toLatin1().constData(), ibase); + break; + } + QString outstr; + if (num < 0) { + num = -num; + outstr = QLatin1Char('-'); + } else if (sign == AlwaysSign) { + outstr = QLatin1Char('+'); + } else if (sign == PadSign) { + outstr = QLatin1Char(' '); + } + QString numstr = QString::number(num, obase); + int space = width - outstr.length() - numstr.length(); + if (space <= 0) { + outstr += numstr; + } else if (leftalign) { + outstr += numstr + QString(space, QLatin1Char(' ')); + } else if (zeropad) { + outstr += QString(space, QLatin1Char('0')) + numstr; + } else { + outstr.prepend(QString(space, QLatin1Char(' '))); + outstr += numstr; + } + ret += outstr; + } + formfail: + break; case E_JOIN: { if(args.count() < 1 || args.count() > 4) { fprintf(stderr, "%s:%d: join(var, glue, before, after) requires four" @@ -1991,26 +2461,33 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, fprintf(stderr, "%s:%d system(execut) requires one argument.\n", parser.file.toLatin1().constData(), parser.line_no); } else { - char buff[256]; + bool blob = false; + bool lines = false; bool singleLine = true; - if(args.count() > 1) - singleLine = (args[1].toLower() == "true"); - QString output; - FILE *proc = QT_POPEN(args[0].toLatin1().constData(), "r"); - while(proc && !feof(proc)) { - int read_in = int(fread(buff, 1, 255, proc)); - if(!read_in) - break; - for(int i = 0; i < read_in; i++) { - if((singleLine && buff[i] == '\n') || buff[i] == '\t') - buff[i] = ' '; + if (args.count() > 1) { + if (!args.at(1).compare(QLatin1String("false"), Qt::CaseInsensitive)) + singleLine = false; + else if (!args.at(1).compare(QLatin1String("blob"), Qt::CaseInsensitive)) + blob = true; + else if (!args.at(1).compare(QLatin1String("lines"), Qt::CaseInsensitive)) + lines = true; + } + QByteArray bytes = getCommandOutput(args.at(0)); + if (lines) { + QTextStream stream(bytes); + while (!stream.atEnd()) + ret += stream.readLine(); + } else { + QString output = QString::fromLocal8Bit(bytes); + if (blob) { + ret += output; + } else { + output.replace(QLatin1Char('\t'), QLatin1Char(' ')); + if (singleLine) + output.replace(QLatin1Char('\n'), QLatin1Char(' ')); + ret += split_value_list(output); } - buff[read_in] = '\0'; - output += buff; } - ret += split_value_list(output); - if(proc) - QT_PCLOSE(proc); } break; } case E_UNIQUE: { @@ -2025,6 +2502,17 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, } } break; } + case E_REVERSE: + if (args.count() != 1) { + fprintf(stderr, "%s:%d reverse(var) requires one argument.\n", + parser.file.toLatin1().constData(), parser.line_no); + } else { + QStringList var = values(args.first(), place); + for (int i = 0; i < var.size() / 2; i++) + var.swap(i, var.size() - i - 1); + ret += var; + } + break; case E_QUOTE: ret = args; break; @@ -2064,6 +2552,17 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, for(int i = 0; i < args.size(); ++i) ret += QRegExp::escape(args[i]); break; } + case E_VAL_ESCAPE: + if (args.count() != 1) { + fprintf(stderr, "%s:%d val_escape(var) requires one argument.\n", + parser.file.toLatin1().constData(), parser.line_no); + } else { + QStringList vals = values(args.at(0), place); + ret.reserve(vals.length()); + foreach (const QString &str, vals) + ret += quoteValue(str); + } + break; case E_UPPER: case E_LOWER: { for(int i = 0; i < args.size(); ++i) { @@ -2181,6 +2680,53 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, } } break; } + case E_ENUMERATE_VARS: + ret += place.keys(); + break; + case E_SHADOWED: { + QString val = QDir::cleanPath(QFileInfo(args.at(0)).absoluteFilePath()); + if (Option::mkfile::source_root.isEmpty()) + ret += val; + else if (val.startsWith(Option::mkfile::source_root)) + ret += Option::mkfile::build_root + val.mid(Option::mkfile::source_root.length()); + break; } + case E_ABSOLUTE_PATH: + if (args.count() > 2) + fprintf(stderr, "%s:%d absolute_path(path[, base]) requires one or two arguments.\n", + parser.file.toLatin1().constData(), parser.line_no); + else + ret += QDir::cleanPath(QDir(args.count() > 1 ? args.at(1) : QString()) + .absoluteFilePath(args.at(0))); + break; + case E_RELATIVE_PATH: + if (args.count() > 2) + fprintf(stderr, "%s:%d relative_path(path[, base]) requires one or two arguments.\n", + parser.file.toLatin1().constData(), parser.line_no); + else + ret += QDir::cleanPath(QDir(args.count() > 1 ? args.at(1) : QString()) + .relativeFilePath(args.at(0))); + break; + case E_CLEAN_PATH: + if (args.count() != 1) + fprintf(stderr, "%s:%d clean_path(path) requires one argument.\n", + parser.file.toLatin1().constData(), parser.line_no); + else + ret += QDir::cleanPath(args.at(0)); + break; + case E_NATIVE_PATH: + if (args.count() != 1) + fprintf(stderr, "%s:%d native_path(path) requires one argument.\n", + parser.file.toLatin1().constData(), parser.line_no); + else + ret += Option::fixPathToTargetOS(args.at(0), false); + break; + case E_SHELL_QUOTE: + if (args.count() != 1) + fprintf(stderr, "%s:%d shell_quote(args) requires one argument.\n", + parser.file.toLatin1().constData(), parser.line_no); + else + ret += shellQuote(args.at(0)); + break; default: { fprintf(stderr, "%s:%d: Unknown replace function: %s\n", parser.file.toLatin1().constData(), parser.line_no, @@ -2448,6 +2994,8 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QHash<QS return testFunctions.contains(args[0]); else if(args[1] == "replace") return replaceFunctions.contains(args[0]); + else if(args[1] == "var") + return place.contains(args[0]); fprintf(stderr, "%s:%d: defined(function, type): unexpected type [%s].\n", parser.file.toLatin1().constData(), parser.line_no, args[1].toLatin1().constData()); @@ -2623,6 +3171,7 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QHash<QS QString msg = fixEnvVariables(args[1]); debug_msg(args[0].toInt(), "Project DEBUG: %s", msg.toLatin1().constData()); return true; } + case T_LOG: case T_ERROR: case T_MESSAGE: case T_WARNING: { @@ -2632,13 +3181,17 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QHash<QS return false; } QString msg = fixEnvVariables(args.first()); - fprintf(stderr, "Project %s: %s\n", func.toUpper().toLatin1().constData(), msg.toLatin1().constData()); - if(func == "error") + if (func_t == T_LOG) { + fputs(msg.toLatin1().constData(), stderr); + } else { + fprintf(stderr, "Project %s: %s\n", func.toUpper().toLatin1().constData(), msg.toLatin1().constData()); + if (func == "error") #if defined(QT_BUILD_QMAKE_LIBRARY) - return false; + return false; #else - exit(2); + exit(2); #endif + } return true; } case T_OPTION: if (args.count() != 1) { @@ -2648,6 +3201,11 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QHash<QS } if (args.first() == "recursive") { recursive = true; + } else if (args.first() == "host_build") { + if (!host_build && isActiveConfig("cross_compile")) { + host_build = true; + need_restart = true; + } } else { fprintf(stderr, "%s:%d: unrecognized option() argument '%s'.\n", parser.file.toLatin1().constData(), parser.line_no, @@ -2655,6 +3213,238 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QHash<QS return false; } return true; + case T_CACHE: { + if (args.count() > 3) { + fprintf(stderr, "%s:%d: cache(var, [set|add|sub] [transient] [super], [srcvar]) requires one to three arguments.\n", + parser.file.toLatin1().constData(), parser.line_no); + return false; + } + bool persist = true; + bool super = false; + enum { CacheSet, CacheAdd, CacheSub } mode = CacheSet; + QString srcvar; + if (args.count() >= 2) { + foreach (const QString &opt, split_value_list(args.at(1))) { + if (opt == QLatin1String("transient")) { + persist = false; + } else if (opt == QLatin1String("super")) { + super = true; + } else if (opt == QLatin1String("set")) { + mode = CacheSet; + } else if (opt == QLatin1String("add")) { + mode = CacheAdd; + } else if (opt == QLatin1String("sub")) { + mode = CacheSub; + } else { + fprintf(stderr, "%s:%d: cache(): invalid flag %s.\n", + parser.file.toLatin1().constData(), parser.line_no, + opt.toLatin1().constData()); + return false; + } + } + if (args.count() >= 3) { + srcvar = args.at(2); + } else if (mode != CacheSet) { + fprintf(stderr, "%s:%d: cache(): modes other than 'set' require a source variable.\n", + parser.file.toLatin1().constData(), parser.line_no); + return false; + } + } + QString varstr; + QString dstvar = args.at(0); + if (!dstvar.isEmpty()) { + if (srcvar.isEmpty()) + srcvar = dstvar; + if (!place.contains(srcvar)) { + fprintf(stderr, "%s:%d: variable %s is not defined.\n", + parser.file.toLatin1().constData(), parser.line_no, + srcvar.toLatin1().constData()); + return false; + } + // The current ("native") value can differ from the cached value, e.g., the current + // CONFIG will typically have more values than the cached one. Therefore we deal with + // them separately. + const QStringList diffval = values(srcvar, place); + const QStringList oldval = base_vars.value(dstvar); + QStringList newval; + if (mode == CacheSet) { + newval = diffval; + } else { + newval = oldval; + if (mode == CacheAdd) + newval += diffval; + else + subAll(&newval, diffval); + } + // We assume that whatever got the cached value to be what it is now will do so + // the next time as well, so it is OK that the early exit here will skip the + // persisting as well. + if (oldval == newval) + return true; + base_vars[dstvar] = newval; + do { + if (dstvar == "QMAKEPATH") + cached_qmakepath = newval; + else if (dstvar == "QMAKEFEATURES") + cached_qmakefeatures = newval; + else + break; + invalidateFeatureRoots(); + } while (false); + if (!persist) + return true; + varstr = dstvar; + if (mode == CacheAdd) + varstr += QLatin1String(" +="); + else if (mode == CacheSub) + varstr += QLatin1String(" -="); + else + varstr += QLatin1String(" ="); + if (diffval.count() == 1) { + varstr += QLatin1Char(' '); + varstr += quoteValue(diffval.at(0)); + } else if (!diffval.isEmpty()) { + foreach (const QString &vval, diffval) { + varstr += QLatin1String(" \\\n "); + varstr += quoteValue(vval); + } + } + varstr += QLatin1Char('\n'); + } + QString fn; + if (super) { + if (superfile.isEmpty()) { + superfile = Option::output_dir + QLatin1String("/.qmake.super"); + printf("Info: creating super cache file %s\n", superfile.toLatin1().constData()); + } + fn = superfile; + } else { + if (cachefile.isEmpty()) { + cachefile = Option::output_dir + QLatin1String("/.qmake.cache"); + printf("Info: creating cache file %s\n", cachefile.toLatin1().constData()); + if (cached_build_root.isEmpty()) { + cached_build_root = Option::output_dir; + cached_source_root = values("_PRO_FILE_PWD_", place).first(); + if (cached_source_root == cached_build_root) + cached_source_root.clear(); + invalidateFeatureRoots(); + } + } + fn = cachefile; + } + QFileInfo qfi(fn); + if (!QDir::current().mkpath(qfi.path())) { + fprintf(stderr, "%s:%d: ERROR creating cache directory %s\n", + parser.file.toLatin1().constData(), parser.line_no, + qfi.path().toLatin1().constData()); + return false; + } + QString errStr; + if (!writeFile(fn, QIODevice::Append, varstr, &errStr)) { + fprintf(stderr, "ERROR writing cache file %s: %s\n", + fn.toLatin1().constData(), errStr.toLatin1().constData()); +#if defined(QT_BUILD_QMAKE_LIBRARY) + return false; +#else + exit(2); +#endif + } + return true; } + case T_MKPATH: + if (args.count() != 1) { + fprintf(stderr, "%s:%d: mkpath(name) requires one argument.\n", + parser.file.toLatin1().constData(), parser.line_no); + return false; + } + if (!QDir::current().mkpath(args.at(0))) { + fprintf(stderr, "%s:%d: ERROR creating directory %s\n", + parser.file.toLatin1().constData(), parser.line_no, + QDir::toNativeSeparators(args.at(0)).toLatin1().constData()); + return false; + } + return true; + case T_WRITE_FILE: { + if (args.count() > 3) { + fprintf(stderr, "%s:%d: write_file(name, [content var, [append]]) requires one to three arguments.\n", + parser.file.toLatin1().constData(), parser.line_no); + return false; + } + QIODevice::OpenMode mode = QIODevice::Truncate; + QString contents; + if (args.count() >= 2) { + QStringList vals = values(args.at(1), place); + if (!vals.isEmpty()) + contents = vals.join(QLatin1String("\n")) + QLatin1Char('\n'); + if (args.count() >= 3) + if (!args.at(2).compare(QLatin1String("append"), Qt::CaseInsensitive)) + mode = QIODevice::Append; + } + QFileInfo qfi(args.at(0)); + if (!QDir::current().mkpath(qfi.path())) { + fprintf(stderr, "%s:%d: ERROR creating directory %s\n", + parser.file.toLatin1().constData(), parser.line_no, + qfi.path().toLatin1().constData()); + return false; + } + QString errStr; + if (!writeFile(args.at(0), mode, contents, &errStr)) { + fprintf(stderr, "%s:%d ERROR writing %s: %s\n", + parser.file.toLatin1().constData(), parser.line_no, + args.at(0).toLatin1().constData(), errStr.toLatin1().constData()); + return false; + } + return true; } + case T_TOUCH: { + if (args.count() != 2) { + fprintf(stderr, "%s:%d: touch(file, reffile) requires two arguments.\n", + parser.file.toLatin1().constData(), parser.line_no); + return false; + } +#ifdef Q_OS_UNIX + struct stat st; + if (stat(args.at(1).toLocal8Bit().constData(), &st)) { + fprintf(stderr, "%s:%d: ERROR: cannot stat() reference file %s: %s.\n", + parser.file.toLatin1().constData(), parser.line_no, + args.at(1).toLatin1().constData(), strerror(errno)); + return false; + } + struct utimbuf utb; + utb.actime = time(0); + utb.modtime = st.st_mtime; + if (utime(args.at(0).toLocal8Bit().constData(), &utb)) { + fprintf(stderr, "%s:%d: ERROR: cannot touch %s: %s.\n", + parser.file.toLatin1().constData(), parser.line_no, + args.at(0).toLatin1().constData(), strerror(errno)); + return false; + } +#else + HANDLE rHand = CreateFile((wchar_t*)args.at(1).utf16(), + GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (rHand == INVALID_HANDLE_VALUE) { + fprintf(stderr, "%s:%d: ERROR: cannot open() reference file %s: %s.\n", + parser.file.toLatin1().constData(), parser.line_no, + args.at(1).toLatin1().constData(), + windowsErrorCode().toLatin1().constData()); + return false; + } + FILETIME ft; + GetFileTime(rHand, 0, 0, &ft); + CloseHandle(rHand); + HANDLE wHand = CreateFile((wchar_t*)args.at(0).utf16(), + GENERIC_WRITE, FILE_SHARE_READ, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (wHand == INVALID_HANDLE_VALUE) { + fprintf(stderr, "%s:%d: ERROR: cannot open %s: %s.\n", + parser.file.toLatin1().constData(), parser.line_no, + args.at(0).toLatin1().constData(), + windowsErrorCode().toLatin1().constData()); + return false; + } + SetFileTime(wHand, 0, 0, &ft); + CloseHandle(wHand); +#endif + break; } default: fprintf(stderr, "%s:%d: Unknown test function: %s\n", parser.file.toLatin1().constData(), parser.line_no, func.toLatin1().constData()); @@ -2968,7 +3758,11 @@ QStringList &QMakeProject::values(const QString &_var, QHash<QString, QStringLis } else if(var == QLatin1String("_QMAKE_CACHE_")) { var = ".BUILTIN." + var; if(Option::mkfile::do_cache) - place[var] = QStringList(Option::mkfile::cachefile); + place[var] = QStringList(cachefile); + } else if(var == QLatin1String("_QMAKE_SUPER_CACHE_")) { + var = ".BUILTIN." + var; + if(Option::mkfile::do_cache && !superfile.isEmpty()) + place[var] = QStringList(superfile); } else if(var == QLatin1String("TEMPLATE")) { if(!Option::user_template.isEmpty()) { var = ".BUILTIN.USER." + var; @@ -3067,11 +3861,11 @@ QStringList &QMakeProject::values(const QString &_var, QHash<QString, QStringLis } } else if (var == QLatin1String("QMAKE_QMAKE")) { if (place[var].isEmpty()) - place[var] = QStringList(Option::fixPathToTargetOS( + place[var] = QStringList( !Option::qmake_abslocation.isEmpty() ? Option::qmake_abslocation - : QLibraryInfo::location(QLibraryInfo::HostBinariesPath) + "/qmake", - false)); + : QLibraryInfo::rawLocation(QLibraryInfo::HostBinariesPath, + QLibraryInfo::EffectivePaths) + "/qmake"); } #if defined(Q_OS_WIN32) && defined(Q_CC_MSVC) else if(var.startsWith(QLatin1String("QMAKE_TARGET."))) { diff --git a/qmake/project.h b/qmake/project.h index ccdc1b63f1..e733f6097c 100644 --- a/qmake/project.h +++ b/qmake/project.h @@ -79,8 +79,13 @@ class QMakeProject QHash<QString, FunctionBlock*> testFunctions, replaceFunctions; bool recursive; + bool host_build; + bool need_restart; bool own_prop; bool backslashWarned; + QString conffile; + QString superfile; + QString cachefile; QString pfile; QMakeProperty *prop; void reset(); @@ -107,6 +112,7 @@ class QMakeProject bool doVariableReplace(QString &str, QHash<QString, QStringList> &place); QStringList doVariableReplaceExpand(const QString &str, QHash<QString, QStringList> &place, bool *ok=0); void init(QMakeProperty *); + void cleanup(); QStringList &values(const QString &v, QHash<QString, QStringList> &place); void validateModes(); void resolveSpec(QString *spec, const QString &qmakespec); @@ -128,6 +134,8 @@ public: QStringList userTestFunctions() { return testFunctions.keys(); } QString projectFile(); + QString confFile() const { return conffile; } + QString cacheFile() const { return cachefile; } inline QMakeProperty *properties() { return prop; } bool doProjectTest(QString str, QHash<QString, QStringList> &place); @@ -160,6 +168,7 @@ public: QHash<QString, QStringList> &variables(); // No compat mapping and magic, obviously bool isRecursive() const { return recursive; } + bool isHostBuild() const { return host_build; } protected: friend class MakefileGenerator; diff --git a/qmake/property.cpp b/qmake/property.cpp index 1952b5069b..8d2e14ca11 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -49,6 +49,8 @@ QT_BEGIN_NAMESPACE +QStringList qmake_mkspec_paths(); //project.cpp + static const struct { const char *name; QLibraryInfo::LibraryLocation loc; @@ -77,7 +79,8 @@ QMakeProperty::QMakeProperty() : settings(0) { for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) { QString name = QString::fromLatin1(propList[i].name); - QString val = QLibraryInfo::rawLocation(propList[i].loc); + m_values[name + "/get"] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths); + QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths); if (!propList[i].raw) { m_values[name] = QLibraryInfo::location(propList[i].loc); name += "/raw"; @@ -115,7 +118,7 @@ QMakeProperty::value(QString v, bool just_check) if (!val.isNull()) return val; else if(v == "QMAKE_MKSPECS") - return Option::mkspecPaths().join(Option::dirlist_sep); + return qmake_mkspec_paths().join(Option::dirlist_sep); else if(v == "QMAKE_VERSION") return qmake_version(); #ifdef QT_VERSION_STR @@ -212,9 +215,12 @@ QMakeProperty::exec() foreach (QString prop, specialProps) { QString val = value(prop); QString pval = value(prop + "/raw"); + QString gval = value(prop + "/get"); fprintf(stdout, "%s:%s\n", prop.toLatin1().constData(), val.toLatin1().constData()); if (!pval.isEmpty() && pval != val) fprintf(stdout, "%s/raw:%s\n", prop.toLatin1().constData(), pval.toLatin1().constData()); + if (!gval.isEmpty() && gval != (pval.isEmpty() ? val : pval)) + fprintf(stdout, "%s/get:%s\n", prop.toLatin1().constData(), gval.toLatin1().constData()); } return true; } diff --git a/qmake/qmake.pri b/qmake/qmake.pri index cfa0c1359d..68b78f8d21 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -14,7 +14,8 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ generators/win32/msvc_vcproj.cpp \ generators/win32/msvc_vcxproj.cpp \ generators/win32/msvc_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp \ - generators/integrity/gbuild.cpp + generators/integrity/gbuild.cpp \ + generators/win32/cesdkhandler.cpp HEADERS += project.h property.h generators/makefile.h \ generators/unix/unixmake.h meta.h option.h cachekeys.h \ @@ -24,7 +25,8 @@ HEADERS += project.h property.h generators/makefile.h \ generators/win32/msvc_vcproj.h \ generators/win32/msvc_vcxproj.h \ generators/win32/msvc_objectmodel.h generators/win32/msbuild_objectmodel.h \ - generators/integrity/gbuild.h + generators/integrity/gbuild.h \ + generators/win32/cesdkhandler.h contains(QT_EDITION, OpenSource) { DEFINES += QMAKE_OPENSOURCE_EDITION diff --git a/qmake/qmake.pro b/qmake/qmake.pro index 5a5010ff6a..0693d9a4ac 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -3,6 +3,7 @@ #once you are boot strapped though, the qmake.pro will offer better coverage of a #platform than either of the generic makefiles +option(host_build) CONFIG += console bootstrap CONFIG -= qt shared app_bundle uic DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED diff --git a/qtbase.pro b/qtbase.pro index 5efe77e99d..ffb8d6a80c 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -21,15 +21,15 @@ contains(PROJECTS, qmake) { } contains(PROJECTS, libs) { PROJECTS -= libs - include(src/src.pro) + SUBDIRS += src } contains(PROJECTS, examples) { PROJECTS -= examples - SUBDIRS += examples + !fast:SUBDIRS += examples } contains(PROJECTS, tests) { PROJECTS -= tests - SUBDIRS += module_qtbase_tests + !fast:SUBDIRS += module_qtbase_tests } !isEmpty(PROJECTS) { message(Unknown PROJECTS: $$PROJECTS) @@ -118,15 +118,17 @@ INSTALLS += configtests mkspecs.path = $$[QT_HOST_DATA]/mkspecs mkspecs.files = $$OUT_PWD/mkspecs/qconfig.pri $$OUT_PWD/mkspecs/qmodule.pri $$OUT_PWD/mkspecs/qdevice.pri $$files($$PWD/mkspecs/*) mkspecs.files -= $$PWD/mkspecs/modules -unix { - DEFAULT_QMAKESPEC = $$QMAKESPEC - DEFAULT_QMAKESPEC ~= s,^.*mkspecs/,,g - mkspecs.commands += $(DEL_FILE) $(INSTALL_ROOT)$$mkspecs.path/default; $(SYMLINK) $$DEFAULT_QMAKESPEC $(INSTALL_ROOT)$$mkspecs.path/default - mkspecs.files -= $$PWD/mkspecs/default -} -win32:!equals(OUT_PWD, $$PWD) { +unix { + DEFAULT_QMAKESPEC = $$replace(QMAKESPEC, ^.*mkspecs/, ) + DEFAULT_XQMAKESPEC = $$replace(XQMAKESPEC, ^.*mkspecs/, ) + mkspecs.commands = \ + $(DEL_FILE) $(INSTALL_ROOT)$$mkspecs.path/default-host $(INSTALL_ROOT)$$mkspecs.path/default; \ + $(SYMLINK) $$DEFAULT_QMAKESPEC $(INSTALL_ROOT)$$mkspecs.path/default-host && \ + $(SYMLINK) $$DEFAULT_XQMAKESPEC $(INSTALL_ROOT)$$mkspecs.path/default + mkspecs.files -= $$PWD/mkspecs/default-host $$PWD/mkspecs/default +} else:!equals(OUT_PWD, $$PWD) { # When shadow building on Windows, the default mkspec only exists in the build tree. - mkspecs.files += $$OUT_PWD/mkspecs/default + mkspecs.files += $$OUT_PWD/mkspecs/default-host $$OUT_PWD/mkspecs/default } INSTALLS += mkspecs diff --git a/src/concurrent/concurrent.pro b/src/concurrent/concurrent.pro index b0809c8939..6b81950138 100644 --- a/src/concurrent/concurrent.pro +++ b/src/concurrent/concurrent.pro @@ -1,21 +1,14 @@ -load(qt_module) +load(qt_build_config) TARGET = QtConcurrent -QPRO_PWD = $$PWD QT = core-private +CONFIG += exceptions -CONFIG += module exceptions -MODULE_PRI = ../modules/qt_concurrent.pri - -DEFINES += QT_BUILD_CONCURRENT_LIB QT_NO_USING_NAMESPACE +DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000 -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore - load(qt_module_config) -HEADERS += $$QT_SOURCE_TREE/src/concurrent/qtconcurrentversion.h - PRECOMPILED_HEADER = ../corelib/global/qt_pch.h SOURCES += \ diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 545a94fdee..673d34b548 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -1,21 +1,18 @@ -load(qt_module) +load(qt_build_config) TARGET = QtCore -QPRO_PWD = $$PWD QT = +CONFIG += exceptions -CONFIG += module exceptions MODULE = core # not corelib, as per project file -MODULE_PRI = ../modules/qt_core.pri +MODULE_CONFIG = moc resources -DEFINES += QT_BUILD_CORE_LIB QT_NO_USING_NAMESPACE +DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused load(qt_module_config) -HEADERS += $$QT_SOURCE_TREE/src/corelib/qtcoreversion.h - QMAKE_DOCS = $$PWD/doc/qtcore.qdocconf QMAKE_DOCS_INDEX = ../../doc @@ -50,3 +47,27 @@ QMAKE_LIBS += $$QMAKE_LIBS_CORE QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtCore.dynlist contains(DEFINES,QT_EVAL):include(eval.pri) + +load(moc) +load(resources) + +moc_dir.name = moc_location +moc_dir.variable = QMAKE_MOC + +rcc_dir.name = rcc_location +rcc_dir.variable = QMAKE_RCC + +QMAKE_PKGCONFIG_VARIABLES += moc_dir rcc_dir + +# These are aliens, but Linguist installs no own module, and it fits here best. + +qtPrepareTool(QMAKE_LUPDATE, lupdate) +qtPrepareTool(QMAKE_LRELEASE, lrelease) + +lupdate_dir.name = lupdate_location +lupdate_dir.variable = QMAKE_LUPDATE + +lrelease_dir.name = lrelease_location +lrelease_dir.variable = QMAKE_LRELEASE + +QMAKE_PKGCONFIG_VARIABLES += lupdate_dir lrelease_dir diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 801b4d94cd..1bd17ce9ff 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -70,6 +70,10 @@ struct QLibrarySettings { QLibrarySettings(); QScopedPointer<QSettings> settings; +#ifdef QT_BUILD_QMAKE + bool haveEffectivePaths; + bool havePaths; +#endif }; Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings) @@ -77,12 +81,21 @@ class QLibraryInfoPrivate { public: static QSettings *findConfiguration(); +#ifndef QT_BUILD_QMAKE static void cleanup() { QLibrarySettings *ls = qt_library_settings(); if (ls) ls->settings.reset(0); } +#else + static bool haveGroup(QLibraryInfo::PathGroup group) + { + QLibrarySettings *ls = qt_library_settings(); + return ls ? (group == QLibraryInfo::EffectivePaths + ? ls->haveEffectivePaths : ls->havePaths) : false; + } +#endif static QSettings *configuration() { QLibrarySettings *ls = qt_library_settings(); @@ -95,7 +108,25 @@ QLibrarySettings::QLibrarySettings() { #ifndef QT_BUILD_QMAKE qAddPostRoutine(QLibraryInfoPrivate::cleanup); + bool haveEffectivePaths; + bool havePaths; +#endif + if (settings) { + // This code needs to be in the regular library, as otherwise a qt.conf that + // works for qmake would break things for dynamically built Qt tools. + QStringList children = settings->childGroups(); + haveEffectivePaths = children.contains(QLatin1String("EffectivePaths")); + // Backwards compat: an existing but empty file is claimed to contain the Paths section. + havePaths = !haveEffectivePaths || children.contains(QLatin1String("Paths")); +#ifndef QT_BUILD_QMAKE + if (!havePaths) + settings.reset(0); +#else + } else { + haveEffectivePaths = false; + havePaths = false; #endif + } } QSettings *QLibraryInfoPrivate::findConfiguration() @@ -244,11 +275,11 @@ QString QLibraryInfo::location(LibraryLocation loc) { #ifdef QT_BUILD_QMAKE - QString ret = rawLocation(loc); + QString ret = rawLocation(loc, FinalPaths); // Automatically prepend the sysroot to target paths if (loc < SysrootPath || loc > LastHostPath) { - QString sysroot = rawLocation(SysrootPath); + QString sysroot = rawLocation(SysrootPath, FinalPaths); if (!sysroot.isEmpty() && ret.length() > 2 && ret.at(1) == QLatin1Char(':') && (ret.at(2) == QLatin1Char('/') || ret.at(2) == QLatin1Char('\\'))) ret.replace(0, 2, sysroot); // Strip out the drive on Windows targets @@ -260,13 +291,25 @@ QLibraryInfo::location(LibraryLocation loc) } QString -QLibraryInfo::rawLocation(LibraryLocation loc) +QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) { #else -# define rawLocation location +# define rawLocation(loca, group) location(loca) +# define group dummy #endif QString ret; - if(!QLibraryInfoPrivate::configuration()) { +#ifdef QT_BUILD_QMAKE + // Logic for choosing the right data source: if EffectivePaths are requested + // and qt.conf with that section is present, use it, otherwise fall back to + // FinalPaths. For FinalPaths, use qt.conf if present and contains not only + // [EffectivePaths], otherwise fall back to builtins. + if (!QLibraryInfoPrivate::haveGroup(group) + && (group == FinalPaths + || !(group = FinalPaths, QLibraryInfoPrivate::haveGroup(FinalPaths)))) +#else + if (!QLibraryInfoPrivate::configuration()) +#endif + { const char *path = 0; if (loc >= 0 && loc < sizeof(qt_configure_prefix_path_strs)/sizeof(qt_configure_prefix_path_strs[0])) path = qt_configure_prefix_path_strs[loc] + 12; @@ -291,7 +334,11 @@ QLibraryInfo::rawLocation(LibraryLocation loc) if(!key.isNull()) { QSettings *config = QLibraryInfoPrivate::configuration(); - config->beginGroup(QLatin1String("Paths")); + config->beginGroup(QLatin1String( +#ifdef QT_BUILD_QMAKE + group == EffectivePaths ? "EffectivePaths" : +#endif + "Paths")); ret = config->value(key, defaultValue).toString(); @@ -312,6 +359,8 @@ QLibraryInfo::rawLocation(LibraryLocation loc) } config->endGroup(); + + ret = QDir::fromNativeSeparators(ret); } } @@ -325,7 +374,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc) baseDir = QFileInfo(qmake_libraryInfoFile()).absolutePath(); } else if (loc > SysrootPath && loc <= LastHostPath) { // We make any other host path absolute to the host prefix directory. - baseDir = rawLocation(HostPrefixPath); + baseDir = rawLocation(HostPrefixPath, group); #else if (loc == PrefixPath) { if (QCoreApplication::instance()) { @@ -347,7 +396,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc) #endif } else { // we make any other path absolute to the prefix directory - baseDir = rawLocation(PrefixPath); + baseDir = rawLocation(PrefixPath, group); } ret = QDir::cleanPath(baseDir + QLatin1Char('/') + ret); } diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index 5666afbad8..5861b4b8bd 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -90,7 +90,8 @@ public: }; static QString location(LibraryLocation); // ### Qt 6: consider renaming it to path() #ifdef QT_BUILD_QMAKE - static QString rawLocation(LibraryLocation); + enum PathGroup { FinalPaths, EffectivePaths }; + static QString rawLocation(LibraryLocation, PathGroup); #endif private: diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index b1a3e12e1f..0360d654e6 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -1,14 +1,11 @@ -load(qt_module) +load(qt_build_config) TARGET = QtDBus -QPRO_PWD = $$PWD QT = core-private +CONFIG += link_pkgconfig +MODULE_CONFIG = dbusadaptors dbusinterfaces -CONFIG += link_pkgconfig module -MODULE_PRI = ../modules/qt_dbus.pri - -DEFINES += QT_BUILD_DBUS_LIB \ - DBUS_API_SUBJECT_TO_CHANGE +DEFINES += DBUS_API_SUBJECT_TO_CHANGE QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS contains(QT_CONFIG, dbus-linked) { LIBS_PRIVATE += $$QT_LIBS_DBUS @@ -16,12 +13,6 @@ contains(QT_CONFIG, dbus-linked) { } # INCLUDEPATH += . -unix|win32-g++* { - QMAKE_PKGCONFIG_DESCRIPTION = Qt \ - DBus \ - module - QMAKE_PKGCONFIG_REQUIRES = QtCore -} win32 { wince*:LIBS_PRIVATE += -lws2 else:LIBS_PRIVATE += -lws2_32 \ @@ -33,8 +24,6 @@ win32 { } load(qt_module_config) -HEADERS += $$QT_SOURCE_TREE/src/dbus/qtdbusversion.h - QMAKE_DOCS = $$PWD/doc/qtdbus.qdocconf QMAKE_DOCS_INDEX = ../../doc diff --git a/src/gui/gui.pro b/src/gui/gui.pro index b1f4a106a4..50dc41b8aa 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -1,15 +1,10 @@ -load(qt_module) +load(qt_build_config) TARGET = QtGui -QPRO_PWD = $$PWD QT = core-private +MODULE_CONFIG = opengl -CONFIG += module -MODULE_PRI = ../modules/qt_gui.pri - -DEFINES += QT_BUILD_GUI_LIB QT_NO_USING_NAMESPACE - -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore +DEFINES += QT_NO_USING_NAMESPACE load(qt_module_config) @@ -21,8 +16,6 @@ testcocoon { load(testcocoon) } -HEADERS += $$QT_SOURCE_TREE/src/gui/qtguiversion.h - QMAKE_DOCS = $$PWD/doc/qtgui.qdocconf QMAKE_DOCS_INDEX = ../../doc diff --git a/src/modules/qt_concurrent.pri b/src/modules/qt_concurrent.pri deleted file mode 100644 index eccec12f66..0000000000 --- a/src/modules/qt_concurrent.pri +++ /dev/null @@ -1,15 +0,0 @@ -QT.concurrent.VERSION = 5.0.0 -QT.concurrent.MAJOR_VERSION = 5 -QT.concurrent.MINOR_VERSION = 0 -QT.concurrent.PATCH_VERSION = 0 - -QT.concurrent.name = QtConcurrent -QT.concurrent.bins = $$QT_MODULE_BIN_BASE -QT.concurrent.includes = $$QT_MODULE_INCLUDE_BASE/QtConcurrent -QT.concurrent.private_includes = $$QT_MODULE_INCLUDE_BASE/QtConcurrent/$$QT.concurrent.VERSION -QT.concurrent.sources = $$QT_MODULE_BASE/src/concurrent -QT.concurrent.libs = $$QT_MODULE_LIB_BASE -QT.concurrent.plugins = $$QT_MODULE_PLUGIN_BASE -QT.concurrent.imports = $$QT_MODULE_IMPORT_BASE -QT.concurrent.depends = core -QT.concurrent.DEFINES = QT_CONCURRENT_LIB diff --git a/src/modules/qt_core.pri b/src/modules/qt_core.pri deleted file mode 100644 index e6e5df9d27..0000000000 --- a/src/modules/qt_core.pri +++ /dev/null @@ -1,15 +0,0 @@ -QT.core.VERSION = 5.0.0 -QT.core.MAJOR_VERSION = 5 -QT.core.MINOR_VERSION = 0 -QT.core.PATCH_VERSION = 0 - -QT.core.name = QtCore -QT.core.bins = $$QT_MODULE_BIN_BASE -QT.core.includes = $$QT_MODULE_INCLUDE_BASE/QtCore -QT.core.private_includes = $$QT_MODULE_INCLUDE_BASE/QtCore/$$QT.core.VERSION -QT.core.sources = $$QT_MODULE_BASE/src/corelib -QT.core.libs = $$QT_MODULE_LIB_BASE -QT.core.plugins = $$QT_MODULE_PLUGIN_BASE -QT.core.imports = $$QT_MODULE_IMPORT_BASE -QT.core.depends = -QT.core.DEFINES = QT_CORE_LIB diff --git a/src/modules/qt_dbus.pri b/src/modules/qt_dbus.pri deleted file mode 100644 index 8514265f8c..0000000000 --- a/src/modules/qt_dbus.pri +++ /dev/null @@ -1,16 +0,0 @@ -QT.dbus.VERSION = 5.0.0 -QT.dbus.MAJOR_VERSION = 5 -QT.dbus.MINOR_VERSION = 0 -QT.dbus.PATCH_VERSION = 0 - -QT.dbus.name = QtDBus -QT.dbus.bins = $$QT_MODULE_BIN_BASE -QT.dbus.includes = $$QT_MODULE_INCLUDE_BASE/QtDBus -QT.dbus.private_includes = $$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT.dbus.VERSION -QT.dbus.sources = $$QT_MODULE_BASE/src/dbus -QT.dbus.libs = $$QT_MODULE_LIB_BASE -QT.dbus.plugins = $$QT_MODULE_PLUGIN_BASE -QT.dbus.imports = $$QT_MODULE_IMPORT_BASE -QT.dbus.depends = core -QT.dbus.CONFIG = dbusadaptors dbusinterfaces -QT.dbus.DEFINES = QT_DBUS_LIB diff --git a/src/modules/qt_gui.pri b/src/modules/qt_gui.pri deleted file mode 100644 index 2dfbb4a604..0000000000 --- a/src/modules/qt_gui.pri +++ /dev/null @@ -1,15 +0,0 @@ -QT.gui.VERSION = 5.0.0 -QT.gui.MAJOR_VERSION = 5 -QT.gui.MINOR_VERSION = 0 -QT.gui.PATCH_VERSION = 0 - -QT.gui.name = QtGui -QT.gui.includes = $$QT_MODULE_INCLUDE_BASE/QtGui -QT.gui.private_includes = $$QT_MODULE_INCLUDE_BASE/QtGui/$$QT.gui.VERSION -QT.gui.sources = $$QT_MODULE_BASE/src/gui -QT.gui.libs = $$QT_MODULE_LIB_BASE -QT.gui.plugins = $$QT_MODULE_PLUGIN_BASE -QT.gui.imports = $$QT_MODULE_IMPORT_BASE -QT.gui.depends = core -QT.gui.CONFIG = opengl -QT.gui.DEFINES = QT_GUI_LIB diff --git a/src/modules/qt_network.pri b/src/modules/qt_network.pri deleted file mode 100644 index 76b462286f..0000000000 --- a/src/modules/qt_network.pri +++ /dev/null @@ -1,15 +0,0 @@ -QT.network.VERSION = 5.0.0 -QT.network.MAJOR_VERSION = 5 -QT.network.MINOR_VERSION = 0 -QT.network.PATCH_VERSION = 0 - -QT.network.name = QtNetwork -QT.network.bins = $$QT_MODULE_BIN_BASE -QT.network.includes = $$QT_MODULE_INCLUDE_BASE/QtNetwork -QT.network.private_includes = $$QT_MODULE_INCLUDE_BASE/QtNetwork/$$QT.network.VERSION -QT.network.sources = $$QT_MODULE_BASE/src/network -QT.network.libs = $$QT_MODULE_LIB_BASE -QT.network.plugins = $$QT_MODULE_PLUGIN_BASE -QT.network.imports = $$QT_MODULE_IMPORT_BASE -QT.network.depends = core -QT.network.DEFINES = QT_NETWORK_LIB diff --git a/src/modules/qt_opengl.pri b/src/modules/qt_opengl.pri deleted file mode 100644 index 22476cf949..0000000000 --- a/src/modules/qt_opengl.pri +++ /dev/null @@ -1,16 +0,0 @@ -QT.opengl.VERSION = 5.0.0 -QT.opengl.MAJOR_VERSION = 5 -QT.opengl.MINOR_VERSION = 0 -QT.opengl.PATCH_VERSION = 0 - -QT.opengl.name = QtOpenGL -QT.opengl.bins = $$QT_MODULE_BIN_BASE -QT.opengl.includes = $$QT_MODULE_INCLUDE_BASE/QtOpenGL -QT.opengl.private_includes = $$QT_MODULE_INCLUDE_BASE/QtOpenGL/$$QT.opengl.VERSION -QT.opengl.sources = $$QT_MODULE_BASE/src/opengl -QT.opengl.libs = $$QT_MODULE_LIB_BASE -QT.opengl.plugins = $$QT_MODULE_PLUGIN_BASE -QT.opengl.imports = $$QT_MODULE_IMPORT_BASE -QT.opengl.depends = core gui widgets -QT.opengl.CONFIG = opengl -QT.opengl.DEFINES = QT_OPENGL_LIB diff --git a/src/modules/qt_platformsupport.pri b/src/modules/qt_platformsupport.pri deleted file mode 100644 index 6671cc0584..0000000000 --- a/src/modules/qt_platformsupport.pri +++ /dev/null @@ -1,16 +0,0 @@ -QT.platformsupport.VERSION = 5.0.0 -QT.platformsupport.MAJOR_VERSION = 5 -QT.platformsupport.MINOR_VERSION = 0 -QT.platformsupport.PATCH_VERSION = 0 - -QT.platformsupport.name = QtPlatformSupport -QT.platformsupport.bins = $$QT_MODULE_BIN_BASE -QT.platformsupport.includes = $$QT_MODULE_INCLUDE_BASE/QtPlatformSupport -QT.platformsupport.private_includes = $$QT_MODULE_INCLUDE_BASE/QtPlatformSupport/$$QT.platformsupport.VERSION -QT.platformsupport.sources = $$QT_MODULE_BASE/src/platformsupport -QT.platformsupport.libs = $$QT_MODULE_LIB_BASE -QT.platformsupport.plugins = $$QT_MODULE_PLUGIN_BASE -QT.platformsupport.imports = $$QT_MODULE_IMPORT_BASE -QT.platformsupport.depends = core gui -QT.platformsupport.module_config = staticlib -QT.platformsupport.DEFINES = diff --git a/src/modules/qt_printsupport.pri b/src/modules/qt_printsupport.pri deleted file mode 100644 index 85603296a6..0000000000 --- a/src/modules/qt_printsupport.pri +++ /dev/null @@ -1,14 +0,0 @@ -QT.printsupport.VERSION = 5.0.0 -QT.printsupport.MAJOR_VERSION = 5 -QT.printsupport.MINOR_VERSION = 0 -QT.printsupport.PATCH_VERSION = 0 - -QT.printsupport.name = QtPrintSupport -QT.printsupport.includes = $$QT_MODULE_INCLUDE_BASE/QtPrintSupport -QT.printsupport.private_includes = $$QT_MODULE_INCLUDE_BASE/QtPrintSupport/$$QT.printsupport.VERSION -QT.printsupport.sources = $$QT_MODULE_BASE/src/printsupport -QT.printsupport.libs = $$QT_MODULE_LIB_BASE -QT.printsupport.plugins = $$QT_MODULE_PLUGIN_BASE -QT.printsupport.imports = $$QT_MODULE_IMPORT_BASE -QT.printsupport.depends = core gui widgets -QT.printsupport.DEFINES = QT_PRINTSUPPORT_LIB diff --git a/src/modules/qt_sql.pri b/src/modules/qt_sql.pri deleted file mode 100644 index 02f48d2a6b..0000000000 --- a/src/modules/qt_sql.pri +++ /dev/null @@ -1,15 +0,0 @@ -QT.sql.VERSION = 5.0.0 -QT.sql.MAJOR_VERSION = 5 -QT.sql.MINOR_VERSION = 0 -QT.sql.PATCH_VERSION = 0 - -QT.sql.name = QtSql -QT.sql.bins = $$QT_MODULE_BIN_BASE -QT.sql.includes = $$QT_MODULE_INCLUDE_BASE/QtSql -QT.sql.private_includes = $$QT_MODULE_INCLUDE_BASE/QtSql/$$QT.sql.VERSION -QT.sql.sources = $$QT_MODULE_BASE/src/sql -QT.sql.libs = $$QT_MODULE_LIB_BASE -QT.sql.plugins = $$QT_MODULE_PLUGIN_BASE -QT.sql.imports = $$QT_MODULE_IMPORT_BASE -QT.sql.depends = core -QT.sql.DEFINES = QT_SQL_LIB diff --git a/src/modules/qt_testlib.pri b/src/modules/qt_testlib.pri deleted file mode 100644 index 8f6a342a58..0000000000 --- a/src/modules/qt_testlib.pri +++ /dev/null @@ -1,16 +0,0 @@ -QT.testlib.VERSION = 5.0.0 -QT.testlib.MAJOR_VERSION = 5 -QT.testlib.MINOR_VERSION = 0 -QT.testlib.PATCH_VERSION = 0 - -QT.testlib.name = QtTest -QT.testlib.bins = $$QT_MODULE_BIN_BASE -QT.testlib.includes = $$QT_MODULE_INCLUDE_BASE/QtTest -QT.testlib.private_includes = $$QT_MODULE_INCLUDE_BASE/QtTest/$$QT.testlib.VERSION -QT.testlib.sources = $$QT_MODULE_BASE/src/testlib -QT.testlib.libs = $$QT_MODULE_LIB_BASE -QT.testlib.plugins = $$QT_MODULE_PLUGIN_BASE -QT.testlib.imports = $$QT_MODULE_IMPORT_BASE -QT.testlib.depends = core -QT.testlib.CONFIG = console -QT.testlib.DEFINES = QT_TESTLIB_LIB QT_TESTCASE_BUILDDIR=\\\"$$OUT_PWD\\\" diff --git a/src/modules/qt_widgets.pri b/src/modules/qt_widgets.pri deleted file mode 100644 index 9e42fdae61..0000000000 --- a/src/modules/qt_widgets.pri +++ /dev/null @@ -1,15 +0,0 @@ -QT.widgets.VERSION = 5.0.0 -QT.widgets.MAJOR_VERSION = 5 -QT.widgets.MINOR_VERSION = 0 -QT.widgets.PATCH_VERSION = 0 - -QT.widgets.name = QtWidgets -QT.widgets.bins = $$QT_MODULE_BIN_BASE -QT.widgets.includes = $$QT_MODULE_INCLUDE_BASE/QtWidgets -QT.widgets.private_includes = $$QT_MODULE_INCLUDE_BASE/QtWidgets/$$QT.widgets.VERSION -QT.widgets.sources = $$QT_MODULE_BASE/src/widgets -QT.widgets.libs = $$QT_MODULE_LIB_BASE -QT.widgets.plugins = $$QT_MODULE_PLUGIN_BASE -QT.widgets.imports = $$QT_MODULE_IMPORT_BASE -QT.widgets.depends = core gui -QT.widgets.DEFINES = QT_WIDGETS_LIB diff --git a/src/modules/qt_xml.pri b/src/modules/qt_xml.pri deleted file mode 100644 index ea831236e6..0000000000 --- a/src/modules/qt_xml.pri +++ /dev/null @@ -1,15 +0,0 @@ -QT.xml.VERSION = 5.0.0 -QT.xml.MAJOR_VERSION = 5 -QT.xml.MINOR_VERSION = 0 -QT.xml.PATCH_VERSION = 0 - -QT.xml.name = QtXml -QT.xml.bins = $$QT_MODULE_BIN_BASE -QT.xml.includes = $$QT_MODULE_INCLUDE_BASE/QtXml -QT.xml.private_includes = $$QT_MODULE_INCLUDE_BASE/QtXml/$$QT.xml.VERSION -QT.xml.sources = $$QT_MODULE_BASE/src/xml -QT.xml.libs = $$QT_MODULE_LIB_BASE -QT.xml.plugins = $$QT_MODULE_PLUGIN_BASE -QT.xml.imports = $$QT_MODULE_IMPORT_BASE -QT.xml.depends = core -QT.xml.DEFINES = QT_XML_LIB diff --git a/src/network/network.pro b/src/network/network.pro index 3e1bc6d4e5..fc901da072 100644 --- a/src/network/network.pro +++ b/src/network/network.pro @@ -1,13 +1,9 @@ -load(qt_module) +load(qt_build_config) -# Qt network module TARGET = QtNetwork -QPRO_PWD = $$PWD - -CONFIG += module -MODULE_PRI = ../modules/qt_network.pri +QT = core-private -DEFINES += QT_BUILD_NETWORK_LIB QT_NO_USING_NAMESPACE +DEFINES += QT_NO_USING_NAMESPACE #DEFINES += QLOCALSERVER_DEBUG QLOCALSOCKET_DEBUG #DEFINES += QNETWORKDISKCACHE_DEBUG #DEFINES += QSSLSOCKET_DEBUG @@ -15,15 +11,10 @@ DEFINES += QT_BUILD_NETWORK_LIB QT_NO_USING_NAMESPACE #DEFINES += QABSTRACTSOCKET_DEBUG QNATIVESOCKETENGINE_DEBUG #DEFINES += QTCPSOCKETENGINE_DEBUG QTCPSOCKET_DEBUG QTCPSERVER_DEBUG QSSLSOCKET_DEBUG #DEFINES += QUDPSOCKET_DEBUG QUDPSERVER_DEBUG -QT = core-private win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x64000000 -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore - load(qt_module_config) -HEADERS += $$QT_SOURCE_TREE/src/network/qtnetworkversion.h - QMAKE_DOCS = $$PWD/doc/qtnetwork.qdocconf QMAKE_DOCS_INDEX = ../../doc diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index f1589694a8..1649651ce7 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -1,24 +1,15 @@ -load(qt_module) +load(qt_build_config) TARGET = QtOpenGL -QPRO_PWD = $$PWD QT = core-private gui-private widgets-private -CONFIG += module -MODULE_PRI = ../modules/qt_opengl.pri - -DEFINES += QT_BUILD_OPENGL_LIB DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x63000000 solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui - load(qt_module_config) -HEADERS += $$QT_SOURCE_TREE/src/opengl/qtopenglversion.h - contains(QT_CONFIG, opengl):CONFIG += opengl contains(QT_CONFIG, opengles1):CONFIG += opengles1 contains(QT_CONFIG, opengles2):CONFIG += opengles2 diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro index fba1096ab2..e8ea981d6d 100644 --- a/src/platformsupport/platformsupport.pro +++ b/src/platformsupport/platformsupport.pro @@ -1,26 +1,12 @@ -load(qt_module) +load(qt_build_config) TARGET = QtPlatformSupport -QPRO_PWD = $$PWD -QT += core-private gui-private -TEMPLATE = lib -DESTDIR = $$QT.gui.libs +QT = core-private gui-private -CONFIG += module CONFIG += staticlib mac:LIBS += -lz -framework CoreFoundation -framework Carbon -MODULE_PRI = ../modules/qt_platformsupport.pri - -DEFINES += QT_BUILD_PLATFORMSUPPORT_LIB - load(qt_module_config) -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui - -include(../qbase.pri) - -HEADERS += $$PWD/qtplatformsupportversion.h - DEFINES += QT_NO_CAST_FROM_ASCII PRECOMPILED_HEADER = ../corelib/global/qt_pch.h diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 206ef7380b..3b189e2cb5 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -1351,9 +1351,6 @@ QT_END_NAMESPACE #include "moc_qprintdialog.cpp" #include "qprintdialog_unix.moc" -#ifndef Q_OS_MAC -#include "qrc_qprintdialog.cpp" -#endif #endif // QT_NO_PRINTDIALOG diff --git a/src/printsupport/printsupport.pro b/src/printsupport/printsupport.pro index 9002ba3996..6dffbd83c8 100644 --- a/src/printsupport/printsupport.pro +++ b/src/printsupport/printsupport.pro @@ -1,20 +1,12 @@ -load(qt_module) +load(qt_build_config) TARGET = QtPrintSupport -QPRO_PWD = $$PWD QT = core-private gui-private widgets-private -CONFIG += module -MODULE_PRI = ../modules/qt_printsupport.pri - -DEFINES += QT_BUILD_PRINTSUPPORT_LIB QT_NO_USING_NAMESPACE - -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui +DEFINES += QT_NO_USING_NAMESPACE load(qt_module_config) -HEADERS += $$QT_SOURCE_TREE/src/printsupport/qtprintsupportversion.h - QMAKE_DOCS = $$PWD/doc/qtprintsupport.qdocconf QMAKE_DOCS_INDEX = ../../doc diff --git a/src/qbase.pri b/src/qbase.pri deleted file mode 100644 index 528dd1e17a..0000000000 --- a/src/qbase.pri +++ /dev/null @@ -1 +0,0 @@ -load(qt_module_config) diff --git a/src/qt_install.pri b/src/qt_install.pri deleted file mode 100644 index 8a9a7ab5ba..0000000000 --- a/src/qt_install.pri +++ /dev/null @@ -1 +0,0 @@ -load(qt_installs) diff --git a/src/qt_targets.pri b/src/qt_targets.pri deleted file mode 100644 index 900b50bde4..0000000000 --- a/src/qt_targets.pri +++ /dev/null @@ -1 +0,0 @@ -load(qt_targets) diff --git a/src/sql/sql.pro b/src/sql/sql.pro index c2345d92ef..319217013f 100644 --- a/src/sql/sql.pro +++ b/src/sql/sql.pro @@ -1,22 +1,13 @@ -load(qt_module) +load(qt_build_config) TARGET = QtSql -QPRO_PWD = $$PWD QT = core-private -CONFIG += module -MODULE_PRI = ../modules/qt_sql.pri - -DEFINES += QT_BUILD_SQL_LIB DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x62000000 -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore - load(qt_module_config) -HEADERS += $$QT_SOURCE_TREE/src/sql/qtsqlversion.h - DEFINES += QT_NO_CAST_FROM_ASCII PRECOMPILED_HEADER = ../corelib/global/qt_pch.h SQL_P = sql diff --git a/src/src.pro b/src/src.pro index e46dc2e68a..a474b795af 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,117 +1,92 @@ TEMPLATE = subdirs -# this order is important -unset(SRC_SUBDIRS) -win32:SRC_SUBDIRS += src_winmain -!wince*:include(tools/tools.pro) -SRC_SUBDIRS += src_corelib -SRC_SUBDIRS += src_network src_sql src_gui src_xml src_testlib src_platformsupport src_widgets -!wince*:SRC_SUBDIRS += src_printsupport -nacl: SRC_SUBDIRS -= src_network src_testlib -contains(QT_CONFIG, dbus):SRC_SUBDIRS += src_dbus -contains(QT_CONFIG, concurrent):SRC_SUBDIRS += src_concurrent - -contains(QT_CONFIG, no-gui): SRC_SUBDIRS -= src_gui - -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2): SRC_SUBDIRS += src_opengl -SRC_SUBDIRS += src_plugins +src_tools.subdir = $$PWD/tools +src_tools.target = sub-tools src_winmain.subdir = $$PWD/winmain src_winmain.target = sub-winmain +src_winmain.depends = sub-corelib # just for the module .pri file + src_corelib.subdir = $$PWD/corelib src_corelib.target = sub-corelib + src_xml.subdir = $$PWD/xml src_xml.target = sub-xml +src_xml.depends = src_corelib + src_dbus.subdir = $$PWD/dbus src_dbus.target = sub-dbus -src_gui.subdir = $$PWD/gui -src_gui.target = sub-gui +src_dbus.depends = src_corelib + +src_concurrent.subdir = $$PWD/concurrent +src_concurrent.target = sub-concurrent +src_concurrent.depends = src_corelib + src_sql.subdir = $$PWD/sql src_sql.target = sub-sql +src_sql.depends = src_corelib + src_network.subdir = $$PWD/network src_network.target = sub-network -src_opengl.subdir = $$PWD/opengl -src_opengl.target = sub-opengl -src_plugins.subdir = $$PWD/plugins -src_plugins.target = sub-plugins -src_widgets.subdir = $$PWD/widgets -src_widgets.target = sub-widgets -!wince*: { - src_printsupport.subdir = $$PWD/printsupport - src_printsupport.target = sub-printsupport -} +src_network.depends = src_corelib + src_testlib.subdir = $$PWD/testlib src_testlib.target = sub-testlib +src_testlib.depends = src_corelib # src_gui & src_widgets are not build-depends + +src_gui.subdir = $$PWD/gui +src_gui.target = sub-gui +src_gui.depends = src_corelib + src_platformsupport.subdir = $$PWD/platformsupport src_platformsupport.target = sub-platformsupport -src_concurrent.subdir = $$PWD/concurrent -src_concurrent.target = sub-concurrent +src_platformsupport.depends = src_corelib src_gui src_network +src_widgets.subdir = $$PWD/widgets +src_widgets.target = sub-widgets +src_widgets.depends = src_corelib src_gui -#CONFIG += ordered -!wince*:!ordered { - src_corelib.depends = src_tools_moc src_tools_rcc - src_gui.depends = src_corelib - src_printsupport.depends = src_corelib src_gui src_widgets - src_platformsupport.depends = src_corelib src_gui src_network - src_widgets.depends = src_corelib src_gui src_tools_uic - src_xml.depends = src_corelib - src_concurrent.depends = src_corelib - src_dbus.depends = src_corelib - src_network.depends = src_corelib - src_opengl.depends = src_gui src_widgets - src_sql.depends = src_corelib - src_testlib.depends = src_corelib src_gui src_widgets - src_plugins.depends = src_gui src_sql src_xml src_platformsupport -} +src_opengl.subdir = $$PWD/opengl +src_opengl.target = sub-opengl +src_opengl.depends = src_gui src_widgets + +src_printsupport.subdir = $$PWD/printsupport +src_printsupport.target = sub-printsupport +src_printsupport.depends = src_corelib src_gui src_widgets -contains(QT_CONFIG, no-widgets): SRC_SUBDIRS -= src_opengl src_widgets src_printsupport - -# This creates a sub-src rule -sub_src_target.CONFIG = recursive -sub_src_target.recurse = $$TOOLS_SUBDIRS $$SRC_SUBDIRS -sub_src_target.target = sub-src -sub_src_target.recurse_target = -QMAKE_EXTRA_TARGETS += sub_src_target - -# This gives us a top level debug/release -for(subname, SRC_SUBDIRS) { - subdir = $$subname - !isEmpty($${subname}.subdir):subdir = $$eval($${subname}.subdir) - subpro = $$subdir/$${basename(subdir)}.pro - !exists($$subpro):next() - subtarget = $$replace(subdir, [^A-Za-z0-9], _) - reg_src = $$replace(QT_SOURCE_TREE, \\\\, \\\\) - subdir = $$replace(subdir, $$reg_src, $$QT_BUILD_TREE) - subdir = $$replace(subdir, /, $$QMAKE_DIR_SEP) - subdir = $$replace(subdir, \\\\, $$QMAKE_DIR_SEP) - include($$subpro, SUB) - !isEqual(subname, src_tools_bootstrap):if(isEqual(SUB.TEMPLATE, lib) | isEqual(SUB.TEMPLATE, subdirs)):!separate_debug_info { - #debug - debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS - debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug) - EXTRA_DEBUG_TARGETS += debug-$${subtarget} - QMAKE_EXTRA_TARGETS += debug-$${subtarget} - #release - release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS - release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release) - EXTRA_RELEASE_TARGETS += release-$${subtarget} - QMAKE_EXTRA_TARGETS += release-$${subtarget} - } else { #do not have a real debug target/release - #debug - debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS - debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first) - EXTRA_DEBUG_TARGETS += debug-$${subtarget} - QMAKE_EXTRA_TARGETS += debug-$${subtarget} - #release - release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS - release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first) - EXTRA_RELEASE_TARGETS += release-$${subtarget} - QMAKE_EXTRA_TARGETS += release-$${subtarget} - } +src_plugins.subdir = $$PWD/plugins +src_plugins.target = sub-plugins +src_plugins.depends = src_sql src_xml src_network src_platformsupport + +# this order is important +!wince* { + SUBDIRS += src_tools + src_corelib.depends += src_tools +} +SUBDIRS += src_corelib +win32:SUBDIRS += src_winmain +SUBDIRS += src_network src_sql src_xml src_testlib +contains(QT_CONFIG, dbus) { + SUBDIRS += src_dbus + src_plugins.depends += src_dbus +} +contains(QT_CONFIG, concurrent):SUBDIRS += src_concurrent +!contains(QT_CONFIG, no-gui) { + SUBDIRS += src_gui + src_plugins.depends += src_gui + !contains(QT_CONFIG, no-widgets) { + SUBDIRS += src_platformsupport src_widgets + src_plugins.depends += src_platformsupport src_widgets + contains(QT_CONFIG, opengl(es1|es2)?) { + SUBDIRS += src_opengl + src_plugins.depends += src_opengl + } + !wince* { + SUBDIRS += src_printsupport + src_plugins.depends += src_printsupport + } + } } -debug.depends = $$EXTRA_DEBUG_TARGETS -release.depends = $$EXTRA_RELEASE_TARGETS -QMAKE_EXTRA_TARGETS += debug release +SUBDIRS += src_plugins -SUBDIRS += $$SRC_SUBDIRS +nacl: SUBDIRS -= src_network src_testlib diff --git a/src/testlib/qtest_global.h b/src/testlib/qtest_global.h index b567fe7c00..18d09ba162 100644 --- a/src/testlib/qtest_global.h +++ b/src/testlib/qtest_global.h @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE #if !defined(QT_SHARED) && !defined(QT_DLL) # define Q_TESTLIB_EXPORT #else -# ifdef QTESTLIB_MAKEDLL +# ifdef QT_BUILD_TESTLIB_LIB # define Q_TESTLIB_EXPORT Q_DECL_EXPORT # else # define Q_TESTLIB_EXPORT Q_DECL_IMPORT diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro index 1a76a3b556..f77a611e25 100644 --- a/src/testlib/testlib.pro +++ b/src/testlib/testlib.pro @@ -1,11 +1,10 @@ -load(qt_module) +load(qt_build_config) TARGET = QtTest -QPRO_PWD = $$PWD QT = core-private +CONFIG += exceptions -CONFIG += module exceptions -MODULE_PRI = ../modules/qt_testlib.pri +MODULE_CONFIG = console testlib_defines INCLUDEPATH += . unix:!embedded:QMAKE_PKGCONFIG_DESCRIPTION = Qt \ @@ -59,7 +58,6 @@ SOURCES = qtestcase.cpp \ qxunittestlogger.cpp DEFINES *= QT_NO_CAST_TO_ASCII \ QT_NO_CAST_FROM_ASCII \ - QTESTLIB_MAKEDLL \ QT_NO_DATASTREAM embedded:QMAKE_CXXFLAGS += -fno-rtti wince*::LIBS += libcmt.lib \ @@ -83,8 +81,6 @@ mac { load(qt_module_config) -HEADERS += $$QT_SOURCE_TREE/src/testlib/qttestversion.h - QMAKE_TARGET_PRODUCT = QTestLib QMAKE_TARGET_DESCRIPTION = Qt \ Unit \ diff --git a/src/tools/bootstrap/bootstrap.pri b/src/tools/bootstrap/bootstrap.pri index f6f8eba82b..5ea10d0e46 100644 --- a/src/tools/bootstrap/bootstrap.pri +++ b/src/tools/bootstrap/bootstrap.pri @@ -27,8 +27,8 @@ win32:DEFINES += QT_NODLL INCLUDEPATH += $$QT_BUILD_TREE/include \ $$QT_BUILD_TREE/include/QtCore \ - $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION \ - $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION/QtCore + $$QT_BUILD_TREE/include/QtCore/$$QT_VERSION \ + $$QT_BUILD_TREE/include/QtCore/$$QT_VERSION/QtCore DEPENDPATH += $$INCLUDEPATH \ $$QT_SOURCE_TREE/src/corelib/global \ $$QT_SOURCE_TREE/src/corelib/kernel \ diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 239f9e58b3..afb1448be2 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -1,3 +1,4 @@ +option(host_build) TEMPLATE = lib TARGET = bootstrap CONFIG += staticlib @@ -30,8 +31,8 @@ win32:DEFINES += QT_NODLL INCLUDEPATH += $$QT_BUILD_TREE/include \ $$QT_BUILD_TREE/include/QtCore \ - $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION \ - $$QT_BUILD_TREE/include/QtCore/$$QT.core.VERSION/QtCore + $$QT_BUILD_TREE/include/QtCore/$$QT_VERSION \ + $$QT_BUILD_TREE/include/QtCore/$$QT_VERSION/QtCore DEPENDPATH += $$INCLUDEPATH \ ../../corelib/global \ diff --git a/src/tools/moc/moc.pro b/src/tools/moc/moc.pro index 62d692844f..8b53578e23 100644 --- a/src/tools/moc/moc.pro +++ b/src/tools/moc/moc.pro @@ -1,10 +1,11 @@ +option(host_build) TEMPLATE = app TARGET = moc DEFINES += QT_MOC QT_NO_CAST_FROM_BYTEARRAY QT_NO_COMPRESS DESTDIR = ../../../bin -INCLUDEPATH += . $$OUT_PWD/../../corelib/global -DEPENDPATH += . +INCLUDEPATH += $$OUT_PWD/../../corelib/global +DEPENDPATH += $$OUT_PWD/../../corelib/global LIBS = OBJECTS_DIR = . diff --git a/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro b/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro index 33f7937c5b..6dc6699b9b 100644 --- a/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro +++ b/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro @@ -1,4 +1,4 @@ - +option(host_build) TEMPLATE = app TARGET = qdbuscpp2xml @@ -6,13 +6,10 @@ DESTDIR = ../../../bin include(../moc/moc.pri) -INCLUDEPATH += . -DEPENDPATH += . - INCLUDEPATH += $$QT_BUILD_TREE/include \ $$QT_BUILD_TREE/include/QtDBus \ - $$QT_BUILD_TREE/include/QtDBus/$$QT.dbus.VERSION \ - $$QT_BUILD_TREE/include/QtDBus/$$QT.dbus.VERSION/QtDBus \ + $$QT_BUILD_TREE/include/QtDBus/$$QT_VERSION \ + $$QT_BUILD_TREE/include/QtDBus/$$QT_VERSION/QtDBus \ $$QT_SOURCE_TREE/src/dbus QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro index 5c430fdfb1..aebdef50ad 100644 --- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro +++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro @@ -1,17 +1,15 @@ +option(host_build) TEMPLATE = app TARGET = qdbusxml2cpp DESTDIR = ../../../bin -INCLUDEPATH += . -DEPENDPATH += . - include(../bootstrap/bootstrap.pri) INCLUDEPATH += $$QT_BUILD_TREE/include \ $$QT_BUILD_TREE/include/QtDBus \ - $$QT_BUILD_TREE/include/QtDBus/$$QT.dbus.VERSION \ - $$QT_BUILD_TREE/include/QtDBus/$$QT.dbus.VERSION/QtDBus \ + $$QT_BUILD_TREE/include/QtDBus/$$QT_VERSION \ + $$QT_BUILD_TREE/include/QtDBus/$$QT_VERSION/QtDBus \ $$QT_SOURCE_TREE/src/dbus QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS diff --git a/src/tools/qdoc/qdoc.pro b/src/tools/qdoc/qdoc.pro index 348593d74a..9a4796cebe 100644 --- a/src/tools/qdoc/qdoc.pro +++ b/src/tools/qdoc/qdoc.pro @@ -1,3 +1,4 @@ +option(host_build) TEMPLATE = app TARGET = qdoc @@ -11,8 +12,8 @@ DEFINES += QT_NO_TRANSLATION INCLUDEPATH += $$QT_SOURCE_TREE/src/tools/qdoc \ $$QT_SOURCE_TREE/src/tools/qdoc/qmlparser \ $$QT_BUILD_TREE/include/QtXml \ - $$QT_BUILD_TREE/include/QtXml/$$QT.xml.VERSION \ - $$QT_BUILD_TREE/include/QtXml/$$QT.xml.VERSION/QtXml + $$QT_BUILD_TREE/include/QtXml/$$QT_VERSION \ + $$QT_BUILD_TREE/include/QtXml/$$QT_VERSION/QtXml DEPENDPATH += $$QT_SOURCE_TREE/src/tools/qdoc \ $$QT_SOURCE_TREE/src/tools/qdoc/qmlparser \ diff --git a/src/tools/rcc/rcc.pro b/src/tools/rcc/rcc.pro index e87ef605b9..b224f98b61 100644 --- a/src/tools/rcc/rcc.pro +++ b/src/tools/rcc/rcc.pro @@ -1,10 +1,9 @@ +option(host_build) TEMPLATE = app TARGET = rcc DESTDIR = ../../../bin DEFINES += QT_RCC -INCLUDEPATH += . -DEPENDPATH += . include(rcc.pri) HEADERS += ../../corelib/kernel/qcorecmdlineargs_p.h diff --git a/src/tools/tools.pro b/src/tools/tools.pro index 8ad30a998d..bd8896259a 100644 --- a/src/tools/tools.pro +++ b/src/tools/tools.pro @@ -33,44 +33,4 @@ contains(QT_CONFIG, dbus) { } } -# Special handling, depending on type of project, if it used debug/release or only has one configuration -EXTRA_DEBUG_TARGETS = -EXTRA_RELEASE_TARGETS = -for(subname, TOOLS_SUBDIRS) { - subdir = $$subname - !isEmpty($${subname}.subdir):subdir = $$eval($${subname}.subdir) - subpro = $$subdir/$${basename(subdir)}.pro - !exists($$subpro):next() - subtarget = $$replace(subdir, [^A-Za-z0-9], _) - reg_src = $$replace(QT_SOURCE_TREE, \\\\, \\\\) - subdir = $$replace(subdir, $$reg_src, $$QT_BUILD_TREE) - subdir = $$replace(subdir, /, $$QMAKE_DIR_SEP) - subdir = $$replace(subdir, \\\\, $$QMAKE_DIR_SEP) - include($$subpro, SUB) - !isEqual(subname, src_tools_bootstrap):if(isEqual(SUB.TEMPLATE, lib) | isEqual(SUB.TEMPLATE, subdirs)):!separate_debug_info { - #debug - debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS - debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug) - EXTRA_DEBUG_TARGETS += debug-$${subtarget} - QMAKE_EXTRA_TARGETS += debug-$${subtarget} - #release - release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS - release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release) - EXTRA_RELEASE_TARGETS += release-$${subtarget} - QMAKE_EXTRA_TARGETS += release-$${subtarget} - } else { #do not have a real debug target/release - #debug - debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS - debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first) - EXTRA_DEBUG_TARGETS += debug-$${subtarget} - QMAKE_EXTRA_TARGETS += debug-$${subtarget} - #release - release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS - release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first) - EXTRA_RELEASE_TARGETS += release-$${subtarget} - QMAKE_EXTRA_TARGETS += release-$${subtarget} - } -} - -SUBDIRS = $$TOOLS_SUBDIRS $$SUBDIRS -isEqual(TARGET,tools): SUBDIRS += $$SRC_SUBDIRS +SUBDIRS = $$TOOLS_SUBDIRS diff --git a/src/tools/uic/uic.pro b/src/tools/uic/uic.pro index 0acc6e77c8..c4b7ca2e19 100644 --- a/src/tools/uic/uic.pro +++ b/src/tools/uic/uic.pro @@ -1,10 +1,9 @@ +option(host_build) TEMPLATE = app TARGET = uic DESTDIR = ../../../bin DEFINES += QT_UIC -INCLUDEPATH += . -DEPENDPATH += . include(uic.pri) include(cpp/cpp.pri) diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro index 91ac4074e9..94ae7824a3 100644 --- a/src/widgets/widgets.pro +++ b/src/widgets/widgets.pro @@ -1,24 +1,17 @@ -load(qt_module) +load(qt_build_config) TARGET = QtWidgets -QPRO_PWD = $$PWD -QT = core core-private gui gui-private platformsupport-private +QT = core-private gui-private +MODULE_CONFIG = uic -CONFIG += module -MODULE_PRI = ../modules/qt_widgets.pri - -DEFINES += QT_BUILD_WIDGETS_LIB QT_NO_USING_NAMESPACE +DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore - -HEADERS += $$QT_SOURCE_TREE/src/widgets/qtwidgetsversion.h - QMAKE_DOCS = $$PWD/doc/qtwidgets.qdocconf QMAKE_DOCS_INDEX = ../../doc -include(../qbase.pri) +load(qt_module_config) #platforms mac:include(kernel/mac.pri) @@ -56,3 +49,10 @@ INCLUDEPATH += ../3rdparty/harfbuzz/src win32:!contains(QT_CONFIG, directwrite) { DEFINES += QT_NO_DIRECTWRITE } + +load(uic) + +uic_dir.name = uic_location +uic_dir.variable = QMAKE_UIC + +QMAKE_PKGCONFIG_VARIABLES += uic_dir diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro index 1d2c097c20..e5aa8c49e2 100644 --- a/src/winmain/winmain.pro +++ b/src/winmain/winmain.pro @@ -1,24 +1,32 @@ -# Additional Qt project file for qtmain lib on Windows -TEMPLATE = lib -TARGET = qtmain -QT = - -CONFIG += staticlib warn_on -CONFIG -= qt shared - -win32 { - win32-msvc*:QMAKE_CFLAGS_DEBUG -= -Zi - win32-msvc*:QMAKE_CXXFLAGS_DEBUG -= -Zi - win32-msvc*:QMAKE_CFLAGS_DEBUG *= -Z7 - win32-msvc*:QMAKE_CXXFLAGS_DEBUG *= -Z7 - win32-g++*:DEFINES += QT_NEEDS_QMAIN - win32-borland:DEFINES += QT_NEEDS_QMAIN - SOURCES = qtmain_win.cpp - CONFIG += png - INCLUDEPATH += tmp $$QT.core.includes -} +load(qt_build_config) +# Additional Qt project file for qtmain lib on Windows !win32:error("$$_FILE_ is intended only for Windows!") -load(qt_module_config) + +TEMPLATE = lib +TARGET = qtmain DESTDIR = $$QT.core.libs + +CONFIG += static warn_on depend_includepath +CONFIG -= fix_output_dirs +QT = # qt.prf is still needed for some DEFINES, etc. + +contains(QT_CONFIG, build_all):CONFIG += build_all + +win32-msvc*:QMAKE_CFLAGS_DEBUG -= -Zi +win32-msvc*:QMAKE_CXXFLAGS_DEBUG -= -Zi +win32-msvc*:QMAKE_CFLAGS_DEBUG *= -Z7 +win32-msvc*:QMAKE_CXXFLAGS_DEBUG *= -Z7 +win32-g++*|win32-borland:DEFINES += QT_NEEDS_QMAIN + +INCLUDEPATH += $$QT.core.includes + +SOURCES = qtmain_win.cpp + +load(qt_installs) + +TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end + +load(qt_targets) + wince*:QMAKE_POST_LINK = diff --git a/src/xml/xml.pro b/src/xml/xml.pro index 2fff0218e4..5f4d844ea5 100644 --- a/src/xml/xml.pro +++ b/src/xml/xml.pro @@ -1,21 +1,13 @@ -load(qt_module) +load(qt_build_config) TARGET = QtXml -QPRO_PWD = $$PWD QT = core-private -CONFIG += module -MODULE_PRI = ../modules/qt_xml.pri - -DEFINES += QT_BUILD_XML_LIB QT_NO_USING_NAMESPACE +DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x61000000 -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore - load(qt_module_config) -HEADERS += $$QT_SOURCE_TREE/src/xml/qtxmlversion.h - QMAKE_DOCS = $$PWD/doc/qtxml.qdocconf QMAKE_DOCS_INDEX = ../../doc diff --git a/sync.profile b/sync.profile index 362118aefa..e6c811636e 100644 --- a/sync.profile +++ b/sync.profile @@ -31,42 +31,6 @@ "qtconcurrentmap.h" => "QtConcurrentMap", "qtconcurrentfilter.h" => "QtConcurrentFilter", "qtconcurrentrun.h" => "QtConcurrentRun", - "qtcoreversion.h" => "QtCoreVersion", - "qtdbusversion.h" => "QtDBusVersion", - "qtguiversion.h" => "QtGuiVersion", - "qtnetworkversion.h" => "QtNetworkVersion", - "qtopenglversion.h" => "QtOpenGLVersion", - "qtsqlversion.h" => "QtSqlVersion", - "qttestversion.h" => "QtTestVersion", - "qtxmlversion.h" => "QtXmlVersion", - "qtwidgetsversion.h" => "QtWidgetsVersion", - "qtprintsupportversion.h" => "QtPrintSupportVersion", - "qtconcurrentversion.h" => "QtConcurrentVersion", - "qtplatformsupportversion.h" => "QtPlatformSupportVersion", -); -%mastercontent = ( - "core" => "#include <QtCore/QtCore>\n", - "gui" => "#include <QtGui/QtGui>\n", - "printsupport" => "#include <QtPrintSupport/QtPrintSupport>\n", - "widgets" => "#include <QtWidgets/QtWidgets>\n", - "network" => "#include <QtNetwork/QtNetwork>\n", - "opengl" => "#include <QtOpenGL/QtOpenGL>\n", - "xml" => "#include <QtXml/QtXml>\n", - "concurrent" => "#include <QtConcurrent/QtConcurrent>\n", -); -%modulepris = ( - "QtCore" => "$basedir/src/modules/qt_core.pri", - "QtDBus" => "$basedir/src/modules/qt_dbus.pri", - "QtGui" => "$basedir/src/modules/qt_gui.pri", - "QtPrintSupport" => "$basedir/src/modules/qt_printsupport.pri", - "QtWidgets" => "$basedir/src/modules/qt_widgets.pri", - "QtNetwork" => "$basedir/src/modules/qt_network.pri", - "QtOpenGL" => "$basedir/src/modules/qt_opengl.pri", - "QtSql" => "$basedir/src/modules/qt_sql.pri", - "QtTest" => "$basedir/src/modules/qt_testlib.pri", - "QtXml" => "$basedir/src/modules/qt_xml.pri", - "QtConcurrent" => "$basedir/src/modules/qt_concurrent.pri", - "QtPlatformSupport" => "$basedir/src/modules/qt_platformsupport.pri", ); %deprecatedheaders = ( "QtGui" => { @@ -152,11 +116,11 @@ } ); -@ignore_for_master_contents = ( "qt.h", "qpaintdevicedefs.h" ); @ignore_for_include_check = ( "qsystemdetection.h", "qcompilerdetection.h", "qprocessordetection.h" ); @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qt_windows.h" ); @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" ); @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtTest}", "$modules{QtDBus}" ); +%inject_headers = ( "$basedir/src/corelib/global" => [ "qconfig.h" ] ); # Module dependencies. # Every module that is required to build this module should have one entry. # Each of the module version specifiers can take one of the following values: diff --git a/tests/auto/corelib/plugin/qplugin/qplugin.pro b/tests/auto/corelib/plugin/qplugin/qplugin.pro index 37a12da732..e8840a0fb2 100644 --- a/tests/auto/corelib/plugin/qplugin/qplugin.pro +++ b/tests/auto/corelib/plugin/qplugin/qplugin.pro @@ -1,10 +1,10 @@ QT = core TEMPLATE = subdirs win32 { - exists($$[QT_INSTALL_LIBS]/QtCore4.dll) { + exists($$[QT_INSTALL_LIBS/get]/QtCore4.dll) { SUBDIRS = releaseplugin } - exists($$[QT_INSTALL_LIBS]/QtCored4.dll) { + exists($$[QT_INSTALL_LIBS/get]/QtCored4.dll) { SUBDIRS += debugplugin } } diff --git a/tests/auto/other/macnativeevents/macnativeevents.pro b/tests/auto/other/macnativeevents/macnativeevents.pro index 6ec0942222..d72a87f205 100644 --- a/tests/auto/other/macnativeevents/macnativeevents.pro +++ b/tests/auto/other/macnativeevents/macnativeevents.pro @@ -1,8 +1,5 @@ CONFIG += testcase TARGET = tst_macnativeevents -TEMPLATE = app -DEPENDPATH += . -INCLUDEPATH += . LIBS += -framework Carbon QT += widgets testlib HEADERS += qnativeevents.h nativeeventlist.h expectedeventlist.h diff --git a/tests/auto/tools/qmake/testdata/functions/functions.pro b/tests/auto/tools/qmake/testdata/functions/functions.pro index ad66ee863d..9ec2ffe93f 100644 --- a/tests/auto/tools/qmake/testdata/functions/functions.pro +++ b/tests/auto/tools/qmake/testdata/functions/functions.pro @@ -1,5 +1,9 @@ CONFIG = qt thread +defineTest(testReplace) { + !isEqual(1, $$2):message("FAILED: $$3: got $$1, expected $${2}.") +} + #count !count( CONFIG, 2 ) { message( "FAILED: count function: $$CONFIG" ) @@ -84,4 +88,61 @@ myTestFunction("oink baa moo") message("FAILED: myTestFunction: $$RESULT") } +moo = "this is a test" "for real" +fn = $$OUT_PWD/testdir/afile +write_file($$fn, moo)|message("FAILED: write_file() failed") +exists($$fn)|message("FAILED: write_file() didn't write anything") +mooout = $$cat($$fn, line) +equals(moo, $$mooout)|message("FAILED: write_file() wrote something wrong") +moo += "another line" +write_file($$fn, moo)|message("FAILED: write_file() failed (take 2)") +mooout = $$cat($$fn, line) +equals(moo, $$mooout)|message("FAILED: write_file() wrote something wrong (take 2)") +mooadd = "yet another line" +write_file($$fn, mooadd, append)|message("FAILED: write_file() failed (append)") +moo += $$mooadd +mooout = $$cat($$fn, line) +equals(moo, $$mooout)|message("FAILED: write_file() wrote something wrong when appending") + +pn = $$OUT_PWD/testpath/subdir +mkpath($$pn)|message("FAILED: mkpath() failed") +exists($$pn)|message("FAILED: mkpath() didn't create anything") + +in = easy "less easy" sca$${LITERAL_HASH}ry crazy$$escape_expand(\\t\\r\\n) $$escape_expand(\\t)shit \'no\"way\\here +out = "easy \"less easy\" sca\$\${LITERAL_HASH}ry crazy\$\$escape_expand(\\\\t\\\\r\\\\n) \$\$escape_expand(\\\\t)shit \\\'no\\\"way\\\\here" +testReplace($$val_escape(in), $$out, "val_escape") + +testReplace($$shadowed($$PWD/something), $$OUT_PWD/something, "shadowed") + +#format_number +spc = " " +testReplace($$format_number(13), 13, "simple number format") +testReplace($$format_number(-13), -13, "negative number format") +testReplace($$format_number(13, ibase=16), 19, "hex input number format") +testReplace($$format_number(13, obase=16), d, "hex output number format") +testReplace($$format_number(13, width=5), " $$spc 13", "right aligned number format") +testReplace($$format_number(13, width=5 leftalign), "13 $$spc ", "left aligned number format") +testReplace($$format_number(13, width=5 zeropad), "00013", "zero-padded number format") +testReplace($$format_number(13, width=5 alwayssign), "$$spc +13", "always signed number format") +testReplace($$format_number(13, width=5 alwayssign zeropad), "+0013", "zero-padded always signed number format") +testReplace($$format_number(13, width=5 padsign), " $$spc 13", "sign-padded number format") +testReplace($$format_number(13, width=5 padsign zeropad), " 0013", "zero-padded sign-padded number format") + +testReplace($$clean_path("c:$${DIR_SEPARATOR}crazy//path/../trolls"), "c:/crazy/trolls", "clean_path") + +testReplace($$native_path("/crazy/trolls"), "$${DIR_SEPARATOR}crazy$${DIR_SEPARATOR}trolls", "native_path") + +testReplace($$absolute_path("crazy/trolls"), "$$PWD/crazy/trolls", "absolute_path") +testReplace($$absolute_path("crazy/trolls", "/fake/path"), "/fake/path/crazy/trolls", "absolute_path with base") +testReplace($$relative_path($$_PRO_FILE_PWD_), $$basename($$_PRO_FILE_), "relative_path") +testReplace($$relative_path("/fake/trolls", "/fake/path"), "../trolls", "relative_path with base") + +#this test is very rudimentary. the backend function is thoroughly tested in qt creator +in = "some nasty\" path\\" +win32: \ + out = "\"some nasty\"\\^\"\" path\"\\" +else: \ + out = "'some nasty\" path\\'" +testReplace($$shell_quote($$in), $$out, "shell_quote") +testReplace($$reverse($$list(one two three)), three two one, "reverse") diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index 88ff10a764..1cdf0d7c7e 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -250,7 +250,8 @@ void tst_qmake::subdir_via_pro_file_extra_target() void tst_qmake::functions() { QString workDir = base_path + "/testdata/functions"; - QVERIFY( test_compiler.qmake( workDir, "functions" )); + QString buildDir = base_path + "/testdata/functions_build"; + QVERIFY( test_compiler.qmake( workDir, "functions", buildDir )); } void tst_qmake::operators() diff --git a/tests/auto/widgets/kernel/qapplication/modal/modal.pro b/tests/auto/widgets/kernel/qapplication/modal/modal.pro index d9489928ba..05e5a7ada7 100644 --- a/tests/auto/widgets/kernel/qapplication/modal/modal.pro +++ b/tests/auto/widgets/kernel/qapplication/modal/modal.pro @@ -1,7 +1,4 @@ -TEMPLATE = app QT += widgets -DEPENDPATH += . -INCLUDEPATH += . SOURCES += main.cpp \ base.cpp DESTDIR = ./ diff --git a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro b/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro index 8498d8b31d..3c3b2d0767 100644 --- a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro +++ b/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro @@ -1,6 +1,3 @@ -TEMPLATE = app -DEPENDPATH += . -INCLUDEPATH += . QT += widgets SOURCES += main.cpp DESTDIR = ./ diff --git a/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro index dc579ab742..20559cec64 100644 --- a/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro +++ b/tests/auto/xml/sax/qxmlsimplereader/qxmlsimplereader.pro @@ -1,8 +1,7 @@ CONFIG += testcase TARGET = tst_qxmlsimplereader -TEMPLATE = app DEPENDPATH += parser -INCLUDEPATH += . parser +INCLUDEPATH += parser HEADERS += parser/parser.h SOURCES += tst_qxmlsimplereader.cpp parser/parser.cpp diff --git a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro index af3be799c6..3cfb0b44de 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro +++ b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro @@ -1,7 +1,4 @@ -TEMPLATE = app TARGET = tst_bench_qdiriterator -DEPENDPATH += . -INCLUDEPATH += . QT = core testlib diff --git a/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro b/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro index 12d131f262..8ea7200d53 100644 --- a/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro +++ b/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro @@ -1,7 +1,4 @@ -TEMPLATE = app TARGET = tst_bench_qvariant -DEPENDPATH += . -INCLUDEPATH += . QT += testlib CONFIG += release diff --git a/tests/benchmarks/gui/animation/qanimation/qanimation.pro b/tests/benchmarks/gui/animation/qanimation/qanimation.pro index d72e3c87d9..a5859468f7 100644 --- a/tests/benchmarks/gui/animation/qanimation/qanimation.pro +++ b/tests/benchmarks/gui/animation/qanimation/qanimation.pro @@ -1,9 +1,6 @@ QT += widgets testlib -TEMPLATE = app TARGET = tst_bench_qanimation -DEPENDPATH += . -INCLUDEPATH += . CONFIG += release #CONFIG += debug diff --git a/tests/manual/qssloptions/qssloptions.pro b/tests/manual/qssloptions/qssloptions.pro index 3fcb696cd0..55d6dd049b 100644 --- a/tests/manual/qssloptions/qssloptions.pro +++ b/tests/manual/qssloptions/qssloptions.pro @@ -1,8 +1,5 @@ CONFIG += testcase -TEMPLATE = app TARGET = tst_qssloptions -DEPENDPATH += . -INCLUDEPATH += . QT -= gui QT += network testlib diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index ba50d9604c..2e813af8f1 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -101,7 +101,6 @@ bool writeToFile(const char* text, const QString &filename) Configure::Configure(int& argc, char** argv) { - useUnixSeparators = false; // Default values for indentation optionIndent = 4; descIndent = 25; @@ -164,7 +163,8 @@ Configure::Configure(int& argc, char** argv) if (syncqt_bat.open(QFile::WriteOnly | QFile::Text)) { QTextStream stream(&syncqt_bat); stream << "@echo off" << endl - << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/syncqt.bat -qtdir \"") << fixSeparators(buildPath) << "\" %*" << endl; + << "call " << QDir::toNativeSeparators(sourcePath + "/bin/syncqt.bat") + << " -qtdir \"" << QDir::toNativeSeparators(buildPath) << "\" %*" << endl; syncqt_bat.close(); } } @@ -189,9 +189,9 @@ Configure::Configure(int& argc, char** argv) } defaultBuildParts << QStringLiteral("libs") << QStringLiteral("examples"); - dictionary[ "QT_SOURCE_TREE" ] = fixSeparators(sourcePath); - dictionary[ "QT_BUILD_TREE" ] = fixSeparators(buildPath); - dictionary[ "QT_INSTALL_PREFIX" ] = fixSeparators(installPath); + dictionary[ "QT_SOURCE_TREE" ] = sourcePath; + dictionary[ "QT_BUILD_TREE" ] = buildPath; + dictionary[ "QT_INSTALL_PREFIX" ] = installPath; dictionary[ "QMAKESPEC" ] = getenv("QMAKESPEC"); if (dictionary[ "QMAKESPEC" ].size() == 0) { @@ -338,19 +338,26 @@ Configure::~Configure() } } -QString Configure::fixSeparators(const QString &somePath, bool escape) +QString Configure::formatPath(const QString &path) { - if (useUnixSeparators) - return QDir::fromNativeSeparators(somePath); - QString ret = QDir::toNativeSeparators(somePath); - return escape ? escapeSeparators(ret) : ret; + QString ret = QDir::cleanPath(path); + // This amount of quoting is deemed sufficient. ™ + if (ret.contains(QLatin1Char(' '))) { + ret.prepend(QLatin1Char('"')); + ret.append(QLatin1Char('"')); + } + return ret; } -QString Configure::escapeSeparators(const QString &somePath) +QString Configure::formatPaths(const QStringList &paths) { - QString out = somePath; - out.replace(QLatin1Char('\\'), QLatin1String("\\\\")); - return out; + QString ret; + foreach (const QString &path, paths) { + if (!ret.isEmpty()) + ret += QLatin1Char(' '); + ret += formatPath(path); + } + return ret; } // We could use QDir::homePath() + "/.qt-license", but @@ -1126,7 +1133,7 @@ void Configure::parseCmdLine() } // Ensure that QMAKESPEC exists in the mkspecs folder - const QString mkspecPath = fixSeparators(sourcePath + "/mkspecs"); + const QString mkspecPath(sourcePath + "/mkspecs"); QDirIterator itMkspecs(mkspecPath, QDir::AllDirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories); QStringList mkspecs; @@ -1212,8 +1219,6 @@ void Configure::parseCmdLine() } } - useUnixSeparators = (dictionary["QMAKESPEC"] == "win32-g++"); - // Allow tests for private classes to be compiled against internal builds if (dictionary["BUILDDEV"] == "yes") qtConfig += "private_tests"; @@ -2360,10 +2365,10 @@ void Configure::generateOutputVars() qtConfig += "accessibility"; if (!qmakeLibs.isEmpty()) - qmakeVars += "LIBS += " + escapeSeparators(qmakeLibs.join(" ")); + qmakeVars += "LIBS += " + formatPaths(qmakeLibs); if (!dictionary["QT_LFLAGS_SQLITE"].isEmpty()) - qmakeVars += "QT_LFLAGS_SQLITE += " + escapeSeparators(dictionary["QT_LFLAGS_SQLITE"]); + qmakeVars += "QT_LFLAGS_SQLITE += " + formatPath(dictionary["QT_LFLAGS_SQLITE"]); if (dictionary[ "OPENGL" ] == "yes") qtConfig += "opengl"; @@ -2452,25 +2457,25 @@ void Configure::generateOutputVars() qipempty = true; if (!dictionary[ "QT_INSTALL_DOCS" ].size()) - dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/doc"); + dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/doc"; if (!dictionary[ "QT_INSTALL_HEADERS" ].size()) - dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/include"); + dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/include"; if (!dictionary[ "QT_INSTALL_LIBS" ].size()) - dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/lib"); + dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/lib"; if (!dictionary[ "QT_INSTALL_BINS" ].size()) - dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/bin"); + dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/bin"; if (!dictionary[ "QT_INSTALL_PLUGINS" ].size()) - dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins"); + dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins"; if (!dictionary[ "QT_INSTALL_IMPORTS" ].size()) - dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/imports"); + dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/imports"; if (!dictionary[ "QT_INSTALL_DATA" ].size()) - dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ]); + dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ]; if (!dictionary[ "QT_INSTALL_TRANSLATIONS" ].size()) - dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/translations"); + dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/translations"; if (!dictionary[ "QT_INSTALL_EXAMPLES" ].size()) - dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/examples"); + dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/examples"; if (!dictionary[ "QT_INSTALL_TESTS" ].size()) - dictionary[ "QT_INSTALL_TESTS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/tests"); + dictionary[ "QT_INSTALL_TESTS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/tests"; bool haveHpx = false; if (dictionary[ "QT_HOST_PREFIX" ].isEmpty()) @@ -2478,21 +2483,21 @@ void Configure::generateOutputVars() else haveHpx = true; if (dictionary[ "QT_HOST_BINS" ].isEmpty()) - dictionary[ "QT_HOST_BINS" ] = haveHpx ? fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/bin") : dictionary[ "QT_INSTALL_BINS" ]; + dictionary[ "QT_HOST_BINS" ] = haveHpx ? dictionary[ "QT_HOST_PREFIX" ] + "/bin" : dictionary[ "QT_INSTALL_BINS" ]; if (dictionary[ "QT_HOST_DATA" ].isEmpty()) dictionary[ "QT_HOST_DATA" ] = haveHpx ? dictionary[ "QT_HOST_PREFIX" ] : dictionary[ "QT_INSTALL_DATA" ]; if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux")) dictionary[ "QMAKE_RPATHDIR" ] = dictionary[ "QT_INSTALL_LIBS" ]; - qmakeVars += QString("OBJECTS_DIR = ") + fixSeparators("tmp/obj/" + dictionary[ "QMAKE_OUTDIR" ], true); - qmakeVars += QString("MOC_DIR = ") + fixSeparators("tmp/moc/" + dictionary[ "QMAKE_OUTDIR" ], true); - qmakeVars += QString("RCC_DIR = ") + fixSeparators("tmp/rcc/" + dictionary["QMAKE_OUTDIR"], true); + qmakeVars += QString("OBJECTS_DIR = ") + formatPath("tmp/obj/" + dictionary["QMAKE_OUTDIR"]); + qmakeVars += QString("MOC_DIR = ") + formatPath("tmp/moc/" + dictionary["QMAKE_OUTDIR"]); + qmakeVars += QString("RCC_DIR = ") + formatPath("tmp/rcc/" + dictionary["QMAKE_OUTDIR"]); if (!qmakeDefines.isEmpty()) qmakeVars += QString("DEFINES += ") + qmakeDefines.join(" "); if (!qmakeIncludes.isEmpty()) - qmakeVars += QString("INCLUDEPATH += ") + escapeSeparators(qmakeIncludes.join(" ")); + qmakeVars += QString("INCLUDEPATH += ") + formatPaths(qmakeIncludes); if (!opensslLibs.isEmpty()) qmakeVars += opensslLibs; else if (dictionary[ "OPENSSL" ] == "linked") @@ -2503,7 +2508,7 @@ void Configure::generateOutputVars() { QStringList lflagsTDS; if (!sybase.isEmpty()) - lflagsTDS += QString("-L") + fixSeparators(sybase.section("=", 1) + "/lib"); + lflagsTDS += QString("-L") + formatPath(sybase.section("=", 1) + "/lib"); if (!sybaseLibs.isEmpty()) lflagsTDS += sybaseLibs.section("=", 1); if (!lflagsTDS.isEmpty()) @@ -2574,33 +2579,33 @@ void Configure::generateCachefile() QTextStream moduleStream(&moduleFile); moduleStream << "#paths" << endl; - moduleStream << "QT_BUILD_TREE = " << fixSeparators(dictionary[ "QT_BUILD_TREE" ], true) << endl; - moduleStream << "QT_SOURCE_TREE = " << fixSeparators(dictionary[ "QT_SOURCE_TREE" ], true) << endl; + moduleStream << "QT_BUILD_TREE = " << formatPath(dictionary["QT_BUILD_TREE"]) << endl; + moduleStream << "QT_SOURCE_TREE = " << formatPath(dictionary["QT_SOURCE_TREE"]) << endl; moduleStream << "QT_BUILD_PARTS = " << buildParts.join(" ") << endl << endl; - //so that we can build without an install first (which would be impossible) - moduleStream << "#local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR" << endl; - moduleStream << "QMAKE_INCDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/include", true) << endl; - moduleStream << "QMAKE_LIBDIR_QT = $$QT_BUILD_TREE" << fixSeparators("/lib", true) << endl; - - - QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ]; - QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec); + QString hostSpec = dictionary[ "QMAKESPEC" ]; + QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : hostSpec; + QString xmkspec_path = sourcePath + "/mkspecs/" + targetSpec; + if (QFile::exists(xmkspec_path)) + moduleStream << "XQMAKESPEC = " << xmkspec_path << endl; + else + moduleStream << "XQMAKESPEC = " << targetSpec << endl; + QString mkspec_path = sourcePath + "/mkspecs/" + hostSpec; if (QFile::exists(mkspec_path)) - moduleStream << "QMAKESPEC = " << escapeSeparators(mkspec_path) << endl; + moduleStream << "QMAKESPEC = " << mkspec_path << endl; else - moduleStream << "QMAKESPEC = " << fixSeparators(targetSpec, true) << endl; + moduleStream << "QMAKESPEC = " << hostSpec << endl; if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE") moduleStream << "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" << endl; if (dictionary["CETEST"] == "yes") { - moduleStream << "QT_CE_RAPI_INC = " << fixSeparators(dictionary[ "QT_CE_RAPI_INC" ], true) << endl; - moduleStream << "QT_CE_RAPI_LIB = " << fixSeparators(dictionary[ "QT_CE_RAPI_LIB" ], true) << endl; + moduleStream << "QT_CE_RAPI_INC = " << formatPath(dictionary["QT_CE_RAPI_INC"]) << endl; + moduleStream << "QT_CE_RAPI_LIB = " << formatPath(dictionary["QT_CE_RAPI_LIB"]) << endl; } moduleStream << "#Qt for Windows CE c-runtime deployment" << endl - << "QT_CE_C_RUNTIME = " << fixSeparators(dictionary[ "CE_CRT" ], true) << endl; + << "QT_CE_C_RUNTIME = " << formatPath(dictionary["CE_CRT"]) << endl; if (dictionary["CE_SIGNATURE"] != QLatin1String("no")) moduleStream << "DEFAULT_SIGNATURE=" << dictionary["CE_SIGNATURE"] << endl; @@ -2658,14 +2663,14 @@ void Configure::detectArch() { QString oldpwd = QDir::currentPath(); - QString newpwd = fixSeparators(QString("%1/config.tests/arch").arg(buildPath)); + QString newpwd = QString("%1/config.tests/arch").arg(buildPath); if (!QDir().exists(newpwd) && !QDir().mkpath(newpwd)) { - cout << "Failed to create directory " << qPrintable(newpwd) << endl; + cout << "Failed to create directory " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl; dictionary["DONE"] = "error"; return; } if (!QDir::setCurrent(newpwd)) { - cout << "Failed to change working directory to " << qPrintable(newpwd) << endl; + cout << "Failed to change working directory to " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl; dictionary["DONE"] = "error"; return; } @@ -2682,9 +2687,10 @@ void Configure::detectArch() QString subarchKey = data.subarchKey; // run qmake - QString command = - fixSeparators(QString("%1/bin/qmake.exe -spec %2 %3/config.tests/arch/arch.pro 2>&1") - .arg(buildPath, qmakespec, sourcePath)); + QString command = QString("%1 -spec %2 %3 2>&1") + .arg(QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"), + QDir::toNativeSeparators(qmakespec), + QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch.pro")); Environment::execute(command); // compile @@ -2756,22 +2762,23 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext { QString oldpwd = QDir::currentPath(); - QString newpwd = fixSeparators(QString("%1/config.tests/%2").arg(buildPath, projectPath)); + QString newpwd = QString("%1/config.tests/%2").arg(buildPath, projectPath); if (!QDir().exists(newpwd) && !QDir().mkpath(newpwd)) { - cout << "Failed to create directory " << qPrintable(newpwd) << endl; + cout << "Failed to create directory " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl; dictionary["DONE"] = "error"; return false; } if (!QDir::setCurrent(newpwd)) { - cout << "Failed to change working directory to " << qPrintable(newpwd) << endl; + cout << "Failed to change working directory to " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl; dictionary["DONE"] = "error"; return false; } // run qmake - QString command = - fixSeparators(QString("%1/bin/qmake.exe %2/config.tests/%3 %4 2>&1") - .arg(buildPath, sourcePath, projectPath, extraOptions)); + QString command = QString("%1 %2 %3 2>&1") + .arg(QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"), + QDir::toNativeSeparators(sourcePath + "/config.tests/" + projectPath), + extraOptions); int code = 0; QString output = Environment::execute(command, &code); //cout << output << endl; @@ -2853,7 +2860,7 @@ void Configure::generateQConfigPri() } if (!dictionary["QMAKE_RPATHDIR"].isEmpty()) - configStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl; + configStream << "QMAKE_RPATHDIR += " << formatPath(dictionary["QMAKE_RPATHDIR"]) << endl; if (!dictionary["QT_LIBINFIX"].isEmpty()) configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl; @@ -2865,12 +2872,9 @@ void Configure::generateQConfigPri() const QString angleDir = dictionary.value(QStringLiteral("ANGLE_DIR")); if (!angleDir.isEmpty()) { configStream - << "QMAKE_INCDIR_OPENGL_ES2 = " - << fixSeparators(angleDir + QStringLiteral("/include"), true) << '\n' - << "QMAKE_LIBDIR_OPENGL_ES2_DEBUG = " - << fixSeparators(angleDir + QStringLiteral("/lib/Debug"), true) << '\n' - << "QMAKE_LIBDIR_OPENGL_ES2_RELEASE = " - << fixSeparators(angleDir + QStringLiteral("/lib/Release"), true) + '\n'; + << "QMAKE_INCDIR_OPENGL_ES2 = " << angleDir << "/include\n" + << "QMAKE_LIBDIR_OPENGL_ES2_DEBUG = " << angleDir << "/lib/Debug\n" + << "QMAKE_LIBDIR_OPENGL_ES2_RELEASE = " << angleDir << "/lib/Release\n"; } } @@ -3109,7 +3113,8 @@ void Configure::generateConfigfiles() } QString spec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : dictionary["QMAKESPEC"]; - if (!copySpec("default", "", spec)) + if (!copySpec("default", "", spec) + || !copySpec("default-host", "host ", dictionary["QMAKESPEC"])) return; // Generate the new qconfig.cpp file @@ -3127,25 +3132,25 @@ void Configure::generateConfigfiles() << "static const char qt_configure_installation [11 + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl << endl << "static const char qt_configure_prefix_path_strs[][12 + 512] = {" << endl - << " \"qt_prfxpath=" << escapeSeparators(dictionary["QT_INSTALL_PREFIX"]) << "\"," << endl - << " \"qt_docspath=" << escapeSeparators(dictionary["QT_INSTALL_DOCS"]) << "\"," << endl - << " \"qt_hdrspath=" << escapeSeparators(dictionary["QT_INSTALL_HEADERS"]) << "\"," << endl - << " \"qt_libspath=" << escapeSeparators(dictionary["QT_INSTALL_LIBS"]) << "\"," << endl - << " \"qt_binspath=" << escapeSeparators(dictionary["QT_INSTALL_BINS"]) << "\"," << endl - << " \"qt_plugpath=" << escapeSeparators(dictionary["QT_INSTALL_PLUGINS"]) << "\"," << endl - << " \"qt_impspath=" << escapeSeparators(dictionary["QT_INSTALL_IMPORTS"]) << "\"," << endl - << " \"qt_datapath=" << escapeSeparators(dictionary["QT_INSTALL_DATA"]) << "\"," << endl - << " \"qt_trnspath=" << escapeSeparators(dictionary["QT_INSTALL_TRANSLATIONS"]) << "\"," << endl - << " \"qt_xmplpath=" << escapeSeparators(dictionary["QT_INSTALL_EXAMPLES"]) << "\"," << endl - << " \"qt_tstspath=" << escapeSeparators(dictionary["QT_INSTALL_TESTS"]) << "\"," << endl + << " \"qt_prfxpath=" << formatPath(dictionary["QT_INSTALL_PREFIX"]) << "\"," << endl + << " \"qt_docspath=" << formatPath(dictionary["QT_INSTALL_DOCS"]) << "\"," << endl + << " \"qt_hdrspath=" << formatPath(dictionary["QT_INSTALL_HEADERS"]) << "\"," << endl + << " \"qt_libspath=" << formatPath(dictionary["QT_INSTALL_LIBS"]) << "\"," << endl + << " \"qt_binspath=" << formatPath(dictionary["QT_INSTALL_BINS"]) << "\"," << endl + << " \"qt_plugpath=" << formatPath(dictionary["QT_INSTALL_PLUGINS"]) << "\"," << endl + << " \"qt_impspath=" << formatPath(dictionary["QT_INSTALL_IMPORTS"]) << "\"," << endl + << " \"qt_datapath=" << formatPath(dictionary["QT_INSTALL_DATA"]) << "\"," << endl + << " \"qt_trnspath=" << formatPath(dictionary["QT_INSTALL_TRANSLATIONS"]) << "\"," << endl + << " \"qt_xmplpath=" << formatPath(dictionary["QT_INSTALL_EXAMPLES"]) << "\"," << endl + << " \"qt_tstspath=" << formatPath(dictionary["QT_INSTALL_TESTS"]) << "\"," << endl << "#ifdef QT_BUILD_QMAKE" << endl - << " \"qt_ssrtpath=" << escapeSeparators(dictionary["CFG_SYSROOT"]) << "\"," << endl - << " \"qt_hpfxpath=" << escapeSeparators(dictionary["QT_HOST_PREFIX"]) << "\"," << endl - << " \"qt_hbinpath=" << escapeSeparators(dictionary["QT_HOST_BINS"]) << "\"," << endl - << " \"qt_hdatpath=" << escapeSeparators(dictionary["QT_HOST_DATA"]) << "\"," << endl + << " \"qt_ssrtpath=" << formatPath(dictionary["CFG_SYSROOT"]) << "\"," << endl + << " \"qt_hpfxpath=" << formatPath(dictionary["QT_HOST_PREFIX"]) << "\"," << endl + << " \"qt_hbinpath=" << formatPath(dictionary["QT_HOST_BINS"]) << "\"," << endl + << " \"qt_hdatpath=" << formatPath(dictionary["QT_HOST_DATA"]) << "\"," << endl << "#endif" << endl << "};" << endl - //<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << escapeSeparators(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl + //<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << formatPath(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl << endl << "/* strlen( \"qt_lcnsxxxx\") == 12 */" << endl << "#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;" << endl @@ -3287,19 +3292,19 @@ void Configure::displayConfig() sout << " SQLite2................." << dictionary[ "SQL_SQLITE2" ] << endl; sout << " InterBase..............." << dictionary[ "SQL_IBASE" ] << endl << endl; - sout << "Sources are in.............." << dictionary[ "QT_SOURCE_TREE" ] << endl; - sout << "Build is done in............" << dictionary[ "QT_BUILD_TREE" ] << endl; - sout << "Install prefix.............." << dictionary[ "QT_INSTALL_PREFIX" ] << endl; - sout << "Headers installed to........" << dictionary[ "QT_INSTALL_HEADERS" ] << endl; - sout << "Libraries installed to......" << dictionary[ "QT_INSTALL_LIBS" ] << endl; - sout << "Plugins installed to........" << dictionary[ "QT_INSTALL_PLUGINS" ] << endl; - sout << "Imports installed to........" << dictionary[ "QT_INSTALL_IMPORTS" ] << endl; - sout << "Binaries installed to......." << dictionary[ "QT_INSTALL_BINS" ] << endl; - sout << "Docs installed to..........." << dictionary[ "QT_INSTALL_DOCS" ] << endl; - sout << "Data installed to..........." << dictionary[ "QT_INSTALL_DATA" ] << endl; - sout << "Translations installed to..." << dictionary[ "QT_INSTALL_TRANSLATIONS" ] << endl; - sout << "Examples installed to......." << dictionary[ "QT_INSTALL_EXAMPLES" ] << endl; - sout << "Tests installed to.........." << dictionary[ "QT_INSTALL_TESTS" ] << endl; + sout << "Sources are in.............." << QDir::toNativeSeparators(dictionary["QT_SOURCE_TREE"]) << endl; + sout << "Build is done in............" << QDir::toNativeSeparators(dictionary["QT_BUILD_TREE"]) << endl; + sout << "Install prefix.............." << QDir::toNativeSeparators(dictionary["QT_INSTALL_PREFIX"]) << endl; + sout << "Headers installed to........" << QDir::toNativeSeparators(dictionary["QT_INSTALL_HEADERS"]) << endl; + sout << "Libraries installed to......" << QDir::toNativeSeparators(dictionary["QT_INSTALL_LIBS"]) << endl; + sout << "Plugins installed to........" << QDir::toNativeSeparators(dictionary["QT_INSTALL_PLUGINS"]) << endl; + sout << "Imports installed to........" << QDir::toNativeSeparators(dictionary["QT_INSTALL_IMPORTS"]) << endl; + sout << "Binaries installed to......." << QDir::toNativeSeparators(dictionary["QT_INSTALL_BINS"]) << endl; + sout << "Docs installed to..........." << QDir::toNativeSeparators(dictionary["QT_INSTALL_DOCS"]) << endl; + sout << "Data installed to..........." << QDir::toNativeSeparators(dictionary["QT_INSTALL_DATA"]) << endl; + sout << "Translations installed to..." << QDir::toNativeSeparators(dictionary["QT_INSTALL_TRANSLATIONS"]) << endl; + sout << "Examples installed to......." << QDir::toNativeSeparators(dictionary["QT_INSTALL_EXAMPLES"]) << endl; + sout << "Tests installed to.........." << QDir::toNativeSeparators(dictionary["QT_INSTALL_TESTS"]) << endl; if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith(QLatin1String("wince"))) { sout << "Using c runtime detection..." << dictionary[ "CE_CRT" ] << endl; @@ -3471,6 +3476,17 @@ void Configure::buildQmake() } QDir::setCurrent(pwd); } + + // Generate qt.conf + QFile confFile(buildPath + "/bin/qt.conf"); + if (confFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file. + QTextStream confStream(&confFile); + confStream << "[EffectivePaths]" << endl + << "Prefix=.." << endl; + + confStream.flush(); + confFile.close(); + } } #endif @@ -3621,10 +3637,10 @@ void Configure::generateMakefiles() || dictionary["VCPROJFILES"] == "yes"); while (generate) { QString pwd = QDir::currentPath(); - QString dirPath = fixSeparators(buildPath + dirName); + QString dirPath = buildPath + dirName; QStringList args; - args << fixSeparators(buildPath + "/bin/qmake"); + args << buildPath + "/bin/qmake"; if (doDsp) { if (dictionary[ "DEPENDENCIES" ] == "no") @@ -3636,7 +3652,6 @@ void Configure::generateMakefiles() printf("Generating Makefiles...\n"); generate = false; // Now Makefiles will be done } - // don't pass -spec - .qmake.cache has it already args << "-r"; args << (sourcePath + "/qtbase.pro"); args << "-o"; @@ -3644,7 +3659,7 @@ void Configure::generateMakefiles() if (!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty()) args << dictionary[ "QMAKEADDITIONALARGS" ]; - QDir::setCurrent(fixSeparators(dirPath)); + QDir::setCurrent(dirPath); if (int exitCode = Environment::execute(args, QStringList(), QStringList())) { cout << "Qmake failed, return code " << exitCode << endl << endl; dictionary[ "DONE" ] = "error"; @@ -3658,7 +3673,7 @@ void Configure::generateMakefiles() if (it->directory == "tools/configure") continue; // don't overwrite our own Makefile - QString dirPath = fixSeparators(it->directory + "/"); + QString dirPath = it->directory + '/'; QString projectName = it->proFile; QString makefileName = buildPath + "/" + dirPath + it->target; @@ -3669,30 +3684,29 @@ void Configure::generateMakefiles() QStringList args; - args << fixSeparators(buildPath + "/bin/qmake"); + args << QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"); args << sourcePath + "/" + dirPath + projectName; args << dictionary[ "QMAKE_ALL_ARGS" ]; - cout << "For " << qPrintable(dirPath + projectName) << endl; + cout << "For " << qPrintable(QDir::toNativeSeparators(dirPath + projectName)) << endl; args << "-o"; args << it->target; - args << "-spec"; - args << spec; if (!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty()) args << dictionary[ "QMAKEADDITIONALARGS" ]; - QDir::setCurrent(fixSeparators(dirPath)); + QDir::setCurrent(dirPath); QFile file(makefileName); if (!file.open(QFile::WriteOnly | QFile::Text)) { printf("failed on dirPath=%s, makefile=%s\n", - qPrintable(dirPath), qPrintable(makefileName)); + qPrintable(QDir::toNativeSeparators(dirPath)), + qPrintable(QDir::toNativeSeparators(makefileName))); continue; } QTextStream txt(&file); txt << "all:\n"; txt << "\t" << args.join(" ") << "\n"; - txt << "\t\"$(MAKE)\" -$(MAKEFLAGS) -f " << it->target << "\n"; + txt << "\t$(MAKE) -$(MAKEFLAGS) -f " << it->target << "\n"; txt << "first: all\n"; txt << "qmake:\n"; txt << "\t" << args.join(" ") << "\n"; diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 5aac227c9e..6b9d9b7f52 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -157,9 +157,8 @@ private: int descIndent; int outputWidth; - bool useUnixSeparators; - QString fixSeparators(const QString &somePath, bool escape = false); - QString escapeSeparators(const QString &somePath); + QString formatPath(const QString &path); + QString formatPaths(const QStringList &paths); bool filesDiffer(const QString &file1, const QString &file2); bool findFile(const QString &fileName); |