This file is indexed.

/usr/lib/perl5/Wx/build/Options.pm is in libwx-perl 1:0.9922-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
package Wx::build::Options;

use strict;

=head1 NAME

Wx::build::Options - retrieve wxWidgets/wxPerl build options

=head1 METHODS

=cut

use Getopt::Long;
Getopt::Long::Configure( 'pass_through' );

my $help         = 0;
my $mksymlinks   = 0;
my $extra_libs   = '';
my $extra_cflags = '';
my $alien_key    = '';
my %subdirs      = ();
my %wx           = ();
my $options;

sub _wx_version {
    my( $o, $v ) = @_;

    $v =~ m/(\d+)\.(\d+)(?:\.(\d+))?/
      or die 'Invalid version specification: ', $v, "\n";

    if( defined $3 ) {
        $wx{version} = [ $1 + ( $2 + $3 / 1000 ) / 1000,
                         $1 + ( $2 + ( $3 + 1 ) / 1000 ) / 1000 ];
    } else {
        $wx{version} = [ $1 + $2 / 1000,
                         $1 + ( $2 + 1 ) / 1000 ];
    }
}

sub _load_options {
  return if $options;

  $options = do 'Wx/build/Opt.pm';
  die "Unable to load options: $@" unless $options;

  ( $extra_cflags, $extra_libs, $alien_key )
    = @{$options}{qw(extra_cflags extra_libs alien_key)};

  require Alien::wxWidgets;
  Alien::wxWidgets->load( key => $alien_key );
}

my $parsed = 0;
my @argv;

sub _parse_options {
  return if $parsed;

  $parsed = 1;

  my $result = GetOptions( 'help'           => \$help,
                           'mksymlinks'     => \$mksymlinks,
                           'extra-libs=s'   => \$extra_libs,
                           'extra-cflags=s' => \$extra_cflags,
                           # for Alien::wxWidgets
                           'wx-debug!'      => \($wx{debug}),
                           'wx-unicode!'    => \($wx{unicode}),
                           'wx-mslu!'       => \($wx{mslu}),
                           'wx-version=s'   => \&_wx_version,
                           'wx-toolkit=s'   => \($wx{toolkit}),
                           '<>'             => \&_process_options,
                         );

  @ARGV = @argv; @argv = ();

  if( !$result || $help ) {
    print <<HELP;
Usage: perl Makefile.PL [options]
  --enable/disable-foo where foo is one of: dnd filesys grid help
                       html mdi print xrc stc docview calendar datetime 
  --help               you are reading it
  --mksymlinks         create a symlink tree
  --extra-libs=libs    specify extra linking flags
  --extra-cflags=flags specify extra compilation flags

  --[no-]wx-debug      [Non-] debugging wxWidgets
  --[no-]wx-unicode    [Non-] Unicode wxWidgets
  --[no-]wx-mslu       [Non-] MSLU wxWidgets (Windows only)
  --wx-version=2.9[.4] 
  --wx-toolkit=msw|gtk|gtk2|motif|mac|wce|...
HELP

    exit !$result;
  }

  if( $wx{toolkit} && $wx{toolkit} eq 'wce' ) {
    $wx{compiler_kind} = 'evc';
  }

  if( Alien::wxWidgets->can( 'load' ) ) {
      Alien::wxWidgets->load( map  { $_ => $wx{$_} }
                              grep { defined $wx{$_} }
                                   keys %wx );
      $alien_key = Alien::wxWidgets->key;
  }
}

sub _process_options {
  my $i = shift;

  unless( $i =~ m/^-/ ) {
    push @argv, $i;
    return;
  }

  if( $i =~ m/^--(enable|disable)-(\w+)$/ ) {
    $subdirs{$2} = ( $1 eq 'enable' ? 1 : 0 );
  } else {
    die "invalid option $i";
  }
}

=head2 get_makemaker_options

  my %mm_options = Wx::build::Options->get_makemaker_options;

Returns options meaningful at wxPerl building time.

  my %options = ( mksymlinks   => 0,
                  extra_libs   => '',
                  extra_cflags => '',
                  subdirs      => { stc => 1,
                                    xrc => 0 } )

=cut

sub get_makemaker_options {
  my $ref = shift;
  my $from = shift || '';

  if( $from eq 'saved' ) {
    _load_options();
  } else {
    _parse_options();
  }

  return ( mksymlinks   => $mksymlinks,
           extra_libs   => $extra_libs,
           extra_cflags => $extra_cflags,
           subdirs      => \%subdirs );
}

=head2 write_config_file

  my $ok = Wx::build::Options->write_config_file( '/path/to/file' );

Writes a machine-readable representation of command-line options given to
top-level Makefile.PL

=cut

sub write_config_file {
  my $class = shift;
  my $file = shift;

  require Data::Dumper;
  my $str = Data::Dumper->Dump( [ { extra_libs   => $extra_libs,
                                    extra_cflags => $extra_cflags,
                                    alien_key    => $alien_key,
                                  } ] );

  Wx::build::Utils::write_string( $file, $str );
}

1;

# local variables:
# mode: cperl
# end: