提交 a3f7c847 编写于 作者: P Peter Kuhn

[stv] Modify STV build scripts to build with latest toolchains.

上级 306f2ba3
#!/usr/bin/perl
package PrepareSTVNDK;
use File::Spec;
use File::Basename qw(dirname basename);
use lib File::Spec->rel2abs(dirname(__FILE__));
use PrepareSTVNDK;
if ($#ARGV + 1 == 0)
{
print "Usage:\n";
print "\t" . basename(__FILE__) . " -ndk=<rX>\n";
print "\ti.e. \"" . basename(__FILE__) . " -ndk=r01 -env=setupenv.sh && source setupenv.sh\"\n";
print "\n";
}
my ($sdk, $tools, $ndk, $env);
Getopt::Long::GetOptions("ndk=s"=>\$ndk, "env=s"=>\$setenv) or die ("Illegal cmdline options");
PrepareSTVNDK::GetSTVNDK($ndk, $setenv);
#!/usr/bin/perl
package PrepareSTVNDK;
use strict;
use warnings;
use Getopt::Long;
use Carp qw(croak carp);
use File::Path qw(mkpath rmtree);
use File::Spec::Functions;
use File::Copy;
use File::Basename;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK=qw(GetSTVNDK);
our $NDK_ROOT_ENV = "STV_NDK_ROOT";
our $NDK_VERSION_ENV = "STV_NDK_VERSION";
our $BASE_URL_NDK = "https://rhodecode.unity3d.com/unity-extra/stv-sdk";
#our $BASE_URL_NDK = "~/stv-sdk";
our $BASE_URL_NDK_MIRROR = "http://mercurial-mirror.hq.unity3d.com/unity-extra/stv-sdk";
our $FOLDER_PREFIX = "stv-ndk";
our ($HOST_ENV, $TMP, $HOME, $WINZIP);
sub GetSTVNDK
{
if(lc $^O eq 'darwin')
{
$HOST_ENV = "macosx";
$TMP = $ENV{"TMPDIR"};
$HOME = $ENV{"HOME"};
}
elsif(lc $^O eq 'linux')
{
$HOST_ENV = "linux";
$TMP = "/tmp";
$HOME = $ENV{"HOME"};
}
elsif(lc $^O eq 'mswin32')
{
$HOST_ENV = "windows";
$TMP = $ENV{"TMP"};
$HOME = $ENV{"USERPROFILE"};
if (-e "Tools/WinUtils/7z/7z.exe")
{
$WINZIP = "Tools/WinUtils/7z/7z.exe";
}
}
elsif(lc $^O eq 'cygwin')
{
$HOST_ENV = "windows";
$TMP = $ENV{"TMP"};
$HOME = $ENV{"HOME"};
}
else
{
die "UNKNOWN " . $^O;
}
print "Environment:\n";
print "\tHost = $HOST_ENV\n";
print "\tTemporary = $TMP\n";
print "\tHome = $HOME\n";
print "\n";
print "\t\$$NDK_ROOT_ENV = $ENV{$NDK_ROOT_ENV}\n" if ($ENV{$NDK_ROOT_ENV});
print "\n";
my ($ndk, $setenv) = @_;
# Allow version override via env var
if ($ENV{$NDK_VERSION_ENV})
{
print("Overrideing SDK version from $ndk to" . $ENV{$NDK_VERSION_ENV} . "\n");
$ndk = $ENV{$NDK_VERSION_ENV};
}
if ($ndk)
{
print "Installing NDK '$ndk':\n";
if (!$ENV{$NDK_ROOT_ENV})
{
$ENV{$NDK_ROOT_ENV} = catfile($HOME, $FOLDER_PREFIX . "-auto-" . $ndk);
print "\t\$$NDK_ROOT_ENV not set; using $ENV{$NDK_ROOT_ENV} instead\n";
}
PrepareNDK($ndk);
PrepareNDKEnv($ndk);
print "\n";
}
my $export = "export";
if (lc $^O eq 'mswin32')
{
$export = "set";
}
if ($setenv and ($ENV{$NDK_ROOT_ENV}))
{
print "Outputing updated environment:\n";
print "\t'$setenv'\n";
open (SETENV, '>' . $setenv);
print SETENV "$export $NDK_ROOT_ENV=$ENV{$NDK_ROOT_ENV}\n" if ($ENV{$NDK_ROOT_ENV});
close (SETENV);
print "\n";
}
print "Environment:\n" if ($ENV{$NDK_ROOT_ENV});
print "\t\$$NDK_ROOT_ENV = $ENV{$NDK_ROOT_ENV}\n" if ($ENV{$NDK_ROOT_ENV});
print "\n";
if (not $ENV{STV_NDK})
{
print "ERROR: STV_NDK env var not set after setting up SDK.. try again next time\n";
unlink($ENV{$NDK_ROOT_ENV} . "/RELEASE.TXT") if ($ENV{$NDK_ROOT_ENV});
}
}
sub DownloadAndUnpackArchive
{
my ($url, $output, $compressed_file, $ndk) = @_;
my ($base,$base_url) = fileparse($url, qr/\.[^.]*/);
my ($dest_name,$dest_path) = fileparse($output);
my ($branch,$notUsed2,$suffix) = fileparse($compressed_file,qr/\.\D.*/);
my $temporary_download_path = catfile($TMP, $base);
my $temporary_download_file = catfile($temporary_download_path, $compressed_file);
my $temporary_unpack_path = catfile($TMP, $base . "_unpack");
print "\t\tURL: " . $url . "\n";
print "\t\tBranch: " . $branch . "\n";
print "\t\tOutput: " . $output . "\n";
print "\t\tBase: " . $base . "\n";
print "\t\tURL base: " . $base_url . "\n";
print "\t\tSuffix: " . $suffix . "\n";
print "\t\tTmp DL: " . $temporary_download_path . "\n";
print "\t\tTmp DL File: " . $temporary_download_file . "\n";
print "\t\tTmp unpack: " . $temporary_unpack_path . "\n";
print "\t\tDest path: " . $dest_path . "\n";
print "\t\tDest name: " . $dest_name . "\n";
print "\t\tFile: " . $compressed_file . "\n";
# remove old output
rmtree($output);
mkpath($dest_path);
# create temporary locations
rmtree($temporary_download_path);
rmtree($temporary_unpack_path);
mkpath($temporary_download_path);
mkpath($temporary_unpack_path);
print "\t\t Cloning Mercurial Repository.\n";
system ("hg clone -b $branch $url $temporary_download_path") == 0 or die("Failed to clone branch -- sdk doesn't exist or improper mercurial privileges");
if ($WINZIP)
{
system($WINZIP, "x", $temporary_download_file, "-o" . $temporary_unpack_path);
}
else
{
if (lc $suffix eq '.zip')
{
system("unzip", "-q", $temporary_download_file, "-d", $temporary_unpack_path);
}
elsif (lc $suffix eq '.tar.bz2')
{
system("tar", "-xf", $temporary_download_file, "-C", $temporary_unpack_path);
}
else
{
die "Unknown file extension '" . $suffix . "'\n";
}
}
opendir(my $dh, $temporary_unpack_path);
my @dirs = grep { !/^\.\.?$/ && -d catfile($temporary_unpack_path, $_) } readdir($dh);
closedir $dh;
my $unpacked_subdir = catfile($temporary_unpack_path, $dirs[0]);
move($unpacked_subdir, $output);
unlink($temporary_download_file);
for my $f (glob catfile($temporary_download_path, '*'))
{
print ("move $f -> $output/$f\n");
move($f, $output);
}
# clean up
rmtree($temporary_download_path);
rmtree($temporary_unpack_path);
# Write out file to tag this directory as a paticular NDK version.
my $release_file = catfile($output,"RELEASE.TXT");
system("echo $ndk > $release_file");
}
sub PrepareNDK
{
my ($ndk) = @_;
my $ndk_root = $ENV{$NDK_ROOT_ENV};
$ndk_root = $1 if($ndk_root=~/(.*)\/$/);
if (-e $ndk_root and open RELEASE, "<", catfile("$ndk_root", "RELEASE.TXT"))
{
my @content = <RELEASE>;
close RELEASE;
chomp(@content);
my $current = $content[0];
print "\tCurrently installed = " . $current . "\n";
if ($ndk eq $current)
{
print "\tNDK '$ndk' is already installed\n";
return;
}
else
{
my ($current_name,$path) = fileparse($ndk_root);
$ENV{$NDK_ROOT_ENV} = catfile($path, $FOLDER_PREFIX . "-" . $ndk);
print "\t\$$NDK_ROOT_ENV is pointing to a mismatching NDK; using $ENV{$NDK_ROOT_ENV} instead\n";
PrepareNDK($ndk);
return;
}
}
rmtree($ndk_root);
my $archive = "$FOLDER_PREFIX-$ndk-$HOST_ENV.tar.bz2";
die ("Unknown NDK release '$ndk' (for $HOST_ENV)") if (!$archive);
print "\tDownloading '$ndk' to '$ndk_root'\n";
if ($ENV{UNITY_THISISABUILDMACHINE})
{
DownloadAndUnpackArchive($BASE_URL_NDK_MIRROR, $ndk_root, $archive, $ndk);
}
else
{
DownloadAndUnpackArchive($BASE_URL_NDK, $ndk_root, $archive, $ndk);
}
}
sub PrepareNDKEnv
{
my ($ndk) = @_;
my $ndk_root = $ENV{$NDK_ROOT_ENV};
if (-e $ndk_root and open CONFIG, "<", catfile("$ndk_root", $FOLDER_PREFIX . "-env.sh"))
{
my $i = 0;
my $tmp = catfile("$ndk_root", $FOLDER_PREFIX . "-env.sh");
my @variables = ("STV_NDK","STV_GCC_PREFIX","STV_HEADERS");
open(CONFIG, ". $tmp; echo \$STV_NDK; echo \$STV_GCC_PREFIX; echo \$STV_HEADERS |");
while(<CONFIG>)
{
chomp($_);
$ENV{$variables[$i]} = $_;
print "\t$variables[$i] = $ENV{$variables[$i]}\n";
$i++;
}
close CONFIG;
}
}
1;
#!/usr/bin/perl
package SDKDownloader;
use strict;
use warnings;
use Cwd;
use File::Basename qw(dirname basename);
use File::Path qw(mkpath rmtree);
use File::Spec::Functions;
use File::Copy;
use File::Basename;
use Getopt::Long;
use lib File::Spec->rel2abs(dirname(__FILE__)).'/.';
# Override this value to point to a local directory for local testing
my $base_url = "https://rhodecode.unity3d.com/unity-extra/";
my $base_url_mirror = "http://mercurial-mirror.hq.unity3d.com/unity-extra/";
# SDKDownloader fetches the default branch of a remote repository located at $base_url/$repo_name.
# The default branch contains an SDK.pm which specifies the version of the SDK along with branch information.
# It also has methods to install the sdk and check if it is installed.
# Named branches of the repository contain different versions of the sdk for different platforms.
# If necessary, this script clones the appropriate branch for the given version and installs the SDK.
# Version number is set in SDK.pm but can be overriden via $sdk_override passed to PepareSDK.
# By default the install location is set to HOME but each SDK can override this, and it can be overriden
# by setting the environment variable UNITY_SDK_LOCATION.
# https://rhodecode.unity3d.com/unity-extra/stv-sdk
# - branch: default
# - SDK.pm contains the following:
#
# our %default_values = (
# # Current version of the sdk that everything will build with unless sdk-override is specified.
# # Change this to update SDK globally.
# version => "r03",
#
# # Format of the branches for updating
# # \$version is replaced with the version number
# # \$platform is replaced with the platform name
# branch => "stv-ndk-\$version-\$platform",
#
# # Format of the archive that exists after updating to the above branch.
# # The same substition applies as above.
# archive => "stv-ndk-\$version-\$platform.tar.bz2",
#
# # The format of the above archive.
# # Valid values: zip, gzip, bz2
# compress_format => "bz2",
#
# # The following are filled out by the SDKDownloader.pm
# install_path => "",
# );
#
# sub IsCorrectVersionInstalled
# - Determine if the SDK for $config->{version} is installed.
#
# sub InstallSDK
# - Install the SDK for $config->{version}.
# - SDK has already been cloned to $sdk_download->{clone_path}
# - SDK has already been extracted to $sdk_download->{unpack_path}
# - This should install it to $config->{install_path} if necessary, or put it wherever it goes.
#
# sub SetupSDK
# - This is called on each build after the SDK is confirmed to be installed.
# - This can do whatever per build setup you need to do here such as setting ENV vars.
#
# - branch: stv-ndk-r03-linux
# - stv-ndk-r03-linux.tar.bz2
#
# The named branches have one platform / revision archive each. They are discovered via the patterns
# in SDK.pm's default_values' branch / archive strings.
# Main entry point to SDKDownloader system:
# repo_name: name of the repo at $base_url
# sdk_override: SDK revision to install. Leave blank to install the "default" (from SDK.pm)
# artifacts_folder: Place to pull and update the inividual SDK repos.
sub PrepareSDK
{
my ($repo_name, $sdk_override, $artifacts_folder) = @_;
# let the user decide to use the SDK that's locally installed.
# Handy if the connection to the repo is really slow or unavailable.
if( $sdk_override eq "local" )
{
print "[SDKDownloader] using local SDK.\n";
return;
}
$repo_name || die ("ERROR: repo_name not set");
my $cwd = getcwd;
my $dir = File::Spec->rel2abs (dirname ($0));
if ($artifacts_folder)
{
$dir = catfile($artifacts_folder, "SDKDownloader");
mkpath ($dir);
}
chdir ($dir);
# Obtain platform specific information
my $host_config = GetHostDetails();
print "[SDKDownloader] Begin SDK check: $repo_name ...\n";
my $vcs_url = GetBaseURL() . $repo_name;
# Clones / Updates the specific SDK repo which contains the sdk perl module
UpdateSDKRepo($repo_name, $vcs_url, $dir);
# Load in the SDK specific perl module
my $module = "SDK.pm";
require $module;
# Obtain default SDK configuration so we can fill out values
\%SDK::default_values || die ("ERROR: SDK.pm does not contain default values.");
my $sdk_config = \%SDK::default_values;
# apply sdk override if necessary
$sdk_config->{version} = $sdk_override if $sdk_override;
# set the branch/archive name given our current version and platform
$sdk_config->{branch} =~ s/\$version/$sdk_config->{version}/;
$sdk_config->{branch} =~ s/\$platform/$host_config->{platform}/;
$sdk_config->{archive} =~ s/\$version/$sdk_config->{version}/;
$sdk_config->{archive} =~ s/\$platform/$host_config->{platform}/;
$sdk_config->{install_path} = $host_config->{install_path};
$sdk_config->{host_config} = $host_config;
$sdk_config->{vcs_url} = $vcs_url;
# Determine if the SDK for $version is installed.
if (SDK::IsCorrectVersionInstalled ($sdk_config))
{
print "[SDKDownloader] SDK $sdk_config->{version} is already installed ...\n";
}
else
{
my $sdk_download = DownloadAndExtractSDK ($sdk_config, $repo_name);
# Install the SDK for $version.
# SDK has already been cloned to $sdk_download->{clone_path}
# SDK has already been extracted to $sdk_download->{unpack_path}
# This should install it to $sdk_config->{install_path} if necessary, or put it wherever it goes.
SDK::InstallSDK ($sdk_config, $sdk_download);
CleanupSDKDownload ($sdk_download);
if (!SDK::IsCorrectVersionInstalled($sdk_config))
{
die ("Failed to install SDK. Something is wrong with $vcs_url SDK.pm?");
}
}
# This is called on each build after the SDK is confirmed to be installed.
# This can do whatever per build setup you need to do here such as setting ENV vars.
print "[SDKDownloader] Setup SDK ...\n";
SDK::SetupSDK ($sdk_config);
print "[SDKDownloader] Setup complete for $repo_name at version $sdk_config->{version}.\n";
chdir ($cwd);
}
# Pulls / Updates the SDK repo $vcs_url to $dir (artifacts) if necessary.
# We avoid calling hg update every build by caching the parent revision and only updating when it changes.
sub UpdateSDKRepo
{
my ($repo_name, $vcs_url, $dir) = @_;
print "[SDKDownloader] Checking if we need to update $vcs_url ...\n";
# We want to avoid calling hg update every time we build, so cache the parent revision
# and only update if it changes
my $parent_rev = "parent";
# check if we're in a mercurial repo
if (system("hg parent --template \"{node}\"") == 0)
{
$parent_rev = `hg parent --template "{node}"`;
}
# check if we're in a git repo
elsif (system("git rev-parse HEAD") == 0)
{
$parent_rev = `git rev-parse HEAD`;
}
# else we'll just pull every time
my $old_rev = "";
if (open (REV, "<$repo_name-rev.txt"))
{
$old_rev = <REV>;
close (REV);
}
# If the sdk repo already exists just update it
my $updated = 0;
if (-d $repo_name)
{
print "[SDKDownloader] \tOLD REV: $old_rev\n";
print "[SDKDownloader] \tPARENT_REV: $parent_rev\n";
chdir ($repo_name);
if ($old_rev ne $parent_rev)
{
print "[SDKDownloader] Updating $vcs_url (branch default) at $dir ...\n\n";
system ("hg pull $vcs_url") && die ("ERROR: can't hg pull $vcs_url");
system ("hg update") && die ("ERROR: can't hg update $vcs_url");
$updated = 1;
}
}
else
{
print "[SDKDownloader] Cloning $vcs_url (branch default) to $dir ...\n";
system ("hg clone $vcs_url") && die ("ERROR: can't hg clone $vcs_url");
chdir ($repo_name);
$updated = 1;
}
if ($updated)
{
open (REV, ">../$repo_name-rev.txt") or die ("ERROR: Couldn't open $repo_name-rev.txt for writing.");
print REV $parent_rev;
close (REV);
}
else
{
print "[SDKDownloader] Repo has not changed parent since last build, no need to get latest $repo_name.\n";
}
}
# Pulls and extracts a specific revision of the SDK.
# sdk_config:
# version: version of sdk to install
# branch: branch name of repo to clone
# archive: archive name in repo to extract
# compress_format: format of archive
# temp_folder_name: basename of folder to use
# returns:
# sdk_download:
# clone_path: location the sdk repo is cloned to
# unpack_path: location the archive is extracted to
#
# NOTE: must call CleanupSDKDownload to remove clone_path and unpack_path when done.
sub DownloadAndExtractSDK
{
my ($sdk_config, $temp_folder_name) = @_;
my $host_config = $sdk_config->{host_config};
my $vcs_url = $sdk_config->{vcs_url};
# Download and extract SDK
my $temp_clone_path = catfile ($host_config->{tmp}, $temp_folder_name);
my $temp_archive_file = catfile ($temp_clone_path, $sdk_config->{archive});
my $temp_unpack_path = catfile ($host_config->{tmp}, $temp_folder_name . "_unpack");
print "[SDKDownloader]\tInstalling SDK $sdk_config->{version} ...\n";
print "[SDKDownloader]\t\tTmp DL: " . $temp_clone_path . "\n";
print "[SDKDownloader]\t\tTmp DL File: " . $temp_archive_file . "\n";
print "[SDKDownloader]\t\tTmp unpack: " . $temp_unpack_path . "\n";
rmtree ($temp_clone_path);
rmtree ($temp_unpack_path);
mkpath ($temp_clone_path);
mkpath ($temp_unpack_path);
# obtain sdk
print "\n[SDKDownloader]\t\tCloning SDK $vcs_url (branch $sdk_config->{branch}) ...\n";
system ("hg clone -b $sdk_config->{branch} $vcs_url $temp_clone_path") && die ("ERROR: can't hg clone -b $sdk_config->{branch} $vcs_url $temp_clone_path");
# extract sdk
my $sdk_compressed_format = $sdk_config->{compress_format};
print "[SDKDownloader]\t\tCompress format: $sdk_compressed_format\n";
my $uncompress = $host_config->{uncompressors}{$sdk_compressed_format};
$uncompress =~ s/\$ARCHIVE/$temp_archive_file/;
$uncompress =~ s/\$OUT_DIR/$temp_unpack_path/;
print "[SDKDownloader]\t\tExtracting $temp_archive_file => $temp_unpack_path ...\n";
print "[SDKDownloader]\t\t\t$uncompress\n";
system ($uncompress);
unlink ($temp_archive_file);
my %sdk_download = (
clone_path => $temp_clone_path,
unpack_path => $temp_unpack_path,
);
return \%sdk_download;
}
# Removes temporary files from DownloadAndExtractSDK.
sub CleanupSDKDownload
{
my ($sdk_download) = @_;
rmtree ($sdk_download->{unpack_path});
rmtree ($sdk_download->{clone_path});
}
# Returns information about the host environment.
sub GetHostDetails
{
my $HOST_ENV;
my $TMP;
my $HOME;
my %UNCOMPRESSORS = (
"zip" => "unzip -d \$OUT_DIR \$ARCHIVE",
"gzip" => "tar -C \$OUT_DIR -xf \$ARCHIVE",
"bz2" => "tar -C \$OUT_DIR -xf \$ARCHIVE",
"7z" => "7za x \$ARCHIVE -o\$OUT_DIR",
);
if (lc $^O eq 'darwin')
{
$HOST_ENV = "macosx";
$TMP = $ENV{"TMPDIR"};
$HOME = $ENV{"HOME"};
}
elsif (lc $^O eq 'linux')
{
$HOST_ENV = "linux";
$TMP = "/tmp";
$HOME = $ENV{"HOME"};
}
elsif (lc $^O eq 'mswin32')
{
$HOST_ENV = "windows";
$TMP = $ENV{"TMP"};
$HOME = $ENV{"USERPROFILE"};
my $WINZIP = "7z.exe";
if (-e "Tools/WinUtils/7z/7z.exe")
{
$WINZIP = "Tools/WinUtils/7z/7z.exe";
}
%UNCOMPRESSORS = (
"zip" => "$WINZIP x \$ARCHIVE -o\$OUT_DIR",
"gzip" => "$WINZIP x -so -tgzip \$ARCHIVE | $WINZIP x -si -ttar -o\$OUT_DIR",
"bz2" => "$WINZIP x -so -tbzip2 \$ARCHIVE | $WINZIP x -si -ttar -o\$OUT_DIR",
"7z" => "$WINZIP x \$ARCHIVE -o\$OUT_DIR",
);
}
elsif (lc $^O eq 'cygwin')
{
$HOST_ENV = "windows";
$TMP = $ENV{"TMP"};
$HOME = $ENV{"HOME"};
}
else
{
die "UNKNOWN " . $^O;
}
# override home location
if ($ENV{UNITY_SDK_LOCATION})
{
$HOME = $ENV{UNITY_SDK_LOCATION};
}
my %host_config = (platform => $HOST_ENV,
tmp => $TMP,
install_path => $HOME,
uncompressors => \%UNCOMPRESSORS);
return \%host_config;
}
# Returns HG url
sub GetBaseURL
{
if ($ENV{UNITY_THISISABUILDMACHINE})
{
return $base_url_mirror;
}
return $base_url;
}
sub ParseCmdline
{
my (@ARGV) = @_;
my ($repo_name, $sdk_override, $artifacts_folder);
GetOptions (
"repo_name=s" => \$repo_name,
"sdk_override=s" => \$sdk_override,
"artifacts_folder=s" => \$artifacts_folder,
) or die ("could not parse commandline");
PrepareSDK($repo_name, $sdk_override, $artifacts_folder);
}
__PACKAGE__->ParseCmdline(@ARGV) unless caller;
1;
......@@ -2,18 +2,33 @@
PREFIX=`pwd`/builds/stv
OUTDIR=builds/embedruntimes/stv
perl SDKDownloader.pm --repo_name=stv-sdk --artifacts_folder=artifacts && source artifacts/SDKDownloader/stv-sdk/env.sh
perl PrepareSTVNDK.pl -ndk=r03 -env=envsetup.sh && source envsetup.sh && source ${STV_NDK_ROOT}/stv-ndk-env.sh
rm -rf builds
for STV_TARGET in ${STV_TARGETS}; do
echo "BUILDING FOR $STV_TARGET"
OUTDIR=builds/embedruntimes/stv/$STV_TARGET
STV_GCC_PREFIX="STV_GCC_PREFIX_${STV_TARGET}"
STV_GCC_PREFIX="${!STV_GCC_PREFIX}"
CXXFLAGS="-DARM_FPU_VFP=1 -D__ARM_EABI__ -mno-thumb -march=armv7-a -mfpu=vfpv3 -mtune=cortex-a9 -fPIC";
CC="${STV_GCC_PREFIX}gcc"
CXX="${STV_GCC_PREFIX}g++"
AR="${STV_GCC_PREFIX}ar"
LD="${STV_GCC_PREFIX}ld"
LDFLAGS=""
# need to swap flags when building for different platforms.
CXXFLAGS="-g -DARM_FPU_VFP=1 -DHAVE_ARMV6=1 -D__ARM_EABI__ -DLINUX -D__linux__ -DHAVE_PTHREAD_MUTEX_TIMEDLOCK -march=armv7-a -mfpu=vfp -mfloat-abi=softfp -fpic -funwind-tables -ffunction-sections -fdata-sections";
CC="${STV_GCC_PREFIX}gcc"
CXX="${STV_GCC_PREFIX}g++"
AR="${STV_GCC_PREFIX}ar"
LD="${STV_GCC_PREFIX}ld"
LDFLAGS="-Wl,--fix-cortex-a8"
CONFIG_OPTS="\
echo "CXXFLAGS= ${CXXFLAGS}"
echo "CC= ${CC}"
echo "CXX= ${CXX}"
echo "AR= ${AR}"
echo "LD= ${LD}"
echo "LDFLAGS= ${LDFLAGS}"
CONFIG_OPTS="\
--prefix=$PREFIX \
--cache-file=stv_cross.cache \
--host=arm-unknown-linux-gnueabi \
......@@ -26,25 +41,28 @@ CONFIG_OPTS="\
--disable-nls \
mono_cv_uscore=yes"
make clean && make distclean
rm stv_cross.cache
make clean && make distclean
rm stv_cross.cache
pushd eglib
autoreconf -i
popd
autoreconf -i
pushd eglib
autoreconf -i
popd
autoreconf -i
# Run configure
./configure $CONFIG_OPTS CFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" CC="$CC" CXX="$CXX" AR="$AR" LD="$LD"
# Run configure
./configure $CONFIG_OPTS CFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" CC="$CC" CXX="$CXX" AR="$AR" LD="$LD"
# Run Make
make && echo "Build SUCCESS!" || exit 1
# Run Make
make && echo "Build SUCCESS!" || exit 1
rm -rf builds
mkdir -p $OUTDIR
cp -f mono/mini/.libs/libmono.a $OUTDIR
if [ -d builds/monodistribution ] ; then
rm -r builds/monodistribution
fi
done
mkdir -p $OUTDIR
cp -f mono/mini/.libs/libmono.a $OUTDIR
# Support backwards compatibility with old file location
cp -f builds/embedruntimes/stv/STANDARD_13/libmono.a builds/embedruntimes/stv/libmono.a
if [ -d builds/monodistribution ] ; then
rm -r builds/monodistribution
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册