void-packages/srcpkgs/perl/patches/cross-Makefile.SH.patch

63 lines
1.8 KiB
Diff

--- Makefile.SH 2014-09-14 13:30:59.000000000 +0200
+++ Makefile.SH 2014-09-22 18:06:16.402316893 +0200
@@ -308,6 +308,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)
@@ -336,6 +337,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
@@ -569,6 +587,9 @@
@echo " ";
@echo " Everything is up to date. Type '$(MAKE) test' to run test suite."
+# Cross building requires a separate target to allow manipulation of the build tree
+extensions: $(dynamic_ext) $(nonxs_ext)
+
.PHONY: all translators utilities
# Both git_version.h and lib/Config_git.pl are built
@@ -666,6 +687,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
@@ -690,6 +714,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!
;;