-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 Jeremy Huntwork wrote: > 3) Section 5.7, 'Adjusting the Toolchain'. Here's where it gets a > little fun. But still, easily adapted to fit both situations. > Somewhere, at the beginning of the book, we set a LINKER (or some > such) variable, depending on arch. Easily scripted via `uname -m` for > the sake of accuracy. We also take into account that gcc will make > use of the /lib64 directory internally, so we account for that, too, > in our adjusting command. Like so: > gcc -dumpspecs | sed "s@/lib[64]*/$LINKER@/tools&@g" \ (etc.)
Just a suggestion: that sed regexp will match more strings than we intend (but not in this context). This would work fine too, and would be more restrictive: gcc -dumpspecs | sed "s@/lib\(64\)\?/$LINKER@/tools&@g" \ (etc.) Not that I think it really matters -- what we have will work OK. It's just that people may inadvertently start to think that square brackets tell sed to group things together, when they really delimit character classes. Unfortunately the "make a group out of "64", and accept zero or one of them" version is several characters longer due to the backslashes. That can be shortened a bit with sed's -r option: gcc -dumpspecs | sed -r "s@/lib(64)?/$LINKER@/tools&@g" \ (etc.) but then you're typing in a new "-r" option, so it's pretty much no different in terms of amount of typing. ;-) (It may also require GNU sed, I'm not sure.) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGrm56S5vET1Wea5wRAyMoAKCwViWZgKqPjB5fnUHXKjkM49cNSwCfUQ5V /dR3X6zRrtrrl1Pic+uuSV4= =xYZ6 -----END PGP SIGNATURE----- -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page