From 939767c9d84f9288c260508432b50879f71e1d3b Mon Sep 17 00:00:00 2001 From: Andy Dougherty Date: Wed, 13 Oct 2010 13:27:12 -0400 Subject: [PATCH] Fix x2p and utils dependencies for static builds The x2p and utils .PL extractions use the Cwd module, which is not available in miniperl in a static build. (For a dynamic build, miniperl only loads the pure perl portion of Cwd, but building the whole extension ensures that the pure perl part is correctly built and available. It might be cleaner just to always require the full perl.) --- Makefile.SH | 22 ++++++++++++++++++---- utils/Makefile | 3 +++ utils/Makefile.SH | 11 ++++++++++- x2p/Makefile.SH | 13 ++++++++++--- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/Makefile.SH b/Makefile.SH index f886564..6559583 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -562,16 +562,30 @@ lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl # make sure that we recompile perl.c if the git version changes perl$(OBJ_EXT): git_version.h -translators: $(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE - @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all - !NO!SUBS! +# Making utilities and translators require Cwd. If we have dynamic +# loading, we only need miniperl and Cwd.$dlext. If we have static +# loading, we need to build perl first. +case "$usedl" in +define) + util_deps='$(MINIPERL_EXE) $(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE' + x2p_deps='$(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE' + ;; +*) util_deps='$(PERL_EXE) $(CONFIGPM) FORCE' + x2p_deps='$(PERL_EXE) $(CONFIGPM) FORCE' + ;; +esac + $spitshell >>$Makefile <>$Makefile <<'!NO!SUBS!' # This is now done by installman only if you actually want the man pages. diff --git a/utils/Makefile b/utils/Makefile index 4d56bea..aaa0b5f 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -1,3 +1,6 @@ +# Generated from utils/Makefile.SH. The generated file is +# shipped with the source kit for systems such as win32 +# which don't do .SH extraction. PERL = ../miniperl REALPERL = ../perl diff --git a/utils/Makefile.SH b/utils/Makefile.SH index b5a2f12..6601c13 100644 --- a/utils/Makefile.SH +++ b/utils/Makefile.SH @@ -26,9 +26,18 @@ esac echo "Extracting utils/Makefile (with variable substitutions)" rm -f Makefile +# These use the Cwd extension. For statically-built perls, we +# need perl, not just miniperl. +case "$usedl" in + define) perl="../miniperl" ;; + *) perl="../perl" ;; +esac cat >Makefile <Makefile <.shlist -# These should be automatically generated - $(plextract): - $(RUN) ../miniperl -I../lib $@.PL + $(RUN) $(PERL) -I../lib $@.PL find2perl: find2perl.PL -- 2.7.4