ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/autoconf.pm
Revision: 1.4
Committed: Mon Jan 22 15:56:03 2007 UTC (17 years, 3 months ago) by root
Branch: MAIN
CVS Tags: rel-2_6, rel-2_4, rel-2_5, rel-2_51, rel-2_32, rel-2_33, rel-2_61, rel-2_62, rel-2_41
Changes since 1.3: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.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 root 1.3 $ENV{LIBS} = "";
26 root 1.1 $ENV{LINKER} = $Config{ld}; # nonstandard
27    
28 root 1.4 my $status = system $ENV{SHELL}, -c => "cd \Q$wd\E && \Q$script\E --prefix \Q$Config{prefixexp}\E";
29 root 1.2
30     $status
31 root 1.1 }
32    
33     1