ext/nfc/extconf.rb in nfc-2.0.1 vs ext/nfc/extconf.rb in nfc-2.1.0
- old
+ new
@@ -4,51 +4,19 @@
require 'mkmf'
LIBDIR = Config::CONFIG['libdir']
INCLUDEDIR = Config::CONFIG['includedir']
+HEADER_DIRS = [ '/usr/local/include', INCLUDEDIR, '/usr/include', ]
+LIB_DIRS = [ '/usr/local/lib', LIBDIR, '/usr/lib', ]
-$CFLAGS << " -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline"
+nfc_dirs = dir_config('nfc', HEADER_DIRS, LIB_DIRS)
-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',
-]
-
-nfc_dirs = dir_config('nfc', '/opt/local/include', '/opt/local/lib')
-unless ["", ""] == nfc_dirs
- HEADER_DIRS.unshift nfc_dirs.first
- LIB_DIRS.unshift nfc_dirs[1]
-end
-
-unless find_header('libnfc/libnfc.h', *HEADER_DIRS)
+unless find_header('nfc/nfc.h')
abort "libnfc is missing. please install libnfc: http://libnfc.org/"
end
-unless find_library('nfc', 'nfc_connect', *LIB_DIRS)
+unless find_library('nfc', 'nfc_connect')
abort "libnfc is missing. please install libnfc: http://libnfc.org/"
end
create_makefile('nfc/nfc')