Changeset 45 for trunk/src/kmk/main.c


Ignore:
Timestamp:
Apr 3, 2003, 4:23:37 AM (22 years ago)
Author:
bird
Message:

KMK changes..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/main.c

    r40 r45  
    7979 */
    8080
    81 #if defined(USE_KLIB) || defined(KMK)
     81#if defined(USE_KLIB) //|| defined(KMK)
    8282    #define KLIB_INSTRICT
    8383    #include <kLib/kLib.h>
     
    533533        char *cp = NULL, *start;
    534534                                        /* avoid faults on read-only strings */
     535        #ifndef KMK
    535536        static char syspath[] = _PATH_DEFSYSPATH;
     537        #endif
    536538
    537539#ifdef RLIMIT_NOFILE
     
    634636        }
    635637       
     638        #ifdef KMK
     639        /* @todo figure out how to set object directory! */
     640        #else
    636641        /*
    637642         * The object directory location is determined using the
     
    675680                        objdir = curdir;
    676681        }
     682        #endif
    677683
    678684#ifdef WANT_ENV_PWD
     
    794800
    795801
     802        #ifdef KMK
     803        /*
     804         * Add current directory tree to system include path all levels up to the root.
     805         * ASSUMES that curdir is absolute.
     806         */
     807        {
     808            char *  psz = estrdup(curdir);
     809            char *  pszEnd = psz + strlen(psz);
     810            while (psz < pszEnd)
     811            {
     812                Dir_AddDir(sysIncPath, psz);
     813
     814                /* Trim of the last directory component. */
     815                while (pszEnd-- > psz)
     816                    if (*pszEnd == '/' || *pszEnd == ':')
     817                    {
     818                        if (*pszEnd == ':') /*Drive letter means end of story */
     819                            pszEnd = psz;
     820                        *pszEnd = '\0';
     821                        break;
     822                    }
     823            }
     824            efree(psz);
     825        }
     826
     827        #else
    796828        /*
    797829         * If no user-supplied system path was given (through the -m option)
     
    811843                }
    812844        }
     845        #endif
    813846
    814847        /*
Note: See TracChangeset for help on using the changeset viewer.