On 14 November 2006 17:45, Salvatore D'Angelo wrote: > Dave you're right. I forgot to add -r. > Thanks a lot. Your solution work fine. > > The problem now is that I should change the Makefile in order to have > two different behaviour in CYGWIN and linux.
Actually, if I haven't messed up, the workaround method using -r should be fine for linux too - have you tried it? > The solutions are: > > 1. use if statements in order to execute different statements on linux > and cygwin. The question now is how I can do that. I mean what is the > variable I have to check with ifdef? If you actually /needed/ to know, you could find out by $(shell uname) or some similar variant, but I think the solution I gave should work fine on linux and cygwin without needing to do anything different between the two. > 2. Install binutils cross and set target i686-pc-linux. In this way I > have to change only the name of tools used to compile and link. But I do > not know how to do that. Could someone suggest me a link? Oh, it'll be easier to just show you how. (Bulding a cross-compiler can be ever so tricky, but building cross binutils is almost always a breeze): Step 1: Download and untar the sources, create a directory for building in. cd /tmp wget http://tinyurl.com/y7a7hu tar xfvj binutils-2.17.tar.bz2 mkdir obj Step 2: Configure, build and install the sources. cd obj ../binutils-2.17/configure -v --prefix=/usr/local \ --target=i686-pc-linux 2>&1 | tee conf.log make all 2>&1 | tee build.log make install 2>&1 | tee install.log [optional] make -k check 2>&1 | tee check.log Step 3: Tidy up. cd .. rm -rf obj binutils-2.17 Now all you need to do is make sure you've got /usr/local/bin in your $PATH, and away you go; set AS to i686-pc-linux-as and LD to i686-pc-linux-ld in your makefile. > please cc my address since I am not subscribed at the list I remembered this time! cheers, DaveK [*] - the tinyurl points to http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/binutils/binutils-2.17.tar. bz2 but avoids getting line-wrapped by the mailer! -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/