Search for object files under both lower- and upper-case extensions.

This enables the linker to work correctly with object files with either extension case (or a mix), so it can work with objects from any of the ORCA languages even on a case-sensitive filesystem.

If two object files differ only in the case of their extension, the one with the lower-case extension will be used, and the one with the upper-case extension will be ignored.
This commit is contained in:
Stephen Heumann 2018-09-15 16:20:18 -05:00
parent 433b4652d7
commit 170fa09ecc
1 changed files with 32 additions and 4 deletions

36
seg.asm
View File

@ -336,7 +336,18 @@ kn1 lda #'.'
iny
lda suffix
sta [fname],Y
dec suffix --suffix
long M
phy
ph4 fname if not exists(fname) then
jsr ExistsM
ply
tax
short M
bne kn2
lda suffix uppercase suffix
and #$DF
sta [fname],Y
kn2 dec suffix --suffix
long M
sec
rts
@ -1091,15 +1102,32 @@ RootName private
iny
iny
ldx #0
phy
short M
kn1 lda root,X
rn1 lda root,X
sta [fname],Y
iny
inx
cpx #l:root
bne kn1
bne rn1
long M
rts
ph4 fname if not exists(fname) then
jsr ExistsM
ply
tax
bne ret
short M
ldx #1
iny
rn2 lda root,X uppercase suffix
and #$DF
sta [fname],Y
iny
inx
cpx #l:root
bne rn2
long M
ret rts
root dc c'.root'
end