rewrite top-level configures without perl

otherwise the whole no-syncqt-and-thus-perl-needed stunt in qtbase would
be fairly useless for top-level builds.

Task-number: QTBUG-31786
Change-Id: I9f9b38091155a2d50ffec169267e0363fc24d3c0
Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Oswald Buddenhagen
2013-06-18 17:10:00 +02:00
committed by The Qt Project
parent 23a639d4cc
commit 8c2518eea4
2 changed files with 44 additions and 56 deletions

70
configure vendored
View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#! /bin/sh
#############################################################################
##
## Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
@@ -40,61 +40,23 @@
##
#############################################################################
####################################################################################################
#
# Mother script for Qt Modularization
#
####################################################################################################
srcpath=`dirname $0`
configure=$srcpath/qtbase/configure
if [ ! -e "$configure" ]; then
echo "$configure not found. Did you forget to run \"init-repository\"?" >&2
exit 1
fi
use strict;
use warnings;
mkdir -p qtbase || exit
use File::Basename;
use File::Path;
use Cwd;
use Cwd 'abs_path';
use Config;
echo "+ cd qtbase"
cd qtbase || exit
# Makes sure the arguments are directories, and creates them if not.
# Will die if there is an error.
sub ensureDir {
foreach (@_) {
if (-e $_) {
if (-d $_) {
next;
} else {
die ("$_ exists, but is not a directory");
}
}
File::Path::mkpath($_) or die("Could not create $_");
}
}
echo "+ $configure $@"
"$configure" "$@" || exit 1
# `system', but also print the command
sub system_v
{
print "+ @_\n";
return system(@_);
}
echo "+ cd .."
cd ..
my $relpath = dirname(abs_path($0));
$relpath =~ s,\\,/,g;
# the current directory is the "build tree" or "object tree"
my $outpath = getcwd();
if (! -e "$relpath/qtbase/configure") {
die("$relpath/qtbase/configure not found. Did you forget to run \"init-repository\"?");
}
ensureDir("$outpath/qtbase");
chdir("$outpath/qtbase");
my $ret = system_v("$relpath/qtbase/configure", @ARGV);
if ($ret != 0) {
print "*** qtbase/configure exited with non-zero status.\n";
exit ($ret>>8) ;
}
chdir("$outpath");
$ret = system_v("$outpath/qtbase/bin/qmake", "$relpath/qt.pro");
exit ($ret>>8);
echo "+ qtbase/bin/qmake $srcpath"
exec qtbase/bin/qmake "$srcpath"

View File

@@ -1,3 +1,4 @@
@echo off
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
@@ -38,5 +39,30 @@
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@rem ***** This assumes PERL is in the PATH *****
@perl.exe %~dp0configure %*
set "srcpath=%~dp0"
set "configure=%srcpath%qtbase\configure.bat"
if not exist "%configure%" (
echo %configure% not found. Did you forget to run "init-repository"? >&2
exit /b 1
)
if not exist qtbase mkdir qtbase || exit /b 1
echo + cd qtbase
cd qtbase || exit /b 1
echo + %configure% %*
call %configure% %*
set err=%errorlevel%
cd ..
if not %err% == 0 goto out
echo + qtbase\bin\qmake %srcpath%
qtbase\bin\qmake %srcpath%
set err=%errorlevel%
:out
exit /b %err%