summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-09-28 11:40:21 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-09-28 11:40:21 -0700
commitc9d59861da280f22b09aa67b44aace288569269d (patch)
treea8797b535fb74e28d94bbfe42c633bf0476d5a90
parent49fca7804e07247adff31d00f90e98004ccf0f33 (diff)
parent0b3db166cd9e616fea231687d48582d53743ebe8 (diff)
downloadpsych-c9d59861da280f22b09aa67b44aace288569269d.zip
Merge branch 'master' of github.com:tenderlove/psych
* 'master' of github.com:tenderlove/psych: Clean up extconf.
-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'