Skip to content

Commit

Permalink
fix for building on >=libX11-1.5.99.901
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Apr 22, 2014
1 parent 44057a5 commit 288ec7a
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/My/Utility.pm
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ our $source_packs = [
patches => [
'test1.patch',
'SDL-1.2-openbsd-rldflags.patch',
'libsdl-1.2.15-const-xdata32.1.patch',
'libsdl-1.2.15-const-xdata32.2.patch',
'libsdl-1.2.15-const-xdata32.3.patch',
'libsdl-1.2.15-const-xdata32.4.patch',
],
prereqs => {
libs => [
Expand Down
20 changes: 20 additions & 0 deletions patches/libsdl-1.2.15-const-xdata32.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- SDL-1.2/configure.in 2012-05-28 13:21:49.000000000 +0200
+++ SDL-1.2/configure.in 2014-04-22 20:22:46.000000000 +0200
@@ -1127,6 +1127,17 @@
if test x$definitely_enable_video_x11_xrandr = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
fi
+ AC_MSG_CHECKING(for const parameter to _XData32)
+ have_const_param_xdata32=no
+ AC_TRY_COMPILE([
+ #include <X11/Xlibint.h>
+ extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
+ ],[
+ ],[
+ have_const_param_xdata32=yes
+ AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32)
+ ])
+ AC_MSG_RESULT($have_const_param_xdata32)
fi
fi
}
10 changes: 10 additions & 0 deletions patches/libsdl-1.2.15-const-xdata32.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- SDL-1.2/include/SDL_config.h.in 2012-05-28 13:21:49.000000000 +0200
+++ SDL-1.2/include/SDL_config.h.in 2014-04-22 20:24:02.000000000 +0200
@@ -282,6 +282,7 @@
#undef SDL_VIDEO_DRIVER_WINDIB
#undef SDL_VIDEO_DRIVER_WSCONS
#undef SDL_VIDEO_DRIVER_X11
+#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
14 changes: 14 additions & 0 deletions patches/libsdl-1.2.15-const-xdata32.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- SDL-1.2/src/video/x11/SDL_x11sym.h 2012-05-28 13:21:49.000000000 +0200
+++ SDL-1.2/src/video/x11/SDL_x11sym.h 2014-04-22 20:18:37.000000000 +0200
@@ -165,7 +165,11 @@
*/
#ifdef LONG64
SDL_X11_MODULE(IO_32BIT)
+#if SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
+SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
+#else
SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
+#endif
SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
#endif

62 changes: 62 additions & 0 deletions patches/libsdl-1.2.15-const-xdata32.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
--- SDL-1.2/configure 2014-04-22 20:52:13.000000000 +0200
+++ SDL-1.2/configure 2014-04-22 20:52:27.000000000 +0200
@@ -24440,6 +24440,59 @@
_ACEOF

fi
+ { echo "$as_me:$LINENO: checking for const parameter to _XData32" >&5
+ echo $ECHO_N "checking for const parameter to _XData32... $ECHO_C" >&6; }
+ have_const_param_xdata32=no
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+#include <X11/Xlibint.h>
+extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
+
+int
+main ()
+{
+
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ have_const_param_xdata32=yes
+ cat >>confdefs.h <<\_ACEOF
+#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1
+_ACEOF
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ have_const_param_xdata32=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { echo "$as_me:$LINENO: result: $have_const_param_xdata32" >&5
+ echo "${ECHO_T}$have_const_param_xdata32" >&6; }
fi
fi
}

0 comments on commit 288ec7a

Please sign in to comment.