Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pkg-config #11

Open
meator opened this issue Sep 21, 2024 · 3 comments
Open

Use pkg-config #11

meator opened this issue Sep 21, 2024 · 3 comments

Comments

@meator
Copy link

meator commented Sep 21, 2024

I have started working on a PR to address #10 properly. I have noticed that all external libraries are hardcoded. This is (again) not portable and it makes using custom libraries that are not system installed practically impossible. Systems such as Nix and GNU Guix depend on this functionality.

I propose using pkg-config in all Nymph project's Makefiles. What are your thoughts on this?

Some systems use pkgconf or other alternatives to pkg-config. I would make the executable overridable with PKG_CONFIG, but it should be considered when picking a default value for the executable.

@meator
Copy link
Author

meator commented Sep 21, 2024

poco, the main dependency of your projects, doesn't currently output pkg-config files. The support for .pc files is included in its develop-experimental branch. This means that using pkg-config in Nymph projects would't really improve things.

The main way poco wants to be discovered is through CMake discovery files. This means that the only two ways of doing this correctly is by using CMake, or preferably Meson (which also supports CMake's dependency lookup without depending on CMake).

With Make, there is no good way to link Nymph projects to a cross compiled libpoco. This complicates cross compiling NymphRPC and related projects.

@MayaPosch
Copy link
Owner

Library names are identical across platforms, for good reasons. I'm not sure that I understand the issue here.

@meator
Copy link
Author

meator commented Nov 9, 2024

Library names are identical across platforms

Library locations unfortunately aren't standardized across platforms. This complicates cross compilation. Library lookup on nonstandard systems such as Nix and GNU Guix is also affected.

Many package builders and other related systems have built in systems that override the library lookup path using standardized ways. These include pkg-config, with its .pc files and standardized environmental variables, CMake lookup scripts (used by poco), Meson's dependency lookup (which provides several methods for overriding dependencies with cross compiling and package building in mind) and more.

The current Makefile doesn't implement any dependency lookup. The library is either in one of the compiler's default library lookup directories or the library is not found.

Library lookup can also be altered by modifying LDFLAGS or similar environmental variables. This has many drawbacks when compared to standardized solutions outlined above, but it also works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants