ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/autoconf.pm
Revision: 1.2
Committed: Fri Aug 19 01:07:27 2005 UTC (19 years, 4 months ago) by root
Branch: MAIN
CVS Tags: rel-1_5, rel-1_6
Changes since 1.1: +2 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 package autoconf;
2
3 # I plan to improve this and make it a standalone ExtUtils::Autoconf module,
4 # but right now it just runs an external configure script.
5
6 use Config;
7
8 sub run_script(;$$) {
9 my ($wd, $file) = @_;
10 $wd ||= "autoconf";
11 $script ||= "./configure";
12
13 local %ENV = %ENV;
14
15 while (my ($k, $v) = each %Config) {
16 $ENV{$k} = $v;
17 }
18
19 $ENV{MAKE} = $Config{make};
20 $ENV{SHELL} = $Config{sh};
21 $ENV{CC} = $Config{cc};
22 $ENV{CPPFLAGS} = $Config{cppflags};
23 $ENV{CFLAGS} = $Config{ccflags};
24 $ENV{LDFLAGS} = $Config{ldflags};
25 $ENV{LIBS} = $Config{libs};
26 $ENV{LINKER} = $Config{ld}; # nonstandard
27
28 my $status = system $ENV{SHELL}, -c => "cd \Q$wd\E && \Q$script\E --prefix \Q$Config{prefix}\E";
29
30 $status
31 }
32
33 1