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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     1
#!/usr/bin/env ruby
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     2
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     3
require 'mkmf'
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     4
require 'fileutils'
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     5
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     6
ADDITIONAL_LIBRARY_DIRS = %w[
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     7
	/usr/local/lib
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     8
	/opt/lib
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     9
	/opt/local/lib
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    10
]
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    11
ADDITIONAL_INCLUDE_DIRS = %w[
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    12
	/usr/local/include
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    13
	/opt/include
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    14
	/opt/local/include
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    15
]
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    16
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    17
$CFLAGS << ' -Wall' << ' -ggdb' << ' -DDEBUG'
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    18
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    19
def fail( *messages )
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    20
	$stderr.puts( *messages )
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    21
	exit( 1 )
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    22
end
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    23
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    24
7
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    25
dir_config( 'bsd/jail' )
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    26
7
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    27
have_header( 'stdio.h' )      or fail "Can't find the stdio.h header."
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    28
have_header( 'sys/param.h' )  or fail "Can't find the sys/param.h header."
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    29
have_header( 'sys/jail.h' )   or fail "Can't find the sys/jail.h header."
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    30
have_header( 'sys/types.h' )  or fail "Can't find the sys/types.h header."
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    31
have_header( 'sys/sysctl.h' ) or fail "Can't find the sys/sysctl.h header."
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    32
have_header( 'unistd.h' )     or fail "Can't find the unistd.h header."
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    33
have_header( 'arpa/inet.h' )  or fail "Can't find the arpa/inet.h header."
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    34
have_header( 'errno.h' )      or fail "Can't find the errno.h header."
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    35
7
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    36
have_func( "jail_attach" ) or fail "Can't find jail_attach in the stdlib."
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    37
7
4460fc10c6a3 * Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents: 5
diff changeset
    38
create_makefile( 'bsd/jail' )
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    39