diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-05-20 13:42:24 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-05-20 13:42:24 -0700 |
commit | 4d5928172b7b1bf480165688fc36c12d93bb33fe (patch) | |
tree | 8771c0d972433161ff7ac2ac21777fae2ec4e476 | |
parent | e4f115e43a78d339b066fde96adfcccfbbd81f50 (diff) | |
download | libyajl2-gem-4d5928172b7b1bf480165688fc36c12d93bb33fe.tar.gz |
bludgeoning mkmf.rb into submission
should finally fix windows def file issue
-rw-r--r-- | ext/libyajl2/extconf.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/libyajl2/extconf.rb b/ext/libyajl2/extconf.rb index de3e8cd..370881f 100644 --- a/ext/libyajl2/extconf.rb +++ b/ext/libyajl2/extconf.rb @@ -40,16 +40,9 @@ module Libyajl2Build $CFLAGS << " -DNDEBUG" - # ENV vars can override everything $CFLAGS = ENV['CFLAGS'] if ENV['CFLAGS'] $LDFLAGS = ENV['LDFLAGS'] if ENV['LDFLAGS'] - - if windows? - # on windows this will try to spit out a *.def that exports Init_libyajl which is wrong, we aren't a ruby lib, so we - # will never export that. - RbConfig::MAKEFILE_CONFIG['DLDFLAGS'].gsub!(/\$\(DEFFILE\)/, '') - end end def self.makemakefiles @@ -57,6 +50,14 @@ module Libyajl2Build dir_config("libyajl") create_makefile("libyajl") + # on windows the Makefile will try to export Init_libyajl which is wrong because we aren't a ruby lib. + # i could not figure out how to tell mkmf.rb to stop being so helpful, so instead will just patch it here. + if windows? + makefile = IO.read("Makefile") + makefile.gsub!(/\$\(DEFFILE\)/, '') + File.open("Makefile", 'w+') {|f| f.write(makefile) } + end + # we cheat and build it right away... system("make V=1") # ...so we can hack up what install does later and copy over the include files |