diff options
-rwxr-xr-x | configure | 70 | ||||
-rw-r--r-- | configure.bat | 30 |
2 files changed, 44 insertions, 56 deletions
@@ -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" diff --git a/configure.bat b/configure.bat index 399dd339..73395684 100644 --- a/configure.bat +++ b/configure.bat @@ -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% |