dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/cscc Makefile.am,1.17,1.18 cscc.c,1.27,


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc Makefile.am,1.17,1.18 cscc.c,1.27,1.28
Date: Tue, 17 Dec 2002 00:36:08 -0500

Update of /cvsroot/dotgnu-pnet/pnet/cscc
In directory subversions:/tmp/cvs-serv5835/cscc

Modified Files:
        Makefile.am cscc.c 
Log Message:


Look for plugins in install-relative locations.



Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/Makefile.am,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** Makefile.am 13 Dec 2002 00:33:30 -0000      1.17
--- Makefile.am 17 Dec 2002 05:36:05 -0000      1.18
***************
*** 27,33 ****
                                ../image/libILImage.a ../support/libILSupport.a
  
! AM_CFLAGS = -DCSCC_LIB_PREFIX=\"$(libdir)/cscc\" \
!                   -DCSCC_BIN_PREFIX=\"$(bindir)\" \
!                       -I$(top_srcdir) -I$(top_builddir) 
-I$(top_srcdir)/include
  
  install-exec-local:
--- 27,31 ----
                                ../image/libILImage.a ../support/libILSupport.a
  
! AM_CFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/include
  
  install-exec-local:

Index: cscc.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/cscc.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** cscc.c      14 Dec 2002 22:16:59 -0000      1.27
--- cscc.c      17 Dec 2002 05:36:05 -0000      1.28
***************
*** 27,32 ****
        CSCC_LIB_PATH                   Where to look for link libraries.
        CSCC_PLUGINS_PATH               Where to look for language plug-ins.
-       CSCC_ILASM_PATH                 Pathname of the "ilasm" program.
-       CSCC_ILALINK_PATH               Pathname of the "ilalink" program.
  
  */
--- 27,30 ----
***************
*** 44,130 ****
  
  /*
-  * Define this variable to use the builtin "ilasm" library
-  * rather than the external "ilasm" executable.
-  */
- #define       USE_BUILTIN_ILASM       1
- 
- /*
   * The default system include path.  We look in "lib" first,
   * just in case there is a pre-compiled "dll" for a package.
   */
- #ifdef CSCC_LIB_PREFIX
  #define       INCLUDE_PATH    \
-                       CSCC_LIB_PREFIX "/lib:" \
-                       CSCC_LIB_PREFIX "/include:" \
                        "/usr/local/lib/cscc/lib:" \
                        "/usr/local/lib/cscc/include:" \
                        "/usr/lib/cscc/lib:" \
                        "/usr/lib/cscc/include"
- #else
- #define       INCLUDE_PATH    \
-                       "/usr/local/lib/cscc/lib:" \
-                       "/usr/local/lib/cscc/include:" \
-                       "/usr/lib/cscc/lib:"
-                       "/usr/lib/cscc/include"
- #endif
  
  /*
   * The default system C++ include path.
   */
- #ifdef CSCC_LIB_PREFIX
- #define       INCLUDE_CPP_PATH        \
-                       "/usr/local/lib/cscc/include/c++:" \
-                       "/usr/lib/cscc/include/c++"
- #else
  #define       INCLUDE_CPP_PATH        \
-                       CSCC_LIB_PREFIX "/include/c++:" \
                        "/usr/local/lib/cscc/include/c++:" \
                        "/usr/lib/cscc/include/c++"
- #endif
  
  /*
   * The default system library link path.
   */
- #ifdef CSCC_LIB_PREFIX
- #define       LIB_PATH        \
-                       CSCC_LIB_PREFIX "/lib:" \
-                       "/usr/local/lib/cscc/lib:" \
-                       "/usr/lib/cscc/lib"
- #else
  #define       LIB_PATH        \
                        "/usr/local/lib/cscc/lib:" \
                        "/usr/lib/cscc/lib"
- #endif
  
  /*
   * The default plugins path.
   */
- #ifdef CSCC_LIB_PREFIX
  #define       PLUGINS_PATH    \
-                       CSCC_LIB_PREFIX "/plugins:" \
                        "/usr/local/lib/cscc/plugins:" \
                        "/usr/lib/cscc/plugins"
