2004-09-12 13:34:30 -04:00
|
|
|
#!ruby -s
|
|
|
|
|
|
|
|
require 'mkmf'
|
|
|
|
require 'rbconfig'
|
|
|
|
|
|
|
|
def main
|
|
|
|
unless have_command('bison')
|
2004-12-15 14:02:42 -05:00
|
|
|
unless File.exist?('ripper.c') or File.exist?("#{$srcdir}/ripper.c")
|
|
|
|
$stderr.puts 'missing bison; abort'
|
|
|
|
exit 1
|
|
|
|
end
|
2004-09-12 13:34:30 -04:00
|
|
|
end
|
|
|
|
$objs = %w(ripper.o)
|
2004-09-14 07:27:36 -04:00
|
|
|
$cleanfiles.concat %w(ripper.y ripper.c ripper.E ripper.output eventids1.c ids1 ids2)
|
2004-09-12 13:34:30 -04:00
|
|
|
$CPPFLAGS += ' -DRIPPER'
|
|
|
|
$CPPFLAGS += ' -DRIPPER_DEBUG' if $debug
|
|
|
|
create_makefile 'ripper'
|
|
|
|
end
|
|
|
|
|
|
|
|
def have_command(cmd)
|
2004-09-14 07:27:36 -04:00
|
|
|
checking_for(cmd) {
|
|
|
|
ENV['PATH'].split(File::PATH_SEPARATOR).any? {|path|
|
|
|
|
File.executable?("#{path}/#{cmd}#{Config::CONFIG['EXEEXT']}")
|
|
|
|
}
|
2004-09-12 13:34:30 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
main
|