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;
'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 {
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';
# 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)\*.*
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)\*.*