Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-06

32 and 64 bit fpc.cfg file

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joost van der Sluis

Hi all,

On Fedora 64-bit libraries are installed in /usr/lib64 and 32 bit libraries are in /usr/lib. The fedora fpc-packages also use these directories. The fpc.cfg file contains the following:

# 32-bits
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl
# 64-bits
-Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget
-Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/*
-Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/rtl

This works, but is not ideal offcourse. Is there a way to detect if the compiler is 32 or 64 bit in the fpc.cfg file? So that it's possible to define these options depending on compiling for 32 or 64 bit?

Joost

Reply by email

Marco van de Voort
to Joost van der Sluis
Show quoted text 16 lines
On Fedora 64-bit libraries are installed in /usr/lib64 and 32 bit libraries are in /usr/lib. The fedora fpc-packages also use these directories. The fpc.cfg file contains the following: # 32-bits -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl # 64-bits -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/rtl This works, but is not ideal offcourse. Is there a way to detect if the compiler is 32 or 64 bit in the fpc.cfg file? So that it's possible to define these options depending on compiling for 32 or 64 bit?

Huh, I thought samplecfg did this right? Else try CPUX86_64

Reply by email

Ales Katona
to Joost van der Sluis: On Fedora 64-bit libraries are installed in /usr/lib64 and 32 bit libraries are in…

Joost van der Sluis wrote / napísal(a):

Show quoted text 22 lines
Hi all, On Fedora 64-bit libraries are installed in /usr/lib64 and 32 bit libraries are in /usr/lib. The fedora fpc-packages also use these directories. The fpc.cfg file contains the following: # 32-bits -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl # 64-bits -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/rtl This works, but is not ideal offcourse. Is there a way to detect if the compiler is 32 or 64 bit in the fpc.cfg file? So that it's possible to define these options depending on compiling for 32 or 64 bit? Joost ________________________

You're making it just specifically for fedora right? Because for example Ubuntu 64bit has it inverted, /usr/lib is a symlink to /usr/lib64.

Perhaps 64bit fpc.cfg should have explicit lib<bits> dirs.

Ales

Reply by email

Peter Vreman
to Joost van der Sluis: On Fedora 64-bit libraries are installed in /usr/lib64 and 32 bit libraries are in…
Joost van der Sluis wrote 18 lines
Hi all, On Fedora 64-bit libraries are installed in /usr/lib64 and 32 bit libraries are in /usr/lib. The fedora fpc-packages also use these directories. The fpc.cfg file contains the following: # 32-bits -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl # 64-bits -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/rtl This works, but is not ideal offcourse. Is there a way to detect if the compiler is 32 or 64 bit in the fpc.cfg file? So that it's possible to define these options depending on compiling for 32 or 64 bit?

You can use:

#ifdef CPU64
-Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget
...
#else
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
#endif

Reply by email

Ales Katona
to Peter Vreman

Peter Vreman wrote / napísal(a):

Show quoted text 9 lines
You can use: #ifdef CPU64 -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget ... #else -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget #endif

Note that this won't work with /usr/local as prefix, because there's only one lib (by default) there.

Reply by email

Marco van de Voort
to Ales Katona
Show quoted text 13 lines
Peter Vreman wrote / nap?sal(a): > You can use: > > #ifdef CPU64 > -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget > ... > #else > -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget > #endif > Note that this won't work with /usr/local as prefix, because there's only one lib (by default) there.

What happens if you have a bunch of 32-bit and 64-bit packages then?

Reply by email

Ales Katona
to Marco van de Voort

Marco van de Voort wrote / napísal(a):

What happens if you have a bunch of 32-bit and 64-bit packages then?

Packages go to /usr/lib not /usr/local/lib, and /usr/lib is either symlink or the "main" one (depends on distro if it's 64 or 32 I guess).

/usr/local is completely untouched by all packages (at least on ubuntu).

Ales

Reply by email

Joost van der Sluis
to Ales Katona: Peter Vreman wrote / napísal(a): Note that this won't work with /usr/local as prefix,…

Op woensdag 25-06-2008 om 12:55 uur [tijdzone +0200], schreef Ales Katona:

Show quoted text 13 lines
Peter Vreman wrote / napísal(a): > You can use: > > #ifdef CPU64 > -Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget > ... > #else > -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget > #endif > Note that this won't work with /usr/local as prefix, because there's only one lib (by default) there.

Afaik it's so that packages maintained by Fedora install in /usr/ and 'external' packages install in /usr/local. So the rpm's provided by Fedora install everything in /usr/libXX/, including the packages.

If you use the rpm's provided by the fpc-team, they install in /usr/local.

Joost.

Reply by email