1 use ExtUtils::MakeMaker;
6 %MakeParams = InitMakeParams();
8 WriteMakefile(%MakeParams);
13 'NAME' => 'NetSNMP::agent::default_store',
14 'VERSION_FROM' => 'default_store.pm', # finds $VERSION
15 'XSPROTOARG' => '-prototypes',
18 my $snmp_lib, $snmp_llib, $sep;
19 if ($Config{'osname'} eq 'MSWin32') {
20 $snmp_lib = 'libnetsnmp.lib';
21 $snmp_link_lib = 'libnetsnmp';
25 $opts = NetSNMPGetOpts("../../");
26 $Params{'LIBS'} = `$opts->{'nsconfig'} --libs`;
27 chomp($Params{'LIBS'});
28 $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`;
29 chomp($Params{'CCFLAGS'});
30 $Params{'CCFLAGS'} .= " " . $Config{'ccflags'};
31 if ($opts->{'insource'} eq "true") {
32 $Params{'LIBS'} = "-L../../../snmplib/.libs -L../../../snmplib/ " . $Params{'LIBS'};
33 $Params{'CCFLAGS'} = "-I../../../include " . $Params{'CCFLAGS'};
35 $Params{'CCFLAGS'} =~ s/ -W[-\w]+//g; # ignore developer warnings
36 if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
37 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;