[fpc-pascal] FPC on NetBSD (i386)
Jonas Maebe
jonas.maebe at elis.ugent.be
Sat Apr 22 13:10:21 CEST 2006
On 19 Apr 2006, at 21:25, Adrian Maier wrote:
> Ok. I'll try to get 2.0.0 working, but i'll certainly need some
> guidance at
> the beginning.
Of course.
> I downloaded the release_2_0_0 from svn , and i am now trying to
> compile rtl using the fpc 1.0.10 .
>
> 1. cd rtl/netbsd
> 2. gmake
> [...]
>
> /usr/local/bin/ppc386 -dUNIX -Fi../inc -Fi../i386 -Fi../unix -Fi../bsd
> -Fi../bsd/i386 -Fi../netbsd/i386 -FE. -FU../../rtl/units/i386-netbsd
> -di386 ../bsd/system.pp
> Compiling ../bsd/system.pp
> system.pp(24,21) Error: Illegal unit name: SYSBSD
> system.pp(24,21) Warning: Compiling the system unit requires the -
> Us switch
This is quite strange. The 2.0.0 netbsd Makefile contains:
$(SYSTEMUNIT)$(PPUEXT) : $(BSDINC)/$(SYSTEMUNIT).pp sysconst.inc
systypes.inc sy
scalls.inc $(SYSDEPS)
$(COMPILER) -Us -Sg $(BSDINC)/$(SYSTEMUNIT).pp
I.e., it does specify -Us
> 3. I've modified in bsd/system.pp the line :
> Unit {$ifdef VER1_0}SysBSD{$else}System{$endif};
> to :
> Unit System;
>
> Is this correct ?
At some time, we switched from platform-specific system unit names to
"system" for all platforms. Afaik that was when switching from 1.x to
2.x, so normally 1.x should still require sysbsd.
The Makefile contains this:
ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
SYSTEMUNIT=system
LINUXUNIT=
PRT0=prt0
else
SYSTEMUNIT=sysbsd
LINUXUNIT=
override FPCOPT+=-dUNIX
PRT0=prt0_10
endif
So normally it should try to compile sysbsd.pp and not system.pp (rtl/
bsd/sysbsd.pp simply includes the contents of rtl/bsd/system.pp, but
a unit file called "system.pp" cannot have the unit name "sysbsd").
Is your /usr/local/bin/ppc386 a version 1.0.10 compiler? What does "/
usr/local/bin/ppc386 -iV" show? And what does "gmake info" show?
(when run in the rtl/netbsd directory)
> Then I ran ppc386 manually (and added the -Us switch) :
>
> /usr/local/bin/ppc386 -dUNIX -Fi../inc -Fi../i386 -Fi../unix -Fi../bsd
> -Fi../bsd/i386 -Fi../netbsd/i386 -FE. -FU../../rtl/units/i386-netbsd
> -di386 -Us ../bsd/system.pp
>
> 4. Ran gmake again , but when building the baseunix unit it is
> missing some
> files:
> $(BSDINC)/bunxtype.inc
> $(BSDINC)/ctypes.inc
> $(BSDINC)/bunxmain.inc
> $(BSDINC)/bunxfunc.inc
> $(BSDINC)/ossysch.inc
> $(BSDINC)/bunxmacr.inc
>
> I have noticed that in freebsd/Makefile these files are not referred .
>
> This is the progress so far.
I think the easiest would be to
a) move rtl/netbsd/Makefile and rtl/netbsd/Makefile.fpc aside for
reference
b) copy rtl/freebsd/Makefile.fpc to rtl/netbsd
c) edit the copied Makefile.fpc, changing all "freebsd" to "netbsd"
and removing references to gprt0* (that one is only needed for gprof
support, and is not implemented for netbsd at this time)
d) run "fpcmake" inside the rtl/netbsd directory to regenerate the
Makefile from the new Makefile.fpc
e) try running gmake again
If you get errors about missing seemingly OS-specific files, check if
those files exist in rtl/freebsd and either copy/adapt them, or if
they're not part of a critical unit (like terminfo or so), just
remove the involved unit from the units to be compiled in the
Makefile.fpc and regenerate the Makefile.
Jonas
More information about the fpc-pascal
mailing list