Skip to contentSkip to conversation

Perl in the toolchain

DISCUSSION Konrad Eisele 1 participant 1 message Feb 1, 2003

lore
Share & tools
lore
#0 lore raw

Kai Germaschewski <[email protected]> schrieb am 31.01.03 20:41:39:

Quoted 10 lines · Pete Zaitcev
Quoted 8 lines

Kai, what's your opinion? I suspect you missed my posing to l-k

Date: Thu, 30 Jan 2003 14:53:59 +0100
From: Konrad Eisele <[email protected]>
To: "PeteZaitcev" <[email protected]>
Subject: Adding sparc-leon linux to sourcetree

Quoted 9 lines
Quoted 5 lines

.....
There is also one change I have made on the buildsystem. Because I'm using some perl inline scripts in the $cmd_xxx the >'< and >$< signs in the inline perl scripts cause trouble (perl -e '...$x=....'), the >'< because of the echo command, the >$< when rereading from the xxx..cmd files. Could this be applied to the original file?

Unfortunately, I cannot find the original posting quoted above, since that would probably reveal where the actual usage of perl is.

I wanted to use perl inline script in a post build command to check weather the kernel fits in rom for a port of Linux to the sparc Leon Processor. Which requires nested if then clauses.
First, I could also call an external script but that would require a new file, so inline script is nicer. Second, I could do the checking with shell if then clauses and expressions without $ or ', but perl is much nicer to read. Especially if you have hex conversion and large calculations.

Quoted 7 lines

Generally, we've been trying to not make perl a prequisite for the kernel build, and I'd like to keep it that way. Except for some arch specific stuff I don't really care about, the uses of perl are for the optional "make checkconfig" etc. (which btw look mostly obsolete and should probably be killed), and for generating some firmware, though by default a shipped version of the generated files is used.

Quoted 25 lines

That said, I'm not necessarily opposed to allowing for use of ',$ in the command variables as the change above does (getting that as a patch would be nice, though).

--Kai

Quoted 17 lines

scripts/Makefile.lib:
+-------------------------------+

# =========================================================================== # Generic stuff
# ===========================================================================

# function to only execute the passed command if necessary
# the ' -> '\'' and $ to $$ substitution are done if $(cmd_$(1)) includes a inline perlscript
if_changed = $(if $(strip $? \
		          $(filter-out $(cmd_$(1)),$(cmd_$@))\
			  $(filter-out $(cmd_$@),$(cmd_$(1)))),\
	@set -e; \
	$(if $($(quiet)cmd_$(1)),echo '  $(subst ','\'',$($(quiet)cmd_$(1)))';) \
	$(cmd_$(1)); \
	echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd)

______________________________________________________________________________
Die SMS direkt auf's Handy. - Die Blitz-SMS bei WEB.DE FreeMail
http://freemail.web.de/features/?mc=021165