opnsense-ports/japanese/ruby-eb/files/patch-extconf.rb
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

32 lines
900 B
Ruby

--- extconf.rb.orig 2004-07-13 02:46:01.000000000 +0900
+++ extconf.rb 2013-05-02 15:17:55.000000000 +0900
@@ -5,9 +5,26 @@
have_library('eb')
have_func("rb_block_proc")
have_func("eb_bitmap_to_png")
-have_header('eb/sysdefs.h')
+have_header('eb/sysdefs.h')
+have_type('rb_encoding', ['ruby/ruby.h', 'ruby/encoding.h'])
-# uncomment the following line if you use eb-4.0beta* with pthread support.
-# $defs << '-DEBCONF_ENABLE_PTHREAD'
+if have_func("eb_pthread_enabled")
+ print "checking that the EB library is pthread enabled... "
+ STDOUT.flush
+ if try_run(<<EOS)
+#include <eb/eb.h>
+
+int main()
+{
+ printf("eb_pthread_enabled() => %d\\n", eb_pthread_enabled());
+ return eb_pthread_enabled() ? 0 : 1;
+}
+EOS
+ puts "yes"
+ $defs << '-DRUBY_EB_ENABLE_PTHREAD'
+ else
+ puts "no"
+ end
+end
create_makefile("eb")