Skip to content

Commit

Permalink
Add --options with arguments to make_ext.pl. Pass $target as --target…
Browse files Browse the repository at this point in the history
…=...

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
  • Loading branch information
nwc10 committed Jan 29, 2009
1 parent 4846f1d commit e2fabae
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Cross/Makefile-cross-SH
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions Makefile.SH
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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 ; \
Expand Down
20 changes: 13 additions & 7 deletions make_ext.pl
Expand Up @@ -6,12 +6,12 @@
# 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 (/^!(.*)$/) {
Expand All @@ -20,15 +20,21 @@
$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
Expand Down

0 comments on commit e2fabae

Please sign in to comment.