2004-09-12 13:34:30 -04:00
|
|
|
#!ruby -s
|
2017-02-05 02:54:32 -05:00
|
|
|
# frozen_string_literal: true
|
2004-09-12 13:34:30 -04:00
|
|
|
|
|
|
|
require 'mkmf'
|
|
|
|
require 'rbconfig'
|
|
|
|
|
|
|
|
def main
|
2019-03-01 03:31:43 -05:00
|
|
|
yacc = ENV["YACC"] || "bison"
|
|
|
|
|
|
|
|
unless find_executable(yacc)
|
2004-12-15 14:02:42 -05:00
|
|
|
unless File.exist?('ripper.c') or File.exist?("#{$srcdir}/ripper.c")
|
2012-05-18 03:01:54 -04:00
|
|
|
raise 'missing bison; abort'
|
2004-12-15 14:02:42 -05:00
|
|
|
end
|
2004-09-12 13:34:30 -04:00
|
|
|
end
|
|
|
|
$objs = %w(ripper.o)
|
2021-11-25 01:38:24 -05:00
|
|
|
$distcleanfiles.concat %w(ripper.y ripper.c eventids1.c eventids2table.c)
|
|
|
|
$cleanfiles.concat %w(ripper.E ripper.output y.output .eventids2-check)
|
2007-06-09 23:06:15 -04:00
|
|
|
$defs << '-DRIPPER'
|
|
|
|
$defs << '-DRIPPER_DEBUG' if $debug
|
|
|
|
$VPATH << '$(topdir)' << '$(top_srcdir)'
|
|
|
|
$INCFLAGS << ' -I$(topdir) -I$(top_srcdir)'
|
2019-02-28 22:45:00 -05:00
|
|
|
create_makefile 'ripper' do |conf|
|
2019-03-01 03:31:43 -05:00
|
|
|
conf << "BISON = #{yacc}"
|
2019-02-28 22:45:00 -05:00
|
|
|
end
|
2004-09-12 13:34:30 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
main
|