Hi again !
Basically, porting meant AIX-specific modules …
Your changes will be incorporated into SDL 1.1.2
That’s great !
I had some problems with the header file changes.
I have attached a patch that should do better. It refers to the CVS tree,
not to the 1.1.1 release.
You rely on automake to generate the endianness information, but the
headers as they are installed on the system do not have the automake
defines enabled. Can you give me a unique C preprocessor symbol that
defines the AIX hardware platform?
The standard preprocessor symbol (for gcc and for CSet) is _AIX
The attached patch is supposed to do 2 things:
- solve the little endian/big endian decision in configure by auto-generating
the header file include/SDL_byteorder.h [as proposed in the comments ;-)]
- add _AIX to include/SDL_syswm.h
The patch modifies these files:
configure.in: - define SDL_CONF_BIGENDIAN and call AC_SUBST
- add -I$(top_builddir)/include to CFLAGS and CXXFLAGS
- generate include/SDL_byteorder.h from include/SDL_byteorder.h.in
include/SDL_byteorder.h: deleted
include/SDL_byteorder.h.in: generated depending on @SDL_CONF_BIGENDIAN@
include/SDL_syswm.h: add _AIX to #if defined()
Regards,
Carsten
-------------- next part --------------
diff -Nur SDL/configure.in SDL.changes/configure.in
— SDL/configure.in Wed Mar 15 15:29:38 2000
+++ SDL.changes/configure.in Wed Mar 15 14:58:46 2000
@@ -45,6 +45,17 @@
AC_CANONICAL_TARGET
AC_C_INLINE
+dnl griff - 15mar2000
+dnl Check whether the platform is big endian
+dnl Use AC_SUBST later to make the appropriate adaptations
+AC_C_BIGENDIAN
+if test x$ac_cv_c_bigendian = xyes; then
- SDL_CONF_BIGENDIAN=1
+else
- SDL_CONF_BIGENDIAN=0
+fi+
dnl Check for tools
AC_LIBTOOL_WIN32_DLL
@@ -973,6 +984,13 @@
dnl Expand the libraries needed for static linking
AC_SUBST(SYSTEM_LIBS)
+dnl Select the little endian/big endian case in the byteorder header file
+AC_SUBST(SDL_CONF_BIGENDIAN)
+
+dnl griff - 15mar2000
+dnl For headers generated by configure, files must be included from builddir
+CFLAGS=“$CFLAGS -I$(top_builddir)/include”
+
dnl Expand the include directories for building SDL
CFLAGS=“$CFLAGS -I$(top_srcdir)/include”
CFLAGS=“$CFLAGS -I$(top_srcdir)/include/SDL”
@@ -993,10 +1011,15 @@
dnl Important: Any directory that you want to be in the distcheck should
dnl have a file listed here, so that configure generates the
dnl subdirectories on the build target.
+dnl
+dnl griff - 15mar2000
+dnl added generation of include/SDL_byteorder.h
+dnl
AC_OUTPUT([
Makefile
docs/Makefile
include/Makefile
+include/SDL_byteorder.h
src/Makefile
src/main/Makefile
src/audio/Makefile
diff -Nur SDL/include/SDL_byteorder.h SDL.changes/include/SDL_byteorder.h
— SDL/include/SDL_byteorder.h Wed Mar 15 09:13:46 2000
+++ SDL.changes/include/SDL_byteorder.h Thu Jan 1 01:00:00 1970
@@ -1,48 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999 Sam Lantinga
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Sam Lantinga
- slouken at devolution.com
-*/
-#ifdef SAVE_RCSID
-static char rcsid =
- “@(#) $Id: SDL_byteorder.h,v 1.3 1999/12/09 22:31:52 hercules Exp $”;
-#endif
-/* Macros for determining the byte-order of this platform */
-#ifndef _SDL_byteorder_h
-#define _SDL_byteorder_h
-/* The two types of endianness */
-#define SDL_LIL_ENDIAN 1234
-#define SDL_BIG_ENDIAN 4321
-/* Pardon the mess, I’m trying to determine the endianness of this host.
- I’m doing it by preprocessor defines rather than some sort of configure
- script so that application code can use this too. The “right” way would
- be to dynamically generate this file on install, but that’s alot of work.
- */
-#if defined(i386) || defined(WIN32) || defined(alpha) || defined(arm)
-#define SDL_BYTEORDER SDL_LIL_ENDIAN
-#else
-#define SDL_BYTEORDER SDL_BIG_ENDIAN
-#endif
-#endif /* _SDL_byteorder_h /
diff -Nur SDL/include/SDL_byteorder.h.in SDL.changes/include/SDL_byteorder.h.in
— SDL/include/SDL_byteorder.h.in Thu Jan 1 01:00:00 1970
+++ SDL.changes/include/SDL_byteorder.h.in Wed Mar 15 10:10:31 2000
@@ -0,0 +1,43 @@
+/
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999 Sam Lantinga
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Sam Lantinga
- slouken at devolution.com
+*/
+#ifdef SAVE_RCSID
+static char rcsid =
- “@(#) $Id: SDL_byteorder.h,v 1.3 1999/12/09 22:31:52 hercules Exp $”;
+#endif
+/* Macros for determining the byte-order of this platform /
+
+#ifndef _SDL_byteorder_h
+#define _SDL_byteorder_h
+
+/ The two types of endianness /
+#define SDL_LIL_ENDIAN 1234
+#define SDL_BIG_ENDIAN 4321
+
+#if @SDL_CONF_BIGENDIAN@ / ← this value is determined by configure /
+#define SDL_BYTEORDER SDL_LIL_ENDIAN
+#else
+#define SDL_BYTEORDER SDL_BIG_ENDIAN
+#endif
+
+#endif / _SDL_byteorder_h */
diff -Nur SDL/include/SDL_syswm.h SDL.changes/include/SDL_syswm.h
— SDL/include/SDL_syswm.h Wed Mar 15 09:13:48 2000
+++ SDL.changes/include/SDL_syswm.h Wed Mar 15 10:15:54 2000
@@ -49,7 +49,8 @@
#else
/* This is the structure for custom window manager events */
-#if defined(unix) || defined(unix)
+#if defined(unix) || defined(unix) || defined(_AIX)
- /* AIX is unix, of course, but the native compiler CSet doesn’t define unix */
#include <X11/Xlib.h>
#include <X11/Xatom.h>