From: Nicholas Clark Date: Wed, 23 Sep 2009 10:59:31 +0000 (+0100) Subject: Add a --chdir option to configpm, and use this in the Win32 Makfiles. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e73d6a402bc493d66d19c409c41e1e271c6450b;p=p5sagit%2Fp5-mst-13.2.git Add a --chdir option to configpm, and use this in the Win32 Makfiles. A slight Makefile simplification, and another move towards Win32 standardising on running miniperl as $(MINIPERL), which currently is ..\miniperl.exe --- diff --git a/configpm b/configpm index 5baed2b..5b6a4e6 100755 --- a/configpm +++ b/configpm @@ -34,6 +34,7 @@ sub usage { die < '', # --cross=PLATFORM - crosscompiling for PLATFORM 'glossary' => 1, # --no-glossary - no glossary file inclusion, # for compactness + 'chdir' => '', # --chdir=dir - change directory before writing files ); sub opts { @@ -85,6 +87,10 @@ sub opts { my %Opts = opts(); +if ($Opts{chdir}) { + chdir $Opts{chdir} or die "$0: could not chdir $Opts{chdir}: $!" +} + my ($Config_SH, $Config_PM, $Config_heavy, $Config_POD); my $Glossary = 'Porting/Glossary'; diff --git a/win32/Makefile b/win32/Makefile index 5c53cb8..8be691a 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -894,17 +894,13 @@ config.w32 : $(CFGSH_TMPL) # the special __GNUC__ handling that is otherwise lost. regen_config_h: $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh - cd .. - miniperl configpm - cd win32 + $(MINIPERL) -I..\lib ..\configpm --chdir=.. -del /f $(CFGH_TMPL) -$(MINIPERL) -I..\lib $(ICWD) config_h.PL "INST_VER=$(INST_VER)" rename config.h $(CFGH_TMPL) $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl - cd .. - miniperl configpm - cd win32 + $(MINIPERL) -I..\lib ..\configpm --chdir=.. if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL) $(XCOPY) ..\*.h $(COREDIR)\*.* $(XCOPY) *.h $(COREDIR)\*.* diff --git a/win32/makefile.mk b/win32/makefile.mk index faf080a..38b89d9 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -1144,13 +1144,13 @@ config.w32 : $(CFGSH_TMPL) regen_config_h: $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file $(mktmp $(CFG_VARS)) \ $(CFGSH_TMPL) > ..\config.sh - cd .. && miniperl configpm + $(MINIPERL) -I..\lib ..\configpm --chdir=.. -del /f $(CFGH_TMPL) -$(MINIPERL) -I..\lib $(ICWD) config_h.PL "INST_VER=$(INST_VER)" rename config.h $(CFGH_TMPL) $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl - cd .. && miniperl configpm + $(MINIPERL) -I..\lib ..\configpm --chdir=.. if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL) $(XCOPY) ..\*.h $(COREDIR)\*.* $(XCOPY) *.h $(COREDIR)\*.*