#!/usr/bin/perl
use strict;
use warnings;

use Cwd;
use File::Basename;
use lib ( dirname($0) );
use Qtopia::Paths;
use Qtopia::Vars;

Qtopia::Paths::get_paths();

# Windows depot builds use the perl scripts directly rather than the compiled code
if ( $isWindows ) {
    check_script($0, "$depotpath/src/build/bin", $ARGV[0]);
}

$ENV{QTDIR} = $qt_depot_path;

# This is a wrapper that serves to let Windows users run syncqt without having perl installed.
# Load the syncqt perl script into this interpreter.
my $syncqt = shift(@ARGV);
$0 = $syncqt;
open IN, "$syncqt" or die "Can't read $syncqt";
my @data = <IN>;
close IN;
my $script = join("", @data);
eval $script;
if ( $@ ) {
    die "Error while evaluating $syncqt:\n$@";
}
exit 0;
