ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/autoconf.pm
Revision: 1.1
Committed: Mon Aug 1 08:52:53 2005 UTC (19 years, 4 months ago) by root
Branch: MAIN
CVS Tags: rel-1_1, rel-1_3, rel-1_2, rel-1_4
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     $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    
31     1