targetport=''
to=''
usecrosscompile=''
+hostperl=''
+hostgenerate=''
extern_C=''
mistrustnm=''
usedevel=''
case "$croak" in
y) echo "Cannot continue, aborting." >&4; exit 1 ;;
esac
+ : compile a host miniperl and generate_uudmap, unless we got passed them
+ if $test "X$hostperl" = X; then
+ echo "Building host miniperl and generate_uudmap binaries" >&4
+ cd ..
+ test -d host || mkdir host
+ cd host && rm -rf ./*
+ ../Configure -des -Dusedevel -Dmksymlinks
+ make miniperl
+ make generate_uudmap
+ hostperl=host/miniperl
+ hostgenerate=host/generate_uudmap
+ cd ..
+ cd UU
+ fi
;;
*)
usecrosscompile='undef'
html1direxp='$html1direxp'
html3dir='$html3dir'
html3direxp='$html3direxp'
+hostgenerate='$hostgenerate'
+hostperl='$hostperl'
i16size='$i16size'
i16type='$i16type'
i32size='$i32size'
# Sometimes running an executable is an adventure.
RUN =
+# When cross-compiling we want to use a (mini)perl built for the host, not the target
+HOST_PERL = $hostperl
+HOST_GENERATE = $hostgenerate
+
# These variables may need to be manually set for non-Unix systems.
AR = $full_ar
HOST_EXE_EXT = $_exe
generate_uudmap$(OBJ_EXT): mg_raw.h
+!NO!SUBS!
+
+if test "X$hostgenerate" != X; then
+ $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)
+
+!NO!SUBS!
+else
+ $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)
+!NO!SUBS!
+fi
+
+$spitshell >>$Makefile <<'!NO!SUBS!'
perlmain.c: $(MINIPERL_EXE) ext/ExtUtils-Miniperl/pm_to_blib
$(MINIPERL) -Ilib -MExtUtils::Miniperl -e 'writemain(\"perlmain.c", @ARGV)' DynaLoader $(static_ext)
!NO!SUBS!
;;
*)
- $spitshell >>$Makefile <<'!NO!SUBS!'
+ if test "X$hostperl" != X; then
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl
+ -@rm -f miniperl.xok
+ -@rm $(MINIPERL_EXE)
+ ln -s $(HOST_PERL) $(MINIPERL_EXE)
+ $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
+!NO!SUBS!
+ else
+ $spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl
-@rm -f miniperl.xok
$(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
$(MINIPERL) -f write_buildcustomize.pl
!NO!SUBS!
+ fi
;;
esac
_clobber:
-@rm -f Cross/run-* Cross/to-* Cross/from-*
+ -rm -rf host
rm -f t/test_state
rm -f config.sh cppstdin Policy.sh extras.lst