- #else
- #define       PLUGINS_PATH    \
-                       "/usr/local/lib/cscc/plugins:" \
-                       "/usr/lib/cscc/plugins"
- #endif
- 
- /*
-  * The default search path for "ilasm" and "ilalink"
-  * if not found on the real PATH.
-  */
- #ifdef CSCC_BIN_PREFIX
- #define       ILASM_PATH      \
-                       CSCC_BIN_PREFIX ":" \
-                       "/usr/local/bin:" \
-                       "/usr/bin:" \
-                       "/bin"
- #else
- #define       ILASM_PATH      \
-                       "/usr/local/bin:" \
-                       "/usr/bin:" \
-                       "/bin"
- #endif
  
  /*
--- 42,74 ----
***************
*** 142,146 ****
   * Global variables.
   */
- static char *ilasm_program = 0;
  static char *csharp_compiler = 0;
  static char **plugin_list;
--- 86,89 ----
***************
*** 370,396 ****
                {
                        status = LinkExecutable();
-                       if(status == 0 &&
-                          CCStringListContains(extension_flags, 
num_extension_flags,
-                                                                   
"metadata-only"))
-                       {
-                               fputs("******************** Warning 
**************************\n", stderr);
-                               fputs("The compiler has only done a metadata 
compile, and\n", stderr);
-                               fputs("not a full compile.  Portable.NET is a 
work in\n", stderr);
-                               fputs("progress and full compilation is still 
to be completed.\n", stderr);
-                               fputs("You will need to use Microsoft's 
compiler to build.\n", stderr);
-                               
fputs("*******************************************************\n", stderr);
-                       }
                }
        }
-       else if(CCStringListContains(extension_flags, num_extension_flags,
-                                                            "syntax-check"))
-       {
-               fputs("****************** Warning ************************\n", 
stderr);
-               fputs("The compiler has only done a syntax check, and not\n", 
stderr);
-               fputs("a full compile.  Portable.NET is a work in progress\n", 
stderr);
-               fputs("and full compilation is still to be completed.  You\n", 
stderr);
-               fputs("will need to use Microsoft's compiler to build.\n", 
stderr);
-               fputs("***************************************************\n", 
stderr);
-       }
  
        /* Delete temporary files that were created prior to the link */
--- 313,318 ----
***************
*** 458,467 ****
                if(env && *env != '\0')
                {
!                       CCAddPathStrings(&sys_include_dirs, 
&num_sys_include_dirs, env);
                }
                else
                {
                        CCAddPathStrings(&sys_include_dirs, 
&num_sys_include_dirs,
!                                                        INCLUDE_PATH);
                }
        }
--- 380,392 ----
                if(env && *env != '\0')
                {
!                       CCAddPathStrings(&sys_include_dirs, 
&num_sys_include_dirs,
!                                                        env, 0, 0);
                }
                else
                {
                        CCAddPathStrings(&sys_include_dirs, 
&num_sys_include_dirs,
!                                                        INCLUDE_PATH,
!                                                        
ILGetStandardLibraryPath("cscc/lib"),
!                                                        
ILGetStandardLibraryPath("cscc/include"));
                }
        }
***************
*** 472,481 ****
                {
                        CCAddPathStrings(&sys_cpp_include_dirs, 
&num_sys_cpp_include_dirs,
!                                                        env);
                }
                else
                {
                        CCAddPathStrings(&sys_cpp_include_dirs, 
&num_sys_cpp_include_dirs,
!                                                        INCLUDE_CPP_PATH);
                }
        }
--- 397,407 ----
                {
                        CCAddPathStrings(&sys_cpp_include_dirs, 
&num_sys_cpp_include_dirs,
!                                                        env, 0, 0);
                }
                else
                {
                        CCAddPathStrings(&sys_cpp_include_dirs, 
&num_sys_cpp_include_dirs,
!                                                        INCLUDE_CPP_PATH,
!                                                        
ILGetStandardLibraryPath("cscc/include/c++"), 0);
                }
        }
