Skip to content

Instantly share code, notes, and snippets.

@perlmonk
Created February 3, 2016 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perlmonk/c82e5e07eb6e9dcde676 to your computer and use it in GitHub Desktop.
Save perlmonk/c82e5e07eb6e9dcde676 to your computer and use it in GitHub Desktop.
compile openssl on osx 10.11
#!/usr/bin/perl
=pod
I have GNU libtool installed so the answer from link below not simply work:
http://stackoverflow.com/a/30970680/3368344
The `ar` command like `ar r ../libcrypto.a cryptlib.o mem.o ...`
This script remove `r` from arguments, and call osx libtool to merge o files to a file.
Put this file in openssl dir and run:
```
chmod +x libtool.pl
alias ar="./libtool.pl"
./Configure darwin64-x86_64-cc
make
sudo make install
```
logs:
ld: warning: ignoring file ../libssl.a, file was built for archive which is not the architecture being linked (x86_64): ../libssl.a
ld: warning: ignoring file ../libcrypto.a, file was built for archive which is not the architecture being linked (x86_64): ../libcrypto.a
ld: warning: ignoring file ../libssl.a, file was built for archive which is not the architecture being linked (x86_64): ../libssl.a
ld: warning: ignoring file ../libcrypto.a, file was built for archive which is not the architecture being linked (x86_64): ../libcrypto.a
Undefined symbols for architecture x86_64:
Undefined symbols for architecture x86_64:
"_BN_CTX_free", referenced from:
_prime_field_tests in ectest.o
_char2_field_tests in ectest.o
_group_order_tests in ectest.o
=cut
# ar r ../libcrypto.a cryptlib.o mem.o
# remove 'r'
shift @ARGV;
unshift @ARGV, '/usr/bin/libtool', '-static', '-o';
print "using libtool for ar: @ARGV\n";
system @ARGV;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment