diff options
author | Brian Fraser <fraserbn@gmail.com> | 2014-01-16 07:20:28 -0300 |
---|---|---|
committer | Brian Fraser <fraserbn@gmail.com> | 2014-01-22 13:27:06 -0300 |
commit | 1ca484acee72052c3a485c2eef7bad6a98476e96 (patch) | |
tree | 275be5d086a0ed933c1c386348cdd32d2d059fc1 /Makefile.SH | |
parent | 4346df8fafba75d8565b1c0187f7b3b4ca4e9b75 (diff) | |
download | perl-1ca484acee72052c3a485c2eef7bad6a98476e96.tar.gz |
Configure, Makefile.SH: Allow running generate_uudmap in the target
This is a bit of a step backwards, but we want to run this in
the target platform when cross-compiling to some unusual setups,
like ASCII -> EBCDIC.
What this branch introduces is a third "path" for generate_uudmap:
* If we are doing a native build, just build it as usual and run it.
* If we're cross-compiling, and either -Dhostgenerate was specified OR
if it was left empty, which is the default case, then create
a host generate_uudmap and run it locally
* Finally, if are cross-compiling and were built with -Uhostgenerate,
then build generate_uudmap for the target and run it there, bringing
back the resulting headers.
Diffstat (limited to 'Makefile.SH')
-rwxr-xr-x | Makefile.SH | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/Makefile.SH b/Makefile.SH index d86953ab2a..2bf79428de 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -668,27 +668,44 @@ globals$(OBJ_EXT): $(generated_headers) uudmap.h mg_data.h: bitcount.h -bitcount.h: generate_uudmap$(HOST_EXE_EXT) - ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers) - generate_uudmap$(OBJ_EXT): mg_raw.h !NO!SUBS! -if test "X$hostgenerate" != X; then - $spitshell >>$Makefile <<'!NO!SUBS!' +# If hostgerenate isn't defined, then we have to build +# generate_uudmap and run it. This can potentially mean running +# it on the target system if we're cross-compiling. +# If it is defined, then we just run it locally. +case "$hostgenerate" in +'') +$spitshell >>$Makefile <<!GROK!THIS! +bitcount.h: generate_uudmap\$(HOST_EXE_EXT) + $run ./generate_uudmap\$(HOST_EXE_EXT) \$(generated_headers) + -@for f in \$(generated_headers); do \\ + $from \$\$f; \\ + done + +!GROK!THIS! + +$spitshell >>$Makefile <<'!NO!SUBS!' generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT) - -@rm generate_uudmap$(HOST_EXE_EXT) - $(LNS) $(HOST_GENERATE) generate_uudmap$(HOST_EXE_EXT) + $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs) !NO!SUBS! -else - $spitshell >>$Makefile <<'!NO!SUBS!' +;; +*) +$spitshell >>$Makefile <<'!NO!SUBS!' +bitcount.h: generate_uudmap$(HOST_EXE_EXT) + ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers) + generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT) - $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs) + -@rm generate_uudmap$(HOST_EXE_EXT) + $(LNS) $(HOST_GENERATE) generate_uudmap$(HOST_EXE_EXT) !NO!SUBS! -fi +;; +esac + $spitshell >>$Makefile <<'!NO!SUBS!' perlmain.c: $(MINIPERL_EXE) ext/ExtUtils-Miniperl/pm_to_blib |