Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #ifndef WEXITSTATUS
  4. #include <sys/wait.h>
  5. #endif
  6.  
  7. char buf[32768];
  8.  
  9. #if (HAS_DEVENV==0)
  10. char * __dev_env;
  11. #endif
  12.  
  13. static void __env(void)
  14. {
  15.  char * p=getenv("MENUETDEV");
  16.  if(!p)
  17.  {
  18.   printf("MENUETDEV system variable not set !!!\n");
  19.   exit(-1);
  20.  }
  21. #if (HAS_DEVENV==0)
  22.  __dev_env=p;
  23. #endif
  24. }
  25.  
  26. int main(int argc,char * argv[])
  27. {
  28.  int u;
  29.  __env();
  30.  if(argc<3)
  31.  {
  32.   fprintf(stderr,"Usage: %s infile.cpp outfile.o\n",argv[0]);
  33.   return 1;
  34.  }
  35. #if (HAS_DEVENV==1)
  36.  sprintf(buf,"%s -c %s -o %s -nostdinc -fno-builtin -fno-stack-protector -I/dev/env/MENUETDEV/include -fno-common "
  37.              "-I/dev/env/MENUETDEV/include/STL "
  38.              "-O1 -fno-rtti -fno-exceptions -fomit-frame-pointer -D__MENUETOS__ ",TOOLNAME,argv[1],argv[2]);
  39. #else
  40.  sprintf(buf,"%s -c %s -o %s -nostdinc -fno-builtin -fno-stack-protector -I%s/include -fno-common "
  41.              "-I%s/include/STL -D__MENUETOS__ "
  42.              "-O1 -fno-rtti -fno-exceptions -fomit-frame-pointer ",TOOLNAME,argv[1],argv[2],
  43.              __dev_env,__dev_env);
  44. #endif
  45.  if(argc>3)
  46.   for(u=3;u<argc;u++)
  47.   {
  48.    strcat(buf,argv[u]);
  49.    strcat(buf," ");
  50.   }
  51.  return WEXITSTATUS(system(buf));
  52. }
  53.