I'm maintaining a small USB device driver code for Linux. This is a user mode code so , there are places that we need to find what is the version of libudev so and etc. So the only way that I came up with , assumes that there are certain UNIX commands already available by default in almost all distributions that we are going to provide our binaries. Few of those commands are as follows.


What I'm asking is, is it safe to assume that ? that those commands are exists in almost all Linux distributions?

We will surely have issues with porting this to *nix, like MacOs or GNU Hrud. But we are targeting the Linux distributions only not even BSD.

  • Even on systems that use pkg-config, it may be absent. – Serge Sep 7 '16 at 3:43
  • So what about other distributions other than debain ? But ubuntu do have that function and I'm currently developing with ubuntu. So code would need some modification only to handle pkg-config dependency right ? – sandun dhammika Sep 7 '16 at 3:50
  • 1
    @cutrightjm Um... What? pkg-config is used in Debian, it's just not installed by default (it's a development tool, unnecessary for most users). – Stephen Kitt Sep 7 '16 at 6:04
  • @StephenKitt "... assumes that there are certain UNIX commands available by default.." I took that to mean already installed. – cutrightjm Sep 7 '16 at 6:18
  • 1
    Don't assume anything, check, and if missing prompt about it. – Rabin Sep 7 '16 at 6:42

You shouldn't worry about this, unless there are really many dependencies.

The porters/packagers in the teams know how to handle build-time and runtime dependencies. And the tools you mentioned might not be installed on all systems (especially pkg-config), but are all pretty common and well understood.

You should document the dependencies and that's all these people need to know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.