ext/polarssl/extconf.rb in polarssl-0.0.5 vs ext/polarssl/extconf.rb in polarssl-0.0.6
- old
+ new
@@ -1,8 +1,41 @@
require 'mkmf'
$CFLAGS = "-g -Wall -Wdeclaration-after-statement " + $CFLAGS
+LIBDIR = RbConfig::CONFIG['libdir']
+INCLUDEDIR = RbConfig::CONFIG['includedir']
+
+HEADER_DIRS = [
+ # First search /opt/local for macports
+ '/opt/local/include',
+
+ # Then search /usr/local for people that installed from source
+ '/usr/local/include',
+
+ # Check the ruby install locations
+ INCLUDEDIR,
+
+ # Finally fall back to /usr
+ '/usr/include',
+]
+
+LIB_DIRS = [
+ # First search /opt/local for macports
+ '/opt/local/lib',
+
+ # Then search /usr/local for people that installed from source
+ '/usr/local/lib',
+
+ # Check the ruby install locations
+ LIBDIR,
+
+ # Finally fall back to /usr
+ '/usr/lib',
+]
+
+dir_config('polarssl', HEADER_DIRS, LIB_DIRS)
+
unless find_header('polarssl/entropy.h')
abort "libpolarssl is missing. please install libpolarssl"
end
unless find_library('polarssl', 'entropy_init')
\ No newline at end of file