using bcrypt.a #2

Closed
arianitu opened this Issue Oct 7, 2013 · 1 comment

2 participants

@arianitu

To use bcrypt.a, it has a dependency on crypt_blowfish.a (so you need to build with both.)

I'm rather inexperienced with building static libs with ar, but couldn't we do (to build with only bcrypt.a)

bcrypt.a: bcrypt.o crypt_blowfish/crypt_blowfish.a
    ar r bcrypt.a bcrypt.o crypt_blowfish/*.o

instead of

bcrypt.a: bcrypt.o crypt_blowfish/crypt_blowfish.a
    ar r bcrypt.a bcrypt.o crypt_blowfish/crypt_blowfish.a

or is this type of coupling a bad idea?

@rg3
Owner
rg3 commented Oct 7, 2013

I see your problem and would like to solve it. Word of warning: I'm not an expert in static or dynamic libraries.

To answer your question, yes, the solution you propose makes bcrypt.a depend on some things, but builds it based on others. It creaks a little. On the other hand, it just works unless you're doing weird stuff with the tree.

The proper solution would be to make bcrypt.a include the object files that are part of crypt_blowfish/crypt_blowfish.a without depending on them externally existing, but to do that you'd need to extract the files from crypt_blowfish.a to a temporary location, then use them to build bcrypt.a, then delete them. It feels like killing a fly with a cannon.

So I'm doing what you suggested. :D

@rg3 rg3 closed this in f3b5c06 Oct 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment