ext/extconf.rb
author Mahlon E. Smith <mahlon@martini.nu>
Tue, 03 Mar 2009 22:23:45 +0000
changeset 7 4460fc10c6a3
parent 5 41a1542b3b10
permissions -rwxr-xr-x
* Now with 87% more hot jail action! * Predeclared all C methods in jail.h, so they could be arranged in logical order in jail.c * Fixed the extconf namespace. * Added rdoc. * Added usage examples, demonstrating jls, jexec, and jail ruby equivalents. * Re-added the "attach and execute within a block" code. * Added Enumerable and Comparable support. * Return 'path' as a Pathname object. TODO: * Create the actual 'jParallel' shell binary, now that we have a good backend framework. * Tests? How? * Add support for recently committed (will be part of 7.2-RELEASE) multiple IPs per jail, and jail labels.

#!/usr/bin/env ruby

require 'mkmf'
require 'fileutils'

ADDITIONAL_LIBRARY_DIRS = %w[
	/usr/local/lib
	/opt/lib
	/opt/local/lib
]
ADDITIONAL_INCLUDE_DIRS = %w[
	/usr/local/include
	/opt/include
	/opt/local/include
]

$CFLAGS << ' -Wall' << ' -ggdb' << ' -DDEBUG'

def fail( *messages )
	$stderr.puts( *messages )
	exit( 1 )
end


dir_config( 'bsd/jail' )

have_header( 'stdio.h' )      or fail "Can't find the stdio.h header."
have_header( 'sys/param.h' )  or fail "Can't find the sys/param.h header."
have_header( 'sys/jail.h' )   or fail "Can't find the sys/jail.h header."
have_header( 'sys/types.h' )  or fail "Can't find the sys/types.h header."
have_header( 'sys/sysctl.h' ) or fail "Can't find the sys/sysctl.h header."
have_header( 'unistd.h' )     or fail "Can't find the unistd.h header."
have_header( 'arpa/inet.h' )  or fail "Can't find the arpa/inet.h header."
have_header( 'errno.h' )      or fail "Can't find the errno.h header."

have_func( "jail_attach" ) or fail "Can't find jail_attach in the stdlib."

create_makefile( 'bsd/jail' )