[fpc-pascal] cross compiling enigma

2007-12-07 Thread Sam Liddicott
I'm modifying the lazarus packaging scripts to make building debs of 
lazarus, fpc and cross-fpc variants simpler than it is. (Cross is not 
simple right now)


I've read the buildfaq (thanks Marco) and various fpc build scripts but 
am still puzzled in this respect:


Why does:

$ cd fpc
$make clean all OS_TARGET=win32  FPC=/usr/bin/ppc386

make:
./compiler/ppc386.exe

I thought I was building a cross-compiler, not cross-compiling one - or 
is it a side effect of building the rtl etc?


(Not to mention utils/*exe)

also with the ubuntu mingw* packages installed,
$ make clean all OS_TARGET=win32  FPC=/usr/bin/ppc386 
BINUTILSPREFIX=i586-mingw32msvc-


generates all these .exe files.

Am I doing the cross-compiler build wrong?
It dumps out: compiler/ppcross386
as well, which was used to build all the .exe

I'm puzzled, it seems like the fpc makefile had the wrong idea and built 
a cross compiler so it could build windows binaries which is not what I 
was actually trying to do.


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


Re: [fpc-pascal] cross compiling enigma

2007-12-08 Thread Sam Liddicott
* Marco van de Voort wrote, On 07/12/07 08:20:
>> I'm modifying the lazarus packaging scripts to make building debs of 
>> lazarus, fpc and cross-fpc variants simpler than it is. (Cross is not 
>> simple right now)
>>
>> I've read the buildfaq (thanks Marco) and various fpc build scripts but 
>> am still puzzled in this respect:
>>
>> Why does:
>>
>> $ cd fpc
>> $make clean all OS_TARGET=win32  FPC=/usr/bin/ppc386
>>
>> make:
>> ./compiler/ppc386.exe
>>
>> I thought I was building a cross-compiler, not cross-compiling one - or 
>> is it a side effect of building the rtl etc?
>> 
>
> The thing you are missing (read buildfaq better :-) is that FPC doesn't have
> to be cross for platforms on the same architecture.
>   

:-(
I used 386-win32 for testing the script because FPC-SVN won't compile
for arm-wince - I'll try a ppc build for the test then.

So... because the makefile knew it was compiling for the same
architecture it decided that I wasn't building an fpc cross compiler but
cross building an fpc compiler? That's a bit unexpectedly clever...

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

Re: [fpc-pascal] cross compiling enigma

2007-12-08 Thread Sam Liddicott
Sam Liddicott wrote:
> Sam Liddicott wrote:
>> * Marco van de Voort wrote, On 07/12/07 08:20:
>>>> I'm modifying the lazarus packaging scripts to make building debs of 
>>>> lazarus, fpc and cross-fpc variants simpler than it is. (Cross is not 
>>>> simple right now)
>>>>
>>>> I've read the buildfaq (thanks Marco) and various fpc build scripts but 
>>>> am still puzzled in this respect:
>>>>
>>>> Why does:
>>>>
>>>> $ cd fpc
>>>> $make clean all OS_TARGET=win32  FPC=/usr/bin/ppc386
>>>>
>>>> make:
>>>> ./compiler/ppc386.exe
>>>>
>>>> I thought I was building a cross-compiler, not cross-compiling one - or 
>>>> is it a side effect of building the rtl etc?
>>>> 
>>>
>>> The thing you are missing (read buildfaq better :-) is that FPC doesn't have
>>> to be cross for platforms on the same architecture.
>>>   
>>
>> :-(
>> I used 386-win32 for testing the script because FPC-SVN won't compile
>> for arm-wince - I'll try a ppc build for the test then.
>>
>> So... because the makefile knew it was compiling for the same
>> architecture it decided that I wasn't building an fpc cross compiler
>> but cross building an fpc compiler? That's a bit unexpectedly clever...
> So... this time:
> $ make clean all CPU_TARGET=powerpc OS_TARGET=linux
> FPC=/usr/bin/ppc386 BINUTILSPREFIX=/usr/bin/powerpc-linux-gnu-
>
> And, just like before, it has created a load of powerpc binaries:
>
> $ file /tmp/fpc_patchdir/fpc_build/usr/bin/postw32
> /tmp/fpc_patchdir/fpc_build/usr/bin/postw32: ELF 32-bit MSB
> executable, PowerPC or cisco 4500, version 1 (SYSV), statically
> linked, stripped
>
>
> So I'm still puzzled that the recipe for creating a cross compiler is
> actually cross-compiling a compiler and cross-compiling the tools.
>
> Of course,  compiler/ppcrossppc was created, but it seems as a
> precursor to creating all the powerpc binaries.
>
> So I still think I'm doing it wrong; was my make command line correct
> to produce an fpc instance that will cross-compile for powerpc-linux?
I guess my mistake was in "make all", possibly a less encompassing
target would be better :-) like make cycle or whatever.

Sam

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


Re: [fpc-pascal] cross compiling enigma

2007-12-09 Thread Sam Liddicott
Sam Liddicott wrote:
> * Marco van de Voort wrote, On 07/12/07 08:20:
>>> I'm modifying the lazarus packaging scripts to make building debs of 
>>> lazarus, fpc and cross-fpc variants simpler than it is. (Cross is not 
>>> simple right now)
>>>
>>> I've read the buildfaq (thanks Marco) and various fpc build scripts but 
>>> am still puzzled in this respect:
>>>
>>> Why does:
>>>
>>> $ cd fpc
>>> $make clean all OS_TARGET=win32  FPC=/usr/bin/ppc386
>>>
>>> make:
>>> ./compiler/ppc386.exe
>>>
>>> I thought I was building a cross-compiler, not cross-compiling one - or 
>>> is it a side effect of building the rtl etc?
>>> 
>>
>> The thing you are missing (read buildfaq better :-) is that FPC doesn't have
>> to be cross for platforms on the same architecture.
>>   
>
> :-(
> I used 386-win32 for testing the script because FPC-SVN won't compile
> for arm-wince - I'll try a ppc build for the test then.
>
> So... because the makefile knew it was compiling for the same
> architecture it decided that I wasn't building an fpc cross compiler
> but cross building an fpc compiler? That's a bit unexpectedly clever...
So... this time:
$ make clean all CPU_TARGET=powerpc OS_TARGET=linux FPC=/usr/bin/ppc386
BINUTILSPREFIX=/usr/bin/powerpc-linux-gnu-

And, just like before, it has created a load of powerpc binaries:

$ file /tmp/fpc_patchdir/fpc_build/usr/bin/postw32
/tmp/fpc_patchdir/fpc_build/usr/bin/postw32: ELF 32-bit MSB executable,
PowerPC or cisco 4500, version 1 (SYSV), statically linked, stripped


So I'm still puzzled that the recipe for creating a cross compiler is
actually cross-compiling a compiler and cross-compiling the tools.

Of course,  compiler/ppcrossppc was created, but it seems as a precursor
to creating all the powerpc binaries.

So I still think I'm doing it wrong; was my make command line correct to
produce an fpc instance that will cross-compile for powerpc-linux?

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

Re: [fpc-pascal] cross compiling enigma

2007-12-10 Thread Sam Liddicott
Jonas Maebe wrote:
>
> On 08 Dec 2007, at 19:26, Sam Liddicott wrote:
>
>>> So... because the makefile knew it was compiling for the same
>>> architecture it decided that I wasn't building an fpc cross compiler
>>> but cross building an fpc compiler? That's a bit unexpectedly clever...
>> So... this time:
>> $ make clean all CPU_TARGET=powerpc OS_TARGET=linux FPC=/usr/bin/ppc386
>> BINUTILSPREFIX=/usr/bin/powerpc-linux-gnu-
>>
>> And, just like before, it has created a load of powerpc binaries:
>>
>> $ file /≈/usr/bin/postw32
>> /tmp/fpc_patchdir/fpc_build/usr/bin/postw32: ELF 32-bit MSB executable,
>> PowerPC or cisco 4500, version 1 (SYSV), statically linked, stripped
>
> "make clean all" does not put anything in usr/bin, so you at least alo
> have done a "make install" afterwards.

Yes, I'm modifying lazarus's create_fpc_deb.sh so it can also create
cross-compiler debs as well (this being simpler than fixing the scripts
in cross_unix)

>
>> So I'm still puzzled that the recipe for creating a cross compiler is
>> actually cross-compiling a compiler and cross-compiling the tools.
>>
>> Of course,  compiler/ppcrossppc was created, but it seems as a precursor
>> to creating all the powerpc binaries.
>
> It's a cross compiler, which is indeed necessary to create PowerPC
> binaries.
>

yes... I was expecting ppcrossppc to be created, the rest was surprising me

>> So I still think I'm doing it wrong; was my make command line correct to
>> produce an fpc instance that will cross-compile for powerpc-linux?
>
> Cross compilers are only intended as add-ons to a native compiler
> suite. If you do a plain install, the Makefiles assume you want to
> create a native install for the target platform (although currently
> this will only work consistently if both the source and target
> platform have the same endianess).
>
> If you want to perform an add-on cross install (which will only
> install the cross compiler and units, but not the PowerPC-native
> compiler and utilities -- as the natively installed versions of those
> utilities will be used), do something like this:
>
> make FPC=`pwd`/compiler/ppcrossppc
> INSTALL_PREFIX=/tmp/fpc_patchdir/fpc_build/usr install CROSSINSTALL=1
>

this was the required tip, thanks

> (the CROSSINSTALL=1 may not even be necessary when you point FPC to
> the cross compiler, as the Makefile should detect that it's a cross
> compiler and set that variable itself)

It seems to be needed, and I think I have it working now, apart from
adding stuff to /etc/fpc.cfg when the cross compiler package is installed.

I see that the old cross_unix crosswin32 stuff tries to add like this:

# add -FD and -XP entry for cross compiling
echo '# set binutils paths for crosscompiling # fpc_crosswin32' >>
/etc/fpc.cfg
echo '#IFDEF FPC_CROSSCOMPILING   # fpc_crosswin32' >>
/etc/fpc.cfg
echo '  -XPfpc-i386-win32-' >> /etc/fpc.cfg
echo '#ENDIF  # fpc_crosswin32' >>
/etc/fpc.cfg
# end.


But that seems to presume there will be only one cross compiler
installed; do you have any hints on what to add to fpc.cfg?

Thank

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


RE: [fpc-pascal] How to initialize a "Text" variable?

2008-03-17 Thread Sam Liddicott
Find the definition of the "text" type and see that it contains pointers to 
read and write functions.

They need replacing in yor instance to pointers to functions that do nothing.

The original Pascal file access is object oriented after all!

Sam


-Original Message-
From: Tomas Hajny <[EMAIL PROTECTED]>
Sent: 17 March 2008 07:17
To: FPC-Pascal users discussions 
Subject: Re: [fpc-pascal] How to initialize a "Text" variable?

On Sun, March 16, 2008 12:14, Felipe Monteiro de Carvalho wrote:
> On Sun, Mar 16, 2008 at 8:16 AM, Michael Van Canneyt
> <[EMAIL PROTECTED]> wrote:
>>  Assign yyoutput to a dummy stream, which simply skips output.
>
> Could you explain better how can this be implemented?
>
> The only think I know about streams is TStream.

I'm not sure if mixing lexlib (which is AFAIK written using procedural TP
style code) with streams is a good idea. Depending on your platform, you
could probably simply assign the text file name of 'NUL' or '/dev/nul'.
Admittedly, I don't know whether this kind of device exists for all
platforms (e.g. Symbian ;-) ).

Tomas


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

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