garetha
Posts: 38
Joined: Sat Jan 05, 2013 12:07 am

Hello_Triangle compile flags

Sat Jan 05, 2013 12:18 am

Hi all,

I've just compiled the hello_triangle example and it worked great. However, I was a little confused by all the stuff that appeared when I ran make.

Having looked a bit closer I've realised they're compilation flags setting various compiler options. I've had a search around and, although I can find some of them on the internet, some I can't find anywhere, e.g. the STANDALONE flag and the rather difficult to search for LINUX flag.

I tried commenting out the flags and the code still compiled and ran fine. Does anyone know a good resource where these flags would be documented? Does anyone know if they're actually needed for any of the sample code? Does everyone just use that as the base makefile or have they created their own without the flags?

Thanks for any help/insight

Gareth

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Hello_Triangle compile flags

Sun Jan 06, 2013 7:05 pm

I am pretty much sure they are Broadcom specific - quite a lot of the code is (at least originally) not just for RPi, but for other platforms as well and the makefiles might be taken from cross-platform projects, so there may or may not be need for all of the flags...
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Hello_Triangle compile flags

Mon Jan 07, 2013 3:37 pm

Or well, maybe not 'Broadcom specific' as such, as similar defines are used in many cross-platform projects ...depending on the project, these are more or less well documented anywhere...

And as I thought I remembered, there are some interesting defines in the headers in /opt/vc/include ('grep -r ANDROID /opt/vc/include/*.*') like ANDROID and __SYMBIAN32__ ;)

In general, if you don't find the defines in the source code or the included headers, you can ignore them.

I personally (and I read between the lines you too) would prefer if the examples did not have such obsolete bits, but I am happy to have the examples even if not perfect.
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

garetha
Posts: 38
Joined: Sat Jan 05, 2013 12:07 am

Re: Hello_Triangle compile flags

Fri Jan 11, 2013 7:44 pm

O.K., that's cool, thanks.

Yeah, I'd prefer if they only had code that was actually to do with the example - it would make it much easier to know what's important!!

I guess I can just try writing my own code and compiling it and see what happens!

Gareth

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Hello_Triangle compile flags

Sat Jan 12, 2013 6:59 pm

Isn't the tradition - at least with anything mechanical, but why not with software - the 'take it apart and see if you can put it back together ...and whether the pieces that did not fit are required for operation' :lol:
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Return to “OpenGLES”