USES
sysutils,dos
VAR
mprog,mpas,mbase,temp,dummy   : AnsiString
bppath,bpopt,fpcpath,fpcopt   : AnsiString
fcfg	: text

begin
INCLUDELIB baspaslib
mprog = Paramstr(1)


mbase = Extract(mprog,'.')
mpas = mbase + '.pas'
? mprog,' ',mpas
IF FileExists('rbpcfg.dat') then
    OpenRead(fcfg,'rbpcfg.dat')
    While not eof(fcfg)
        Readln(fcfg,temp)
        dummy = SnipFirstWord(temp)
        IF UpCase(dummy) = 'BP' THEN
            bppath = temp
        END IF
        IF UpCase(dummy) = 'BPOPT' THEN
            bpopt = temp
	ELSE
		bpopt = ''
        END IF
        IF UpCase(dummy) = 'FPC' THEN
            fpcpath = temp
        END IF   
        IF UpCase(dummy) = 'FPCOPT' THEN
            fpcopt = temp
	ELSE
		fpcopt = ''
        END IF        
    Wend
    Close(fcfg)

{BPOPT = MBASE + ' ' + BPOPT }
BPOPT = mprog
? bppath,' ',bpopt
Exec(bppath,bpopt)

FPCOPT = FPCOPT + MPAS
? fpcpath,' ',fpcopt
Exec(fpcpath,fpcopt)
END IF

end.
