mirror of
https://github.com/love2d/love-android.git
synced 2026-08-20 12:40:28 +02:00
Updated SDL2 to changeset 69a5f3a540af (dev version of 2.0.4)
This commit is contained in:
@@ -115,7 +115,7 @@ echo "public class $ACTIVITY extends SDLActivity {}" >> "$ACTIVITY.java"
|
||||
|
||||
# Update project and build
|
||||
cd $BUILDPATH
|
||||
android update project --path $BUILDPATH
|
||||
$ANDROID update project --path $BUILDPATH
|
||||
$NDKBUILD -j $NCPUS $NDKARGS
|
||||
$ANT debug
|
||||
|
||||
|
||||
+1
@@ -898,6 +898,7 @@ EOF
|
||||
else
|
||||
case `sed -n '/^Hardware/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
BCM2708) MANUFACTURER=raspberry;;
|
||||
BCM2709) MANUFACTURER=raspberry;;
|
||||
*) MANUFACTURER=unknown;;
|
||||
esac
|
||||
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
|
||||
+2
@@ -1534,6 +1534,8 @@ case $os in
|
||||
-pnacl*)
|
||||
os=-pnacl
|
||||
;;
|
||||
-emscripten*)
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
|
||||
SDKDIR="/emsdk_portable"
|
||||
ENVSCRIPT="$SDKDIR/emsdk_env.sh"
|
||||
if [ ! -f "$ENVSCRIPT" ]; then
|
||||
echo "ERROR: This script expects the Emscripten SDK to be in '$SDKDIR'." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TARBALL="$1"
|
||||
if [ -z $1 ]; then
|
||||
TARBALL=sdl-emscripten.tar.xz
|
||||
fi
|
||||
|
||||
cd `dirname "$0"`
|
||||
cd ..
|
||||
SDLBASE=`pwd`
|
||||
|
||||
if [ -z "$MAKE" ]; then
|
||||
OSTYPE=`uname -s`
|
||||
if [ "$OSTYPE" == "Linux" ]; then
|
||||
NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
|
||||
let NCPU=$NCPU+1
|
||||
elif [ "$OSTYPE" = "Darwin" ]; then
|
||||
NCPU=`sysctl -n hw.ncpu`
|
||||
elif [ "$OSTYPE" = "SunOS" ]; then
|
||||
NCPU=`/usr/sbin/psrinfo |wc -l |sed -e 's/^ *//g;s/ *$//g'`
|
||||
else
|
||||
NCPU=1
|
||||
fi
|
||||
|
||||
if [ -z "$NCPU" ]; then
|
||||
NCPU=1
|
||||
elif [ "$NCPU" = "0" ]; then
|
||||
NCPU=1
|
||||
fi
|
||||
|
||||
MAKE="make -j$NCPU"
|
||||
fi
|
||||
|
||||
echo "\$MAKE is '$MAKE'"
|
||||
|
||||
echo "Setting up Emscripten SDK environment..."
|
||||
source "$ENVSCRIPT"
|
||||
|
||||
echo "Setting up..."
|
||||
set -x
|
||||
cd "$SDLBASE"
|
||||
rm -rf buildbot
|
||||
mkdir buildbot
|
||||
pushd buildbot
|
||||
|
||||
echo "Configuring..."
|
||||
emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl2-installed"
|
||||
|
||||
echo "Building..."
|
||||
emmake $MAKE
|
||||
|
||||
echo "Moving things around..."
|
||||
emmake $MAKE install
|
||||
# Fix up a few things to a real install path
|
||||
perl -w -pi -e "s#$PWD/emscripten-sdl2-installed#/usr/local#g;" ./emscripten-sdl2-installed/lib/libSDL2.la ./emscripten-sdl2-installed/lib/pkgconfig/sdl2.pc ./emscripten-sdl2-installed/bin/sdl2-config
|
||||
mkdir -p ./usr
|
||||
mv ./emscripten-sdl2-installed ./usr/local
|
||||
popd
|
||||
tar -cJvvf $TARBALL -C buildbot usr
|
||||
rm -rf buildbot
|
||||
|
||||
exit 0
|
||||
|
||||
# end of emscripten-buildbot.sh ...
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer"
|
||||
|
||||
# Intel 32-bit compiler flags (10.6 runtime compatibility)
|
||||
# Intel 32-bit compiler flags (10.5 runtime compatibility)
|
||||
GCC_COMPILE_X86="g++ -arch i386 -mmacosx-version-min=10.5 \
|
||||
-I/usr/local/include"
|
||||
|
||||
@@ -34,7 +34,7 @@ while test x$1 != x; do
|
||||
compile=no; link=no;;
|
||||
-c) link=no;;
|
||||
-o) output=$2;;
|
||||
*.c|*.cc|*.cpp|*.S) source=$1;;
|
||||
*.c|*.cc|*.cpp|*.S|*.m|*.mm) source=$1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
@@ -35,7 +35,7 @@ while test x$1 != x; do
|
||||
compile=no; link=no;;
|
||||
-c) link=no;;
|
||||
-o) output=$2;;
|
||||
*.c|*.cc|*.cpp|*.S) source=$1;;
|
||||
*.c|*.cc|*.cpp|*.S|*.m|*.mm) source=$1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
find . -type f -exec grep -Il "Copyright" {} \; \
|
||||
| grep -v \.hg \
|
||||
| while read i; \
|
||||
do \
|
||||
sed -ie "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$i"; \
|
||||
rm "${i}e"; \
|
||||
done
|
||||
@@ -0,0 +1,31 @@
|
||||
@echo off
|
||||
rem just a helper batch file for collecting up files and zipping them.
|
||||
rem usage: windows-buildbot-zipper.bat <zipfilename>
|
||||
rem must be run from root of SDL source tree.
|
||||
|
||||
IF EXIST VisualC\Win32\Release GOTO okaydir
|
||||
echo Please run from root of source tree after doing a Release build.
|
||||
GOTO done
|
||||
|
||||
:okaydir
|
||||
erase /q /f /s zipper
|
||||
IF EXIST zipper GOTO zippermade
|
||||
mkdir zipper
|
||||
:zippermade
|
||||
cd zipper
|
||||
mkdir SDL
|
||||
cd SDL
|
||||
mkdir include
|
||||
mkdir lib
|
||||
mkdir lib\win32
|
||||
copy ..\..\include\*.h include\
|
||||
copy ..\..\VisualC\Win32\Release\SDL2.dll lib\win32\
|
||||
copy ..\..\VisualC\Win32\Release\SDL2.lib lib\win32\
|
||||
copy ..\..\VisualC\Win32\Release\SDL2main.lib lib\win32\
|
||||
cd ..
|
||||
zip -9r ..\%1 SDL
|
||||
cd ..
|
||||
erase /q /f /s zipper
|
||||
|
||||
:done
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
@ECHO OFF
|
||||
REM
|
||||
REM winrtbuild.bat: a batch file to help launch the winrtbuild.ps1
|
||||
REM Powershell script, either from Windows Explorer, or through Buildbot.
|
||||
REM
|
||||
SET ThisScriptsDirectory=%~dp0
|
||||
SET PowerShellScriptPath=%ThisScriptsDirectory%winrtbuild.ps1
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%PowerShellScriptPath%'";
|
||||
@@ -0,0 +1,240 @@
|
||||
#
|
||||
# winrtbuild.ps1 -- A Powershell script to build all SDL/WinRT variants,
|
||||
# across all WinRT platforms, in all of their supported, CPU architectures.
|
||||
#
|
||||
# Initial version written by David Ludwig <dludwig@pobox.com>
|
||||
#
|
||||
# This script can be launched from Windows Explorer by double-clicking
|
||||
# on winrtbuild.bat
|
||||
#
|
||||
# Output will be placed in the following subdirectories of the SDL source
|
||||
# tree:
|
||||
# * VisualC-WinRT\lib\ -- final .dll, .lib, and .pdb files
|
||||
# * VisualC-WinRT\obj\ -- intermediate build files
|
||||
#
|
||||
# Recommended Dependencies:
|
||||
# * Windows 8.1 or higher
|
||||
# * Powershell 4.0 or higher (included as part of Windows 8.1)
|
||||
# * Visual C++ 2012, for building Windows 8.0 and Windows Phone 8.0 binaries.
|
||||
# * Visual C++ 2013, for building Windows 8.1 and Windows Phone 8.1 binaries
|
||||
# * SDKs for Windows 8.0, Windows 8.1, Windows Phone 8.0, and
|
||||
# Windows Phone 8.1, as needed
|
||||
#
|
||||
# Commom parameters/variables may include, but aren't strictly limited to:
|
||||
# * PlatformToolset: the name of one of Visual Studio's build platforms.
|
||||
# Different PlatformToolsets output different binaries. One
|
||||
# PlatformToolset exists for each WinRT platform. Possible values
|
||||
# may include:
|
||||
# - "v110": Visual Studio 2012 build tools, plus the Windows 8.0 SDK
|
||||
# - "v110_wp80": Visual Studio 2012 build tools, plus the Windows Phone 8.0 SDK
|
||||
# - "v120": Visual Studio 2013 build tools, plus the Windows 8.1 SDK
|
||||
# - "v120_wp81": Visual Studio 2013 build tools, plus the Windows Phone 8.1 SDK
|
||||
# * VSProjectPath: the full path to a Visual Studio or Visual C++ project file
|
||||
# * VSProjectName: the internal name of a Visual Studio or Visual C++ project
|
||||
# file. Some of Visual Studio's own build tools use this name when
|
||||
# calculating paths for build-output.
|
||||
# * Platform: a Visual Studio platform name, which often maps to a CPU
|
||||
# CPU architecture. Possible values may include: "Win32" (for 32-bit x86),
|
||||
# "ARM", or "x64" (for 64-bit x86).
|
||||
#
|
||||
|
||||
|
||||
# Gets the .bat file that sets up an MSBuild environment, given one of
|
||||
# Visual Studio's, "PlatformToolset"s.
|
||||
function Get-MSBuild-Env-Launcher
|
||||
{
|
||||
param(
|
||||
[Parameter(Mandatory=$true,Position=1)][string]$PlatformToolset
|
||||
)
|
||||
|
||||
if ($PlatformToolset -eq "v110") { # Windows 8.0 (not Windows Phone), via VS 2012
|
||||
return "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
|
||||
}
|
||||
if ($PlatformToolset -eq "v110_wp80") { # Windows Phone 8.0, via VS 2012
|
||||
return "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WPSDK\WP80\vcvarsphoneall.bat"
|
||||
}
|
||||
if ($PlatformToolset -eq "v120") { # Windows 8.1 (not Windows Phone), via VS 2013
|
||||
return "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
|
||||
}
|
||||
if ($PlatformToolset -eq "v120_wp81") { # Windows Phone 8.1, via VS 2013
|
||||
return "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
|
||||
}
|
||||
if ($PlatformToolset -eq "v140") { # Windows 10, via VS 2015
|
||||
return "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
# Gets a string that identifies the build-variant of SDL/WinRT that is specific
|
||||
# to a particular Visual Studio PlatformToolset.
|
||||
function Get-SDL-WinRT-Variant-Name
|
||||
{
|
||||
param(
|
||||
[Parameter(Mandatory=$true,Position=1)][string]$PlatformToolset,
|
||||
|
||||
# If true, append a string to this function's output, identifying the
|
||||
# build-variant's minimum-supported version of Visual Studio.
|
||||
[switch]$IncludeVSSuffix = $false
|
||||
)
|
||||
|
||||
if ($PlatformToolset -eq "v110") { # Windows 8.0 (not Windows Phone), via VS 2012 project files
|
||||
if ($IncludeVSSuffix) {
|
||||
return "WinRT80_VS2012"
|
||||
} else {
|
||||
return "WinRT80"
|
||||
}
|
||||
}
|
||||
if ($PlatformToolset -eq "v110_wp80") { # Windows Phone 8.0, via VS 2012 project files
|
||||
if ($IncludeVSSuffix) {
|
||||
return "WinPhone80_VS2012"
|
||||
} else {
|
||||
return "WinPhone80"
|
||||
}
|
||||
}
|
||||
if ($PlatformToolset -eq "v120") { # Windows 8.1 (not Windows Phone), via VS 2013 project files
|
||||
if ($IncludeVSSuffix) {
|
||||
return "WinRT81_VS2013"
|
||||
} else {
|
||||
return "WinRT81"
|
||||
}
|
||||
}
|
||||
if ($PlatformToolset -eq "v120_wp81") { # Windows Phone 8.1, via VS 2013 project files
|
||||
if ($IncludeVSSuffix) {
|
||||
return "WinPhone81_VS2013"
|
||||
} else {
|
||||
return "WinPhone81"
|
||||
}
|
||||
}
|
||||
if ($PlatformToolset -eq "v140") { # Windows 10, via VS 2015 project files
|
||||
if ($IncludeVSSuffix) {
|
||||
return "UWP_VS2015"
|
||||
} else {
|
||||
return "UWP"
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
# Returns the internal name of a Visual Studio Project.
|
||||
#
|
||||
# The internal name of a VS Project is encoded inside the project file
|
||||
# itself, inside a set of <ProjectName></ProjectName> XML tags.
|
||||
function Get-VS-ProjectName
|
||||
{
|
||||
param(
|
||||
[Parameter(Mandatory=$true,Position=1)]$VSProjectPath
|
||||
)
|
||||
|
||||
# For now, just do a regex for the project name:
|
||||
$matches = (Get-Content $VSProjectPath | Select-String -Pattern ".*<ProjectName>([^<]+)<.*").Matches
|
||||
foreach ($match in $matches) {
|
||||
if ($match.Groups.Count -ge 1) {
|
||||
return $match.Groups[1].Value
|
||||
}
|
||||
}
|
||||
return $null
|
||||
}
|
||||
|
||||
# Build a specific variant of SDL/WinRT
|
||||
function Build-SDL-WinRT-Variant
|
||||
{
|
||||
#
|
||||
# Read in arguments:
|
||||
#
|
||||
param (
|
||||
# name of an SDL project file, minus extensions and
|
||||
# platform-identifying suffixes
|
||||
[Parameter(Mandatory=$true,Position=1)][string]$SDLProjectName,
|
||||
|
||||
[Parameter(Mandatory=$true,Position=2)][string]$PlatformToolset,
|
||||
|
||||
[Parameter(Mandatory=$true,Position=3)][string]$Platform
|
||||
)
|
||||
|
||||
#
|
||||
# Derive other properties from read-in arguments:
|
||||
#
|
||||
|
||||
# The .bat file to setup a platform-appropriate MSBuild environment:
|
||||
$BatchFileForMSBuildEnv = Get-MSBuild-Env-Launcher $PlatformToolset
|
||||
|
||||
# The full path to the VS Project that'll be built:
|
||||
$VSProjectPath = "$PSScriptRoot\..\VisualC-WinRT\$(Get-SDL-WinRT-Variant-Name $PlatformToolset -IncludeVSSuffix)\$SDLProjectName-$(Get-SDL-WinRT-Variant-Name $PlatformToolset).vcxproj"
|
||||
|
||||
# The internal name of the VS Project, used in some post-build steps:
|
||||
$VSProjectName = Get-VS-ProjectName $VSProjectPath
|
||||
|
||||
# Where to place output binaries (.dll, .lib, and .pdb files):
|
||||
$OutDir = "$PSScriptRoot\..\VisualC-WinRT\lib\$PlatformToolset\$Platform"
|
||||
|
||||
# Where to place intermediate build files:
|
||||
$IntermediateDir = "$PSScriptRoot\..\VisualC-WinRT\obj\$SDLProjectName-$(Get-SDL-WinRT-Variant-Name $PlatformToolset)\$Platform"
|
||||
|
||||
#
|
||||
# Build the VS Project:
|
||||
#
|
||||
cmd.exe /c " ""$BatchFileForMSBuildEnv"" x86 & msbuild ""$VSProjectPath"" /p:Configuration=Release /p:Platform=$Platform /p:OutDir=""$OutDir\\"" /p:IntDir=""$IntermediateDir\\""" | Out-Host
|
||||
$BuildResult = $?
|
||||
|
||||
#
|
||||
# Move .dll files into place. This fixes a problem whereby MSBuild may
|
||||
# put output files into a sub-directory of $OutDir, rather than $OutDir
|
||||
# itself.
|
||||
#
|
||||
if (Test-Path "$OutDir\$VSProjectName\") {
|
||||
Move-Item -Force "$OutDir\$VSProjectName\*" "$OutDir"
|
||||
}
|
||||
|
||||
#
|
||||
# Clean up unneeded files in $OutDir:
|
||||
#
|
||||
if (Test-Path "$OutDir\$VSProjectName\") {
|
||||
Remove-Item -Recurse "$OutDir\$VSProjectName"
|
||||
}
|
||||
Remove-Item "$OutDir\*.exp"
|
||||
Remove-Item "$OutDir\*.ilk"
|
||||
Remove-Item "$OutDir\*.pri"
|
||||
|
||||
#
|
||||
# All done. Indicate success, or failure, to the caller:
|
||||
#
|
||||
#echo "RESULT: $BuildResult" | Out-Host
|
||||
return $BuildResult
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Build each variant, with corresponding .dll, .lib, and .pdb files:
|
||||
#
|
||||
$DidAnyFail = $false
|
||||
|
||||
# Build for Windows Phone 8.0, via VC++ 2012:
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v110_wp80" "ARM")) { $DidAnyFail = $true }
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v110_wp80" "Win32")) { $DidAnyFail = $true }
|
||||
|
||||
# Build for Windows Phone 8.1, via VC++ 2013:
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v120_wp81" "ARM")) { $DidAnyFail = $true }
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v120_wp81" "Win32")) { $DidAnyFail = $true }
|
||||
|
||||
# Build for Windows 8.0 and Windows RT 8.0, via VC++ 2012:
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "ARM")) { $DidAnyFail = $true }
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "Win32")) { $DidAnyFail = $true }
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "x64")) { $DidAnyFail = $true }
|
||||
|
||||
# Build for Windows 8.1 and Windows RT 8.1, via VC++ 2013:
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "ARM")) { $DidAnyFail = $true }
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "Win32")) { $DidAnyFail = $true }
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "x64")) { $DidAnyFail = $true }
|
||||
|
||||
# Build for Windows 10, via VC++ 2015
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v140" "ARM")) { $DidAnyFail = $true }
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v140" "Win32")) { $DidAnyFail = $true }
|
||||
if ( ! (Build-SDL-WinRT-Variant "SDL" "v140" "x64")) { $DidAnyFail = $true }
|
||||
|
||||
# Let the script's caller know whether or not any errors occurred.
|
||||
# Exit codes compatible with Buildbot are used (1 for error, 0 for success).
|
||||
if ($DidAnyFail -eq $true) {
|
||||
exit 1
|
||||
} else {
|
||||
exit 0
|
||||
}
|
||||
Reference in New Issue
Block a user