diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-09-23 11:59:31 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-09-23 11:59:31 +0100 |
commit | 4e73d6a402bc493d66d19c409c41e1e271c6450b (patch) | |
tree | 5461d0ffa21fa7f78b7cbe387bafab9c5bc7e8b8 | |
parent | e27b5b51275a893e82bce85334679ee38d3d6bf8 (diff) | |
download | perl-4e73d6a402bc493d66d19c409c41e1e271c6450b.tar.gz |
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
-rwxr-xr-x | configpm | 6 | ||||
-rw-r--r-- | win32/Makefile | 8 | ||||
-rw-r--r-- | win32/makefile.mk | 4 |
3 files changed, 10 insertions, 8 deletions
@@ -34,6 +34,7 @@ sub usage { die <<EOF } usage: $0 [ options ] --cross=PLATFORM cross-compile for a different platform --no-glossary don't include Porting/Glossary in lib/Config.pod + --chdir=dir change directory before writing files EOF use strict; @@ -60,6 +61,7 @@ my %Allowed_Opts = ( 'cross' => '', # --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 5c53cb8d1a..8be691ac29 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 faf080a9a4..38b89d971e 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)\*.* |