***************
*** 490,498 ****
                if(env && *env != '\0')
                {
!                       CCAddPathStrings(&sys_link_dirs, &num_sys_link_dirs, 
env);
                }
                else
                {
!                       CCAddPathStrings(&sys_link_dirs, &num_sys_link_dirs, 
LIB_PATH);
                }
        }
--- 416,425 ----
                if(env && *env != '\0')
                {
!                       CCAddPathStrings(&sys_link_dirs, &num_sys_link_dirs, 
env, 0, 0);
                }
                else
                {
!                       CCAddPathStrings(&sys_link_dirs, &num_sys_link_dirs, 
LIB_PATH,
!                                                        
ILGetStandardLibraryPath("cscc/lib"), 0);
                }
        }
***************
*** 653,682 ****
   * Search a path list for a particular executable.
   */
! static char *SearchPath(char *path, char *name)
  {
!       int len;
        int namelen = strlen(name);
        char *temppath;
        char *newpath;
!       if(!path)
!       {
!               return 0;
!       }
!       while(*path != '\0')
        {
!               if(*path == ' ' || *path == ':')
!               {
!                       ++path;
!                       continue;
!               }
!               len = 1;
!               while(path[len] != ':' && path[len] != '\0')
!               {
!                       ++len;
!               }
!               while(len > 0 && path[len - 1] == ' ')
!               {
!                       --len;
!               }
                temppath = (char *)ILMalloc(len + namelen + 2);
                if(!temppath)
--- 580,601 ----
   * Search a path list for a particular executable.
   */
! static char *SearchPath(char *path, char *name,
!                                               char *standard1, char 
*standard2)
  {
!       char **list;
!       int num, posn, len;
        int namelen = strlen(name);
        char *temppath;
        char *newpath;
! 
!       /* Split the path into its components */
!       list = 0;
!       num = 0;
!       CCAddPathStrings(&list, &num, path, standard1, standard2);
! 
!       /* Search for the file */
!       for(posn = 0; posn < num; ++posn)
        {
!               len = strlen(list[posn]);
                temppath = (char *)ILMalloc(len + namelen + 2);
                if(!temppath)
***************
*** 685,689 ****
--- 604,612 ----
                }
                strncpy(temppath, path, len);
+       #ifdef IL_WIN32_NATIVE
+               temppath[len] = '\\';
+       #else
                temppath[len] = '/';
+       #endif
                strcpy(temppath + len + 1, name);
                if((newpath = FilePresent(temppath)) != 0)
***************
*** 692,697 ****
                }
                ILFree(temppath);
-               path += len;
        }
        return 0;
  }
--- 615,621 ----
                }
                ILFree(temppath);
        }
+ 
+       /* Could not find the requested file */
        return 0;
  }
***************
*** 765,769 ****
                strcat(name, "-s");
        }
!       path = SearchPath(getenv("CSCC_PLUGINS_PATH"), name);
        if(path)
        {
--- 689,693 ----
                strcat(name, "-s");
        }
