From 0e00f80fb74f8f449eacf237e84a698a5555e7bd Mon Sep 17 00:00:00 2001 From: Alexey Lebedeff Date: Tue, 21 Jun 2016 18:01:54 +0300 Subject: Use perl discovered by configure --- make/make_emakefile.in | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 make/make_emakefile.in (limited to 'make/make_emakefile.in') diff --git a/make/make_emakefile.in b/make/make_emakefile.in new file mode 100755 index 0000000000..fbca77887a --- /dev/null +++ b/make/make_emakefile.in @@ -0,0 +1,66 @@ +#!@PERL@ +# -*- cperl -*- + +use strict; + +my $key; +my @opts; +my @modules; +my $m; +my $o; + +foreach (@ARGV) { + if (/^\-I(.+)/) { + push(@opts,"{i,\"$1\"}"); + $key=0; + } + elsif (/^\-o(.+)/) { + push(@opts,"{outdir,\"$1\"}"); + $key=0; + } + elsif (/^\-D(.+)=(.+)/) { + push(@opts,"{d,\'$1\',$2}"); + $key=0; + } + elsif (/^\-D(.+)/) { + push(@opts,"{d,\'$1\'}"); + $key=0; + } + elsif (/^\+(.+)/) { + push(@opts,$1), + $key=0; + } + elsif (/^(\-(.+))$/) { + $key = $1; + } + elsif ($key eq "\-I") { + push(@opts,"{i,\"$_\"}"); + $key=0; + } + elsif ($key eq "\-o") { + push(@opts,"{outdir,\"$_\"}"); + $key=0; + } + elsif ($key) { + print "Warning: Ignoring invalid option \"$key $_\"\n"; + $key=0; + } + else { + push(@modules,"\'$_\'"), + $key=0; + } +}; + +$m = pop(@modules); +print "{[$m"; +foreach (@modules) { + print ",$_"; +}; + +$o = pop(@opts); +print "],[$o"; +foreach (@opts) { + print ",$_"; +}; + +print "]}.\n"; -- cgit v1.2.3