summarylogtreecommitdiffstats
path: root/SDL_image-1.2.12-PSP.patch
blob: 9ad26732a0793d2a6451e7bf01b44899d84a63d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
diff -burN SDL_image-1.2.12/config.sub SDL_image-1.2.12-PSP/config.sub
--- SDL_image-1.2.12/config.sub	2012-01-21 02:51:33.000000000 +0100
+++ SDL_image-1.2.12-PSP/config.sub	2012-06-06 13:08:19.730613627 +0200
@@ -942,6 +942,10 @@
 	ps2)
 		basic_machine=i386-ibm
 		;;
+	psp)
+		basic_machine=mipsallegrexel-psp
+		os=-elf
+		;;
 	pw32)
 		basic_machine=i586-unknown
 		os=-pw32
diff -burN SDL_image-1.2.12/configure.in SDL_image-1.2.12-PSP/configure.in
--- SDL_image-1.2.12/configure.in	2012-01-21 02:51:33.000000000 +0100
+++ SDL_image-1.2.12-PSP/configure.in	2012-06-06 13:08:33.542614064 +0200
@@ -58,6 +58,27 @@
 fi
 AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
 
+dnl Check for a valid PSPSDK installation
+CheckPSPSDK()
+{   
+    AC_CHECK_PROG(psp_config, psp-config, psp-config, no)
+    if test x$psp_config = xno; then
+        AC_MSG_ERROR(Couldn't locate psp-config.)
+    fi
+
+    AC_MSG_CHECKING(for PSPSDK)
+    pspsdk_path=`$psp_config --pspsdk-path`
+    if test ! -d $pspsdk_path -o -z $pspsdk_path; then
+        AC_MSG_RESULT(not found)
+        AC_MSG_ERROR(Couldn't locate PSPSDK.)
+    fi
+    AC_MSG_RESULT($pspsdk_path)
+   
+    # Compile SDL with -G0 to disable the $gp register.
+    CFLAGS="$CFLAGS -G0 -I\"${pspsdk_path}/include\""
+    BUILD_PREFIX="psp-"
+}
+
 case "$host" in
     *-*-beos*)
         ac_default_prefix=/boot/develop/tools/gnupro
@@ -85,6 +106,10 @@
             CFLAGS="$CFLAGS -DSDL_IMAGE_USE_COMMON_BACKEND"
         fi
         ;;
+    *-psp-*)
+        ARCH=psp
+        CheckPSPSDK
+        ;;
 esac
 AM_CONDITIONAL(USE_IMAGEIO, test x$enable_imageio = xyes)
 AM_CONDITIONAL(USE_VERSION_RC, test x$use_version_rc = xtrue)
diff -burN SDL_image-1.2.12/README.PSP SDL_image-1.2.12-PSP/README.PSP
--- SDL_image-1.2.12/README.PSP	1970-01-01 01:00:00.000000000 +0100
+++ SDL_image-1.2.12-PSP/README.PSP	2012-06-06 13:09:08.104615119 +0200
@@ -0,0 +1,11 @@
+To configure:
+
+   ./autogen.sh
+   LDFLAGS="-L$(psp-config --pspsdk-path)/lib" LIBS="-lc -lpspuser" \
+     ./configure --host psp --with-sdl-prefix=$(psp-config --psp-prefix) \
+     --prefix=$(psp-config --psp-prefix)
+
+Then run:
+
+   make
+   make install