Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2379 closed enhancement (fixed)

Compile error When Exclude WITH_CARDREADER for stapi

Reported by: john_28 Owned by: _network
Priority: major Component: ! Please select...
Severity: medium Keywords:
Cc: Sensitive: no


This is not defect , it's mostly enhancement requested for stapi compile to be able like other boxes to exclude CARD_READER :

now all Modules , hardware compile fine with head of rev .
just small issue , When Exclude WITH_CARDREADER and try compile stapi , Get this error :

oscam.c: In function ‘main’:
oscam.c:4288: error: ‘cardreader_stapi’ undeclared (first use in this function)

simply, if i change above line 4288 of oscam.c to :

#if defined(WITH_CARDREADER)

This pass , but get this :

./stapi/liboscam_stapi.a(stapi.o): In function `STReader_Reset':
stapi.c:(.text+0x16f0): undefined reference to `ATR_InitFromArray'

P.S : before 6309 , it was impossible to exclude Card Readers for all boxes (which was not good) , It was possible to exclude SCI_DEV , But That bianry still contain of Card_Readers (like phoneix ...)

now after r6309 , hopefully For Other Boxes , it's possible to exclude card readers perfectly , so it would be so nice If there would be a new _Network stapi lib which make it possible for stapi too ,like Other boxes to exclude Card_Readers
Thanks in Advance

Change History (11)

comment:1 by john_28, 11 years ago

typo , it just can't be displayed by trac
in Description

#if defined(WITH_CARDREADER) || defined(WITH_STAPI) 

Last edited 11 years ago by john_28 (previous) (diff)

comment:2 by Admin, 11 years ago

The second one is easy and doesn't take much space, I just added that one in r6335. But for the other one you suggested I'm a bit suprised: How shall this work? There is already WITH_STAPI defined on your stapi compile so what shall the "else" help here?

comment:3 by john_28, 11 years ago

Thanks admin for perfect supporting
i meant , for the other error , We might need New stapi lib release which consider one could exclude cardreader for stapi box like other boxes too (i think the reason that other boxes like mips could exclude WITH_CARDREADER is , they don't use any closed source...

well , Suppose one like me , Want to build Oscam , Without any cardreader (ie phoneix , ...) , i just use my stapi box for my client , now if i exclude WITH_CARDREADER , it says :

./stapi/liboscam_stapi.a(stapi.o): In function `STReader_Reset':
stapi.c:(.text+0x16f0): undefined reference to `ATR_InitFromArray'

stapi lib is closed source to me , but I have Thought maybe in _network Lib source code , if in the upper of function named "STReader_Reset" we add this line ,

stapi lib source code :

STReader_Reset (... )

And then recompile his stapi lib. Then this compile error might be pass too :

P.S.1: now ,The binary Including Camd35 , Dvbapi , WITH_CARDREADER is about 400 kb ,
In before , Since i didn't have to add all files of /csctapi The binary was 200 kb

P.S.2: If _network want to release new stapi lib , i want to feedback With_CARDREADER is also had added to reader-common.c and oscam-reader.c .

P.S.3: As said before , To me 6309 is good one , Since now for all other boxes (except stapi) i could exclude cardreader which i never have most of those hardware (in before of 6309 , This Option wasn't possible for me with none of my boxes.)

Best Regards.

Last edited 11 years ago by john_28 (previous) (diff)

comment:4 by john_28, 11 years ago

Btw , i have just tried , With head of oscam rev (6336) and tried to exclude CARDREADER for my stapi build, Still that other error is shown :

./stapi/liboscam_stapi.a(stapi.o): In function `STReader_Reset':
stapi.c:(.text+0x16f0): undefined reference to `ATR_InitFromArray'

i think , this just could be solve by release new stapi lib , As i have just explained in my last post (one post above)
Thanks in advance,

Last edited 11 years ago by john_28 (previous) (diff)

comment:5 by Admin, 11 years ago

You can't put ifdefs in a precompiled binary. It would mean having two and we should really try to avoid that (it is possible in general to workaround that as you can define those missing functions as dummy). I'm just wondering why the atr function doesn't get compiled as I added a WITH_STAPI around it...could you try to define it as "external" in atr.h?

Last edited 11 years ago by Admin (previous) (diff)

comment:6 by john_28, 11 years ago

could you try to define it as "external" in atr.h?

sure , i have just try it , still build stapi exclude cardreader get that error.

Well , It's made me wondering too , But my guess (suggestion) is , even if he recompile his lib against latest head of trunk (rev >= r6336) (without any change in his stapi lib source code) Then it might be possible error might be fix , it worth to try since i had remembered some time ago , That he did recompile his lib without any change in his code against latest trunk at that time, then his lib binary size was differs.
My guess is Whenever he Recompile his stapi lib , His lib considers ifdefs which are defined on that time in oscam root files...
Best Regards

Last edited 11 years ago by john_28 (previous) (diff)

comment:7 by Admin, 11 years ago

I think you should read about how precompiler directives work.
He could for sure compile one without cardreader - but this would not work with cardreader anymore. And we really should try to stay on one, not two precompiled binarys.

comment:8 by john_28, 11 years ago

I understand u , But I didn't mean we should have 2 precompiled lib binary.

Let me clarify : As said , Even after your recent commit (i mean 6335 , 6336) still it's not possible to compile oscam exclude CARDREADER for stapi (and i posted error log above) , So my guess is , The reason is Stapi lib , itself ...

That's why i have suggested once , _network will Recompile his lib (without any change in it's source code) , Against head of trunk (rev >= 6336) and then we could try with this new stapi lib , to see if it's possible to compile oscam stapi with excluding CARDREADER or not , i think this worth to try ... But maybe u have some other suggestion (or way) for fix this compile error? do u?
Best Regards

Last edited 11 years ago by john_28 (previous) (diff)

comment:9 by john_28, 11 years ago

Resolution: fixed
Status: newclosed

with r6339 (and now i can exclude it , with stapi too) , big Thanks to Admin . But still i believe , The real reason was stapi lib :D
since the 6339 is workaround , As admin mentioned ... still my guess is if remove r6339 and then Recompile stapi lib against head of trunk , Then it should be fix ... and if my guess would be right , Then , The real question is why stapi lib is like that? i mean , Why it's concern about oscam tree at the time of compliing stapi lib. (i mean it should be fully independent of that ...)
Anyway , Thanks again to admin

comment:10 by Admin, 11 years ago

It can never be independent as this lib is bound to OSCam in many ways. The point is, that the libstapi also includes most of the reader functionality on these receivers and one of those calls the ATR function. The only possible solutions would be:

  1. Offer two libstapis - one with cardreader, the other without. The one without could probably be quite a bit smaller than currently.
  2. Add the ATR_InitFromArray function into libstapi.

But as it works now there's no point in bothering _network about that.

comment:11 by john_28, 11 years ago

It can never be independent as this lib is bound to OSCam in many ways.

Well , u are right that it's bound but i meant , lib stapi whenever an user (like me) try to compile any oscam rev , Should follow oscam tree , not just the time it's author (_network) try compile his stapi lib ...

but i think the reason is stapi oscam lib , is static library , If it will change to dynamic lib , Then these kinds of error (problem) might reduce isn't it?

P.S : here is the difference beetween static and dynamic lib , which i meant in above :

anyway , you or _network know much better than me , how it should be.
Best regards

Last edited 11 years ago by john_28 (previous) (diff)
Note: See TracTickets for help on using tickets.