Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Compiling Allegro 5 on Solaris 10 (sparc)

This thread is locked; no one can reply to it. rss feed Print
Compiling Allegro 5 on Solaris 10 (sparc)
Buckley
Member #10,105
August 2008

I have a Sun Blade 100 system (it is old, but works great) that I've installed Solaris 10 on. I have also installed Gnu make 3.80 and CMake 2.6.4. gcc came pre-installed and is at version 3.4.3. Whenever I follow the instructions to compile Allegro on this system, I get the error messages indicated in the attached text file. (CompileError.txt)

The cmake .. command works great.
The make command does not and is what is output in the attached text file.

The compilation seems to work up to the 16% mark, then errors out. Refer to the attached text file.

I have not modified any Allegro source code. The warnings and errors you see in the text file are what I've been getting "out of the box" when trying to compile Allegro.

Any comments or suggestions are GREATLY appreciated.

Arthur Kalliokoski
Second in Command
February 2005
avatar

The first error points to a line that says

         typedef unsigned char _Bool;

Does your compiler know what a typedef is? Is it using the Sun compiler or gcc?

They all watch too much MSNBC... they get ideas.

Buckley
Member #10,105
August 2008

As per my first post I'm using the gcc compiler that installed with Solaris. It is gcc version 3.4.3. However, I have also tried using the SunStudio 12 compiler. Both fail when following the Allegro build instructions.

Looking at the error output (text file attached in first post) it appears that Allegro is redefining some OpenGL variables that are already defined in header files that Solaris installs.

From attached file:
..../Allegro/allegro-5.0.10/include/allegro5/opengl/GLext/glx_ext_defs.h:84:1:
warning: "GLX_SAMPLES_ARB" redefined
In file included from /usr/include/GL/glx.h:33

In the above, /usr/include/GL/glx.h came with Solaris 10. Is it normal for Allegro to redefine OpenGL variables that are already defined in OpenGL header files in the OS?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Buckley
Member #10,105
August 2008

Okay, I've upgraded the system to use gcc/g++ 4.8.2. The results? EXACTLY the same.

I'll try installing a newer version of cmake onto the system. I see that version 2.8.12 is now available for download. If this doesn't work then I'm not quite sure what to do.

What versions of Gnu make, gcc/g++ and cmake are others using? Thanks!!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

OpenGL comes with gcc, but it looks like allegro is trying to patch deficient GL stuff on systems that use X. (I'm thinking out loud)

Unix isn't supported explicitly.

Is there an updated graphics driver for Solaris 10? How old is Solaris 10?

Arthur Kalliokoski
Second in Command
February 2005
avatar

I just tried this with gcc 4.8.2 on Linux

#include <stdio.h>

typedef unsigned char _Bool;

int main(void)
{
  _Bool mybit = 1;
  printf("mybit is %u\n",mybit);
  
  return 0;
}

and it bombed out with

pepsi@fractal:~ 07:59 PM $ gcc -s -O2 -Wall t.c -o t
t.c:3:23: error: two or more data types in declaration specifiers
 typedef unsigned char _Bool;
                       ^
t.c:3:1: warning: useless type name in empty declaration [enabled by default]
 typedef unsigned char _Bool;
 ^
pepsi@fractal:~ 07:59 PM $

Removing the prepended underscore fixed it. Maybe manually patching it will fix it, and possibly the other errors are some type of cascade?

[EDIT]

Renaming it to _Booll also caused it to compile without error. Adding the option -std=c89 didn't affect the _Bool causing an error.
idontevenknowwhatimdoing

[EDIT2]

Eliminating the typedef entirely allowed it to compile even with -std=c89, as if it's still using _Bool as a keyword. Compiler bug? I ran into another gcc 4.8.2 bug a few weeks ago concerning structs.

They all watch too much MSNBC... they get ideas.

Buckley
Member #10,105
August 2008

Thank you Arthur and Edgar for your responses, I really appreciate them. I've been slowly 'fixing' the Allegro source code so that it compiles on my Solaris system. However, I have a wife, a toddler, an infant and a full time job that all compete for my time as well. I'm lucky some days to have 20 minutes on the computer. This is why I was hoping that Allegro would compile "out of the box" on my system. Anyways, I'll post my progress (hopefully a solution) by next week...maybe.

Thanks again!!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

It would be awesome if you contributed a patch once you're done. Then we might be able to add Unix to the list of supported platforms. ;) Which would be cool. 8-)

Have you figured out why you're getting OpenGL errors?

Also, threads lock after a week of inactivity, so if you need us to bump the thread we will.

Thomas Fjellstrom
Member #476
June 2000
avatar

Technically _Bool is a type in C now, so something is causing allegro to define it, even when the system is. I assume the solaris compiler isn't declaring that it supports that type (stdint.h?) the way allegro is expecting?

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

torhu
Member #2,727
September 2002
avatar

It sounds really weird to me that GCC on Solaris would mess up something like that. Are you sure the standard C headers are up to date too? The required header is stdbool.h, the #define is __bool_true_false_are_defined.

Buckley
Member #10,105
August 2008

So I'm guessing that something may not have been properly cleaned out in my allegro directory. Therefore I decided to create a brand new directory to untar allegro into and start from scratch, using only the new version of gcc this time vice starting with the older compiler then moving to the newer compiler. The result this time? Allegro still compiled to the 16% mark, but the error message this time was "unknown type name 'GLintptr'" from file allegro-5.0.10/include/allegro5/opengl/GLext/gl_ext_api.h.

I got this error corrected and recompiled. More errors were displayed. I corrected a bunch and recompiled. More errors, corrected them and recompiled, etc, etc.

My current progress: Allegro compiles to the 50% mark and there is a linker error due to some undefined symbols. But it is late, I have family staying with me and have eggs to hide for my daughter and her neighbors tomorrow.

Edit: On Sunday night I had 3 linker errors. I now have it down to 2 linker errors. Time has been very hard to come by this week so far. I'm hoping that I'll have more time Friday or Saturday to work on this. When I finally get everything compiled and linked I'll post a summary of what I did, just in case there are others out there who want to use Allegro on a Solaris 10 sparc platform.

Go to: