Commits

zeldin  committed be667c5 Draft

Use configure.in to test for endianness on UNIX

  • Participants
  • Parent commits f2da62f

Comments (0)

Files changed (2)

File configure.in

 AC_PROG_LIBTOOL
 AC_PROG_CC
 AC_PROG_CXX
+AC_C_BIGENDIAN
 AC_SEARCH_LIBS([sqrt], [m], [], AC_MSG_ERROR([Can't LÖVE without C math library]))
 AC_SEARCH_LIBS([SDL_Init], [SDL], [], AC_MSG_ERROR([Can't LÖVE without SDL]))
 AC_SEARCH_LIBS([glLoadIdentity], [GL], [], AC_MSG_ERROR([Can't LÖVE without OpenGL]))

File src/common/config.h

 #ifdef HAVE_CONFIG_H
 #	include <../config.h>
 #	undef VERSION
+#	ifdef WORDS_BIGENDIAN
+#		undef LOVE_LITTLE_ENDIAN
+#		define LOVE_BIG_ENDIAN 1
+#	else
+#		undef LOVE_BIG_ENDIAN
+#		define LOVE_LITTLE_ENDIAN 1
+#	endif
 #endif
 
 #endif // LOVE_CONFIG_H