I've not done any pandora development for a long time and decided to get a toolchain set up so I can try building some stuff. I used crosscompilemaker.sh to get gcc/binutils/glibc built, but next I need SDL2. I found https://github.com/ptitSeb/SDL2 but the Makefile.pandora there was a bit broken (or unfinished/discarded?) and I don't have any of the dependencies installed. By trial and error I found that I need the following dependencies from the repo:
kbproto-dev_1.0.4-r1.5_armv7a.ipk
libx11-dev_1.3.3-r7.5_armv7a.ipk
xextproto-dev_7.1.1-r0.5_armv7a.ipk
libgles-omap3-es23-dev_4.00.00.01-r6.5_armv7a.ipk
libxext-dev_1.1.1-r1.5_armv7a.ipk
xproto-dev_7.0.16-r0.5_armv7a.ipk
I wrote a script to extract the ipk files:
And I had to make some small changes to get it to build:
(I know that I should probably use a single
At the end I get libSDL.a, though I haven't tried it yet.
My question really is: Is this the "right" way to do this? Is this SDL2 repository still relevant and should I even be using Makefile.pandora? Is there a newer way to do this? I don't really want to do development on my pandora itself and my understanding is that the code::blocks PND, which already incldues SDL2, is for that. Thanks
kbproto-dev_1.0.4-r1.5_armv7a.ipk
libx11-dev_1.3.3-r7.5_armv7a.ipk
xextproto-dev_7.1.1-r0.5_armv7a.ipk
libgles-omap3-es23-dev_4.00.00.01-r6.5_armv7a.ipk
libxext-dev_1.1.1-r1.5_armv7a.ipk
xproto-dev_7.0.16-r0.5_armv7a.ipk
I wrote a script to extract the ipk files:
Code:
fermat01:~/project/pandora_dev$ cat extract_ipk.sh
#!/bin/sh
ar -x $1 data.tar.gz
mkdir ${1%.*}
tar -xf data.tar.gz -C ${1%.*}
rm data.tar.gz
And I had to make some small changes to get it to build:
Code:
diff --git a/Makefile.pandora b/Makefile.pandora
index f4cb668..2622e29 100644
--- a/Makefile.pandora
+++ b/Makefile.pandora
@@ -1,18 +1,25 @@
# Makefile to build the pandora SDL library
-AR = arm-none-linux-gnueabi-ar
-RANLIB = arm-none-linux-gnueabi-ranlib
-CC = arm-none-linux-gnueabi-gcc
-CXX = arm-none-linux-gnueabi-g++
-STRIP = arm-none-linux-gnueabi-strip
+AR = armv7l-unknown-linux-gnueabi-ar
+RANLIB = armv7l-unknown-linux-gnueabi-ranlib
+CC = armv7l-unknown-linux-gnueabi-gcc
+CXX = armv7l-unknown-linux-gnueabi-g++
+STRIP = armv7l-unknown-linux-gnueabi-strip
CFLAGS = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp \
-mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \
- -I./include -I$(PNDSDK)/usr/include
+ -DSDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS=1 \
+ -I./include \
+ -I/home/edglex/project/pandora_dev/xproto-dev_7.0.16-r0.5_armv7a/usr/include \
+ -I/home/edglex/project/pandora_dev/libx11-dev_1.3.3-r7.5_armv7a/usr/include \
+ -I/home/edglex/project/pandora_dev/libgles-omap3-es23-dev_4.00.00.01-r6.5_armv7a/usr/include \
+ -I/home/edglex/project/pandora_dev/libxext-dev_1.1.1-r1.5_armv7a/usr/include \
+ -I/home/edglex/project/pandora_dev/xextproto-dev_7.1.1-r0.5_armv7a/usr/include \
+ -I/home/edglex/project/pandora_dev/kbproto-dev_1.0.4-r1.5_armv7a/usr/include
TARGET = libSDL.a
-SOURCES =
+SOURCES = \
./src/*.c \
./src/atomic/*.c \
./src/audio/*.c \
diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c
index 4e4f8a5..f60e174 100644
--- a/src/haptic/linux/SDL_syshaptic.c
+++ b/src/haptic/linux/SDL_syshaptic.c
@@ -37,6 +37,7 @@
#include <errno.h> /* errno, strerror */
#include <math.h> /* atan2 */
#include <sys/stat.h> /* stat */
+#include <linux/limits.h> /* PATH_MAX */
/* Just in case. */
#ifndef M_PI
diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c
index 407749c..f7f40e8 100755
--- a/src/joystick/linux/SDL_sysjoystick.c
+++ b/src/joystick/linux/SDL_sysjoystick.c
@@ -31,7 +31,7 @@
#include <sys/stat.h>
#include <errno.h> /* errno, strerror */
#include <fcntl.h>
-#include <limits.h> /* For the definition of PATH_MAX */
+#include <linux/limits.h> /* For the definition of PATH_MAX */
#include <sys/ioctl.h>
#include <unistd.h>
#include <linux/joystick.h>
(I know that I should probably use a single
target/usr/include
directory, but it was easier to do it this way for testing which packages were needed).At the end I get libSDL.a, though I haven't tried it yet.
My question really is: Is this the "right" way to do this? Is this SDL2 repository still relevant and should I even be using Makefile.pandora? Is there a newer way to do this? I don't really want to do development on my pandora itself and my understanding is that the code::blocks PND, which already incldues SDL2, is for that. Thanks