From: uz Date: Tue, 22 Sep 2009 11:49:53 +0000 (+0000) Subject: Changed search paths to use subdirectories of CC65_HOME, remove CC65_LIB. X-Git-Tag: V2.13.0rc1~47 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cb688729aff5f1b77b7c4d60f6f69cd728f8dc06;p=cc65 Changed search paths to use subdirectories of CC65_HOME, remove CC65_LIB. git-svn-id: svn://svn.cc65.org/cc65/trunk@4209 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/doc/cc65.sgml b/doc/cc65.sgml index a0a01c1c4..443f12798 100644 --- a/doc/cc65.sgml +++ b/doc/cc65.sgml @@ -398,10 +398,23 @@ The compiler will accept one C file per invocation and create a file with the same base name, but with the extension replaced by ".s". The output file contains assembler code suitable for the use with the ca65 macro assembler. + +Include files in single quotes are searched in the following places: + +The current directory. +The value of the environment variable Any directory added with the -In addition to the paths named in the +A compiled in directory which is often /usr/lib/cc65/include on + Linux systems. +The value of the environment variable A subdirectory named Any directory added with the diff --git a/doc/ld65.sgml b/doc/ld65.sgml index 3fbc7c2c2..5e9a777ef 100644 --- a/doc/ld65.sgml +++ b/doc/ld65.sgml @@ -324,9 +324,8 @@ The library search path contains in this order: A compiled in library path which is often /usr/lib/cc65/lib on Linux systems. The value of the environment variable The value of the environment variable A subdirectory named Any directory added with the option on the command line. @@ -338,12 +337,11 @@ The object file search path contains in this order: The current directory. -A compiled in directory which is often /usr/lib/cc65/lib on +A compiled in directory which is often /usr/lib/cc65/obj on Linux systems. The value of the environment variable The value of the environment variable A subdirectory named Any directory added with the option on the command line. @@ -358,9 +356,8 @@ The config file search path contains in this order: A compiled in directory which is often /usr/lib/cc65/cfg on Linux systems. The value of the environment variable The value of the environment variable A subdirectory named Any directory added with the option on the command line. diff --git a/src/cc65/incpath.c b/src/cc65/incpath.c index 62ca365b4..937a0d9bf 100644 --- a/src/cc65/incpath.c +++ b/src/cc65/incpath.c @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 2000-2003 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ -/* D-70794 Filderstadt */ -/* EMail: uz@cc65.org */ +/* (C) 2000-2009, Ullrich von Bassewitz */ +/* Roemerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -78,13 +78,17 @@ void InitIncludePaths (void) { /* Add some standard paths to the include search path */ AddSearchPath ("", INC_USER); /* Current directory */ - AddSearchPath ("include", INC_SYS); + + /* Add some compiled in search paths if defined at compile time */ #ifdef CC65_INC AddSearchPath (CC65_INC, INC_SYS); -#else - AddSearchPath ("/usr/lib/cc65/include", INC_SYS); #endif + + /* Add specific paths from the environment */ AddSearchPathFromEnv ("CC65_INC", INC_SYS | INC_USER); + + /* Add paths relative to a main directory defined in an env var */ + AddSubSearchPathFromEnv ("CC65_HOME", "include", INC_SYS); } diff --git a/src/cc65/incpath.h b/src/cc65/incpath.h index df3be913e..26ab52f45 100644 --- a/src/cc65/incpath.h +++ b/src/cc65/incpath.h @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 2000-2003 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ -/* D-70794 Filderstadt */ -/* EMail: uz@cc65.org */ +/* (C) 2000-2009, Ullrich von Bassewitz */ +/* Roemerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ diff --git a/src/ld65/filepath.c b/src/ld65/filepath.c index a11412447..7cbc24ac1 100644 --- a/src/ld65/filepath.c +++ b/src/ld65/filepath.c @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 2003 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ -/* D-70794 Filderstadt */ -/* EMail: uz@cc65.org */ +/* (C) 2003-2009, Ullrich von Bassewitz */ +/* Roemerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -42,7 +42,7 @@ /*****************************************************************************/ -/* Code */ +/* Code */ /*****************************************************************************/ @@ -53,7 +53,7 @@ void InitSearchPaths (void) /* Always search all stuff in the current directory */ AddSearchPath ("", SEARCH_LIB | SEARCH_OBJ | SEARCH_CFG); - /* Add some compiled in search paths if defined on the command line */ + /* Add some compiled in search paths if defined at compile time */ #if defined(LD65_LIB) AddSearchPath (LD65_LIB, SEARCH_LIB); #endif @@ -64,13 +64,15 @@ void InitSearchPaths (void) AddSearchPath (LD65_CFG, SEARCH_CFG); #endif - /* Add paths from the environment */ + /* Add specific paths from the environment */ + AddSearchPathFromEnv ("LD65_CFG", SEARCH_CFG); AddSearchPathFromEnv ("LD65_LIB", SEARCH_LIB); AddSearchPathFromEnv ("LD65_OBJ", SEARCH_OBJ); - AddSearchPathFromEnv ("LD65_CFG", SEARCH_CFG); - /* Add compatibility stuff */ - AddSearchPathFromEnv ("CC65_LIB", SEARCH_LIB | SEARCH_OBJ | SEARCH_CFG); + /* Add paths relative to a main directory defined in an env var */ + AddSubSearchPathFromEnv ("CC65_HOME", "cfg", SEARCH_CFG); + AddSubSearchPathFromEnv ("CC65_HOME", "lib", SEARCH_LIB); + AddSubSearchPathFromEnv ("CC65_HOME", "obj", SEARCH_OBJ); }