ext/readline/extconf.rb


DEFINITIONS

This source file includes following functions.


   1  require "mkmf"
   2  
   3  dir_config("readline")
   4  have_library("user32", nil) if /cygwin/ === RUBY_PLATFORM
   5  have_library("ncurses", "tgetnum") or
   6    have_library("termcap", "tgetnum") or
   7    have_library("curses", "tgetnum")
   8  
   9  if have_header("readline/readline.h") and
  10      have_header("readline/history.h") and
  11      have_library("readline", "readline")
  12    if have_func("rl_filename_completion_function")
  13      $CFLAGS += " -DREADLINE_42_OR_LATER"
  14    end
  15    if have_func("rl_cleanup_after_signal")
  16      $CFLAGS += " -DREADLINE_40_OR_LATER"
  17    end
  18    if try_link(<<EOF, $libs)
  19  #include <stdio.h>
  20  #include <readline/readline.h>
  21  main() {rl_completion_append_character = 1;}
  22  EOF
  23      # this feature is implemented in readline-2.1 or later. 
  24      $CFLAGS += " -DREADLINE_21_OR_LATER"
  25    end
  26    create_makefile("readline")
  27  end