PDCurses icon indicating copy to clipboard operation
PDCurses copied to clipboard

Implement SDL1 and SDL2 shared libraries

Open TurkeyMcMac opened this issue 4 years ago • 7 comments

  • SDL1: make libs now makes pdcurses.so in addition to pdcurses.a.
  • SDL2: You can build pdcurses.so/pdcurses.dylib with make DLL=Y. You can only build either pdcurses.a or pdcurses.so, consistent with the rest of the Makefile.

TurkeyMcMac avatar Sep 29 '20 12:09 TurkeyMcMac

Looks reasonable. I assume something similar could be done with SDL1.

For the X11 platform, make install copies libraries to /usr/local/lib. Should something resembling that be done here? If so, should ldconfig be invoked as well? (My knowledge of shared libraries is minimal.)

Bill-Gray avatar Oct 01 '20 02:10 Bill-Gray

Yes, something similar could probably be done for SDL1. However, the Makefile is structured differently, so it would probably be simpler to make the libs target build both the static and shared libraries at once. I could add that to this PR.

As for make install, that seems like it could be a separate thing. After all, the X11 installer installs both shared and static libraries. Furthermore, I don't know much about shared libraries or the conventions around them either (I've never used ldconfig), so maybe I'm not the person to implement make install.

TurkeyMcMac avatar Oct 02 '20 01:10 TurkeyMcMac

If I remember correctly @wmcbrine wanted to drop install targets wherever possible and likely only leave it in X11 because of its history. In any case this should not be part of this PR.

Introducing "SHARED" is understandable but as this is "alienate" to the existing ones I'd suggest to use "DLL" here and then open another PR which generally uses SHARED for this case in all platforms and to keep compatibility (at least for some time) define SHARED if DLL was specified.

And yes @Bill-Gray getting this PR (possibly adjusted and the SHARED part done separately) into the 4.21 release of PDCursesMod would be nice.

GitMensch avatar Oct 13 '20 20:10 GitMensch

@GitMensch OK, the suggestion has been implemented. I can't test myself that building the DLL still works on Windows.

TurkeyMcMac avatar Oct 13 '20 22:10 TurkeyMcMac

Hi, I am not familiar with SDL or its variants, but I guess someone may be interested in building libs for both variants. However, static and here added dynamic libraries have the same name for both variants. Would not be better to use more specific names, something like libSDL1PDCurses and libSDL2PDCurses?

agmartin2 avatar Feb 21 '21 22:02 agmartin2

@agmartin2 I think that change would be unrelated to this pull request. I called the shared libraries pdcurses.so to match the convention of the already existing static libraries.

TurkeyMcMac avatar Feb 22 '21 14:02 TurkeyMcMac

Would not be better to use more specific names, something like libSDL1PDCurses and libSDL2PDCurses?

Possibly, but I guess you commonly have either a system with SDL1 or SDL2; if you need both then you'd definitely need to install those with a prefix so far and changing the names now, after several years of existing names is likely a bad idea.

GitMensch avatar Feb 22 '21 14:02 GitMensch