summaryrefslogtreecommitdiffstats
path: root/sdl-build.patch
blob: a1538e79c38e5ead812cf99b00b9a8c379d71f4b (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
72
73
74
75
76
77
78
79
80
81
82
83
84
diff -up sdl-0.9.0/config.m4.old sdl-0.9.0/config.m4
--- sdl-0.9.0/config.m4.old	2013-11-24 21:38:31.000000000 +0100
+++ sdl-0.9.0/config.m4	2013-11-25 08:21:59.000000000 +0100
@@ -1,7 +1,7 @@
 dnl $Id$
 dnl config.m4 for extension sdl
 
-PHP_ARG_WITH( sdl, for sdl support, [  --with-sdl=DIR          Include sdl support ] )
+PHP_ARG_WITH(sdl, for sdl support, [  --with-sdl=DIR          Include sdl support ])
 
 if test "$PHP_SDL" != "no"; then
 
@@ -34,21 +34,7 @@ if test "$PHP_SDL" != "no"; then
 		AC_MSG_RESULT(found in $SDL_CONFIG)
 
 		PHP_EVAL_INCLINE(`$SDL_CONFIG --cflags`)
-
-		dnl FIXME: support non-shared builds
-		SDL_LIBS=`$SDL_CONFIG --libs`
-		for i in $SDL_LIBS; do
-			case $i in
-				-L*)
-					tmp=`echo $i | cut -c 3-`
-					PHP_ADD_LIBPATH($tmp, SDL_SHARED_LIBADD)
-					;;
-				-l*)
-					tmp=`echo $i | cut -c 3-`
-					PHP_ADD_LIBRARY($tmp, 1, SDL_SHARED_LIBADD)
-					;;
-			esac
-		done
+		PHP_EVAL_LIBLINE(`$SDL_CONFIG --libs`, SDL_SHARED_LIBADD)
 	else
 		AC_MSG_RESULT([not found, trying manual way])
 
@@ -72,14 +58,17 @@ if test "$PHP_SDL" != "no"; then
 			AC_MSG_RESULT(found below $SDL_DIR/include)
 		fi
 
-		if test ! -f "$i/lib/libSDL.so"; then
-			AC_MSG_ERROR(Cannot find lib/libSDL.so below $i)
+		if test ! -f "$SDL_DIR/$PHP_LIBDIR/libSDL.$SHLIB_SUFFIX_NAME"; then
+			AC_MSG_ERROR(Cannot find $PHP_LIBDIR/libSDL.$SHLIB_SUFFIX_NAME below $i)
 		fi
 
 		PHP_ADD_INCLUDE($SDL_DIR/include/SDL)
+		PHP_ADD_LIBRARY_WITH_PATH(SDL, $SDL_DIR/$PHP_LIBDIR, SDL_SHARED_LIBADD)
 	fi
+	AC_MSG_RESULT(BUILD AS $ext_shared)
 
-	PHP_NEW_EXTENSION( sdl, php_sdl.c php_sdl_audio.c php_sdl_event.c php_sdl_thread.c php_sdl_wm.c php_sdl_cdrom.c php_sdl_joystick.c php_sdl_time.c, $ext_shared )
+	PHP_NEW_EXTENSION(sdl, php_sdl.c php_sdl_audio.c php_sdl_event.c php_sdl_thread.c php_sdl_wm.c php_sdl_cdrom.c php_sdl_joystick.c php_sdl_time.c, $ext_shared)
+	PHP_SUBST(SDL_SHARED_LIBADD)
 	
 	AC_DEFINE(HAVE_SDL, 1, [ ])
 fi
diff -up sdl-0.9.0/php_sdl.c.old sdl-0.9.0/php_sdl.c
--- sdl-0.9.0/php_sdl.c.old	2013-11-25 08:22:37.000000000 +0100
+++ sdl-0.9.0/php_sdl.c	2013-11-25 08:23:02.000000000 +0100
@@ -3318,10 +3318,6 @@ int php_sdl_find_key_with_type(zval *arr
 	return 1;
 }
 
-#ifdef COMPILE_DL_SDL
-ZEND_GET_MODULE(sdl)
-#endif
-
 /*
  * Local variables:
  * tab-width: 4
--- sdl-0.9.0/php_sdl.h.old	2013-11-25 18:18:08.000000000 +0100
+++ sdl-0.9.0/php_sdl.h	2013-11-25 18:18:34.000000000 +0100
@@ -156,6 +156,11 @@
 #define SDL_G(v) (sdl_globals.v)
 #endif
 
+/* ZEND_FE_END exist only in PHP >= 5.3.7 */
+#ifndef ZEND_FE_END
+#define ZEND_FE_END { NULL, NULL, NULL, 0, 0 }
+#endif
+
 #endif	/* PHP_SDL_H */
 
 /*