www.digitalmars.com         C & C++   DMDScript  

D.gnu - D support for XCode 2.1 broken?

reply Fredrik Olsson <peylow gmail.com> writes:
The environment variables seems not to work after updating from XCode 
2.0 to 2.1.

HelloDWorld worked for example flawless in 2.0, in 2.1 this error 
message is generated when building (I include some more than the errors 
and indent for clarity):

   /bin/sh -c "MACOSX_DEPLOYMENT_TARGET=10.3
   export PATH=\"/opt/gdc/bin:$PATH\"
   mkdir -p  $(BUILD_DIR)/$(EXECUTABLE_FOLDER_PATH)
   gdc $(INPUT_FILE_NAME) -g -o $(BUILD_DIR)/$(EXECUTABLE_PATH) 
-Wl,-framework,Carbon"
   /bin/sh: line 1: BUILD_DIR: command not found
   /bin/sh: line 1: EXECUTABLE_FOLDER_PATH: command not found
   /bin/sh: line 1: INPUT_FILE_NAME: command not found
   /bin/sh: line 1: BUILD_DIR: command not found
   /bin/sh: line 1: EXECUTABLE_PATH: command not found
   ld: Undefined symbols:
   _main


regards
	Fredrik Olsson
Aug 06 2005
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Fredrik Olsson wrote:

 The environment variables seems not to work after updating from XCode 
 2.0 to 2.1.
They probably changed the names... Changed the project format as well. Most likely it needs to be updated for Tiger, and changed to "gdc" (as it is installing as /usr/bin/gdc now, and not in /opt/gdc anymore) --anders
Aug 07 2005
prev sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Fredrik Olsson wrote:

 The environment variables seems not to work after updating from XCode 
 2.0 to 2.1.
There seems to be some updated Tiger files at http://www.alanz.com/ ? (took from http://www.prowiki.org/wiki4d/wiki.cgi?GdcHacking, untested) --anders
Aug 07 2005
parent reply Fredrik Olsson <peylow gmail.com> writes:
Anders F Björklund wrote:
 Fredrik Olsson wrote:
 
 The environment variables seems not to work after updating from XCode 
 2.0 to 2.1.
There seems to be some updated Tiger files at http://www.alanz.com/ ? (took from http://www.prowiki.org/wiki4d/wiki.cgi?GdcHacking, untested)
I have downloaded and tried it out for XCode 2.0, I downgraded from 2.1 today when the environment flags failed (Making FreePascal unusable in its current state) so I will not try in 2.1 for a while. But the page states that it is for 2.1 and 2.0 is untested, I can confirm that it works with a few tweaks. 1. Make a symbolik link to gdc using Terminal: cd /usr/bin sudo ln -s gdc gdc-3.3 2. Open the Style tab on the Project inspector in XCode: a. Disable ZeroLink under General->Linking b. Disable Recognize Pascal Strings under GNU C/C++ Compiler->Language. c. Repeat a and b for all styles. 3. Create a new rule for each of your targets: a. Process; D Source Files. b. Using GDC 3.3 Why it is GDC 3.3 when gdc is only version 0.15 can be confusing, but acording to the authoir it necesary to go around the internals of how XCode chooses the compiler process internaly. Oh, well. Happy hacking, I know I will :). regards Fredrik Olsson
Aug 07 2005
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Fredrik Olsson wrote:

 I have downloaded and tried it out for XCode 2.0, I downgraded from 2.1 
 today when the environment flags failed (Making FreePascal unusable in 
 its current state) so I will not try in 2.1 for a while. But the page 
 states that it is for 2.1 and 2.0 is untested, I can confirm that it 
 works with a few tweaks.
Sounds good, as I have delayed upgrading to Tiger as my main OS myself.
 1. Make a symbolik link to gdc using Terminal:
     cd /usr/bin
     sudo ln -s gdc gdc-3.3
I think I will package it this way in the future (except reversed) At least it could be useful when GDC works with GCC 4.0 ? ("soon")
 2. Open the Style tab on the Project inspector in XCode:
     a. Disable ZeroLink under General->Linking
     b. Disable Recognize Pascal Strings under
        GNU C/C++ Compiler->Language.
     c. Repeat a and b for all styles.
Ah, the weirdness that is Xcode. Project Builder was old, but sane...
 3. Create a new rule for each of your targets:
     a. Process; D Source Files.
     b. Using GDC 3.3
 
 Why it is GDC 3.3 when gdc is only version 0.15 can be confusing, but 
 acording to the authoir it necesary to go around the internals of how 
 XCode chooses the compiler process internaly.
GDC 0.15 (for Mac) was built with GCC 3.3, so it (almost) makes sense. --anders
Aug 10 2005
parent Alan West <alan alanz.com> writes:
Anders F Björklund wrote:
     cd /usr/bin
     sudo ln -s gdc gdc-3.3
I think I will package it this way in the future (except reversed) At least it could be useful when GDC works with GCC 4.0 ? ("soon")
 2. Open the Style tab on the Project inspector in XCode:
     a. Disable ZeroLink under General->Linking
     b. Disable Recognize Pascal Strings under
        GNU C/C++ Compiler->Language.
     c. Repeat a and b for all styles.
 Why it is GDC 3.3 when gdc is only version 0.15 can be confusing, but 
 acording to the authoir it necesary to go around the internals of how 
 XCode chooses the compiler process internaly.
GDC 0.15 (for Mac) was built with GCC 3.3, so it (almost) makes sense.
I based the version on the GCC you compiled GDC with, would be better if those spec files where installed with gdcmac, but then you'd need to check which version of Xcode was in use. I intend to fix those minor issues with disabling particular options like ZeroLink and Pascal Strings, I had just got it working after spending a few hours and I'd had enough. Will give the D options proper names too, with their descriptions (currently they are just GCC_D_RELEASE etc). The difference between Xcode 2.0 and 2.1 as far as script based rules, is that you don't use parenthesis anymore in the environment variables but you do in the output files section: mkdir -p $(BUILD_DIR)/$(EXECUTABLE_FOLDER_PATH) gdc $(INPUT_FILE_NAME) -g -o $(BUILD_DIR)/$(EXECUTABLE_PATH) -Wl,-framework,Carbon" becomes: mkdir -p $BUILD_DIR/$EXECUTABLE_FOLDER_PATH gdc $INPUT_FILE_NAME -g -o $BUILD_DIR/$EXECUTABLE_PATH -Wl,-framework,Carbon"
Aug 10 2005