AFS

 view release on metacpan or  search on metacpan

src/Makefile.PL  view on Meta::CPAN

    if ($ENV{AUTOMATED_TESTING}) { exit 0; }
    die "Script terminated ...\n";
}
elsif ($Config{usethreads} and $alpha_sys =~ /amd64_linux2/) {
    if (! -e "$AFSPath/lib/libafsauthent_pic.a" or ! -e "$AFSPath/lib/libafsrpc_pic.a") {
        warn "\nAFS system libraries libafsrpc and/or libafsauthent (PIC) not found ...\n";
        if ($ENV{AUTOMATED_TESTING}) { exit 0; }
        die "Script terminated ...\n";
    }
}
elsif ($Config{usethreads} and $alpha_sys =~ /rs_aix4/) {
    warn "\nAFS modules (Threaded Perl) on AIX platforms are currently not supported ...\n";
    if ($ENV{AUTOMATED_TESTING}) { exit 0; }
    die "Script terminated ...\n";
}

my $m_version = '';
if    ($v_numb =~ /3.4/)   { $m_version = 'AFS 3.4'; }
elsif ($v_numb =~ /3.5/)   { $m_version = 'AFS 3.5'; }
elsif ($v_numb =~ /3.6/)   { $m_version = 'AFS 3.6'; }
elsif ($v_numb =~ /1.0/)   { $m_version = 'OpenAFS 1.0'; }
elsif ($v_numb =~ /1.1/)   { $m_version = 'OpenAFS 1.1'; }
elsif ($v_numb =~ /1.2/)   { $m_version = 'OpenAFS 1.2'; }
elsif ($v_numb =~ /1.3/)   { $m_version = 'OpenAFS 1.3'; }
elsif ($v_numb =~ /1.4/)   { $m_version = 'OpenAFS 1.4'; }
elsif ($v_numb =~ /1.5/)   { $m_version = 'OpenAFS 1.5'; }
elsif ($v_numb =~ /devel/) { $m_version = 'OpenAFS devel'; }

if ($m_version eq '') {
    warn "Could not determine OpenAFS version: $version \n";
    if ($ENV{AUTOMATED_TESTING}) { exit 0; }
    die "Script terminated ...\n";
}

# set the different compiler flags according to the AFS version
my ($d_flag, $a_flag, $e_flag, $i_flag) = ('', '', '', '');
if ($v_string =~ /openafs/)  { $a_flag = '-DOpenAFS'; }

$d_flag = $m_version;
$d_flag =~ tr/\. /__/;
$d_flag = '-D' . $d_flag;

if ($v_numb gt v1.4.4 and $v_string =~ /openafs/) {
    $e_flag = '-DAFS_OLD_COM_ERR';
    $i_flag = '-I ./ ';
    $d_flag .= ' -DOpenAFS_1_4_05';
}

if ($v_numb gt v1.4.6 and $v_string =~ /openafs/) {
    $d_flag .= ' -DOpenAFS_1_4_07';
}

if ($v_numb gt v1.4.7 and $v_string =~ /openafs/) {
    $d_flag .= ' -DOpenAFS_1_4_64';
}

if ($v_numb gt v1.4.11 and $v_string =~ /openafs/) {
    $d_flag .= ' -DOpenAFS_1_4_12';
}

# print out a summary of determined data
print "AFS Version = $v_string v$v_numb \n";
print "Your AFS system libraries are located at:  $AFSPath \n";
print "                  their major version is:  $m_version \n";
print "                  and their type is:       \"pthreaded\"\n" if ($Config{usethreads});
print "Your AFS system type seems to be:          $alpha_sys \n\n";
print "The Compile Flags are set to:              $a_flag \n";
print "                                           $d_flag \n";
print "                                           $e_flag \n";
print "                                           $p_flag\n\n";

# set the Makefile values
my $ccflags = $Config::Config{ccflags} || '';
my %MakefileArgs = (
    'NAME'         => 'AFS',
    'VERSION_FROM' => 'AFS.pm',
    'CCFLAGS'      => "-Wall $ccflags",
    'DEFINE'	   => "$d_flag $p_flag $a_flag $e_flag",
    'INC'          => $i_flag . "-I$AFSPath/include",
    'LIBS'         => [
                       "-L$AFSPath/lib -L$AFSPath/lib/afs "
                       . $libs
                      ],
    'realclean'    => {FILES => 'Makefile.bak lib'},
                   );

if ($Config{osname} =~ /aix/) {
    $MakefileArgs{LIBS}->[0] .= ' -ldl';
}
elsif ($Config{osname} =~ /irix/) {
   # just the default LIBS
}
elsif ($Config{osname} =~ /solaris/) {
    $MakefileArgs{DEFINE} .= ' -Dint32=afs_int32 -Duint32=afs_uint32' if $alpha_sys eq 'sun4x_56'; # From Peter@PSDT.com
    $MakefileArgs{LIBS}->[0] .= ' -lresolv -lsocket -lnsl -lintl -ldl';
    $MakefileArgs{CC} = 'gcc';
    #$MakefileArgs{LD} = 'gcc';
    $MakefileArgs{CCCDLFLAGS} = '-fPIC';
}
elsif ($Config{osname} =~ /linux/) {
    $MakefileArgs{LIBS}->[0] .= ' -lresolv';
}
# elsif ($Config{osname} =~ /dec_osf/) {
# # hier fehlt noch was !!!!!
# }
else {
    warn("System type '$Config{osname}' not yet tested with this Makefile.PL...\n\n"
         . "Using the default values, which may or may not work\n"
         . "If it is working, please inform the maintainer of this package.\n"
         . "Thank you.\n\n");
}

WriteMakefile(%MakefileArgs);

# change the library name of the AFS system library "util.a"
my $command = "\'s#-lutil#$AFSPath/lib/afs/util.a#\'";
system("perl -p -i.bak -e $command Makefile") unless -f "$AFSPath/lib/afs/libutil.a";

# change the library name of the AFS system library "vlib.a"
# my $command = "\'s#-lvlib#$AFSPath/lib/afs/vlib.a#\'";
# system("perl -p -i.bak -e $command Makefile") unless -f "$AFSPath/lib/afs/libvlib.a";



( run in 0.426 second using v1.01-cache-2.11-cpan-501a3233654 )