Re: [fpc-pascal] building universal binary

2009-02-03 Thread Jonas Maebe


On 03 Feb 2009, at 20:21, Ken G. Brown wrote:

Have a Pascal program calling some C code from a static library I  
build in a separate project so I can use the debugger.


You can also build it in a separate target of the same project and  
then change the target-specific flags for that C library (as in the  
"FPC-C-C++ Carbon Application 2.2.0" template).


I looked at my App using lipo -info fromTerminal and get the  
following error:
lipo: Can't map input file: .../myapp/build/Release/myapp.app ((os/ 
kern) invalid argument)


myapp.app is a folder (or more specifically, a bundle). The actual  
program is .../myapp/build/Release/myapp.app/Contents/MacOS/myapp


As well, in Finder Get Info for my app, the 'open using Rosetta  
checkbox is greyed out and I cannot select it. Activity Monitor of  
course shows an intel program but i need to deploy to PowerPC  
running 10.3.9.


If I look at my 'C' library project product with lipo, I get  
Architectures in the fat file: ./libkbCarbonLib.a are: i386 ppc


What else do I need to do in order to generate a universal binary?  
Do I need to run the fpc ppc version somehow for the ppc side of  
tings? I suspect so but cannot find what to do.


You have to go to the project's build settings for the configuration  
that you are building (presumably "release"), and then set the  
"Architectures" setting (the second from the top) to "Standard (32-bit  
Universal)". This works at least for me with the "FPC-C-C++ Carbon  
Application 2.2.0" template.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Error: Assembler as not found, switching to external assembling

2009-02-03 Thread Jonas Maebe


On 20 Jan 2009, at 10:18, Jonas Maebe wrote:


On 19 Jan 2009, at 18:05, Ingemar Ragnemalm wrote:

One of the users reporting problems did search for as, and found it  
in /developer/usr/bin/as! So Xcode

was installed, and "as" was installed, but not in /usr/bin/as!

Maybe Apple has changed the paths in some Xcode version? I have no  
problems on my MBP/10.5 though.


Perhaps an alias from /usr/bin/as would help? Or is there anything  
else that FPC needs?


As of Xcode 3.x, you can install multiple versions of Xcode at the  
same time on a system. To allow for this, Xcode can install  
everything it needs into a a subdirectory, without installing  
anything globally on the system (i.e., nothing under /usr, / 
var, ..., only things under whatever directory you decide to install  
Xcode in).


However, for compatibility with standard unix development  
environments and configure/makefile-based source distributions, you  
still have the option to also install the command line utilities  
(such as automake, autoconf, as, ld, gcc, cpp, ...) globally under / 
usr.


Now, I am pretty certain that this is done by default and that this  
is only not done if you choose a custom install and deselect that  
option. I don't have an Xcode installer lying around to verify that  
though.


I've now verified it, and the installer option is called "UNIX  
Development Support" and is selected by default. So if anyone reports  
this error, tell them to relaunch the Xcode installer and to install  
that option (although it's strange that FPC can be installed if Xcode  
was installed without that option, because the FPC installer checks  
for the existence of /usr/bin/gcc, and that one is not installed  
either if you deselect that option).



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: building universal binary

2009-02-03 Thread Ken G. Brown
Further:
it appears that lipo cannot handle app bundles, so if I run it on the 
executable itself, it says it is ok, has both i386 and ppc. So I guess I'm 
missing something that tells Finder it is a universal binary, but what?

Thx,
Ken G. Brown

