ext/extconf.rb
author Mahlon E. Smith <mahlon@martini.nu>
Sat, 28 Feb 2009 04:54:46 +0000
branchmahlon-misc
changeset 12 5fd07a9e7e7b
parent 10 b1426511fb64
permissions -rwxr-xr-x
* Added jail header dependencies for mkmf Makefile. * Renamed header file (bsdjail -> jail) * Fixed copyright * Initial commit of primary functionality * Attach to a running jail * Create a new jail * List and instantiate existing jails * Fetch information about existing jails * Still needs... * Attach "in a block" fleshed out * Documentation and better comments * Tests (of some kind, this will be tough) * Update for not-yet-MFC'ed multiple IP jail patch in FBSD 7.2-STABLE

#!/usr/bin/env ruby
# vim: set nosta noet ts=4 sw=4:

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( 'arpa/inet.h' )	or fail "Can't find the arpa/inet.h header."
have_header( 'errno.h' )	or fail "Can't find the arpa/inet.h header."
have_header( 'unistd.h' )	or fail "Can't find the unistd.h header."

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

create_makefile( 'bsd/jail' )