]> git.sur5r.net Git - cc65/blobdiff - src/ld65/filepath.c
Change search paths for the linker.
[cc65] / src / ld65 / filepath.c
index 37f7964d05d81a73e56d875bbe632fde692d4807..a114124478e7c0a02e774e73f60058e405dac89c 100644 (file)
 
 
 
-/*****************************************************************************/
-/*                                  Data                                    */
-/*****************************************************************************/
-
-
-
-/* If the standard library search path is not given, use a hardcoded one */
-#ifndef CC65_LIB
-#define CC65_LIB        "/usr/lib/cc65/lib/";
-#endif
-
-
-
 /*****************************************************************************/
 /*                                  Code                                    */
 /*****************************************************************************/
@@ -66,8 +53,16 @@ void InitSearchPaths (void)
     /* Always search all stuff in the current directory */
     AddSearchPath ("", SEARCH_LIB | SEARCH_OBJ | SEARCH_CFG);
 
-    /* Add a standard path for the libraries and objects */
-    AddSearchPath (CC65_LIB, SEARCH_LIB | SEARCH_OBJ);
+    /* Add some compiled in search paths if defined on the command line */
+#if defined(LD65_LIB)
+    AddSearchPath (LD65_LIB, SEARCH_LIB);
+#endif
+#if defined(LD65_OBJ)
+    AddSearchPath (LD65_OBJ, SEARCH_OBJ);
+#endif
+#if defined(LD65_CFG)
+    AddSearchPath (LD65_CFG, SEARCH_CFG);
+#endif
 
     /* Add paths from the environment */
     AddSearchPathFromEnv ("LD65_LIB", SEARCH_LIB);
@@ -75,7 +70,7 @@ void InitSearchPaths (void)
     AddSearchPathFromEnv ("LD65_CFG", SEARCH_CFG);
 
     /* Add compatibility stuff */
-    AddSearchPathFromEnv ("CC65_LIB", SEARCH_LIB | SEARCH_OBJ);
+    AddSearchPathFromEnv ("CC65_LIB", SEARCH_LIB | SEARCH_OBJ | SEARCH_CFG);
 }