jsnyder / avr32-toolchain

Makefile & supporting patches/scripts to build an AVR32 toolchain.
29 stars 30 forks source link

Suggestion: add $(DEPENDENCIES) when building gcc/g++ #3

Open ilg-ul opened 13 years ago

ilg-ul commented 13 years ago

In order to accommodate different location for the dependencies (for personal reasons I prefer to completely isolate Homebrew from the rest of the system, so I installed it in /brew/local instead of /usr/local), I added the following definition to the Makefile

DEPENDENCY_DIR = /usr/local

DEPENDENCY_DIR = /brew/local DEPENDENCIES = --with-mpc=$(DEPENDENCY_DIR) --with-mpfr=$(DEPENDENCY_DIR) --with-gmp=$(DEPENDENCY_DIR)

and when building gcc I used

../../gcc-$(GCC_VERSION)/configure --prefix=$(PREFIX)       \
--target=$(TARGET) $(DEPENDENCIES) --enable-languages="c" --with-gnu-ld     \
...

(similarly for g++).

It would be useful to have something like this included in the Makefile, to simplify customisation when using different environments. (same for the ARM build)

Thank you,

Liviu

ilg-ul commented 13 years ago

As in the post about PREFIX, it is not needed to edit the Makefile to update the definition of DEPENDENCIES, it can be inherited from the environment.

I completely removed them from the Makefile and used the following before calling make:

# Define extra dependencies, in case they are not in the system path 
DEPENDENCY_DIR=/brew/local
export DEPENDENCIES="--with-mpc=$DEPENDENCY_DIR --with-mpfr=$DEPENDENCY_DIR --with-gmp=$DEPENDENCY_DIR"

Liviu

kblomqvist commented 12 years ago

Exporting DEPENDENCIES is more elegant than changing the Makefile. I like :+1: A mention about this in the README file and the issue could be closed.