From 9a4ec37b404e07bc9e3f5b8ce7f1d4986386dd14 Mon Sep 17 00:00:00 2001 From: uz Date: Fri, 18 Sep 2009 19:00:24 +0000 Subject: [PATCH] Change search paths for the linker. git-svn-id: svn://svn.cc65.org/cc65/trunk@4193 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ld65/filepath.c | 25 ++++++++++--------------- src/ld65/make/gcc.mak | 10 ++++++---- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/ld65/filepath.c b/src/ld65/filepath.c index ad302d10a..a11412447 100644 --- a/src/ld65/filepath.c +++ b/src/ld65/filepath.c @@ -41,19 +41,6 @@ -/*****************************************************************************/ -/* 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 | SEARCH_CFG); + /* 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); diff --git a/src/ld65/make/gcc.mak b/src/ld65/make/gcc.mak index e2d7bf631..f1aa9c1e4 100644 --- a/src/ld65/make/gcc.mak +++ b/src/ld65/make/gcc.mak @@ -10,12 +10,14 @@ EXE = ld65 # Library dir COMMON = ../common -# The linker library search path. Default is "/usr/lib/cc65/lib/" if nothing -# is defined. You may use CC65_LIB=foo on the command line to override it. -CC65_LIB = \"/usr/lib/cc65/lib/\" +# Several search paths. You may redefine these on the command line +LD65_LIB = \"/usr/lib/cc65/lib/\" +LD65_OBJ = \"/usr/lib/cc65/lib/\" +LD65_CFG = \"/usr/lib/cc65/cfg/\" # -CFLAGS = -g -O2 -Wall -W -std=c89 -I$(COMMON) -DCC65_LIB=$(CC65_LIB) +CFLAGS = -g -O2 -Wall -W -std=c89 -I$(COMMON) +CFLAGS += -DLD65_LIB=$(LD65_LIB) -DLD65_OBJ=$(LD65_OBJ) -DLD65_CFG=$(LD65_CFG) CC=gcc EBIND=emxbind LDFLAGS= -- 2.39.2