for Information

---------- Forwarded message ----------
From: Eric Keller <[EMAIL PROTECTED]>
Date: Tue, Aug 19, 2008 at 1:09 PM
Subject: Re: [distcc] Problems using tool chain distcc/cygwin with armcc
compiler on Windows XP
To: "Anderson Fredrik (fa)" <[EMAIL PROTECTED]>


On Tue, Aug 19, 2008 at 12:26 PM, Anderson Fredrik (fa) <
[EMAIL PROTECTED]> wrote:

>  Hi,
>
> I have got into problems using tool chain distcc/cygwin with armcc
> compiler on Windows XP.
>
> We are using cygwin package to build, using GNU make, some SW componentson 
> Windows XP.
> We are investigating distcc to hopefully be able to decrease our build 
> timeusing distributed builds.
>
> Currently my investigation has got the following results:
> * Able to compile a small C++ project using distcc and g++ compiler, very
> nice.
> * Not able to compile a .cpp file using distcc and armcc compiler. As
> preprocessing makes .i files, armcc compiler complains and don't compile
> those files.
> As described in thread,
> http://www.mail-archive.com/distcc@lists.samba.org/msg03363.html.
> * Tried, as suggested in above thread, to use pump mode as introduced in
> distcc 3.0. However got compilation result as attached below in cygwin.
>
> * Do you know about any successful setup of described tool chain,
> distcc/cygwin/armcc?
> * Any suggestions how to go further?
>
> Compilation result:
>
> *Fredrik Anderson*
> Software Designer
>

Hi Frederik,

I encountered the same problems with the Windriver c++ppc.exe Windows
compiler... The workaround described by Fergus was to write a wrapper of the
c++ppc.exe compiler.

Let me explain: the c++ppc.exe compiler does not understand the cygwin path,
for example: /cygdrives/c/tmp these one have to be replaced by Windows
understable paths: C:\tmp

I joined you some chunk of code you can addapt it for your wrapper
(wrapper.c) --> wc++ppc.exe

After what you have to extend your windows PATH environment Varible whith
the path where your wrapper executable is present...

 redefine your Makefile CC or CXX Macro with:

CXX="distcc wc++ppc"

This should work!

-- 
Eric
//# ifdef _WINDOWS
#include "stdafx.h"
//#endif

#include <stdlib.h>
//#include <stdio.h>
#include "string.h"


// this function get the string length of every argument passed to the executable
int get_sizeof_args(int argc, char* argv[])
{
  int argsize = 0;
  int i = 0;
  
  for (i = 0; i < argc; i++)
    argsize += strlen(argv[i]);
  return argsize;
}

int main(int argc, char* argv[])
{
  int	i = 0;
  char	*strtmp = 0;
  char	*compilercall = 0;
  const char mycompiler[] = "C:/Programme/windriver_pid_3_4/gnu/3.4.4-vxworks-6.4/x86-win32/bin/ccppc.EXE\0";
  char	*occur = 0;
  int	strtmplen = 0;  
  int	occurpos = 0;
  int   result = 0;
  int   argsize = 1; // for \0
  
  argsize = get_sizeof_args(argc, argv) + strlen(mycompiler);
  compilercall = (char *) malloc(argsize * sizeof(char));
  
  compilercall = strcpy(compilercall, mycompiler);
  for (i = 1; i < argc; i++)
    {
      strtmplen = strlen(argv[i]);
      strtmp = (char *) malloc((strtmplen + 1) * sizeof(char));
      if (0 != (occur = strstr(argv[i], "/cygdrive/")))
	{
	  occurpos = (int)(occur - argv[i]);
	  strtmp = strcpy(strtmp, "c:");
	  strtmp = strcat(strtmp, argv[i] + 11);
	}
	  else
	    strtmp = strcpy(strtmp, argv[i]);
      
      compilercall = strcat(compilercall, " ");
      compilercall = strcat(compilercall, strtmp);
      free(strtmp);
    }
  
  //printf("compiler call: %s\n", compilercall);
  result = system(compilercall);
  free(compilercall);
  
  return result;
}
__ 
distcc mailing list            http://distcc.samba.org/
To unsubscribe or change options: 
https://lists.samba.org/mailman/listinfo/distcc

Reply via email to