summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/psych/extconf.rb28
1 files changed, 11 insertions, 17 deletions
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb
index a859c98..cfada39 100644
--- a/ext/psych/extconf.rb
+++ b/ext/psych/extconf.rb
@@ -1,25 +1,19 @@
require 'mkmf'
-$CFLAGS << " -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline"
+$CFLAGS << ' -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion' <<
+ ' -Wmissing-noreturn -Winline'
-LIBDIR = Config::CONFIG['libdir']
INCLUDEDIR = Config::CONFIG['includedir']
+LIBDIR = Config::CONFIG['libdir']
+LIB_DIRS = ['/opt/local/lib', '/usr/local/lib', LIBDIR, '/usr/lib']
+libyaml = dir_config 'libyaml', '/opt/local/include', '/opt/local/lib'
-LIB_DIRS = [
- '/opt/local/lib',
- '/usr/local/lib',
- LIBDIR,
- '/usr/lib',
-]
-
-libyaml = dir_config('libyaml', '/opt/local/include', '/opt/local/lib')
-
-unless find_header('yaml.h')
- abort "yaml.y is missing. try 'port install libyaml +universal' or 'yum install libyaml-devel'"
+def asplode missing
+ abort "#{missing} is missing. Try 'port install libyaml +universal' " +
+ "or 'yum install libyaml-devel'"
end
-unless find_library('yaml', 'yaml_get_version')
- abort "libyaml is missing. try 'port install libyaml +universal' or 'yum install libyaml-devel'"
-end
+asplode('yaml.h') unless find_header 'yaml.h'
+asplode('libyaml') unless find_library 'yaml', 'yaml_get_version'
-create_makefile('psych/psych')
+create_makefile 'psych/psych'