ext/extconf.rb
author Michael Granger <ged@FaerieMUD.org>
Thu, 20 Nov 2008 16:43:02 +0000
changeset 3 7f6da371e2ce
child 5 41a1542b3b10
permissions -rwxr-xr-x
* Converted from Mkrf-based build back to mkmf. * Updated the build system.
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
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    25
dir_config( 'bsdjail' )
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    26
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    27
have_header( "sys/param.h" ) or fail "Can't find the sys/param.h header."
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    28
have_header( "sys/jail.h" )  or fail "Can't find the sys/jail.h header."
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    29
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    30
have_func( "jail_attach" )   or fail "Can't find jail_attach in the stdlib."
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    31
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    32
create_makefile( 'bsdjail' )
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    33