Opened 15 years ago

Closed 14 years ago

#23674 closed defect (fixed)

libsdl 1.2.14 misdetects endianess on PPC non-universal build

Reported by: mklein-de (Michael Klein) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: haspatch Cc: keybounce
Port: libsdl

Description

$ grep SDL_BYTEORDER /opt/local/include/SDL/SDL_config.h
#define SDL_BYTEORDER 1234

On PPC, this should be rather 4321. SDL's configure script, generated by autoconf 2.63, reports checking whether byte ordering is bigendian... universal, although I did not ask for a universal variant.

Regenerating with autoconf 2.65 fixes this.

Attachments (2)

config.log (113.9 KB) - added by mklein-de (Michael Klein) 15 years ago.
libsdl-Portfile.diff (633 bytes) - added by mklein-de (Michael Klein) 15 years ago.
Portfile patch

Download all attachments as: .zip

Change History (10)

Changed 15 years ago by mklein-de (Michael Klein)

Attachment: config.log added

Changed 15 years ago by mklein-de (Michael Klein)

Attachment: libsdl-Portfile.diff added

Portfile patch

comment:1 Changed 15 years ago by jmroot (Joshua Root)

Keywords: haspatch added
Owner: changed from macports-tickets@… to nox@…

Please remember to cc the maintainer.

comment:2 Changed 15 years ago by jmroot (Joshua Root)

You can just set use_autoconf yes rather than running the autogen script with system.

comment:3 in reply to:  2 Changed 15 years ago by mklein-de (Michael Klein)

Replying to jmr@…:

You can just set use_autoconf yes rather than running the autogen script with system.

Good to know, unfortunately this does not seem to work for libsdl:

$ port -v configure
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
--->  Computing dependencies for libsdl.
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
--->  Fetching libsdl
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
--->  Verifying checksum(s) for libsdl
--->  Checksumming SDL-1.2.14.tar.gz
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
--->  Extracting libsdl
--->  Extracting SDL-1.2.14.tar.gz
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
--->  Applying patches to libsdl
--->  Applying /opt/local/var/macports/sources/svn.macports.org/devel/libsdl/files/patch-SDL_x11gl_c.h.diff
patching file src/video/x11/SDL_x11gl_c.h
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
--->  Configuring libsdl
configure.in:57: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.in:367: error: possibly undefined macro: AM_PATH_ALSA
configure.in:466: error: possibly undefined macro: AM_PATH_ESD
Error: Target org.macports.configure returned: autoconf failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_devel_libsdl/work/SDL-1.2.14" && autoconf " returned error 1
Warning: the following items did not execute (for libsdl): org.macports.configure
Error: Status 1 encountered during processing.
Before reporting a bug, first run the command again with the -d flag to get complete output.

comment:4 in reply to:  description Changed 14 years ago by keybounce

In fact, it generates 1234 as a constant on a universal build.

There is no "one" value on a universal build. Oddly, commenting it out seems to work better.

SDL_endian.h has this tidbit:

...
/** @name SDL_ENDIANs
 *  The two types of endianness 
 */
/*@{*/
#define SDL_LIL_ENDIAN  1234
#define SDL_BIG_ENDIAN  4321
/*@}*/

#ifndef SDL_BYTEORDER   /* Not defined in SDL_config.h? */
#if defined(__hppa__) || \
    defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
    (defined(__MIPS__) && defined(__MISPEB__)) || \
    defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
    defined(__sparc__)
#define SDL_BYTEORDER   SDL_BIG_ENDIAN
#else
...

It goes through a great deal of trouble to determine at compile time what the endian-ness is, as well as defining optimized assembly for byteswap routines.

So, trying to specify a single endian-ness seems to be a bad idea.

comment:5 Changed 14 years ago by keybounce

Cc: keybounce@… added

Cc Me!

comment:6 Changed 14 years ago by keybounce

Bump

Someone else just ran into the same issue. Can we please get that #define line removed, so that it will work on either system?

comment:7 Changed 14 years ago by jmroot (Joshua Root)

Owner: changed from nox@… to jmr@…
Status: newassigned

comment:8 Changed 14 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.