summaryrefslogtreecommitdiff
path: root/ext/psych/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/extconf.rb')
-rw-r--r--ext/psych/extconf.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb
new file mode 100644
index 0000000000..673b950a63
--- /dev/null
+++ b/ext/psych/extconf.rb
@@ -0,0 +1,22 @@
+require 'mkmf'
+
+# :stopdoc:
+
+RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
+
+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'
+
+def asplode missing
+ abort "#{missing} 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'
+
+# :startdoc: