1 use ExtUtils::MakeMaker;
6 %MakeParams = InitMakeParams();
8 WriteMakefile(%MakeParams);
14 'NAME' => 'NetSNMP::default_store',
15 'VERSION_FROM' => 'default_store.pm', # finds $VERSION
16 'XSPROTOARG' => '-prototypes',
19 my ($snmp_lib, $snmp_llib, $sep);
20 if ($Config{'osname'} eq 'MSWin32') {
21 $snmp_lib = 'libnetsnmp.lib';
22 $snmp_link_lib = 'libnetsnmp';
26 $opts = NetSNMPGetOpts();
27 $Params{'LIBS'} = `$opts->{'nsconfig'} --libs`;
28 chomp($Params{'LIBS'});
29 $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`;
30 chomp($Params{'CCFLAGS'});
31 $Params{'CCFLAGS'} .= " " . $Config{'ccflags'};
32 if ($opts->{'insource'} eq "true") {
33 $Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
34 $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
36 $Params{'CCFLAGS'} =~ s/ -W[-\w]+//g; # ignore developer warnings
37 if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
38 die "You need to install net-snmp first (I can't find net-snmp-config)";
44 # common subroutines -- DO NOT EDIT.
45 # They are imported from the Makefile.subs.pl file
49 $rootpath = "../" if (!$rootpath);
50 $rootpath .= '/' if ($rootpath !~ /\/$/);
52 if ($ENV{'NET-SNMP-CONFIG'} &&
53 $ENV{'NET-SNMP-IN-SOURCE'}) {
54 # have env vars, pull from there
55 $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
56 $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
58 # don't have env vars, pull from command line and put there
59 GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
60 "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
62 if ($ret{'insource'} eq "true" && $ret{'nsconfig'} eq "") {
63 $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
64 } elsif ($ret{'nsconfig'} eq "") {
65 $ret{'nsconfig'}="net-snmp-config";
68 $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
69 $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
72 $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
74 $ret{'rootpath'} = $rootpath;