Jarvik7 / sdl-wii

Automatically exported from code.google.com/p/sdl-wii
0 stars 0 forks source link

configure script fails due to devkitPPC unitptr_t conflict #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm taking a stab at porting an SDL game that uses auto(re)conf/configure to 
create its makefiles. I am using the latest devkitPPC/libogc and precompiled 
SDL-Wii (SDL Wii 07-06-2011) versions for 64-bit Linux. I snagged a 
Wii-specific sdl-config script from somewhere, and now the configure script is 
blowing up because SDL-Wii appears to be attempting to define a 'uintptr_t' 
type that is already defined in devkitPPC's stdint.h:

configure:15946: checking for SDL - version >= 1.1.6
configure:16048: result: yes
configure:16125: checking SDL/SDL_mixer.h usability
configure:16125: powerpc-eabi-gcc -c -g -O2 -I/opt/devkitpro/libogc/include 
-I/opt/devkitpro/libogc/include/SDL -mrvl -Dmain=SDL_main  
-I/opt/devkitpro/libogc/include -I/opt/devkitpro/libogc/include/SDL -mrvl 
-Dmain=SDL_main conftest.c >&5
In file included from /opt/devkitpro/libogc/include/SDL/SDL_config.h:44:0,
                 from /opt/devkitpro/libogc/include/SDL/SDL_stdinc.h:28,
                 from /opt/devkitpro/libogc/include/SDL/SDL_types.h:24,
                 from /opt/devkitpro/libogc/include/SDL/SDL_mixer.h:28,
                 from conftest.c:55:
/opt/devkitpro/libogc/include/SDL/SDL_config_minimal.h:39:23: error: 
conflicting types for 'uintptr_t'
/opt/devkitpro/devkitPPC/lib/gcc/powerpc-eabi/4.6.1/../../../../powerpc-eabi/inc
lude/stdint.h:244:35: note: previous declaration of 'uintptr_t' was here
configure:16125: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "abuse"
| #define PACKAGE_TARNAME "abuse"
| #define PACKAGE_VERSION "0.8"
| #define PACKAGE_STRING "abuse 0.8"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "abuse"
| #define VERSION "0.8"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define LT_OBJDIR ".libs/"
| #define WORDS_BIGENDIAN 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| #include <SDL/SDL_mixer.h>
configure:16125: result: no
configure:16125: checking SDL/SDL_mixer.h presence
configure:16125: powerpc-eabi-gcc -E  -I/opt/devkitpro/libogc/include 
-I/opt/devkitpro/libogc/include/SDL -mrvl -Dmain=SDL_main conftest.c
configure:16125: $? = 0
configure:16125: result: yes
configure:16125: WARNING: SDL/SDL_mixer.h: present but cannot be compiled
configure:16125: WARNING: SDL/SDL_mixer.h:     check for missing prerequisite 
headers?
configure:16125: WARNING: SDL/SDL_mixer.h: see the Autoconf documentation
configure:16125: WARNING: SDL/SDL_mixer.h:     section "Present But Cannot Be 
Compiled"
configure:16125: WARNING: SDL/SDL_mixer.h: proceeding with the compiler's result
configure:16125: checking for SDL/SDL_mixer.h
configure:16125: result: no
configure:16137: error: *** SDL_mixer not found!

Original issue reported on code.google.com by benshadw...@gmail.com on 11 Sep 2011 at 7:04

GoogleCodeExporter commented 9 years ago
configure isn't supported. can't help you here!

Original comment by dborth@gmail.com on 11 Sep 2011 at 11:20

GoogleCodeExporter commented 9 years ago
I knew I shouldn't have mentioned configure because someone would get hung up 
on that. Please note that it's not a configure issue, but rather a devkitPPC 
compatibility issue. I commented out SDL-Wii's duplicate definition and got 
past it.

Original comment by benshadw...@gmail.com on 12 Sep 2011 at 12:51

GoogleCodeExporter commented 9 years ago
Actually I'm already porting Abuse SDL to the Wii, 95% complete, just need to 
setup the constrols. Hint: get rid of this crazy configure script and of 0.8, 
because it WON'T COMPILE, I've already tried to compile using the configure or 
using a custom Wii makefile... but 0.8 won't compile on the Wii. 0.7.1 does, 
but there's some things to change... LOTS of things... It took almost three 
months to fix somethings.

Original comment by gcnmaster1910 on 19 Sep 2011 at 3:10

GoogleCodeExporter commented 9 years ago
It did compile, with a very small amount of massaging, and my port of Sam 
Hocevar's version of the 0.8 source is complete and released after a week's 
worth of effort!

See: http://wiibrew.org/wiki/Abuse_Wii

Original comment by benshadw...@gmail.com on 19 Sep 2011 at 5:01

GoogleCodeExporter commented 9 years ago
Hey, how did you compiled 0.8?? Was it using the configure script? 0.8 just 
won't compile here. And what operating system?

Original comment by gcnmaster1910 on 19 Sep 2011 at 4:10

GoogleCodeExporter commented 9 years ago
I used Ubuntu Linux.

Sam Hocevar's source at http://abuse.zoy.org/ does not come with Makefiles. 
Instead, it has autotools files for generating a configure script, which in 
turn generates makefiles.

So I first ran autoconf/autoreconf to generate configure. It said the autotools 
files were out of date and told me how to update them, so I followed the 
suggestions and re-ran.

I then ran configure with various parameters (and a custom Wii-specific 
sdl-config that I whipped up) to generate the Makefiles, but it choked per my 
bug report above. I commented out SDL Wii's redundant definition of uintptr_t 
to get past that issue.

I had to massage the Makefiles slightly after that, mainly because configure 
puts extra -lm and -lSDL_mixer arguments in the Makefiles.

I also had some trouble with the fact that the game defines a regular int 
main(int argc, char* argv[]) in game.cpp but SDL expects SDL_main() instead. 
There are multiple workarounds (-Dmain=SDL_main or #include <SDL/SDL_main.h>), 
but I had lots of problems trying to get them so work, so I ended up just doing 
an #ifdef'd replacement of main with SDL_main in game.cpp.

I believe I additionally had to add an #include <stdint.h> to one of the imlib 
files.

This got the source to compile for me, but of course it didn't run correctly 
until I made lots of other Wii-specific changes.

I've uploaded my modified source (with Makefiles) to 
http://code.google.com/p/abuse-wii/downloads/list in case you want to take a 
look. The SVN metafiles are in there too so that you can use TortoiseSVN or 
whatever to diff my changes against the SVN baseline.

We should probably move this discussion to either 
http://wiibrew.org/wiki/Talk:Abuse_Wii or 
http://devkitpro.org/viewtopic.php?f=7&t=2920

Original comment by benshadw...@gmail.com on 19 Sep 2011 at 4:32

GoogleCodeExporter commented 9 years ago
Also, libogc 1.8.8 or later is required because previous versions defined a 
color_table variable that clashed with one in the Abuse source. Since 
WinterMute of libogc was answering compiling questions for me on devkitpro.org, 
he decided to fix the conflict by changing libogc.

Original comment by benshadw...@gmail.com on 19 Sep 2011 at 4:56

GoogleCodeExporter commented 9 years ago
But I've already done all of that on 0.8 and still it didn't compiled! In rare 
cases when compiling was successful, the file wasn't an .elf file...

Well, wasted my time. Now I don't know what to port/create next lol but thanks 
for the game, it marked my childhood back then in 2000

Original comment by gcnmaster1910 on 19 Sep 2011 at 5:47

GoogleCodeExporter commented 9 years ago
It will compile to a binary named "abuse" that is actually a Wii .elf file.

The source that I uploaded should compile for you out of the box by just 
running make in the abuse-trunk directory, provided you're running under Linux 
and have devkitpro installed to /opt (otherwise you may need to edit the -I and 
-L paths in the Makefiles).

You can then run elf2dol to convert src/abuse to boot.dol and drop it in place 
of the boot.dol in my pre-built version.

Original comment by benshadw...@gmail.com on 19 Sep 2011 at 6:58

GoogleCodeExporter commented 9 years ago
ah, didn't knew that... well, but still, compiling under Windows using MSYS 
gave me undefined references to blahblahblah... thanks

Original comment by gcnmaster1910 on 19 Sep 2011 at 8:23