summaryrefslogtreecommitdiff
path: root/ext/curses/extconf.rb
blob: 8356241f95ff644609f96c32470ee8eef133c61a (plain)
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
require 'mkmf'
$CFLAGS="-I/usr/include/ncurses -I/usr/local/include/ncurses"
$LDFLAGS="-L/usr/local/lib"
make=FALSE

have_library("mytinfo", "tgetent") if /bow/ =~ PLATFORM
if have_header("ncurses.h") and have_library("ncurses", "initscr")
  make=TRUE
elsif have_header("ncurses/curses.h") and have_library("ncurses", "initscr")
  make=TRUE
elsif have_header("curses_colr/curses.h") and have_library("cur_colr", "initscr")
  make=TRUE
else
  $CFLAGS=nil
  have_library("termcap", "tgetent") 
  if have_library("curses", "initscr")
    make=TRUE
  end
end

if make then
  for f in %w(isendwin ungetch beep doupdate flash deleteln wdeleteln)
    have_func(f)
  end
  create_makefile("curses")
end