Skip Menu |

This queue is for tickets about the CtCmd CPAN distribution.

Report information
The Basics
Id: 104399
Status: new
Priority: 0/
Queue: CtCmd

People
Owner: Nobody in particular
Requestors: marekr [...] cpan.org
Cc: marek.rouchal [...] intel.com
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.11
Fixed in: (no value)



CC: marek.rouchal [...] intel.com
Subject: CtCmd should build on Windows with VS and gcc
We want to use ClearCase::CtCmd on Windows both with ratlperl (as shipped with ClearCase) and with e.g. ActivePerl or Strawberry Perl. The latter is built with gcc (MinGW environment), and we had to patch the CtCmd build process to enable that. Please find the patch attached. Makefile.PL now checks whether gcc was used to build Perl, and if so, directly links the libatria*.dll. If not gcc, the original process is used. The patch also corrects two missing files below win32, and glitches in MANIFEST and a few other minor improvements. We'd welcome an updated release of CtCmd and also an update of MtCmd with the same kind of improvements. Many thanks and best regards, Marek Rouchal
Subject: CtCmd-1.12.diff
diff -ruN CtCmd-1.11-tskheR/CtCmd.pm CtCmd-1.11-work/CtCmd.pm --- CtCmd-1.11-tskheR/CtCmd.pm 2013-02-19 20:13:07.000000000 +0100 +++ CtCmd-1.11-work/CtCmd.pm 2015-05-13 09:14:02.854554200 +0200 @@ -23,7 +23,7 @@ @ISA = qw(Exporter DynaLoader); @EXPORT_OK = qw(cleartool); -$ClearCase::CtCmd::VERSION = '1.11'; +$ClearCase::CtCmd::VERSION = '1.12'; bootstrap ClearCase::CtCmd $VERSION; diff -ruN CtCmd-1.11-tskheR/INSTALL CtCmd-1.11-work/INSTALL --- CtCmd-1.11-tskheR/INSTALL 2008-10-19 16:27:33.000000000 +0200 +++ CtCmd-1.11-work/INSTALL 2015-05-13 09:04:06.201366100 +0200 @@ -121,7 +121,14 @@ There must be an environment variable: TMP=<path to system temporary storage, full control by everyone>. -The path to Microsoft Visual Studio and to Perl must be in the PATH. +The path to Microsoft Visual Studio and to Perl must be in the PATH, +if Perl was built with Visual Studio (this is the case for ratlperl). +The build and test therefore has to be run in the Visual Studio x86 +Native Tools Command Prompt. + +The test creates a temporary share - therefore the test may have to be +run in a command window (cmd) with elevated privileges ("run as +administrator"). The user must be able to run "Perl", "cleartool", "cl" and "dumpbin" from the command line without error messages before attempting diff -ruN CtCmd-1.11-tskheR/MANIFEST CtCmd-1.11-work/MANIFEST --- CtCmd-1.11-tskheR/MANIFEST 2012-10-24 18:04:12.000000000 +0200 +++ CtCmd-1.11-work/MANIFEST 2015-05-12 17:04:00.234112100 +0200 @@ -22,6 +22,8 @@ INSTALL LICENSE.TXT MANIFEST +META.json +META.yml Makefile.PL README SolarisInterposer @@ -37,8 +39,10 @@ win32/atriacm.conf win32/atriacmd.conf win32/atriacmdsyn.conf +win32/atriacmi.conf win32/atriacredmap.conf win32/atriadbrpc.conf +win32/atriajson.conf win32/atriaks.conf win32/atriamsadm.conf win32/atriamsinfobase.conf diff -ruN CtCmd-1.11-tskheR/Makefile.PL CtCmd-1.11-work/Makefile.PL --- CtCmd-1.11-tskheR/Makefile.PL 2013-03-11 19:24:05.000000000 +0100 +++ CtCmd-1.11-work/Makefile.PL 2015-05-13 09:10:03.303601500 +0200 @@ -16,6 +16,7 @@ use ExtUtils::MakeMaker; use File::Basename; +use File::Spec; BEGIN { # On Windows fix the Config.pm based on where ratlperl is installed. @@ -71,10 +72,13 @@ my $os=$Config{osname}; #why not $^O ? -my $name=ClearCase::CtCmd; +my $name='ClearCase::CtCmd'; my $ATRIA_ROOT=$ENV{ATRIA_ROOT}?$ENV{ATRIA_ROOT}:"/opt/rational/clearcase"; my $COMMON_ROOT=$ENV{COMMON_ROOT}?$ENV{COMMON_ROOT}:"/opt/rational/common"; -my $cleartool = $ATRIA_ROOT.'/bin/cleartool'; +my $cleartool = File::Spec->catfile($ATRIA_ROOT, 'bin', 'cleartool'); $cleartool = 'cleartool' if($os =~ /MSWin32/ || $os =~ /Windows/); my $osver; @@ -123,10 +127,14 @@ $atriacmi_libs = '-latriacmi -latriajson'; } +my $shlibdir = ($os =~ /MSWin32/ || $os =~ /Windows/) ? + File::Spec->catdir($ATRIA_ROOT, 'bin') : + File::Spec->catdir($ATRIA_ROOT, 'shlib'); + my %opts = ( 'NAME' => $name, 'VERSION_FROM' => 'CtCmd.pm', # finds $VERSION - 'LIBS' => "-L. -L$ATRIA_ROOT/shlib -L$COMMON_ROOT/shlib -latriacmdsyn -latriacmd -latriasumcmd -latriasum $atriacmi_libs -latriamsadm -latriacm -latriavob -latriaview -latriacm -latriadbrpc -latriaxdr -latriamvfs -latriatbs -latriaadm -latriacredmap -latriaks -lezrpc -lrpcsvc -latriaccfs -latriasquidad -latriasquidcore -latriamsadm -latriamsinfobase -latriamsinfovob" + 'LIBS' => qq{-L. -L"$shlibdir" -latriacmdsyn -latriacmd -latriasumcmd -latriasum $atriacmi_libs -latriamsadm -latriacm -latriavob -latriaview -latriacm -latriadbrpc -latriaxdr -latriamvfs -latriatbs -latriaadm -latriacredmap -latriaks -lezrpc -latriaccfs -latriasquidad -latriasquidcore -latriamsadm -latriamsinfobase -latriamsinfovob} ); $opts{LIBS} .= ' -latriasplit -latriamntrpc' unless($os =~ /MSWin32/ || $os =~ /Windows/); @@ -227,12 +235,18 @@ } }elsif ($os =~ /MSWin32/ || $os =~ /Windows/){ - die - 'Cannot find ' - .$Config{cc}. - ' -> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12' - unless CheckVer('Version','12',$Config{cc}.' 2>&1' ); + if($Config{cc} =~ /gcc/i) { + die "gcc compiler '$Config{cc} not found\n" unless CheckVer('gcc\.exe \(GCC\)','3',"$Config{cc} --version"); $opts{CCFLAGS} = $Config{ccflags}.' -DATRIA_WIN32_COMMON'; + $opts{LDDLFLAGS}=$Config{lddlflags}; + $opts{LDDLFLAGS} =~ s/-nodefaultlib\s*//; + $opts{LD} = $Config{cc}; + $opts{LIBS} =~ s/-lrpcsvc\s*//g; + $opts{dynamic_lib} = { OTHERLDFLAGS => qq[-Wl,--enable-auto-import $opts{LIBS}] }; + } else { + die "Cannot find '$Config{cc}' -> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12\nDid you start Makefile.PL in the admin VS command window?\n" + unless CheckVer('Version','12',$Config{cc}.' 2>&1' ); + $opts{CCFLAGS} = $Config{ccflags}.' -DATRIA_WIN32_COMMON -DATRIA_WIN32_COMMON_DECL'; while($opts{LIBS} =~ /-l(atria[^ ]+)/g) { my $lib = $1; system($^X, 'autoDef', "win32/$lib.conf") @@ -242,6 +256,7 @@ $opts{LDDLFLAGS}=$Config{lddlflags}; $opts{LDDLFLAGS} =~ s/-nodefaultlib//; require 'Win32C_O'; + } }elsif ($os =~ /AIX/i){ $opts{DEFINE}= $opts{DEFINE}.' -q32'; $opts{LIBS} = "-L/usr/lib -L/lib $opts{LIBS} $Config{LIBS}"; diff -ruN CtCmd-1.11-tskheR/Win32C_O CtCmd-1.11-work/Win32C_O --- CtCmd-1.11-tskheR/Win32C_O 2005-09-01 17:06:51.000000000 +0200 +++ CtCmd-1.11-work/Win32C_O 2015-05-12 17:09:26.056691100 +0200 @@ -34,11 +34,10 @@ .cc$(OBJ_EXT): $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cc +clean :: + $(RM_F) atria*.def atria*.exp '; } - - - 1; diff -ruN CtCmd-1.11-tskheR/autoDef CtCmd-1.11-work/autoDef --- CtCmd-1.11-tskheR/autoDef 2012-10-24 18:04:12.000000000 +0200 +++ CtCmd-1.11-work/autoDef 2015-05-12 08:49:07.598741400 +0200 @@ -88,7 +88,7 @@ $libFP = $libDir.$libName . '.dll'; my $line = ""; - $cmd = "dumpbin /exports \"$libFP\" "; + $cmd = qq{dumpbin /exports "$libFP" }; print STDERR "Dumpbin command: $cmd\n" if $debug; @screen = `$cmd`; diff -ruN CtCmd-1.11-tskheR/proc_table.h CtCmd-1.11-work/proc_table.h --- CtCmd-1.11-tskheR/proc_table.h 2011-01-26 16:28:44.000000000 +0100 +++ CtCmd-1.11-work/proc_table.h 2015-05-12 16:58:02.649357200 +0200 @@ -34,12 +34,12 @@ -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern int (*cmdsyn_proc_table[])(gen_t,gen_t,enum_t); -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern gen_t * cmdsyn_get_cmdflags(); @@ -54,52 +54,52 @@ void client_meters_enter_region(gen_t handle){int empty = 1;} -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern void imsg_set_app_name (char *); -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern void imsg_redirect_output (void (*)(void *,char *), BLOK *, void (*)(void *,char *), BLOK *); -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern void stg_free_area (gen_t, int); -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern gen_t stg_create_area ( int ); -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern void pfm_init(); -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern int view_set_current_view(const char *tag_name); -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern int cmdsyn_exec_dispatch (char*, gen_t,gen_t *, int (*[])(gen_t,gen_t,enum_t)); -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern int cmdsyn_execv_dispatch (int,char **,gen_t,gen_t *, int (*[])(gen_t,gen_t,enum_t)); -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern int vob_ob_all_cache_action(int, int, int); -#ifdef ATRIA_WIN32_COMMON +#ifdef ATRIA_WIN32_COMMON_DECL __declspec( dllimport ) #endif extern void pfm_int(void); diff -ruN CtCmd-1.11-tskheR/win32/atriacmi.conf CtCmd-1.11-work/win32/atriacmi.conf --- CtCmd-1.11-tskheR/win32/atriacmi.conf 1970-01-01 01:00:00.000000000 +0100 +++ CtCmd-1.11-work/win32/atriacmi.conf 2015-05-12 08:58:13.720348100 +0200 @@ -0,0 +1,13 @@ +########################################################################## +# # +# © Copyright IBM Corporation 2011. All rights reserved. # +# # +# This program and the accompanying materials are made available under # +# the terms of the Common Public License v1.0 which accompanies this # +# distribution, and is also available at http://www.opensource.org # +# Contributors: # +# # +########################################################################## +libName=libatriacmi +defName=atriacmi.def +funcs=libatriacmi_print_verid diff -ruN CtCmd-1.11-tskheR/win32/atriajson.conf CtCmd-1.11-work/win32/atriajson.conf --- CtCmd-1.11-tskheR/win32/atriajson.conf 1970-01-01 01:00:00.000000000 +0100 +++ CtCmd-1.11-work/win32/atriajson.conf 2015-05-12 08:59:28.178793200 +0200 @@ -0,0 +1,13 @@ +########################################################################## +# # +# © Copyright IBM Corporation 2011. All rights reserved. # +# # +# This program and the accompanying materials are made available under # +# the terms of the Common Public License v1.0 which accompanies this # +# distribution, and is also available at http://www.opensource.org # +# Contributors: # +# # +########################################################################## +libName=libatriajson +defName=atriajson.def +funcs=libatriajson_print_verid