mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-12-07 23:22:31 +00:00
First pass at changing SDL 2.0 to SDL 3.0
This commit is contained in:
@@ -61,8 +61,8 @@ build_cmake_projects() {
|
||||
-DSDL_STATIC=ON \
|
||||
-DSDL_STATIC_PIC=ON \
|
||||
-DSDL_TEST=ON \
|
||||
-DSDL2_DISABLE_SDL2MAIN=OFF \
|
||||
-DSDL2_DISABLE_INSTALL=OFF \
|
||||
-DSDL3_DISABLE_SDL3MAIN=OFF \
|
||||
-DSDL3_DISABLE_INSTALL=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX="${build_root}/build_${android_abi}/prefix" \
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=include \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
|
||||
@@ -69,5 +69,5 @@ ndk-build \
|
||||
APP_BUILD_SCRIPT=Android.mk \
|
||||
APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \
|
||||
APP_PLATFORM=android-16 \
|
||||
APP_MODULES="SDL2 SDL2_main" \
|
||||
APP_MODULES="SDL3 SDL3_main" \
|
||||
$ndk_args
|
||||
|
||||
@@ -55,7 +55,7 @@ mkdir buildbot
|
||||
pushd buildbot
|
||||
|
||||
echo "Configuring..."
|
||||
emconfigure ../configure --host=wasm32-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-s USE_SDL=0 -O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl2-installed" || exit $?
|
||||
emconfigure ../configure --host=wasm32-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-s USE_SDL=0 -O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl3-installed" || exit $?
|
||||
|
||||
echo "Building..."
|
||||
emmake $MAKE || exit $?
|
||||
@@ -64,9 +64,9 @@ echo "Moving things around..."
|
||||
emmake $MAKE install || exit $?
|
||||
|
||||
# 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
|
||||
perl -w -pi -e "s#$PWD/emscripten-sdl3-installed#/usr/local#g;" ./emscripten-sdl3-installed/lib/libSDL3.la ./emscripten-sdl3-installed/lib/pkgconfig/sdl3.pc ./emscripten-sdl3-installed/bin/sdl3-config
|
||||
mkdir -p ./usr
|
||||
mv ./emscripten-sdl2-installed ./usr/local
|
||||
mv ./emscripten-sdl3-installed ./usr/local
|
||||
tar -cJvvf $TARBALL usr
|
||||
popd
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This is the script buildbot.libsdl.org uses to cross-compile SDL2 from
|
||||
# This is the script buildbot.libsdl.org uses to cross-compile SDL3 from
|
||||
# amd64 Linux to NaCl.
|
||||
|
||||
# PLEASE NOTE that we have reports that SDL built with pepper_49 (current
|
||||
@@ -44,13 +44,13 @@ export AR="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ar"
|
||||
export LD="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ar"
|
||||
export RANLIB="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ranlib"
|
||||
|
||||
../configure --host=pnacl --prefix=$PWD/nacl-sdl2-installed
|
||||
../configure --host=pnacl --prefix=$PWD/nacl-sdl3-installed
|
||||
$MAKE
|
||||
$MAKE install
|
||||
# Fix up a few things to a real install path
|
||||
perl -w -pi -e "s#$PWD/nacl-sdl2-installed#/usr/local#g;" ./nacl-sdl2-installed/lib/libSDL2.la ./nacl-sdl2-installed/lib/pkgconfig/sdl2.pc ./nacl-sdl2-installed/bin/sdl2-config
|
||||
perl -w -pi -e "s#$PWD/nacl-sdl3-installed#/usr/local#g;" ./nacl-sdl3-installed/lib/libSDL3.la ./nacl-sdl3-installed/lib/pkgconfig/sdl3.pc ./nacl-sdl3-installed/bin/sdl3-config
|
||||
mkdir -p ./usr
|
||||
mv ./nacl-sdl2-installed ./usr/local
|
||||
mv ./nacl-sdl3-installed ./usr/local
|
||||
|
||||
popd
|
||||
tar -cJvvf $TARBALL -C $BUILDBOTDIR usr
|
||||
|
||||
@@ -39,7 +39,7 @@ CURDIR=`pwd -P`
|
||||
SDLPATH="$( cd "$(dirname "$0")/.." ; pwd -P )"
|
||||
BUILDPATH="$SDLPATH/build/nacl"
|
||||
TESTBUILDPATH="$BUILDPATH/test"
|
||||
SDL2_STATIC="$BUILDPATH/build/.libs/libSDL2.a"
|
||||
SDL3_STATIC="$BUILDPATH/build/.libs/libSDL3.a"
|
||||
mkdir -p $BUILDPATH
|
||||
mkdir -p $TESTBUILDPATH
|
||||
|
||||
@@ -73,8 +73,8 @@ $SDLPATH/configure --host=pnacl --prefix $TESTBUILDPATH
|
||||
make -j$NCPUS CFLAGS="$CFLAGS -I./include"
|
||||
make install
|
||||
|
||||
if [ ! -f "$SDL2_STATIC" ]; then
|
||||
echo "Build failed! $SDL2_STATIC"
|
||||
if [ ! -f "$SDL3_STATIC" ]; then
|
||||
echo "Build failed! $SDL3_STATIC"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -83,7 +83,7 @@ cp -f $SDLPATH/test/nacl/* $TESTBUILDPATH
|
||||
# Some tests need these resource files
|
||||
cp -f $SDLPATH/test/*.bmp $TESTBUILDPATH
|
||||
cp -f $SDLPATH/test/*.wav $TESTBUILDPATH
|
||||
cp -f $SDL2_STATIC $TESTBUILDPATH
|
||||
cp -f $SDL3_STATIC $TESTBUILDPATH
|
||||
|
||||
# Copy user sources
|
||||
_SOURCES=($SOURCES)
|
||||
@@ -94,8 +94,8 @@ done
|
||||
export SOURCES="$SOURCES"
|
||||
|
||||
cd $TESTBUILDPATH
|
||||
make -j$NCPUS CONFIG="Release" CFLAGS="$CFLAGS -I$TESTBUILDPATH/include/SDL2 -I$SDLPATH/include"
|
||||
make -j$NCPUS CONFIG="Debug" CFLAGS="$CFLAGS -I$TESTBUILDPATH/include/SDL2 -I$SDLPATH/include"
|
||||
make -j$NCPUS CONFIG="Release" CFLAGS="$CFLAGS -I$TESTBUILDPATH/include/SDL3 -I$SDLPATH/include"
|
||||
make -j$NCPUS CONFIG="Debug" CFLAGS="$CFLAGS -I$TESTBUILDPATH/include/SDL3 -I$SDLPATH/include"
|
||||
|
||||
echo
|
||||
echo "Run the test with: "
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This is the script buildbot.libsdl.org uses to cross-compile SDL2 from
|
||||
# This is the script buildbot.libsdl.org uses to cross-compile SDL3 from
|
||||
# x86 Linux to Raspberry Pi.
|
||||
|
||||
# The final tarball can be unpacked in the root directory of a RPi,
|
||||
# so the SDL2 install lands in /usr/local. Run ldconfig, and then
|
||||
# you should be able to build and run SDL2-based software on your
|
||||
# so the SDL3 install lands in /usr/local. Run ldconfig, and then
|
||||
# you should be able to build and run SDL3-based software on your
|
||||
# Pi. Standard configure scripts should be able to find SDL and
|
||||
# build against it, and sdl2-config should work correctly on the
|
||||
# build against it, and sdl3-config should work correctly on the
|
||||
# actual device.
|
||||
|
||||
TARBALL="$1"
|
||||
@@ -42,13 +42,13 @@ SYSROOT="/opt/rpi-sysroot"
|
||||
export CC="ccache /opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -L$SYSROOT/opt/vc/lib"
|
||||
# -L$SYSROOT/usr/lib/arm-linux-gnueabihf"
|
||||
# !!! FIXME: shouldn't have to --disable-* things here.
|
||||
../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd --disable-video-wayland
|
||||
../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl3-installed --disable-pulseaudio --disable-esd --disable-video-wayland
|
||||
$MAKE
|
||||
$MAKE install
|
||||
# Fix up a few things to a real install path on a real Raspberry Pi...
|
||||
perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
|
||||
perl -w -pi -e "s#$PWD/rpi-sdl3-installed#/usr/local#g;" ./rpi-sdl3-installed/lib/libSDL3.la ./rpi-sdl3-installed/lib/pkgconfig/sdl3.pc ./rpi-sdl3-installed/bin/sdl3-config
|
||||
mkdir -p ./usr
|
||||
mv ./rpi-sdl2-installed ./usr/local
|
||||
mv ./rpi-sdl3-installed ./usr/local
|
||||
tar -cJvvf $TARBALL usr
|
||||
popd
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ mkdir zipper\SDL
|
||||
mkdir zipper\SDL\include
|
||||
mkdir zipper\SDL\lib
|
||||
copy include\*.h include\
|
||||
copy %2\%1\Release\SDL2.dll zipper\SDL\lib\
|
||||
copy %2\%1\Release\SDL2.lib zipper\SDL\lib\
|
||||
copy %2\%1\Release\SDL2main.lib zipper\SDL\lib\
|
||||
copy %2\%1\Release\SDL3.dll zipper\SDL\lib\
|
||||
copy %2\%1\Release\SDL3.lib zipper\SDL\lib\
|
||||
copy %2\%1\Release\SDL3main.lib zipper\SDL\lib\
|
||||
cd zipper
|
||||
zip -9r ..\%3 SDL
|
||||
cd ..
|
||||
|
||||
Reference in New Issue
Block a user