author | Mahlon E. Smith <mahlon@martini.nu> |
Thu, 25 Dec 2008 07:33:20 +0000 | |
branch | mahlon-misc |
changeset 10 | b1426511fb64 |
child 12 | 5fd07a9e7e7b |
permissions | -rwxr-xr-x |
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
1 |
#!/usr/bin/env ruby |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
2 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
3 |
require 'mkmf' |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
4 |
require 'fileutils' |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
5 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
6 |
ADDITIONAL_LIBRARY_DIRS = %w[ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
7 |
/usr/local/lib |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
8 |
/opt/lib |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
9 |
/opt/local/lib |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
10 |
] |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
11 |
ADDITIONAL_INCLUDE_DIRS = %w[ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
12 |
/usr/local/include |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
13 |
/opt/include |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
14 |
/opt/local/include |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
15 |
] |
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 |
$CFLAGS << ' -Wall' << ' -ggdb' << ' -DDEBUG' |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
18 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
19 |
def fail( *messages ) |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
20 |
$stderr.puts( *messages ) |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
21 |
exit( 1 ) |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
22 |
end |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
23 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
24 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
25 |
dir_config( 'bsdjail' ) |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
26 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
27 |
have_header( 'stdio.h' ) or fail "Can't find the stdio.h header." |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
28 |
have_header( 'sys/param.h' ) or fail "Can't find the sys/param.h header." |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
29 |
have_header( 'sys/jail.h' ) or fail "Can't find the sys/jail.h header." |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
30 |
have_header( 'sys/types.h' ) or fail "Can't find the sys/types.h header." |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
31 |
have_header( 'unistd.h' ) or fail "Can't find the unistd.h header." |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
32 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
33 |
have_func( "jail_attach" ) or fail "Can't find jail_attach in the stdlib." |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
34 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
35 |
create_makefile( 'bsdjail' ) |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
36 |