In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/e2fabae1d9ef1c59ea9ada793c05d5b7452e27b6?hp=4846f1d7989dc95c5974b8be1dbc286ea09e5555>
- Log ----------------------------------------------------------------- commit e2fabae1d9ef1c59ea9ada793c05d5b7452e27b6 Author: Nicholas Clark <n...@ccl4.org> Date: Thu Jan 29 21:13:01 2009 +0000 Add --options with arguments to make_ext.pl. Pass $target as --target=... Treat all arguments that /=/ as passthrough, the rest being extensions. This will converge the argument passing conventions for make_ext.pl and win32/buildext.pl ----------------------------------------------------------------------- Summary of changes: Cross/Makefile-cross-SH | 8 ++++---- Makefile.SH | 12 ++++++------ make_ext.pl | 20 +++++++++++++------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Cross/Makefile-cross-SH b/Cross/Makefile-cross-SH index 1c7d42b..4af8380 100755 --- a/Cross/Makefile-cross-SH +++ b/Cross/Makefile-cross-SH @@ -937,16 +937,16 @@ manicheck: FORCE $(DYNALOADER): preplibrary FORCE - @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) + @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross --target=$(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) d_dummy $(dynamic_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE - @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) + @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross --target=dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) s_dummy $(static_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE - @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) + @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross --target=$(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) n_dummy $(nonxs_ext): miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE - @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) + @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross --target=nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) !NO!SUBS! $spitshell >>$Makefile <<EOF diff --git a/Makefile.SH b/Makefile.SH index 33e5893..db70dfb 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -1127,16 +1127,16 @@ manicheck: FORCE # DynaLoader may be needed for extensions that use Makefile.PL. $(DYNALOADER): miniperl$(EXE_EXT) preplibrary FORCE - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) + $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=$(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) d_dummy $(dynamic_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) + $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) s_dummy $(static_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) + $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=$(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) n_dummy $(nonxs_ext): miniperl$(EXE_EXT) preplibrary FORCE - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) + $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) !NO!SUBS! $spitshell >>$Makefile <<EOF @@ -1196,7 +1196,7 @@ _tidy: -cd x2p; $(LDLIBPTH) $(MAKE) clean -rm -f lib/Config_git.pl git_version.h -...@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl clean $$x MAKE=$(MAKE) ; \ + $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=clean $$x MAKE=$(MAKE) ; \ done _cleaner1: @@ -1206,7 +1206,7 @@ _cleaner1: -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN) -...@if test -f miniperl$(EXE_EXT) ; then \ for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $(CLEAN) $$x MAKE=$(MAKE) ; \ + $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=$(CLEAN) $$x MAKE=$(MAKE) ; \ done ; \ else \ sh $(CLEAN).sh ; \ diff --git a/make_ext.pl b/make_ext.pl index b0dc3ee..2f648e9 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -6,12 +6,12 @@ use warnings; # It primarily used by the perl Makefile: # # d_dummy $(dynamic_ext): miniperl preplibrary FORCE -# @$(RUN) ./miniperl ext/util/make_ext.pl dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) +# @$(RUN) ./miniperl make_ext.pl --target=dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) # # It may be deleted in a later release of perl so try to # avoid using it for other purposes. -my (%excl, %incl, %opts, @argv); +my (%excl, %incl, %opts, @extspec, @passthrough); foreach (@ARGV) { if (/^!(.*)$/) { @@ -20,15 +20,21 @@ foreach (@ARGV) { $incl{$1} = 1; } elsif (/^--([\w\-]+)$/) { $opts{$1} = 1; + } elsif (/^--([\w\-]+)=(.*)$/) { + $opts{$1} = $2; + } elsif (/^--([\w\-]+)=(.*)$/) { + $opts{$1} = $2; + } elsif (/=/) { + push @passthrough, $_; } else { - push @argv, $_; + push @extspec, $_; } } -my $target = shift @argv; -my $extspec = shift @argv; -my $makecmd = shift @argv; # Should be something like MAKE=make -my $passthru = join ' ', @argv; # allow extra macro=value to be passed through +my $target = $opts{target}; +my $extspec = $extspec[0]; +my $makecmd = shift @passthrough; # Should be something like MAKE=make +my $passthru = join ' ', @passthrough; # allow extra macro=value to be passed through print "\n"; # Previously, $make was taken from config.sh. However, the user might -- Perl5 Master Repository