1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
require 'mkmf'
dir_config('sary')
# sary_config = with_config('sary-config', 'sary-config')
# use_sary_config = enable_config('sary-config')
# if use_sary_config || use_sary_config == nil
# $CFLAGS += ' ' + `#{sary_config} --cflags`.chomp
# $LDFLAGS += ' ' + `#{sary_config} --libs`.chomp
# end
pkg_config = 'pkg-config'
unless system("#{pkg_config} sary --exists") then
ENV['PKG_CONFIG_PATH'] = '/usr/local/lib/pkgconfig/'
end
$CFLAGS += ' ' + `#{pkg_config} sary --cflags`.chomp
$LDFLAGS += ' ' + `#{pkg_config} sary --libs`.chomp
if have_header('sary.h') &&
have_library('sary')
create_makefile('sary')
end
# Add make targets
mfile = File.open 'Makefile', 'a'
mfile.print "\n"
mfile.print "\
deb:
if test -d debian ; then fakeroot $(MAKE) -f ./debian/rules clean; fi
if test -d debian ; then fakeroot $(MAKE) -f ./debian/rules binary; fi
.PHONY: deb
"
### Local variables:
### mode: Ruby
### indent-tabs-mode: nil
### End:
|