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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     1
#!/usr/bin/env ruby
12
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
     2
# vim: set nosta noet ts=4 sw=4:
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     3
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     4
require 'mkmf'
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     5
require 'fileutils'
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     6
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     7
ADDITIONAL_LIBRARY_DIRS = %w[
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     8
	/usr/local/lib
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     9
	/opt/lib
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    10
	/opt/local/lib
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    11
]
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    12
ADDITIONAL_INCLUDE_DIRS = %w[
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    13
	/usr/local/include
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    14
	/opt/include
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    15
	/opt/local/include
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    16
]
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    17
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    18
$CFLAGS << ' -Wall' << ' -ggdb' << ' -DDEBUG'
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    19
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    20
def fail( *messages )
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    21
	$stderr.puts( *messages )
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    22
	exit( 1 )
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    23
end
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    24
12
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    25
dir_config( 'bsd/jail' )
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    26
12
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    27
have_header( 'stdio.h' )	or fail "Can't find the stdio.h header."
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    28
have_header( 'sys/param.h' )	or fail "Can't find the sys/param.h header."
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    29
have_header( 'sys/jail.h' )	or fail "Can't find the sys/jail.h header."
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    30
have_header( 'sys/types.h' )	or fail "Can't find the sys/types.h header."
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    31
have_header( 'sys/sysctl.h' )	or fail "Can't find the sys/sysctl.h header."
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    32
have_header( 'arpa/inet.h' )	or fail "Can't find the arpa/inet.h header."
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    33
have_header( 'errno.h' )	or fail "Can't find the arpa/inet.h header."
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    34
have_header( 'unistd.h' )	or fail "Can't find the unistd.h header."
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    35
12
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    36
have_func( "jail" )        or fail "Can't find jail() in the stdlib."
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    37
have_func( "jail_attach" ) or fail "Can't find jail_attach() in the stdlib."
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    38
12
5fd07a9e7e7b * Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents: 10
diff changeset
    39
create_makefile( 'bsd/jail' )
10
b1426511fb64 Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    40