CC: | wspurlin [...] us.ibm.com |
Subject: | missing test and missing link libraries in MtCmd |
It seems that with recent ClearCase 7.1.x releases more link libraries
are required. And there is no test shipped with the distribution.
I have added a very basic test (just loading the module and running
"multitool pwd"), and I have added some link libraries in Makefile.PL
("LIBS" macro).
See the attached patch.
Hope this helps,
Marek
Subject: | MtCmd.diff |
diff -ruN MtCmd/Makefile.PL MtCmd-p1/Makefile.PL
--- MtCmd/Makefile.PL 2007-07-13 20:47:09.000000000 +0200
+++ MtCmd-p1/Makefile.PL 2011-03-15 09:43:03.520854000 +0100
@@ -25,7 +25,7 @@
my $archlib=$Config{archlib};
my $name=ClearCase::MtCmd;
my $inst_lib=$archlib.'/auto/'.$name;
-my $ATRIA_ROOT=$ENV{ATRIA_ROOT}?$ENV{ATRIA_ROOT}:"/usr/atria";
+my $ATRIA_ROOT=$ENV{ATRIA_ROOT}?$ENV{ATRIA_ROOT}:"/opt/rational/clearcase";
my $cleartool = $ATRIA_ROOT.'/bin/cleartool';
my $osver;
@@ -34,7 +34,7 @@
my %opts = (
'NAME' => $name,
'VERSION_FROM' => 'MtCmd.pm', # finds $VERSION
- 'LIBS' =>' -L. -L'.$ATRIA_ROOT.'/shlib -latriacmdsyn -latriacmd -latriasumcmd -latriasum -latriamsadm -latriamntrpc -latriacm -latriavob -latriaview -latriacm -latriadbrpc -latriatirpc -latriaxdr -latriamvfs -latriatbs -latriaadm -latriasplit -latriacredmap -latriaks -lezrpc -lrpcsvc -latriaccfs -latriasquidad -latriasquidcore -latriams_cmdsyn -latriams_cmd'
+ 'LIBS' =>" -L. -L$ATRIA_ROOT/shlib -latriacmdsyn -latriamssvr_utl -latriacmd -latriasumcmd -latriasum -latriamsadm -latriamntrpc -latriacm -latriavob -latriaview -latriacm -latriadbrpc -latriatirpc -latriaxdr -latriamvfs -latriatbs -latriaadm -latriasplit -latriacredmap -latriaks -lezrpc -lrpcsvc -latriaccfs -latriasquidad -latriasquidcore -latriams_cmdsyn -latriams_cmd -latriasyncmgr -latriashp -latriasynctool_ms -latriazlib -latriamsinfoclntvob"
);
@@ -44,8 +44,9 @@
if( $default_compiler =~ /gcc/ || $ENV{CC_MtCmd_GCC}){
$default_compiler = "gcc";
$opts{CC} = $default_compiler;
- $opts{LD} = $default_compiler;
+ $opts{LD} = 'ld';
$opts{OPTIMIZE} = '-O';
+ $opts{LDDLFLAGS} = '-G';
$esp_str="gcc version";
$esp_ver=2.7;
$flag_rd = ' -v 2>&1';
@@ -62,6 +63,7 @@
die "/usr/lib/libCrun.so.1: $!";
}
}
+ $opts{clean} = { FILES => 'libCrun.so' };
}else{
die 'No libCrun.so.1 exist on the lib path';
}
@@ -85,9 +87,9 @@
$opts{LIBS} ="-L/usr/lib ". $opts{LIBS}.' -lc -lw -lCrun'." -R$ATRIA_ROOT/shlib";
$opts{DEFINE} = $opts{DEFINE}.'-DSVR4';
$opts{INC} = '-I. ';
- $opts{dynamic_lib} = { OTHERLDFLAGS => '-Lblib/arch/auto/ClearCase/MtCmd -t -ucmdsyn_proc_table -R$(ATRIA_ROOT)/shlib -R$(INSTALLSITEARCH)/auto/$(FULLEXT) -R$(INSTALLSITELIB)/auto/$(FULLEXT) -R$(INST_ARCHLIB)/auto/$(FULLEXT) '} ;
+ $opts{dynamic_lib} = { OTHERLDFLAGS => '-t -ucmdsyn_proc_table -R$(ATRIA_ROOT)/shlib' } ;
}elsif ($os =~ /linux/){
- $opts{LD} = "ld";
+ #$opts{LD} = "ld";
die 'Cannot find '.$Config{cc}
unless CheckVer('version',
2.7,
@@ -104,21 +106,9 @@
$opts{DEFINE}= $opts{DEFINE}.'-DATRIA_LINUX';
$opts{INC}='-I. ';
$opts{LIBS} ="-L/usr/lib ". $opts{LIBS}.' -lc -lcurses';
- if ($Config{perl} =~ /ratlperl/) {
$opts{dynamic_lib}={ OTHERLDFLAGS =>
- ' -ucmdsyn_proc_table -Wl,-rpath,'.
- $ATRIA_ROOT.
- '/shlib:.:'.
- $inst_lib
+ '-Wl,-ucmdsyn_proc_table,-rpath,$(ATRIA_ROOT)/shlib'
};
- } else {
- $opts{dynamic_lib}={ OTHERLDFLAGS =>
- ' -ucmdsyn_proc_table -rpath '.
- $ATRIA_ROOT.
- '/shlib:.:'.
- $inst_lib
- };
- }
}elsif ($os =~ /hpux/){
@@ -243,4 +233,16 @@
return $found_level;
}
+package MY;
+
+sub postamble {
+ return <<"MAKE_FRAG";
+
+# additional macro and environment definitions
+CCASE_GPATH_HINTS=
+ATRIA_ROOT=$ATRIA_ROOT
+export CCASE_GPATH_HINTS
+
+MAKE_FRAG
+}
diff -ruN MtCmd/MANIFEST MtCmd-p1/MANIFEST
--- MtCmd/MANIFEST 2007-07-13 20:47:08.000000000 +0200
+++ MtCmd-p1/MANIFEST 2011-03-15 09:44:11.167435000 +0100
@@ -2,7 +2,7 @@
MtCmd.xs
Makefile.PL
proc_table.h
-t
MANIFEST
LICENSE.TXT
README
+t/load.t
diff -ruN MtCmd/t/load.t MtCmd-p1/t/load.t
--- MtCmd/t/load.t 1970-01-01 01:00:00.000000000 +0100
+++ MtCmd-p1/t/load.t 2011-03-15 09:31:55.743643000 +0100
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+
+use Test::More tests => 2;
+use blib;
+
+BEGIN { use_ok( 'ClearCase::MtCmd' => qw(multitool) ); }
+
+my ($stat,$out,$err) = multitool('pwd');
+is($stat,0,"pwd succeeded with exit status 0");
+unless($stat == 0) {
+ diag("Error message: $out$err");
+}
+
+
+