diff --git i/Makefile.PL w/Makefile.PL index 71026ef..89af82a 100644 --- i/Makefile.PL +++ w/Makefile.PL @@ -35,12 +35,18 @@ my $has_openssl = check_lib( if ( $has_openssl ) { push @defines, '-DNAR_HAVE_OPENSSL'; push @libs, '-lssl', '-lcrypto'; + if ( $^O eq 'darwin') { + unshift @libs, '-L/usr/local/opt/openssl/lib'; + } if ( $^O eq 'MSWin32' ) { push @inc, "-Irabbitmq-include/win32"; } else { push @inc, "-Irabbitmq-include/unix"; } + if ( $^O eq 'darwin') { + unshift @inc, '-I/usr/local/opt/openssl/include'; + } } my $ofiles = ''; @@ -52,6 +58,10 @@ foreach ( <*.c> ){ $_ =~ s/.c$/.o/; $ofiles .= "$_ "; } +if ( $^O eq 'darwin' ) { + # avoid "duplicate symbol" errors + $ofiles =~ s{RabbitMQ\.o}{}; +} my %WriteMakefileArgs = ( NAME => 'Net::AMQP::RabbitMQ',