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

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

[Dotgnu-pnet-commits] CVS: pnet/image Makefile.am,1.13,1.14 link.c,1.16


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/image Makefile.am,1.13,1.14 link.c,1.16,1.17
Date: Sun, 15 Dec 2002 21:04:45 -0500

Update of /cvsroot/dotgnu-pnet/pnet/image
In directory subversions:/tmp/cvs-serv32112/image

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


Modify the assembly search paths to use the routines in "support/path.c".


Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/Makefile.am,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** Makefile.am 5 Oct 2002 04:25:40 -0000       1.13
--- Makefile.am 16 Dec 2002 02:04:41 -0000      1.14
***************
*** 42,47 ****
  libILTestMacros_a_SOURCES = test_macros.c
  
! AM_CFLAGS = -DCSCC_LIB_DIR=\"$(libdir)\" \
!                   -DCSCC_HOST_TRIPLET=\"$(host_triplet)\" \
                    -DCSCC_HOST_ALIAS=\"$(host_alias)\" \
                    -I$(top_srcdir)/include
--- 42,46 ----
  libILTestMacros_a_SOURCES = test_macros.c
  
! AM_CFLAGS = -DCSCC_HOST_TRIPLET=\"$(host_triplet)\" \
                    -DCSCC_HOST_ALIAS=\"$(host_alias)\" \
                    -I$(top_srcdir)/include

Index: link.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/link.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** link.c      13 Dec 2002 11:24:47 -0000      1.16
--- link.c      16 Dec 2002 02:04:41 -0000      1.17
***************
*** 27,63 ****
  
  /*
-  * Determine the pathname separator to use on this platform.
-  */
- #if defined(IL_WIN32_NATIVE)
-       #define PATH_SEP                        ';'
-       #define PATH_SEP_STRING         ";"
- #else
-       #define PATH_SEP                        ':'
-       #define PATH_SEP_STRING         ":"
- #endif
- 
- /*
   * Various default path lists.
   */
- #ifdef CSCC_LIB_DIR
  #define       CSCC_LIB_PATH_DEFAULT   \
!                       CSCC_LIB_DIR "/cscc/lib" PATH_SEP_STRING \
!                       "/usr/local/lib/cscc/lib" PATH_SEP_STRING \
!                       "/usr/lib/cscc/lib"
! #define       MONO_PATH_DEFAULT       \
!                       CSCC_LIB_DIR
  #define       LD_LIBRARY_PATH_DEFAULT \
!                       CSCC_LIB_DIR PATH_SEP_STRING \
!                       "/usr/local/lib" PATH_SEP_STRING \
!                       "/usr/lib"
! #else
! #define       CSCC_LIB_PATH_DEFAULT   \
!                       "/usr/local/lib/cscc/lib" PATH_SEP_STRING \
!                       "/usr/lib/cscc/lib"
! #define       MONO_PATH_DEFAULT       0
! #define       LD_LIBRARY_PATH_DEFAULT \
!                       "/usr/local/lib" PATH_SEP_STRING \
!                       "/usr/lib"
! #endif
  
  /*
--- 27,36 ----
  
  /*
   * Various default path lists.
   */
  #define       CSCC_LIB_PATH_DEFAULT   \
!                       "/usr/local/lib/cscc/lib:/usr/lib/cscc/lib"
  #define       LD_LIBRARY_PATH_DEFAULT \
!                       "/usr/local/lib:/usr/lib"
  
  /*
***************
*** 81,94 ****
  
  /*
   * Split a pathname list and add it to the global list of system paths.
   */
