Re: building kernel 2.0.x under potato
-----BEGIN PGP SIGNED MESSAGE-----
On Sat, 25 Sep 1999, Herbert Xu wrote:
> > >
> > > make bzImage HOSTCC=/usr/bin/egcs
> >
> > Indeed it does. I was too busy looking for a way to do it in the
> > environment... Can one use this with make-kpkg as well?
>
> Probably not, perhaps you can make a patch...
> --
Ok then.
I actually had to start learning perl for this but I guess it had to
happen once anyway, so...
You probably want to set the HOSTCC and CC variables in make-kpkg itself,
not in debian/rules (as I've done). That way they are passed on to every
target through ${MAKE} (and this is probably why setting on the
commandline works, while environment variables don't). I 've set them to
sane (?) defaults if CC and HOSTCC are not exported in the environment.
Also, dpkg --print-architecture (used in debian/rules) depends on gcc or
$CC, OTOH it produces an error if the word count of $CC > 1, so I passed
on $HOSTCC to it (which *should* be just the name of the compiler -maybe
you could add a check?).
Regards.
- ---------------------------------------------------------------------------
Filip Van Raemdonck
mechanix@digibel.org
member of the fibo-systeam
http://fibo.hogent.be | http://fibolite.hogent.be
- ---------------------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv
iQCVAwUBN+/WbwErWvg4U8B1AQHQRAQArQhuiWHP9i5nfPW0pw7YZvexFjdJU/P0
+cBA5EjGQcadFbvCGx+xz1PFGDws72xCRLS/rUAt5wrma9ERUqtFzH/X36PR7p4q
HwjSHArD1rWoDxiuwExuLxJH9Jb3DIKcQJw+DU3EmTi+BCMezFkrAFF2G39mAnCq
uAWkn00MPmA=
=ssfc
-----END PGP SIGNATURE-----
--- make-kpkg Thu Aug 19 09:02:29 1999
+++ make-kpkg.bak Mon Sep 27 21:38:58 1999
@@ -663,6 +663,21 @@
elsif ($bzimage) {
$command .= " IMAGE_TYPE=bzImage ";
}
+
+ my $hostcc = $ENV{'HOSTCC'};
+ $hostcc .= " ";
+ if ($hostcc eq " ") { $hostcc = "gcc"; };
+
+ my $cc = $ENV{'CC'};
+ $cc .= " ";
+ if ($cc eq ' ') { $cc = $cross_compile; $cc .= "gcc "; };
+
+ $cc .= "-D__KERNEL__ -I";
+ chop($cc .= `pwd`);
+ $cc .= "/include";
+
+ $command .= " CC=\"$cc\" HOSTCC=\"$hostcc\"";
+
$command .= " $Targets";
exec $command;
}
--- rules Sat Sep 25 16:07:05 1999
+++ rules.bak Mon Sep 27 21:32:37 1999
@@ -67,7 +67,7 @@
KERNEL_CROSS:=$(CROSS_COMPILE)-
endif
else
- architecture:=$(shell dpkg --print-architecture)
+ architecture:=$(shell CC=$(HOSTCC) dpkg --print-architecture)
endif
KERNEL_ARCH:=$(architecture)
Reply to: