Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759892AbZACM2W (ORCPT ); Sat, 3 Jan 2009 07:28:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758154AbZACM2N (ORCPT ); Sat, 3 Jan 2009 07:28:13 -0500 Received: from smtprelay07.ispgateway.de ([80.67.29.7]:34231 "EHLO smtprelay07.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757629AbZACM2M (ORCPT ); Sat, 3 Jan 2009 07:28:12 -0500 From: Ingo Oeser To: Rob Landley Subject: Re: [PATCH 1/3]: Replace kernel/timeconst.pl with kernel/timeconst.sh Date: Sat, 3 Jan 2009 13:28:22 +0100 User-Agent: KMail/1.10.3 (Linux/2.6.27-9-generic; KDE/4.1.3; x86_64; ; ) Cc: Embedded Linux mailing list , linux-kernel@vger.kernel.org, Andrew Morton , "H. Peter Anvin" , Sam Ravnborg References: <200901020207.30359.rob@landley.net> <200901020213.30658.rob@landley.net> In-Reply-To: <200901020213.30658.rob@landley.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901031328.23079.ioe-lkml@rameria.de> X-Df-Sender: 849595 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1979 Lines: 75 Hi Robert, I fully support your argument here: Requiring lots of hacks in various languages to build a system core sucks. But now sth. more productive: On Friday 02 January 2009, Rob Landley wrote: > diff -r d0c7611dcfd6 kernel/Makefile > --- a/kernel/Makefile Tue Dec 30 17:48:25 2008 -0800 > +++ b/kernel/Makefile Fri Jan 02 00:10:44 2009 -0600 > @@ -115,7 +115,7 @@ > $(obj)/time.o: $(obj)/timeconst.h > > quiet_cmd_timeconst = TIMEC $@ > - cmd_timeconst = $(PERL) $< $(CONFIG_HZ) > $@ > + cmd_timeconst = $(CONFIG_SHELL) $< $(CONFIG_HZ) > $@ > targets += timeconst.h > -$(obj)/timeconst.h: $(src)/timeconst.pl FORCE > +$(obj)/timeconst.h: $(src)/timeconst.sh FORCE > $(call if_changed,timeconst) > --- /dev/null 1969-12-31 00:00:00.000000000 -0600 > +++ hg/kernel/timeconst.sh 2009-01-01 23:53:17.000000000 -0600 > @@ -0,0 +1,91 @@ > +#!/bin/bash > + > +if [ $# -ne 1 ] > +then > + echo "Usage: timeconst.sh HZ" > + exit 1 > +fi > + > +HZ=$1 > + > +# Sanity test: even the shell in Red Hat 9 (circa 2003) supported 64 bit math. > + > +[ $((1<<32)) -lt 0 ] && exit 1 > + > +# Output start of header file > + > +cat << EOF > +/* Automatically generated by kernel/timeconst.sh */ > +/* Conversion constants for HZ == $HZ */ > + > +#ifndef KERNEL_TIMECONST_H > +#define KERNEL_TIMECONST_H > + > +#include > +#include > + > +#if HZ != $HZ > +#error "kernel/timeconst.h has the wrong HZ value!" > +#endif > + > +EOF > + > +# For both Miliseconds and Microseconds > + > +for i in "MSEC 1000" "USEC 1000000" > +do > + NAME=$(echo $i | awk '{print $1}') cut -d' ' -f1 does the same > + PERIOD=$(echo $i | awk '{print $2}') cut -d' ' -f2 does the same Best Regards Ingo Oeser -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/