ext/extconf.rb
author Mahlon E. Smith <mahlon@martini.nu>
Thu, 25 Dec 2008 08:35:46 +0000
branchmahlon-misc
changeset 11 e908d309e7ec
parent 10 b1426511fb64
child 12 5fd07a9e7e7b
permissions -rwxr-xr-x
* It compiles! * Removed additional leftover link parser stuff. * Removed unused memory allocate/free stuff until I discuss with my cohort. It may be back... it may be left over from linkparser too. ;) * list() works, but cores. Not sure why yet. Really, list() should be renamed to something sensible, and return instantiated BSD::Jail objects to attach() to or get additional info on. * Ruby C bindings are way, way fun. Reminds me how little C I can remember with one project a year :)

#!/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( 'bsdjail' )

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

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

create_makefile( 'bsdjail' )