extconf.rb in ncursesw-1.2.4.3 vs extconf.rb in ncursesw-1.4.0.0
- old
+ new
@@ -1,10 +1,11 @@
#!/usr/bin/env ruby
# ncurses-ruby is a ruby module for accessing the FSF's ncurses library
# (C) 2002, 2004 Tobias Peters <t-peters@users.berlios.de>
-# (C) 2005, 2009 Tobias Herzke
+# (C) 2005, 2009, 2011 Tobias Herzke
+# (C) 2013 Gaute Hope <eg@gaute.vetsj.com>
#
# This module is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
@@ -16,16 +17,15 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this module; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# $Id: extconf.rb,v 1.14 2009/05/03 14:13:27 t-peters Exp $
+# $Id: extconf_ncursesw.rb,v 1.1 2011-05-30 23:05:50 t-peters Exp $
require "mkmf"
-$CFLAGS += " -g"
-$CXXFLAGS = $CFLAGS
+$CFLAGS += " -g -Wformat -Werror=format-security"
have_header("unistd.h")
have_header("locale.h")
if have_header("ncurses.h")
@@ -104,10 +104,15 @@
have_func("wattr_set")
have_func("wchgat")
have_func("wcolor_set")
have_func("getattrs")
+puts "checking for ncursesw (wide char) functions..."
+if not have_func("wget_wch")
+ raise "no wget_wch found."
+end
+
puts "checking which debugging functions to wrap..."
have_func("_tracef")
have_func("_tracedump")
have_func("_nc_tracebits")
have_func("_traceattr")
@@ -122,16 +127,50 @@
have_func("attr_get")
puts "checking for the panel library..."
if have_header("panel.h")
have_library("panelw", "panel_hidden")
+else
+ raise "panel library not found"
end
+
puts "checking for the form library..."
if have_header("form.h")
- have_library("formw", "new_form")
+ if not have_library("formw", "new_form")
+ raise "formw library not found"
+ end
+else
+ raise "form library not found."
end
+
+if have_library("formw", "form_driver_w")
+ $CFLAGS += " -DHAVE_FORM_DRIVER_W"
+end
+
puts "checking for the menu library..."
if have_header("menu.h")
have_library("menu", "new_menu")
+else
+ raise "menu library not found."
end
+puts "checking for various ruby and standard functions.."
+if have_func("rb_thread_fd_select")
+ $CFLAGS += " -DHAVE_RB_THREAD_FD_SELECT"
+end
+
+# Avoid dereferencing WINDOW pointers on FreeBSD
+if RUBY_PLATFORM =~ /freebsd/
+ $CFLAGS += " -DNCURSES_OPAQUE=1"
+else
+ # add NCURSES_OPAQUE for mac
+ $CFLAGS += " -DNCURSES_OPAQUE=0"
+end
+
+if have_func("clock_gettime")
+ $CFLAGS += " -DHAVE_CLOCK_GETTIME"
+end
+
+$CXXFLAGS = $CFLAGS
+
create_makefile('ncursesw_bin')
+