*BSD News Article 50760


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!lll-winken.llnl.gov!noc.near.net!news.mathworks.com!tank.news.pipex.net!pipex!dish.news.pipex.net!pipex!sunic!sunic.sunet.se!news.funet.fi!news.helsinki.fi!not-for-mail
From: torvalds@cc.Helsinki.FI (Linus Torvalds)
Newsgroups: comp.unix.bsd.netbsd.misc,comp.os.linux.advocacy
Subject: Re: DEBATE: BSD vs. Linux
Date: 7 Sep 1995 08:43:12 +0300
Organization: University of Helsinki
Lines: 59
Sender: torvalds@cc.helsinki.fi
Message-ID: <42m0pg$2lv@klaava.helsinki.fi>
References: <4233kp$t8p@hilly.apci.net> <42dp79$bv5@wolfe.wimsey.com> <42gnkt$9ji@klaava.helsinki.fi> <42j4js$lu9@wolfe.wimsey.com>
NNTP-Posting-Host: klaava.helsinki.fi
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.netbsd.misc:998 comp.os.linux.advocacy:20296

In article <42j4js$lu9@wolfe.wimsey.com>,
Curt Sampson <curt@cynic.portal.ca> wrote:
>In article <42gnkt$9ji@klaava.helsinki.fi>,
>Linus Torvalds <torvalds@cc.Helsinki.FI> wrote:
>
>>In article <42dp79$bv5@wolfe.wimsey.com>,
>>Curt Sampson <curt@cynic.portal.ca> wrote:
>
>>>Or in other words, can I cross compile from a platform where I also
>>>compile native systems for that platform?
>
>>This is getting ridiculous.  In a word (or three): "Who really cares?"
>
>I do. If my personal workstation is a nice fast Alpha, and I've
>also got to maintain a handful of i386 workstations and a PowerPC
>or two, I'd like to be able to do all my compilation on my Alpha.
>Perhaps there aren't any Linux users out there who need to maintain
>multiplatform environments.

We're running _unix_, remember? The system where something like this is
supposed to be handled by using a lot of small and easily used tools,
rather than one hard-to-use and not too flexible monstrosity. 

Forget complex makefiles: try "man lndir".  And the nice thing about
using lndir is that it works for _any_ project, not just your pet
project that happens to be set up with VPATH etc. 

I had not done this before, but it wasn't very hard (I did it while
typing this reply, but as I don't have a cross-compiler for the i386 set
up I can't go further):

	/* clean alpha source tree under /usr/src/linux */
	mkdir -p /usr/src/i386/linux
	cd /usr/src/i386/linux
	lndir /usr/src/linux

	/* We need to change the Makefile, make it a real file, not a symlink */
	rm Makefile
	cp /usr/src/linux/Makefile .
	... edit Makefile to say "ARCH=i386" and to change the define
	    for CC/AS/LD to point to your cross-compiler setup ...
	make oldconfig
	make depend

Now, that wasn't too hard, was it? You can automate this if you want to,
and you can use the same approach for other projects.  You can even make
some special fancy setups where you share some of the object files this
way if you have different configurations for the same architecture (say,
you want to have a special debugging kernel available where some of the
object files are compiled with "-g", but not all, for example)

(doing the debugging kernel is trivial: just do a full "make" to create
all the object files in the standard kernel tree, then you do the
"lndir" thing, and then you remove those object file links that you want
to compile with -g and change the Makefile like above to add "-g".  Now,
as an excercise, do the same with VPATH without mucking with the
original setup). 

			Linus