require 'mkmf' begin # for the exception SystemExit $:.unshift File.dirname(__FILE__) require 'type' if( ARGV.include?("--help") ) print <,, : maximum number of arguments of the function : maximum number of arguments of the callback : maximum number of callback entries --enable-asm use the embedded assembler for passing arguments. (this option is available for i386 machine now.) --enable-dlstack use a stack emulation for constructing function call. [experimental] EOF exit(0) end ($CPPFLAGS || $CFLAGS) << " -I." if (Config::CONFIG['CC'] =~ /gcc/) # from Win32API $CFLAGS << " -fno-defer-pop -fno-omit-frame-pointer" end if (Config::CONFIG['CC'] =~ /gcc/) && (Config::CONFIG['arch'] =~ /i.86/) $with_asm = true else $with_asm = false end $with_dlstack = false $with_type_int = try_run(<,,\n") exit(1) end end max_arg ||= 6 max_cbarg ||= 3 max_cbent ||= 3 max_callback_type = types2num(DLTYPE.keys.sort[-1,1] * (max_cbarg + 1)) + 1 max_callback = max_cbent #m = [1].pack("i") #c,cs = m.unpack("c") #bigendian = (c == 0) #print("bigendian ... #{bigendian ? 'true' : 'false'}\n") $dlconfig_h = <