! static void SplitPathString(char *list, char *defaultPath)
  {
        int len;
!       char **newPathList;
  
        /* Use the default path if necessary */
        if(!list || *list == '\0')
        {
                list = defaultPath;
                if(!list)
--- 54,100 ----
  
  /*
+  * Add a pathname to "systemPaths".
+  */
+ static void AddSystemPath(const char *path, int len)
+ {
+       char **newPathList;
+       newPathList = (char **)ILRealloc
+               (systemPath, (systemPathSize + 1) * sizeof(char *));
+       if(!newPathList)
+       {
+               return;
+       }
+       systemPath = newPathList;
+       systemPath[systemPathSize] = ILDupNString(path, len);
+       if(!(systemPath[systemPathSize]))
+       {
+               return;
+       }
+       ++systemPathSize;
+ }
+ 
+ /*
   * Split a pathname list and add it to the global list of system paths.
   */
! static void SplitPathString(char *list, char *stdpath, char *defaultPath)
  {
        int len;
!       int separator;
  
        /* Use the default path if necessary */
        if(!list || *list == '\0')
        {
+               /* If we have a standard path, then add that */
+               if(stdpath)
+               {
+                       AddSystemPath(stdpath, strlen(stdpath));
+                       ILFree(stdpath);
+                       stdpath = 0;
+               }
+ 
+ #ifdef IL_WIN32_NATIVE
+               /* Ignore default paths, as they won't make any sense */
+               return;
+ #else
                list = defaultPath;
                if(!list)
***************
*** 96,100 ****
--- 102,141 ----
                        return;
                }
+ #endif
+       }
+ 
+       /* Garbage-collect the standard path */
+       if(stdpath)
+       {
+               ILFree(stdpath);
+       }
+ 
+       /* Determine the path separator to use */
+ #ifdef IL_WIN32_PLATFORM
+       if(strchr(list, ';') != 0)
+       {
+               /* The path already uses ';', so that is probably the separator 
*/
+               separator = ';';
+       }
+       else
+       {
+               /* Deal with the ambiguity between ':' used as a separator
+                  and ':' used to specify a drive letter */
+               if(((list[0] >= 'A' && list[0] <= 'Z') ||
+                   (list[0] >= 'a' && list[0] <= 'z')) && list[1] == ':')
+               {
+                       /* The path is probably one directory, starting
+                          with a drive letter */
+                       separator = ';';
+               }
+               else
+               {
+                       /* The path is probably Cygwin-like, using ':' to 
separate */
+                       separator = ':';
+               }
        }
+ #else
+       separator = ':';
+ #endif
  
        /* Split the pathname list */
***************
*** 102,106 ****
        {
                /* Skip separators between directory pathnames */
!               if(*list == PATH_SEP || *list == ' ' || *list == '\t' ||
                   *list == '\r' || *list == '\n')
                {
--- 143,147 ----
        {
                /* Skip separators between directory pathnames */
!               if(*list == separator || *list == ' ' || *list == '\t' ||
                   *list == '\r' || *list == '\n')
                {
***************
*** 111,115 ****
                /* Get the next directory pathname */
                len = 1;
!               while(list[len] != '\0' && list[len] != PATH_SEP)
                {
                        ++len;
--- 152,156 ----
                /* Get the next directory pathname */
                len = 1;
!               while(list[len] != '\0' && list[len] != separator)
                {
                        ++len;
***************
*** 122,138 ****
  
                /* Add the path to the global list */
!               newPathList = (char **)ILRealloc
!                       (systemPath, (systemPathSize + 1) * sizeof(char *));
!               if(!newPathList)
!               {
!                       return;
!               }
!               systemPath = newPathList;
!               systemPath[systemPathSize] = ILDupNString(list, len);
!               if(!(systemPath[systemPathSize]))
!               {
!                       return;
!               }
!               ++systemPathSize;
  
                /* Advance to the next path */
--- 163,167 ----
  
                /* Add the path to the global list */
!               AddSystemPath(list, len);
  
                /* Advance to the next path */
***************
*** 148,157 ****
        if(!systemPath)
        {
!               SplitPathString(getenv("CSCC_LIB_PATH"), CSCC_LIB_PATH_DEFAULT);
!               SplitPathString(getenv("MONO_PATH"), MONO_PATH_DEFAULT);
!               SplitPathString(getenv("LD_LIBRARY_PATH"), 
LD_LIBRARY_PATH_DEFAULT);
        #ifdef IL_WIN32_PLATFORM
                /* Win32: try looking in PATH also, since Win32 puts dll's 
there */
!               SplitPathString(getenv("PATH"), 0);
        #endif
        }
--- 177,188 ----
        if(!systemPath)
        {
!               SplitPathString(getenv("CSCC_LIB_PATH"),
!                                               
ILGetStandardLibraryPath("cscc/lib"),
!                                               CSCC_LIB_PATH_DEFAULT);
!               SplitPathString(getenv("MONO_PATH"), 
ILGetStandardLibraryPath(0), 0);
!               SplitPathString(getenv("LD_LIBRARY_PATH"), 0, 
LD_LIBRARY_PATH_DEFAULT);
        #ifdef IL_WIN32_PLATFORM
                /* Win32: try looking in PATH also, since Win32 puts dll's 
there */
!               SplitPathString(getenv("PATH"), 0, 0);
        #endif
        }




reply via email to

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