At 12:21 PM -0700 2/3/09, Ken G. Brown apparently wrote:
>Mac OS X 10.5.6, fpc 2.2.2, Xcode 3.1.2
>
>Have a Pascal program calling some C code from a static library I build in a 
>separate project so I can use the debugger.
>
>I've set Xcode to use gcc 4.0 targeting 10.4 for intel, and gcc 3.3 targetting 
>10.3.9 for PowerPC in both projects.
>
>So far I am basically using the fpc user defined options that came with the 
>template for building for calling C functions.
>
>Do I need to add some fpc options in order to properly compile for a universal 
>binary?
>
>I looked at my App using lipo -info fromTerminal and get the following error:
>lipo: Can't map input file: .../myapp/build/Release/myapp.app ((os/kern) 
>invalid argument)
>
>As well, in Finder Get Info for my app, the 'open using Rosetta checkbox is 
>greyed out and I cannot select it. Activity Monitor of course shows an intel 
>program but i need to deploy to PowerPC running 10.3.9.
>
>If I look at my 'C' library project product with lipo, I get Architectures in 
>the fat file: ./libkbCarbonLib.a are: i386 ppc 
>
>What else do I need to do in order to generate a universal binary? Do I need 
>to run the fpc ppc version somehow for the ppc side of tings? I suspect so but 
>cannot find what to do.
>
>Any tips appreciated.
>
>Thx,
>Ken G. Brown

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: building universal binary

2009-02-03 Thread Ken G. Brown
> > Have a Pascal program calling some C code from a static library I 
> > build in a separate project so I can use the debugger.
>
>You can also build it in a separate target of the same project and 
>then change the target-specific flags for that C library (as in the 
>"FPC-C-C++ Carbon Application 2.2.0" template).

Does this method still allow running gdb on the C code?

> > I looked at my App using lipo -info fromTerminal and get the 
> > following error:
> > lipo: Can't map input file: .../myapp/build/Release/myapp.app ((os/
> > kern) invalid argument)
>
>myapp.app is a folder (or more specifically, a bundle). The actual 
>program is .../myapp/build/Release/myapp.app/Contents/MacOS/myapp

Yep, finally figured that out.

> > As well, in Finder Get Info for my app, the 'open using Rosetta 
> > checkbox is greyed out and I cannot select it. Activity Monitor of 
> > course shows an intel program but i need to deploy to PowerPC 
> > running 10.3.9.

Now my latest build appears to allow running under Rosetta, but incorrectly.

> > If I look at my 'C' library project product with lipo, I get 
> > Architectures in the fat file: ./libkbCarbonLib.a are: i386 ppc
> >
> > What else do I need to do in order to generate a universal binary? 
> > Do I need to run the fpc ppc version somehow for the ppc side of 
> > tings? I suspect so but cannot find what to do.
>
>You have to go to the project's build settings for the configuration 
>that you are building (presumably "release"), and then set the 
>"Architectures" setting (the second from the top) to "Standard (32-bit 
>Universal)". This works at least for me with the "FPC-C-C++ Carbon 
>Application 2.2.0" template.
>

Yes is working now for me too, not sure what i did at this point to make it 
happen.

Thx

>Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] building universal binary

2009-02-03 Thread Ken G. Brown
Mac OS X 10.5.6, fpc 2.2.2, Xcode 3.1.2

Have a Pascal program calling some C code from a static library I build in a 
separate project so I can use the debugger.

I've set Xcode to use gcc 4.0 targeting 10.4 for intel, and gcc 3.3 targetting 
10.3.9 for PowerPC in both projects.

So far I am basically using the fpc user defined options that came with the 
template for building for calling C functions.

Do I need to add some fpc options in order to properly compile for a universal 
binary?

I looked at my App using lipo -info fromTerminal and get the following error:
lipo: Can't map input file: .../myapp/build/Release/myapp.app ((os/kern) 
invalid argument)

As well, in Finder Get Info for my app, the 'open using Rosetta checkbox is 
greyed out and I cannot select it. Activity Monitor of course shows an intel 
program but i need to deploy to PowerPC running 10.3.9.

If I look at my 'C' library project product with lipo, I get Architectures in 
the fat file: ./libkbCarbonLib.a are: i386 ppc  

What else do I need to do in order to generate a universal binary? Do I need to 
run the fpc ppc version somehow for the ppc side of tings? I suspect so but 
cannot find what to do.

Any tips appreciated.

Thx,
Ken G. Brown
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal