ext/libyajl2/extconf.rb in libyajl2-0.1.11 vs ext/libyajl2/extconf.rb in libyajl2-0.1.12

- old
+ new

@@ -32,11 +32,11 @@ $CFLAGS << " -std=c99 -pedantic -Wpointer-arith -Wno-format-y2k -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -Wextra -Wundef -Wwrite-strings -Wold-style-definition -Wredundant-decls -Wno-unused-parameter -Wno-sign-compare -Wmissing-prototypes" $CFLAGS << " -O2" # match what the upstream uses for optimization # create the implib on windows if windows? - $LDFLAGS << " -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--out-implib=libyajl.dll.a" + $LDFLAGS << " -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--out-implib=yajl.dll.a" end end $CFLAGS << " -DNDEBUG" @@ -60,18 +60,35 @@ # 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 + # not sure why ruby windows produces .so's instead of .dll's + if windows? + FileUtils.mv "libyajl.so", "yajl.dll" + end + File.open("Makefile", "w+") do |f| f.write <<EOF TARGET = libyajl DLLIB = $(TARGET).#{RbConfig::MAKEFILE_CONFIG['DLEXT']} all: +EOF + if windows? + f.write <<EOF install: \tmkdir -p #{prefix}/lib -\tcp $(DLLIB) #{prefix}/lib +\tcp yajl.dll #{prefix}/lib/yajl.dll +\tcp yajl.dll.a #{prefix}/lib/yajl.dll.a +\tmkdir -p #{prefix}/include/yajl +\tcp yajl/*.h #{prefix}/include/yajl +EOF + else + f.write <<EOF +install: +\tmkdir -p #{prefix}/lib +\tcp $(DLLIB) #{prefix}/lib/$(DLLIB) \tmkdir -p #{prefix}/include/yajl \tcp yajl/*.h #{prefix}/include/yajl EOF end end