!       path = SearchPath(getenv("CSCC_PLUGINS_PATH"), name, 0, 0);
        if(path)
        {
***************
*** 773,777 ****
  
        /* Search the default plugins path */
!       path = SearchPath(PLUGINS_PATH, name);
        if(path)
        {
--- 697,702 ----
  
        /* Search the default plugins path */
!       path = SearchPath(PLUGINS_PATH, name,
!                                         
ILGetStandardLibraryPath("cscc/plugins"), 0);
        if(path)
        {
***************
*** 781,788 ****
  
        /* If argv[0] contains a directory, then look there */
!       if(strchr(progname, '/') != 0)
        {
                len = strlen(progname);
!               while(len > 0 && progname[len - 1] != '/')
                {
                        --len;
--- 706,713 ----
  
        /* If argv[0] contains a directory, then look there */
!       if(strchr(progname, '/') != 0 || strchr(progname, '\\') != 0)
        {
                len = strlen(progname);
!               while(len > 0 && progname[len - 1] != '/' && progname[len - 1] 
!= '\\')
                {
                        --len;
***************
*** 804,808 ****
  
        /* Search the normal execution PATH */
!       path = SearchPath(getenv("PATH"), name);
        if(path)
        {
--- 729,733 ----
  
        /* Search the normal execution PATH */
!       path = SearchPath(getenv("PATH"), name, ILGetStandardProgramPath(), 0);
        if(path)
        {
***************
*** 887,947 ****
  }
  
- #ifndef USE_BUILTIN_ILASM
- 
- /*
-  * Find the "ilasm" program.
-  */
- static void FindILAsmProgram(void)
- {
-       char *path;
- 
-       /* Check for a "-filasm-path" option on the command-line */
-       path = CCStringListGetValue(extension_flags, num_extension_flags,
-                                                               "ilasm-path");
-       if(path)
-       {
-               ilasm_program = path;
-               return;
-       }
- 
-       /* Use the CSCC_ILASM_PATH environment variable if present */
-       path = getenv("CSCC_ILASM_PATH");
-       if(path && *path != '\0' && (path = FilePresent(path)) != 0)
-       {
-               ilasm_program = path;
-               return;
-       }
- 
-       /* Search the contents of PLUGINS_PATH */
-       path = SearchPath(PLUGINS_PATH, "ilasm");
-       if(path)
-       {
-               ilasm_program = path;
-               return;
-       }
- 
-       /* Search the contents of PATH */
-       path = SearchPath(getenv("PATH"), "ilasm");
-       if(path)
-       {
-               ilasm_program = path;
-               return;
-       }
- 
-       /* Search the contents of the default path */
-       path = SearchPath(ILASM_PATH, "ilasm");
-       if(path)
-       {
-               ilasm_program = path;
-               return;
-       }
- 
-       /* Could not find "ilasm", so bail out of the compiler */
-       fprintf(stderr, _("%s: could not locate the `ilasm' program\n"), 
progname);
-       exit(1);
- }
- 
- #endif /* !USE_BUILTIN_ILASM */
- 
  /*
   * Compare two file extensions for equality, while ignoring case.
--- 812,815 ----
***************
*** 1081,1090 ****
        cmdline = 0;
        cmdline_size = 0;
- #ifdef USE_BUILTIN_ILASM
        AddArgument(&cmdline, &cmdline_size, "ilasm");
- #else
-       FindILAsmProgram();
-       AddArgument(&cmdline, &cmdline_size, ilasm_program);
- #endif
        if(executable_flag)
        {
--- 949,953 ----
***************
*** 1126,1135 ****
  
        /* Execute the assembler */
- #ifdef USE_BUILTIN_ILASM
        ILCmdLineSuppressSlash();
        status = ILAsmMain(cmdline_size - 1, cmdline);
- #else
-       status = ExecChild(cmdline, 0);
- #endif
        ILFree(cmdline);
        if(status != 0)
--- 989,994 ----
***************
*** 1154,1168 ****
        int saveAsm;
  
-       /* If we are compiling to ".obj" or an executable, then
-          get the location of "ilasm" now.  There's no point
-          invoking the plug-in if we cannot assemble the output
-          when it terminates */
-       if(compile_flag || executable_flag)
-       {
-       #ifndef USE_BUILTIN_ILASM
-               FindILAsmProgram();
-       #endif
-       }
- 
        /* Build the command-line for the plug-in */
        cmdline = 0;
--- 1013,1016 ----
***************
*** 1413,1421 ****
        cmdline = 0;
        cmdline_size = 0;
- #ifdef USE_BUILTIN_ILASM
        AddArgument(&cmdline, &cmdline_size, "ilasm");
- #else
-       AddArgument(&cmdline, &cmdline_size, ilasm_program);
- #endif
        if(executable_flag)
        {
--- 1261,1265 ----
***************
*** 1454,1463 ****
        saveAsm = CCStringListContains(extension_flags, num_extension_flags,
                                                               "save-asm");
- #ifdef USE_BUILTIN_ILASM
        ILCmdLineSuppressSlash();
        status = ILAsmMain(cmdline_size - 1, cmdline);
- #else
-       status = ExecChild(cmdline, 0);
- #endif
        ILFree(cmdline);
        if(status != 0)
--- 1298,1303 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]