ext/revdispatch/extconf.rb in evdispatch-0.1.0 vs ext/revdispatch/extconf.rb in evdispatch-0.1.1

- old
+ new

@@ -1,26 +1,27 @@ require 'mkmf' -if !File.exist?("libevdispatch/src/.libs") or !File.exist?("libevdispatch/libev/.libs") - system("chmod a+x libevdispatch/configure") - system("chmod a+x libevdispatch/autogen.sh") - system("chmod a+x libevdispatch/libev/configure") - system("chmod a+x libevdispatch/libev/autogen.sh") - # configure and build libev and libevdispatch we'll link against the static libraries - if !system("cd libevdispatch && ./autogen.sh && ./configure && make") - STDERR.puts "Failed to compile libevdispatcher" +libdispatch="./libdispatch-0.1" +libev="libev-3.2" + +if !File.exist?("#{libdispatch}/src/.libs") or !File.exist?("#{libdispatch}/#{libev}/.libs") + system("chmod a+x #{libdispatch}/configure") + system("chmod a+x #{libdispatch}/#{libev}/configure") + # configure and build #{libev} and #{libdispatch} we'll link against the static libraries + if !system("cd #{libdispatch} && ./configure && make") + STDERR.puts "Failed to compile #{libdispatch}er" exit(1) end end $srcs = ['revdispatch.cc'] $objs = ['revdispatch.o'] # put the header files first -$CPPFLAGS = " -I./libevdispatch/ -I./libevdispatch/src -I./libevdispatch/libev/ #{$CPPFLAGS}" +$CPPFLAGS = " -I./#{libdispatch}/ -I./#{libdispatch}/src -I./#{libdispatch}/#{libev}/ #{$CPPFLAGS}" -# link to the static library versions of libdispatch and libev -$LDFLAGS << " ./libevdispatch/src/.libs/libdispatch.a ./libevdispatch/libev/.libs/libev.a " +# link to the static library versions of libdispatch and #{libev} +$LDFLAGS << " ./#{libdispatch}/src/.libs/libdispatch.a ./#{libdispatch}/#{libev}/.libs/libev.a " dir_config("revdispatch") have_library("c", "main") have_library("stdc++", "main") have_library("rt", "clock_gettime")