root/src/scripts/noit-config.in

Revision fca0a033257b4175c839ab124a5c1a2aebfac3ae, 1.2 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 3 years ago)

this aren't in-core anymore, only modules

  • Property mode set to 100644
Line 
1 #!/usr/bin/perl
2
3 use strict;
4 my %opts;
5 my $worked = 0;
6
7 while(<DATA>) {
8   chomp;
9   my ($o, $v) = split /=/, $_, 2;
10   $v =~ s#-I\$\(top_srcdir\)/src#-I\${includedir}#g;
11   $opts{$o} = $v;
12 }
13
14 sub help {
15   print STDERR "help:\n";
16   for my $o (keys %opts) {
17     $o =~ s/_/-/g;
18     print STDERR "\t--$o\n";
19   }
20   return 1;
21 }
22
23 sub interp {
24   my $o = shift;
25   my $v = $o;
26   $v =~ s#\$\{([^\}]+)\}#$opts{$1}#eg;
27   return $v if $o eq $v;
28   return interp($v);
29 }
30
31 foreach my $v (@ARGV) {
32   if($v eq '-h' || $v eq '--help') {
33     help && exit;
34   }
35   (my $o = $v) =~ s/^--//;
36   die "Bad option: $v" if "--$o" ne $v;
37   $o =~ s/-/_/g;
38   die "No such option: $o" unless exists $opts{$o};
39   print interp($opts{$o});
40   $worked = 1;
41 }
42
43 unless ($worked) {
44   help && exit;
45 }
46
47 __END__
48 cc=@CC@
49 cppflags=@CPPFLAGS@
50 cflags=@CFLAGS@
51 ldflags=@LDFLAGS@
52 libs=@LIBS@
53 prefix=@prefix@
54 exec_prefix=@exec_prefix@
55 bindir=@bindir@
56 sbindir=@sbindir@
57 libdir=@libdir@
58 includedir=${prefix}/include
59 libexecdir=@libexecdir@
60 datarootdir=@datarootdir@
61 mandir=@mandir@
62 mansubdir=@mansubdir@
63 docdir=${prefix}/@docdir@
64 sysconfdir=@sysconfdir@
65 srcdir=@srcdir@
66 top_srcdir=@top_srcdir@
67 shld=@SHLD@
68 shcflags=@SHCFLAGS@
69 moduleld=@MODULELD@
70 modules_dir=@MODULES_DIR@
71 moduleext=@MODULEEXT@
Note: See TracBrowser for help on using the browser.