Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Mac OS » fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa
fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa [message #31008] Mon, 31 January 2011 21:52 Go to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
after building theide with xcode now I can build our beautiful beast for OSX11 with itself.
but apart from this menu fix at least 2 more changes needed:
1. in GccBuilder.cpp around line 319
		linkfile.Add(GetHostPath(product));
		for(int i = 0; i < obj.GetCount(); i++)
			if(GetFileTime(obj[i]) > producttime) {
				String lib;
				if(is_shared) {
					lib = CompilerName();	

					if(HasFlag("OSX11") || HasFlag("COCOA") ){
						String exec;
						exec << "setenv MACOSX_DEPLOYMENT_TARGET 10.6";  //TODO add choices dialog
						Execute(exec);
					}
					lib << " -shared -fPIC -fuse-cxa-atexit";


Is it possible to do a similar thing through the existing build options? I tried but...

2. remove plugin/ndisasm or add flags when !OSX11 !COCOA through "Package organizer" for that plugin in Debugger package or edit Debuggers.upp this way
description "TheIDE - debuggers\377B";

uses
	ide\Common,
	HexView;

uses(!OSX11 !COCOA) plugin/ndisasm;


Sorry, attached ide is 64bit for OSX11. I need a bit more time to cook 32bit.

P.S Update now the attacment inside contains an app file with icns (hope you know Smile ). So, you will see and could keep theide icon in the dock. Smile

[Updated on: Tue, 01 February 2011 00:08]

Report message to a moderator

Re: fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa [message #31009 is a reply to message #31008] Mon, 31 January 2011 22:44 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Aris,

Wouldn't "gcc -mmacosx-version-min=10.6" work the same as setting the environment variable? Quick googling suggest that it has the same or very similar results. Note that the option must be added both for compiling and linking.

Honza

PS: The linking option must be spelt as "-Wl,macosx_version_min=10.6"

[Updated on: Mon, 31 January 2011 22:47]

Report message to a moderator

Re: fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa [message #31010 is a reply to message #31009] Tue, 01 February 2011 00:13 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
bump to those people who downloaded form the top post: if you'd like you can download the updated version with icons.

[Updated on: Tue, 01 February 2011 00:13]

Report message to a moderator

Re: fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa [message #31011 is a reply to message #31009] Tue, 01 February 2011 02:07 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
dolik.rce wrote on Mon, 31 January 2011 21:44

Hi Aris,

Wouldn't "gcc -mmacosx-version-min=10.6" work the same as setting the environment variable? Quick googling suggest that it has the same or very similar results. Note that the option must be added both for compiling and linking.

Honza

PS: The linking option must be spelt as "-Wl,macosx_version_min=10.6"


thanks for the research. I copied setenv from xcode building output.

if I understand correctly, you must switch to existing SDK libs also to tell them the minimum version. e.g
-mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.6.sdk/ -arch i386 ppc. Or maybe I am wrong.

It looks like the following works instead of setenv. But maybe because the env was set before.
-isysroot /Developer/SDKs/MacOSX10.6.sdk/

if I put it into "optimize for speed" field... Twisted Evil

I think we need at least 1 more field "user flags"...
On the other hand, I would like to be able just insert setenv (as script? or as params?) once accordingly.
Re: fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa [message #31013 is a reply to message #31011] Tue, 01 February 2011 10:03 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Xcode uses the environment variable to select the correct SDK. If you put the paths to it in your build method, then it should work just fine. Also there's a tool called gcc_select which you might want to have a look at. It is a bash script that sets the system into state for building for some target (creates correct symlinks etc.).

Why do you put it into speed optimizations flags when there is {Debug,Release} {fixed flags,link options}? But for now it doesn't probably matter Smile

Honza
Re: fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa [message #31022 is a reply to message #31013] Tue, 01 February 2011 14:52 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
dolik.rce wrote on Tue, 01 February 2011 09:03

Xcode uses the environment variable to select the correct SDK. If you put the paths to it in your build method, then it should work just fine. Also there's a tool called gcc_select which you might want to have a look at. It is a bash script that sets the system into state for building for some target (creates correct symlinks etc.).

thanks Honza, I will look at the script. But first, I need to find out how to enable building scripts with OSX11 ide (the button is greyed)...

Quote:


Why do you put it into speed optimizations flags when there is {Debug,Release} {fixed flags,link options}? But for now it doesn't probably matter Smile

Honza


Because there are no proper fields for that. if put into a series of flags into "release fixed flags" theide creates appended names dirs into building dir and spits out a mountain of errors. That's why -> Twisted Evil ... Smile

Or something is hidden in my svn version?:

index.php?t=getfile&id=3068&private=0
  • Attachment: ideFlags1.png
    (Size: 12.83KB, Downloaded 938 times)
Re: fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa [message #31024 is a reply to message #31022] Tue, 01 February 2011 15:59 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Oh, I see... I mixed up flags and compiler options again Evil or Very Mad Embarassed

Well, there is one more place where it could go, and where it should actually work Smile The compiler name can be set to "gcc -mmacosx-version-min=10.6" and it seems to be actually interpreted correctly. Ugly hack, but fine for now Wink We can look for a better solution later.

Honza

icon14.gif  Re: fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa [message #31067 is a reply to message #31024] Thu, 03 February 2011 16:35 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
Honza, thanks a lot for your activities on this forum! Your idea to use compiler name field for setting the sdk was very good. This way then it is even possible to switch sdk's!
Also, your idea led me to a brilliant side effect. I discovered that if I use
/Developer/usr/bin/g++-4.2 -isysroot /Developer/SDKs/MacOSX10.6.sdk

-and not just gcc- now, after some changes in the ide, I am able to compile, link and run cocoa apps from upp theide! Cool
Re: fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa [message #31069 is a reply to message #31067] Thu, 03 February 2011 17:28 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

fudadmin wrote on Thu, 03 February 2011 16:35

Honza, thanks a lot for your activities on this forum! Your idea to use compiler name field for setting the sdk was very good. This way then it is even possible to switch sdk's!
Also, your idea led me to a brilliant side effect. I discovered that if I use
/Developer/usr/bin/g++-4.2 -isysroot /Developer/SDKs/MacOSX10.6.sdk

-and not just gcc- now, after some changes in the ide, I am able to compile, link and run cocoa apps from upp theide! Cool

You're welcome Smile Actually the "proper way" would be to create a wrapper script containing just that and use it as a compiler name. But no need to be fancy Smile

Anyway, I love how theide build system can be "hijacked" in so many ways that in the end everything is possible Very Happy (Even things that shouldn't be... Twisted Evil )

Honza
Re: fix TheIde [DOWNLOAD] GccBuilder.cpp for OSX11 and ObjC [message #33708 is a reply to message #31069] Wed, 07 September 2011 03:21 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
To build ObjC and Cocoa apps (Unix style for now) (maybe iPhone with some more tweaking...) with theide you can use (or apply changes) from the file below.

GCC_obj.bm something like this:
BUILDER = "GCC";
COMPILER = "g++ -arch x86_64";
DEBUG_INFO = "";
DEBUG_BLITZ = "0";
DEBUG_LINKMODE = "2";
DEBUG_OPTIONS = " -x objective-c  -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -fvisibility=hidden -gdwarf-2";
DEBUG_FLAGS = "";
RELEASE_BLITZ = "0";
RELEASE_LINKMODE = "1";
RELEASE_OPTIONS = "-O3 -g -fasm-blocks";
RELEASE_SIZE_OPTIONS = "-finline-limit=20 -fasm-blocks";
RELEASE_FLAGS = "";
DEBUGGER = "gdb";
PATH = "";
INCLUDE = "";
LIB = "";
REMOTE_HOST = "";
REMOTE_OS = "";
REMOTE_TRANSFER = "";
REMOTE_MAP = "";
LINKMODE_LOCK = "0";


Also don't forget to add frameworks to the packages into "Link options" through "Package organizer" eg "-framework Foundation - framework AppKit -framework Cocoa"

If you want launchd style *.app wrapper, then can try to overwrite target via "Output mode" ", but will need to put icons etc inside it, manually. I'll try to improve the code, time permitting.

P.S Is my svn access available?

Aris
Re: fix TheIde [DOWNLOAD] GccBuilder.cpp for OSX11 and ObjC [message #33711 is a reply to message #33708] Wed, 07 September 2011 09:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Tue, 06 September 2011 21:21

To build ObjC and Cocoa apps (Unix style for now) (maybe iPhone with some more tweaking...) with theide you can use (or apply changes) from the file below.

GCC_obj.bm something like this:
BUILDER = "GCC";
COMPILER = "g++ -arch x86_64";
DEBUG_INFO = "";
DEBUG_BLITZ = "0";
DEBUG_LINKMODE = "2";
DEBUG_OPTIONS = " -x objective-c  -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -fvisibility=hidden -gdwarf-2";
DEBUG_FLAGS = "";
RELEASE_BLITZ = "0";
RELEASE_LINKMODE = "1";
RELEASE_OPTIONS = "-O3 -g -fasm-blocks";
RELEASE_SIZE_OPTIONS = "-finline-limit=20 -fasm-blocks";
RELEASE_FLAGS = "";
DEBUGGER = "gdb";
PATH = "";
INCLUDE = "";
LIB = "";
REMOTE_HOST = "";
REMOTE_OS = "";
REMOTE_TRANSFER = "";
REMOTE_MAP = "";
LINKMODE_LOCK = "0";


Also don't forget to add frameworks to the packages into "Link options" through "Package organizer" eg "-framework Foundation - framework AppKit -framework Cocoa"

If you want launchd style *.app wrapper, then can try to overwrite target via "Output mode" ", but will need to put icons etc inside it, manually. I'll try to improve the code, time permitting.

P.S Is my svn access available?

Aris



Sounds good, thanks.

Yes, your svn access should work.

Mirek
Re: fix TheIde [DOWNLOAD] GccBuilder.cpp for OSX11 and ObjC [message #33712 is a reply to message #33711] Wed, 07 September 2011 09:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Please wait before commiting changes... (Besides, your GccBuilder version is out of date anyway).

Why did you:

//			else  //aris002
//				lnk << (!HasFlag("OSX11") ? " -Wl,-s" : "");


?
Re: fix TheIde [DOWNLOAD] GccBuilder.cpp for OSX11 and ObjC [message #33718 is a reply to message #33712] Wed, 07 September 2011 12:38 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
mirek wrote on Wed, 07 September 2011 08:42

Please wait before commiting changes... (Besides, your GccBuilder version is out of date anyway).

Why did you:

//			else  //aris002
//				lnk << (!HasFlag("OSX11") ? " -Wl,-s" : "");


?


One of the reasons I haven't committed and posted here. Thanks for noticing and sorry. This was left from experimenting with ObjC sometime one year ago (I was going to to put this and other options into some settings dialog and expand into XCode style and storing maybe in *.bm options) and last night it slipped through while merging changes.
Another reason, that I was not able to checkout from your svn server. Also, you said, that my version of file is old. For merging, I think, I used the file from google. Is google server a lot behind or have I mixed up something?
Any plans to make theide builders less hardcoded?
Re: fix TheIde [DOWNLOAD] GccBuilder.cpp for OSX11 and ObjC [message #33736 is a reply to message #33718] Fri, 09 September 2011 13:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Wed, 07 September 2011 06:38

mirek wrote on Wed, 07 September 2011 08:42

Please wait before commiting changes... (Besides, your GccBuilder version is out of date anyway).

Why did you:

//			else  //aris002
//				lnk << (!HasFlag("OSX11") ? " -Wl,-s" : "");


?


One of the reasons I haven't committed and posted here. Thanks for noticing and sorry. This was left from experimenting with ObjC sometime one year ago (I was going to to put this and other options into some settings dialog and expand into XCode style and storing maybe in *.bm options) and last night it slipped through while merging changes.
Another reason, that I was not able to checkout from your svn server. Also, you said, that my version of file is old. For merging, I think, I used the file from google. Is google server a lot behind or have I mixed up something?



Just one hour maximum (it gets synced each hour...)

Quote:


Any plans to make theide builders less hardcoded?


I think there are not hardcoded at all. You can add builders as you wish and there is even "Esc" based builder...

Still for this task altering gcc builder is preferable I guess..

Mirek
Re: fix TheIde [DOWNLOAD] GccBuilder.cpp for OSX11 and ObjC [message #33740 is a reply to message #33736] Fri, 09 September 2011 16:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Patch applied, please check.

Mirek
Re: fix TheIde [DOWNLOAD] GccBuilder.cpp for OSX11 and ObjC [message #33800 is a reply to message #33740] Wed, 14 September 2011 17:25 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
thanks Mirek, I tested theide from svn and now it compiles and links objectiveC files. I will try to commit or post my other changes I have regarding *.m & &.mm files for CodeEditor, FindInFiles etc.
One concern/reminder is that in this case (line 192 GccBuilder.cpp):
else if (ext == ".m" || ext == ".mm")
	exec << fuse_cxa_atexit << " -x objective-c++";

theide users will not be able to differentiate between ObjC and ObjC++ compile type as in XCode. The latter has even got the ability to assign compile type individually to each file regardless the extension...
Are we hoping that theide users will use only objc++? Smile
Re: fix TheIde [DOWNLOAD] GccBuilder.cpp for OSX11 and ObjC [message #33804 is a reply to message #33800] Thu, 15 September 2011 08:39 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Wed, 14 September 2011 11:25

thanks Mirek, I tested theide from svn and now it compiles and links objectiveC files. I will try to commit or post my other changes I have regarding *.m & &.mm files for CodeEditor, FindInFiles etc.
One concern/reminder is that in this case (line 192 GccBuilder.cpp):
else if (ext == ".m" || ext == ".mm")
	exec << fuse_cxa_atexit << " -x objective-c++";

theide users will not be able to differentiate between ObjC and ObjC++ compile type as in XCode. The latter has even got the ability to assign compile type individually to each file regardless the extension...
Are we hoping that theide users will use only objc++? Smile


Is not .mm meant to be "objc++" and .m "c" ?

(And if it is not, maybe we can make that convention Wink

Mirek
Previous Topic: Mac OS X port architecture
Next Topic: Upp Core compiles natively on Xcode (download Core.xcodeproj)
Goto Forum:
  


Current Time: Thu Mar 28 23:57:50 CET 2024

Total time taken to generate the page: 0.00969 seconds