[ELDK] eldk-switch.sh has no effect

Wolfgang Denk wd at denx.de
Mon Sep 2 10:01:05 CEST 2013


Dear Maik,

In message <6B37B399D1D6114496906FF69514C614337A9A at aero-mail.aerodata.de> you wrote:
>
> this is my very first post on a mailing list, ever. I hope I'm doing everything the right way.

Welcome - everything is fine, but if you could please restrict your
line length to some 70 characters or so?

> Next thing I tried was to use eldk-switch.sh to set the toolchain to the cross compiler for the target. Here, I got some problems. Please read the outcome of the eldk-switch command (at the end of this log you can also find the information about the Debian version I am using):
...
> So the problem is (as you might see) that the command "eldk-switch -r 5.4 -v armv7a-hf" is doing a lot of stuff but in the end, the command "eldk-switch -q" reveals that actual nothing happened.
> 
> Why is that so? What could be the cause for this?

eldk-switch.sh (or any other script or program) cannot modify the
caller's environment, i. e. here the environment of the shell where
you run the script.  You must use an "eval" command to do that, as it
is documented in
http://www.denx.de/wiki/view/ELDK-5/WebHome#Section_1.8.3.

Please see especially this section:

	Then define the following shell function:

	eldk-switch () 
	{ 
	    eval `eldk-switch.sh $*`
	}

        Note: It is a good idea to add this definition to your
        ~/.bash_profile file, so you always have it ready available.

Then use the "eldk-switch" function instead of eldk-switch.sh, and
everything should work as expected...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A consultant is a person who borrows your watch, tells you what  time
it is, pockets the watch, and sends you a bill for it.


More information about the eldk mailing list