--- Makefile.SH.orig 2015-06-16 13:22:55.921083153 +0200 +++ Makefile.SH 2015-06-16 13:26:14.198352302 +0200 @@ -311,6 +311,7 @@ OBJ_EXT = $_o PATH_SEP = $p_ +ifeq (,\$(CROSS_PERL)) # Macros to invoke a copy of miniperl during the build. Targets which # are built using these macros should depend on \$(MINIPERL_EXE) MINIPERL_EXE = miniperl\$(EXE_EXT) @@ -342,6 +343,23 @@ # Macros to run our tests RUN_TESTS = \$(LDLIBPTH) ./runtests +else # CROSS_PERL + +# Macros to invoke a copy of miniperl during the build. Targets which +# are built using these macros should depend on \$(MINIPERL_EXE) +MINIPERL_EXE = miniperl\$(EXE_EXT) +MINIPERL = \$(CROSS_PERL) +HOST_MINIPERL = \$(CROSS_PERL) + +# Macros to invoke a copy of our fully operational perl during the build. +PERL_EXE = perl\$(EXE_EXT) +RUN_PERL = \$(CROSS_PERL) + +# Macros to run our tests +RUN_TESTS = echo "Not running tests" + +endif # CROSS_PERL + dynamic_ext = $dynamic_list dynamic_ext_re = $dynamic_ext_re static_ext = $static_list @@ -580,6 +598,9 @@ $(RUN_PERL) Porting/manisort -q -o MANIFEST; sh -c true) @touch $(MANIFEST_SRT) +# Cross building requires a separate target to allow manipulation of the build tree +extensions: $(dynamic_ext) $(nonxs_ext) + .PHONY: all utilities # Both git_version.h and lib/Config_git.pl are built @@ -662,6 +683,9 @@ globals$(OBJ_EXT): $(generated_headers) +ifeq (,$(CROSS_PERL)) +# If we're cross-building, we should have uudmap.h and bitcount.h +# provided already uudmap.h mg_data.h: bitcount.h generate_uudmap$(OBJ_EXT): mg_raw.h @@ -686,6 +710,7 @@ $spitshell >>$Makefile <<'!NO!SUBS!' generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT) $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs) +endif !NO!SUBS! ;;