public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Rob Landley <rob@landley.net>
Cc: linux-kernel@vger.kernel.org, miltonm@bga.com, hpa@zytor.com,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] Remove the new perl dependency from build.
Date: Sat, 16 Feb 2008 12:24:41 +0100	[thread overview]
Message-ID: <20080216112441.GA11362@uranus.ravnborg.org> (raw)
In-Reply-To: <200802152010.05505.rob@landley.net>

Hi Rob.
> 
> Remove perl dependency introduced in 2.6.25-rc1, by shipping kernel/timeconst.h
> with all the "canned" values so perl is only used to regenerate it if that
> file is deleted.
While I agree that we should keep the dependencies low for building a kernel
trying to avoid the perl dependency is in the long rund a dead-end.

I have for a while considered replacing part of the kbuild gmake magic
with a perl script thus pushing towards a mandatory dependency
on perl.

A few comments on the actual patch.

> --- linux/hg/kernel/Makefile	2008-02-08 19:06:59.000000000 -0600
> +++ linux-new/kernel/Makefile	2008-02-15 19:32:08.000000000 -0600
> @@ -95,7 +95,7 @@
>  $(obj)/time.o: $(obj)/timeconst.h
>  
>  quiet_cmd_timeconst  = TIMEC   $@
> -      cmd_timeconst  = $(PERL) $< $(CONFIG_HZ) > $@
> -targets += timeconst.h
> -$(obj)/timeconst.h: $(src)/timeconst.pl FORCE
> +      cmd_timeconst  = $(PERL) $< \
> +            24 32 48 64 100 122 128 200 250 256 300 512 1000 1024 1200 > $@
> +$(obj)/timeconst.h:
>  	$(call if_changed,timeconst)

We will only build timeconst.h if the file is missing and this
is not the desired behaviour.
What could be done to make the perl dependency optional would be to
introduce a small shell wrapper.
If called with a CONFIG_HZ value that is unknow use the perl script
to generate the .h file.
For known HZ values take a copy of the shipped .h file.

The MAkefile bits would looke like this:
      cmd_timeconst  = $(CONFIG_SHELL) $< $(CONFIG_HZ)

targets += timeconst.h
$(obj)/timeconst.h: $(src)/timeconst.sh FORCE
	$(call if_changed,timeconst)

Using 'if_changed' will make sure we call the shell script
when HZ is changed.

	Sam

      parent reply	other threads:[~2008-02-16 11:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-16  2:10 [PATCH] Remove the new perl dependency from build Rob Landley
2008-02-16  2:52 ` H. Peter Anvin
2008-02-16 11:24 ` Sam Ravnborg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080216112441.GA11362@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miltonm@bga.com \
    --cc=rob@landley.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox