krokoziabla
krokoziabla

Reputation: 775

automake: how set path to linker script?

I've just set up a cross-helloworld automake project (for stm32f4-discovery). There I have a custom discovery.ld scrpt. I put a line in my Makefile.amAM_LDFLAGS = -T discovery.ld. The problem starts when I run confgure from a different folder (e.g. /path/to/source/build) to the one in which the script is situated (/path/to/source). Effectively, being in /path/to/source/build directory, make runs gcc -T discovery.ld ... and fails to find the script because it's in /path/to/source directory and it's not included in the search path list.

-L/path/to/source or -L.. would solve the problem but I don't want to hardcode things.

Maybe there a autoconf/automake variable exists which points to the folder where configure script (and also my discovery.ld) are situated so that I could use it in my Makefile.am?

I'd be glad to any advice.

Upvotes: 4

Views: 854

Answers (1)

krokoziabla
krokoziabla

Reputation: 775

Many thanks to William Pursell:

AM_LDFLAGS = -T $(top_srcdir)/path/to/discovery.ld

Upvotes: 1

Related Questions