Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 928 lines (709 sloc) 22.646 kB
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
1 #!/usr/bin/perl -w
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
2 #
3 # Configure.pl
4 #
5 # $Id$
6 #
7 # Author: Brent Dax
8 #
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
9
10 use strict;
c1dafb2 @rspier Add './lib' to our @INC because Parrot/* moved.
rspier authored
11 use lib 'lib';
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
12
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
13 use Config;
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
14 use Getopt::Long;
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
15 use ExtUtils::Manifest qw(manicheck);
6b3e60e Patch from Jason Diamond to make win32 platform stuff work:
Gregor N. Purdy authored
16 use File::Copy;
19fa0d4 @tomhughes Stop Configure trying to make op_info.c and op.h as op_info.c no longer
tomhughes authored
17
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
18 use Parrot::BuildUtil;
19
20
21 #
22 # Read the array and scalar forms of the version.
23 # from the VERSION file.
24 #
25
26 my $parrot_version = parrot_version();
27 my @parrot_version = parrot_version();
28
29
30 #
31 # Handle options:
32 #
33
c15d8e5 Added 'reconfig' make target and corresponding --reconfig option to
Gregor N. Purdy authored
34 my $reconfig = 0;
35
be6f835 Made GCC ever so much pickier.
Dan Sugalski authored
36 my($opt_debugging, $opt_defaults, $opt_version, $opt_help) = (0, 0, 0, 0);
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
37 my(%opt_defines);
c15d8e5 Added 'reconfig' make target and corresponding --reconfig option to
Gregor N. Purdy authored
38
39 if (@ARGV and $ARGV[0] eq '--reconfig') {
40 print STDERR "Configure.pl: Reconfiguring based on config.opt file...\n";
41 open OPTS, "<config.opt" or die "Can't --reconfig. Could not open config.opt for reading!";
42
43 foreach my $opt (<OPTS>) {
44 chomp $opt;
45
46 if ($opt =~ m/^\s*debugging\s*$/) {
47 $opt_debugging = 1;
48 $opt = 'debugging';
49 }
50 elsif ($opt =~ m/^\s*defaults\s*$/) {
51 $opt_defaults = 1;
52 $opt = 'defaults';
53 }
54 elsif ($opt =~ m/^\s*define\s+(.*)\s*=\s*(.*)\s*$/) {
55 $opt_defines{$1} = $2;
56 $opt = "define $1=$2";
57 }
58 else {
59 die "Unrecognized option in config.opt: '$opt'!";
60 }
61
62 print " $opt\n";
63 }
64
65 close OPTS;
66 $reconfig = 1;
67 }
68
19fa0d4 @tomhughes Stop Configure trying to make op_info.c and op.h as op_info.c no longer
tomhughes authored
69 my $result = GetOptions(
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
70 'debugging!' => \$opt_debugging,
71 'defaults!' => \$opt_defaults,
72 'version' => \$opt_version,
73 'help' => \$opt_help,
74 'define=s' => \%opt_defines,
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
75 );
76
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
77 if($opt_version) {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
78 print "Parrot Version $parrot_version Configure\n";
79 print '$Id$' . "\n";
80 exit;
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
81 }
82
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
83 if($opt_help) {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
84 print <<"EOT";
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
85 $0 - Parrot Configure
86 Options:
c15d8e5 Added 'reconfig' make target and corresponding --reconfig option to
Gregor N. Purdy authored
87 --reconfig Reconfigure with saved options
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
88 --debugging Enable debugging
89 --defaults Accept all default values
90 --define name=value Defines value name as value
91 --help This text
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
92 --version Show version
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
93 EOT
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
94 exit;
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
95 }
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
96
c15d8e5 Added 'reconfig' make target and corresponding --reconfig option to
Gregor N. Purdy authored
97
98 #
99 # If we didn't just reconfig, store the config options out to config.opt.
100 #
101
102 if (!$reconfig) {
103 open OPTS, ">config.opt" or die "Could not open config.opt for writing!";
104 print OPTS "debugging\n" if $opt_debugging;
105 print OPTS "defaults\n" if $opt_defaults;
106 print(OPTS map { sprintf "define %s=%s\n", $_, $opt_defines{$_}; } keys %opt_defines) if %opt_defines;
107 close OPTS;
108 }
109
110
111 #
112 #
113 #
114
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
115 my($DDOK)=undef;
116 eval {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
117 require Data::Dumper;
118 Data::Dumper->import();
119 $DDOK=1;
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
120 };
121
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
122 #
123 # print the header
124 #
125
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
126 print <<"END";
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
127 Parrot Version $parrot_version Configure
128 Copyright (C) 2001-2002 Yet Another Society
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
129
130 Since you're running this script, you obviously have
131 Perl 5--I'll be pulling some defaults from its configuration.
132
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
133 Checking the MANIFEST to make sure you have a complete Parrot kit...
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
134 END
135
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
136 check_manifest();
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
137
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
138 #
139 # Some versions don't seem to have ivtype or nvtype--provide
140 # defaults for them.
141 # XXX Figure out better defaults
142 #
88663c9 Initial JIT implementation.
Gregor N. Purdy authored
143
729af11 Attempt to fix Win32 builds.
Gregor N. Purdy authored
144 my ($archname, $cpuarch, $osname);
ee77a0a Both test_parrot (via test_main.c) and the intepreter itself (via
Gregor N. Purdy authored
145 my ($jitarchname, $jitcpuarch, $jitosname, $jitcapable);
88663c9 Initial JIT implementation.
Gregor N. Purdy authored
146
729af11 Attempt to fix Win32 builds.
Gregor N. Purdy authored
147 $archname = $Config{archname};
148 ($cpuarch, $osname) = split('-', $archname);
a3ee23b Fix a warning when there's no - in an architecture
Dan Sugalski authored
149 if (!defined $osname) {
150 ($osname, $cpuarch) = ($cpuarch, "");
151 }
729af11 Attempt to fix Win32 builds.
Gregor N. Purdy authored
152
55f5eb2 Make jitarch calculation not get tripped up by extra components to
Gregor N. Purdy authored
153 $jitarchname = "$cpuarch-$osname";
c43e508 Detect if we can use "objdump".
Daniel Grunblatt authored
154 $jitarchname =~ s/i[456]86/i386/i;
729af11 Attempt to fix Win32 builds.
Gregor N. Purdy authored
155 $jitarchname =~ s/-(net|free|open)bsd$/-bsd/i;
c43e508 Detect if we can use "objdump".
Daniel Grunblatt authored
156 $jitcapable = 0;
ee77a0a Both test_parrot (via test_main.c) and the intepreter itself (via
Gregor N. Purdy authored
157
ae993d1 @rspier Updates related to moving files around
rspier authored
158 if (-e "lib/Parrot/Jit/$jitarchname.pm") {
c43e508 Detect if we can use "objdump".
Daniel Grunblatt authored
159 my $objdump_test = `objdump -V`;
160 if(defined($objdump_test)){
161 $jitcapable = 1 if($objdump_test =~ /GNU\s+objdump/)
162 }
ee77a0a Both test_parrot (via test_main.c) and the intepreter itself (via
Gregor N. Purdy authored
163 }
c43e508 Detect if we can use "objdump".
Daniel Grunblatt authored
164
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
165 $jitcapable = $opt_defines{jitcapable} if exists $opt_defines{jitcapable};
166
c43e508 Detect if we can use "objdump".
Daniel Grunblatt authored
167 unless($jitcapable){
ee77a0a Both test_parrot (via test_main.c) and the intepreter itself (via
Gregor N. Purdy authored
168 $jitarchname = 'i386-nojit';
169 }
729af11 Attempt to fix Win32 builds.
Gregor N. Purdy authored
170
171 ($jitcpuarch, $jitosname) = split('-', $jitarchname);
88663c9 Initial JIT implementation.
Gregor N. Purdy authored
172
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
173 my(%c)=(
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
174 iv => ($Config{ivtype} || 'long'),
175 intvalsize => undef,
176
177 nv => ($Config{nvtype} || 'double'),
178 numvalsize => undef,
179
180 opcode_t => ($Config{ivtype} || 'long'),
181 longsize => undef,
182
fe31287 This patch adds macros to the config.h file for INTVAL and NUMVAL printf
Dan Sugalski authored
183 intvalfmt => '%ld',
3e12d79 Change NUMVAL_FMT to FLOATVAL_FMT.
Dan Sugalski authored
184 floatvalfmt => '%f',
fe31287 This patch adds macros to the config.h file for INTVAL and NUMVAL printf
Dan Sugalski authored
185
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
186 cc => $Config{cc},
187
188 #
189 # ADD C COMPILER FLAGS HERE
190 #
191
192 ccflags => $Config{ccflags},
29678fb Make GCC pickier by default.
Dan Sugalski authored
193 cc_inc => "-I./include",
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
194 libs => $Config{libs},
195 cc_debug => '-g',
29678fb Make GCC pickier by default.
Dan Sugalski authored
196 cc_warn => '',
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
197 o => '.o', # object files extension
1a991cb Fixes to get things configuring and building on Win32 Native.
Dan Sugalski authored
198 exe => $Config{_exe}, # executable files extension
199 cc_o_out => '-o ', # cc object output file
200 cc_exe_out => '-o ', # cc executable output file (different on Win32)
c81bf80 Makes config's building of the test programs happier.
Dan Sugalski authored
201
202 cc_ldflags => '', # prefix for ldflags (necessary for Win32)
203
204 cc_ldflags => '', # prefix for ldflags (necessary for Win32)
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
205
206 ld => $Config{ld},
7ae03f5 Add link flags as separate things
Dan Sugalski authored
207 ldflags => $Config{ldflags},
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
208 ld_out => '-o ', # ld output file
209 ld_debug => '', # include debug info in executable
210
211 perl => $^X,
f6b381b Fixed linking to use linker.
Dan Sugalski authored
212 test_prog => 'test_parrot',
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
213 debugging => $opt_debugging,
214 rm_f => 'rm -f',
a6357f6 Makes cleanup better on non-Unix platforms
Dan Sugalski authored
215 rm_rf => 'rm -rf',
cd97417 Updated 64-bit patch
Dan Sugalski authored
216 stacklow => '(~0xfffu)',
217 intlow => '(~0xfffu)',
218 numlow => '(~0xfffu)',
219 strlow => '(~0xfffu)',
220 pmclow => '(~0xfffu)',
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
221 make => $Config{make},
222 make_set_make => $Config{make_set_make},
223
224 platform => $^O,
225
226 cpuarch => $cpuarch,
227 osname => $osname,
228 archname => $archname,
229
230 jitcpuarch => $jitcpuarch,
231 jitosname => $jitosname,
232 jitarchname => $jitarchname,
233 jitcapable => $jitcapable,
7286545 Link jit.o only on supported plataforms
Daniel Grunblatt authored
234 cc_hasjit => '',
235 jit_h => '',
236 jit_struct_h => '',
237 jit_o => '',
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
238
239 cp => 'cp',
240 slash => '/',
241
242 VERSION => $parrot_version,
243 MAJOR => $parrot_version[0],
244 MINOR => $parrot_version[1],
245 PATCH => $parrot_version[2],
633d178 It adds a prompt to Configure asking for a list of opcode files
Dan Sugalski authored
246
247 ops => "",
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
248 );
249
179a33f Added in a platform-independent quote substitution for the makefiles.
Dan Sugalski authored
250 # What's the platform shell quote character?
3639e32 Minor Windows tweak
Dan Sugalski authored
251 if ($^O eq 'VMS' || $^O =~ /MSWin/i) {
179a33f Added in a platform-independent quote substitution for the makefiles.
Dan Sugalski authored
252 $c{PQ} = '"';
253 } else {
254 $c{PQ} = "'";
255 }
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
256
73aa2c3 Get the ccname from either ccname or just cc config var.
Gregor N. Purdy authored
257 #
29678fb Make GCC pickier by default.
Dan Sugalski authored
258 # If using gcc, crank up its warnings as much as possible and make it behave
259 # ansi-ish.
73aa2c3 Get the ccname from either ccname or just cc config var.
Gregor N. Purdy authored
260 #
261 # Some Perl versions put this in Config variable 'ccname', others in 'cc'. We
262 # prefer the former, but accept the latter.
263 #
264
265 my $ccname = $Config{ccname} || $Config{cc};
266
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
267 # Make one more check before allowing the use of the JIT code.
268 # make sure that their choice of compiler and cflags will allow our JIT's
269 # non-ansi use of function pointers.
270 #
271
7286545 Link jit.o only on supported plataforms
Daniel Grunblatt authored
272 # Add the -DHAS_JIT if we're jitcapable
273 if ($jitcapable) {
d5ea0c2 - Added support for ALPHA, by now linux and bsd.
Daniel Grunblatt authored
274 $c{cc_hasjit} = " -DHAS_JIT -D" . uc $jitcpuarch;
7286545 Link jit.o only on supported plataforms
Daniel Grunblatt authored
275 $c{jit_h} = "\$(INC)/jit.h";
276 $c{jit_struct_h} = "\$(INC)/jit_struct.h";
277 $c{jit_o} = "jit\$(O)";
278 }
29678fb Make GCC pickier by default.
Dan Sugalski authored
279
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
280 #
281 # Copy the things from --define foo=bar
282 #
283
5cac2b3 @brentdax Cleaner VMS support, more info for Parrot::Config to remember, more f…
brentdax authored
284 @c{keys %opt_defines}=values %opt_defines;
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
285
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
286
287 #
288 # Set up default values
289 #
290
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
291 my $hints = "hints/" . lc($^O) . ".pl";
292 if(-f $hints) {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
293 local($/);
294 open HINT, "< $hints" or die "Unable to open hints file '$hints'";
295 my $hint = <HINT>;
296 close HINT;
c350c37 Stupid thinko fix
Dan Sugalski authored
297 eval $hint; die "Error in hints file $hints: '$@/$!'" if $@;
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
298 }
299
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
300
301 #
302 # Ask questions
303 #
304
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
305 prompt("What C compiler do you want to use?", 'cc');
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
306 prompt("How about your linker?", 'ld');
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
307 prompt("What flags would you like passed to your C compiler?", 'ccflags');
7ae03f5 Add link flags as separate things
Dan Sugalski authored
308 prompt("What flags would you like passed to your linker?", 'ldflags');
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
309 prompt("Which libraries would you like your C compiler to include?", 'libs');
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
310 prompt("How big would you like integers to be?", 'iv');
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
311 prompt("And your floats?", 'nv');
7af7b70 Changed opcode_t from a union to a configurable type.
Tanton Gibbs authored
312 prompt("What is your native opcode type?", 'opcode_t');
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
313
633d178 It adds a prompt to Configure asking for a list of opcode files
Dan Sugalski authored
314
315 {
316 my(@ops)=glob("*.ops");
317
318 $c{ops}=join ' ', sort {
319 if ($a eq 'core.ops') { -1 }
320 elsif($b eq 'core.ops') { 1 }
321 else { $a cmp $b }
d676d4c This patch cleans up most of the MSVC-warnings when using warning lev…
Dan Sugalski authored
322 } grep {!/obscure\.ops/ && !/vtable\.ops/} @ops;
633d178 It adds a prompt to Configure asking for a list of opcode files
Dan Sugalski authored
323
324 my $msg;
325
326 chomp($msg=<<"END");
327
328 Now I have to find out what opcode files you would like to compile into your
329 Parrot.
330
331 The following opcode files are available:
332 @ops
333
334 WARNING: Bad Things may happen if the first file on the list isn't core.ops.
335
336 WARNING: These file names will not be checked for spelling, and typing them
337 wrong will force you to run Configure again.
338
339 WARNING: I worry way too much about Configure users.
340
341 Which opcode files would you like?
342 END
343
344 prompt($msg, 'ops');
345 }
346
347
1458b5b Better GCC detection (and version detection) with really cranky
Dan Sugalski authored
348 print <<"END";
349
350 Determining if your C compiler is actually gcc (this could take a while):
351
352 END
353
354 {
355 my %gnuc;
356
357 compiletestc("test_gnuc");
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
358 %gnuc=eval(runtestc("test_gnuc")) or die "Can't run the test program: $!";
359 cleantestc("test_gnuc");
1458b5b Better GCC detection (and version detection) with really cranky
Dan Sugalski authored
360
361 unless (exists $gnuc{__GNUC__}) {
633d178 It adds a prompt to Configure asking for a list of opcode files
Dan Sugalski authored
362 print <<'END';
1458b5b Better GCC detection (and version detection) with really cranky
Dan Sugalski authored
363
364 The test program didn't give the expected result - assuming your compiler is
365 not gcc.
366
367 END
368
369 } else {
370 my $major = $gnuc{__GNUC__};
371 my $minor = $gnuc{__GNUC_MINOR__};
372 unless (defined $major) {
633d178 It adds a prompt to Configure asking for a list of opcode files
Dan Sugalski authored
373 print <<'END';
1458b5b Better GCC detection (and version detection) with really cranky
Dan Sugalski authored
374
375 Your C compiler is not gcc.
376
377 END
378 } else {
379 print "Your C compiler reports itself as gcc, major version $major";
380 print ", minor version $minor" if defined $minor;
199d784 Fix for non-gcc systems
Dan Sugalski authored
381
382 print ".\n\n";
383 if ($major =~ tr/0-9//c) {
384 print "major version '$major' is not an integer",
385 " - I don't think that this is gcc.";
386 undef $major; # Don't use it
387 }
388 if (defined $minor and $minor =~ tr/0-9//c) {
389 print "minor version '$minor' is not an integer.";
390 undef $minor; # Don't use it
391 }
392 if (defined $major) {
393 $c{gccversion} = $major;
394 $c{gccversion} .= ".$minor" if defined $minor;
395 }
1458b5b Better GCC detection (and version detection) with really cranky
Dan Sugalski authored
396 }
397 }
398 }
399
400 if ($c{gccversion}) {
401 # If using gcc, crank up its warnings as much as possible and make it
402 # behave ansi-ish.
403 # Here's an attempt at a list of nasty things we can use for a given
404 # version of gcc. The earliest documentation I currently have access to is
405 # for 2.95, so I don't know what version everything came in at. If it turns
406 # out that you're using 2.7.2 and -Wfoo isn't recognised there, move it up
407 # into the next version becone (2.8)
408
4535860 I think the optimal fix here is simply to remove -ansi -pedantic.
Dan Sugalski authored
409 # Don't use -ansi -pedantic. It makes it much harder to compile
410 # using the system headers, which may well be tuned to a
411 # non-strict environment -- especially since we are using perl5
412 # compilation flags determined in a non-strict environment.
413 # An example is Solaris 8.
414
1458b5b Better GCC detection (and version detection) with really cranky
Dan Sugalski authored
415 my @opt_and_vers =
4535860 I think the optimal fix here is simply to remove -ansi -pedantic.
Dan Sugalski authored
416 (0 => "-Wall -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Winline -W -Wsign-compare -Wno-unused",
1458b5b Better GCC detection (and version detection) with really cranky
Dan Sugalski authored
417 # others; ones we might like marked with ?
418 # ? -Wundef for undefined idenfiers in #if
419 # ? -Wbad-function-cast
420 # Warn whenever a function call is cast to a non-matching type
421 # ? -Wmissing-declarations
422 # Warn if a global function is defined without a previous declaration
423 # -Wmissing-noreturn
424 # ? -Wredundant-decls
425 # Warn if anything is declared more than once in the same scope,
426 # ? -Wnested-externs
427 # Warn if an `extern' declaration is encountered within an function.
428 # -Wlong-long
429 # Ha. this is the default! with -pedantic.
430 # -Wno-long-long for the nicest bit of C99
431 2.7 => "",
432 2.8 => "",
433 2.95 => "",
434 3.0 => "-Wformat-nonliteral -Wformat-security -Wpacked -Wpadded -Wdisabled-optimization",
435 # -Wsequence-point is part of -Wall
436 # -Wfloat-equal may not be what we want
437 # We shouldn't be using __packed__, but I doubt -Wpacked will harm us
438 # -Wpadded may prove interesting, or even noisy.
439 # -Wunreachable-code might be useful in a non debugging version
440 );
a37a105 Add -Wno-shadow, as Darwin's headers can't cope with this. Darwin-only
Dan Sugalski authored
441 my $warns = "";
1458b5b Better GCC detection (and version detection) with really cranky
Dan Sugalski authored
442 while (my ($vers, $opt) = splice @opt_and_vers, 0, 2) {
443 last if $vers > $c{gccversion};
444 next unless $opt; # Ignore blank lines
a37a105 Add -Wno-shadow, as Darwin's headers can't cope with this. Darwin-only
Dan Sugalski authored
445 $warns .= " $opt";
1458b5b Better GCC detection (and version detection) with really cranky
Dan Sugalski authored
446 }
a37a105 Add -Wno-shadow, as Darwin's headers can't cope with this. Darwin-only
Dan Sugalski authored
447 $c{cc_warn} = $warns . " " . $c{cc_warn};
448
1458b5b Better GCC detection (and version detection) with really cranky
Dan Sugalski authored
449 prompt("What gcc warning flags do you want to use?", 'cc_warn');
450 }
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
451
452 #
971ed20 Made things a bit more platform-independent. Makefile still
Dan Sugalski authored
453 # Copy the appropriate platform-specific file over
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
454 #
455
971ed20 Made things a bit more platform-independent. Makefile still
Dan Sugalski authored
456 if (-e "platforms/$c{platform}.h") {
457 copy("platforms/$c{platform}.h", "include/parrot/platform.h");
458 copy("platforms/$c{platform}.c", "platform.c");
459 }
460 else {
461 copy("platforms/generic.h", "include/parrot/platform.h");
462 copy("platforms/generic.c", "platform.c");
463 }
464
ff7fa37 Force the time on some copied files to be 'now' to make the Win builds
Dan Sugalski authored
465 my $now = time;
466 utime $now, $now, "include/parrot/platform.h", "platform.c";
467
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
468 unless( $c{debugging} ) {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
469 $c{ld_debug} = ' ';
470 $c{cc_debug} = ' ';
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
471 }
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
472
473 print <<"END";
474
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
475 Probing Perl 5's configuration to determine which headers you have (this could
476 take a while on slow machines)...
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
477 END
478
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
479
480 #
481 # Set up HAS_HEADER_
482 #
483
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
484 foreach(grep {/^i_/} keys %Config) {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
485 $c{$_}=$Config{$_};
486 $c{headers}.=defineifdef((/^i_(.*)$/));
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
487 }
488
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
489 print <<"END";
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
490
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
491 Determining C data type sizes by compiling and running a small C program (this
492 could take a while):
493
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
494 END
495
5cac2b3 @brentdax Cleaner VMS support, more info for Parrot::Config to remember, more f…
brentdax authored
496 {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
497 my %newc;
19fa0d4 @tomhughes Stop Configure trying to make op_info.c and op.h as op_info.c no longer
tomhughes authored
498
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
499 buildfile("test_c");
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
500 compiletestc("test");
501 %newc=eval(runtestc("test")) or die "Can't run the test program: $!";
5cac2b3 @brentdax Cleaner VMS support, more info for Parrot::Config to remember, more f…
brentdax authored
502
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
503 @c{keys %newc}=values %newc;
5cac2b3 @brentdax Cleaner VMS support, more info for Parrot::Config to remember, more f…
brentdax authored
504
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
505 cleantestc("test");
506 unlink('test.c');
4c1a2b9 VMS tweaks
Dan Sugalski authored
507 }
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
508
509 print <<"END";
510
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
511 Figuring out the formats to pass to pack() for the various Parrot internal
512 types...
6fba438 @simoncozens Abstract the argument and opcode packing types and functions out into
simoncozens authored
513 END
514
e5cb406 @brentdax More changes for 64-bit compatibility
brentdax authored
515
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
516 #
9a97be1 @simoncozens The Great Renaming.
simoncozens authored
517 # Alas perl5.7.2 doesn't have an INTVAL flag for pack().
6fba438 @simoncozens Abstract the argument and opcode packing types and functions out into
simoncozens authored
518 # The ! modifier only works for perl 5.6.x or greater.
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
519 #
520
9a97be1 @simoncozens The Great Renaming.
simoncozens authored
521 foreach ('intvalsize', 'opcode_t_size') {
522 my $which = $_ eq 'intvalsize' ? 'packtype_i' : 'packtype_op';
51ff847 Quad updates.
Dan Sugalski authored
523 my $format;
c499a4e Allow 64-bit build of parrot on systems with a mixed 32/64 bit perl
Dan Sugalski authored
524 if (($] >= 5.006) && ($c{$_} == $c{longsize}) && ($c{$_} == $Config{longsize}) ) {
51ff847 Quad updates.
Dan Sugalski authored
525 $format = 'l!';
e5cb406 @brentdax More changes for 64-bit compatibility
brentdax authored
526 }
527 elsif ($c{$_} == 4) {
51ff847 Quad updates.
Dan Sugalski authored
528 $format = 'l';
e5cb406 @brentdax More changes for 64-bit compatibility
brentdax authored
529 }
d5ea0c2 - Added support for ALPHA, by now linux and bsd.
Daniel Grunblatt authored
530 elsif ($c{$_} == 8 || $Config{use64bitint} eq 'define') {
51ff847 Quad updates.
Dan Sugalski authored
531 # pp_pack is annoying, and this won't work unless sizeof(UV) >= 8
532 $format = 'q';
e5cb406 @brentdax More changes for 64-bit compatibility
brentdax authored
533 }
51ff847 Quad updates.
Dan Sugalski authored
534 die "Configure.pl: Unable to find a suitable packtype for $_.\n"
535 unless $format;
536
537 my $test = eval {pack $format, 0};
538 unless (defined $test) {
539 die <<"AARGH"
540 Configure.pl: Unable to find a functional packtype for $_.
541 '$format' failed: $@
542 AARGH
543 }
544 unless (length $test == $c{$_}) {
545 die sprintf <<"AARGH", $c{$_}, length $test;
546 Configure.pl: Unable to find a functional packtype for $_.
547 Need a format for %d bytes, but '$format' gave %d bytes.
548 AARGH
549 }
550 $c{$which} = $format;
6fba438 @simoncozens Abstract the argument and opcode packing types and functions out into
simoncozens authored
551 }
552
553 $c{packtype_n} = 'd';
554
cd97417 Updated 64-bit patch
Dan Sugalski authored
555 #
556 # Find out what integer constant type we can use
557 # for pointers.
558 #
559
560 print "Figuring out what integer type we can mix with pointers...\n";
561
562 if ($c{intsize} == $c{ptrsize}) {
563 print "We'll use 'unsigned int'.\n";
564 $c{ptrconst} = "u";
565 } elsif ($c{longsize} == $c{ptrsize}) {
566 print "We'll use 'unsigned long'.\n";
567 $c{ptrconst} = "ul";
568 } else {
569 die <<"AARGH";
570 Configure.pl: Unable to find an integer type that fits a pointer.
571 AARGH
572 }
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
573
fe31287 This patch adds macros to the config.h file for INTVAL and NUMVAL printf
Dan Sugalski authored
574 #"
575 # Determine format strings for INTVAL and FLOATVAL.
576 #
577
578 if ($c{iv} eq "int") {
579 $c{intvalfmt} = "%d";
580 } elsif (($c{iv} eq "long") || ($c{iv} eq "long int")) {
581 $c{intvalfmt} = "%ld";
582 } elsif (($c{iv} eq "long long") || ($c{iv} eq "long long int")) {
583 $c{intvalfmt} = "%lld";
584 } else {
585 die "Configure.pl: Can't find a printf-style format specifier for type \"$c{iv}\"\n";
586 }
587
588 if ($c{nv} eq "double") {
3e12d79 Change NUMVAL_FMT to FLOATVAL_FMT.
Dan Sugalski authored
589 $c{floatvalfmt} = "%f";
fe31287 This patch adds macros to the config.h file for INTVAL and NUMVAL printf
Dan Sugalski authored
590 } elsif ($c{nv} eq "long double") {
3e12d79 Change NUMVAL_FMT to FLOATVAL_FMT.
Dan Sugalski authored
591 $c{floatvalfmt} = "%lf";
fe31287 This patch adds macros to the config.h file for INTVAL and NUMVAL printf
Dan Sugalski authored
592 } else {
593 die "Configure.pl: Can't find a printf-style format specifier for type \"$c{nv}\"\n";
594 }
595
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
596 #
597 # Build config.h, the Makfefiles and Types.pm:
598 #
599 # Also build Parrot/Config.pm
600 #
601
6fba438 @simoncozens Abstract the argument and opcode packing types and functions out into
simoncozens authored
602 print <<"END";
603
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
604 Building a preliminary version of include/parrot/config.h, your Makefiles, and
605 other files:
606
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
607 END
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
608
62bace3 Committed some files that were missed in the last *.h moving commmit.
Gregor N. Purdy authored
609 buildfile("config_h", "include/parrot");
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
610
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
611 buildfile("Makefile");
133486e (Hopefully the last time...)
Jeff Goff authored
612 buildfile("classes/Makefile");
a6357f6 Makes cleanup better on non-Unix platforms
Dan Sugalski authored
613 buildfile("docs/Makefile");
38f17ac Added a 'languages' target to the top-level Makefile.in, and modified…
Gregor N. Purdy authored
614 buildfile("languages/Makefile");
615 buildfile("languages/jako/Makefile");
04ce4cd Build tweaks.
Dan Sugalski authored
616 buildfile("languages/miniperl/Makefile");
617 buildfile("languages/scheme/Makefile");
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
618
ae993d1 @rspier Updates related to moving files around
rspier authored
619 buildfile("Types_pm", "lib/Parrot");
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
620
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
621 buildconfigpm();
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
622 print "\n";
623
624
625 if ($jitcapable) {
626 print "Verifying that the compiler supports function pointer casts...\n";
627 eval { compiletestc("testparrotfuncptr"); };
628
629 if ($@ || !(runtestc("testparrotfuncptr") =~ /OK/)) {
630 print "Although it is not required by the ANSI C standard,\n";
631 print "Parrot requires the ability to cast from void pointers to function\n";
632 print "pointers for its JIT support.\n\n";
633 print "Your compiler does not appear to support this behavior with the\n";
634 print "flags you have specified. You must adjust your settings in order\n";
635 print "to use the JIT code.\n\n";
636 print "If you wish to continue without JIT support, please re-run this script\n";
637 print "With the '--define jitcapable=0' argument.\n";
638 exit(-1);
639 }
640 cleantestc("testparrotfuncptr");
641 }
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
642
643
644 #
645 # And now we figure out how big our things are
646 #
647
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
648 print <<"END";
649
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
650 Checking some things by compiling and running another small C program (this
651 could take a while):
652
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
653 END
654
655 {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
656 my %newc;
19fa0d4 @tomhughes Stop Configure trying to make op_info.c and op.h as op_info.c no longer
tomhughes authored
657
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
658 open NEEDED, ">include/parrot/vtable.h";
cf0e967 @simoncozens Make lcc happier by adding a dummy structure.
simoncozens authored
659 print NEEDED "/* dummy */ struct _vtable { int a; };\n";
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
660 close NEEDED;
661 buildfile("testparrotsizes_c");
662 compiletestc("testparrotsizes");
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
663 %newc=eval(runtestc("testparrotsizes"))
664 or die "Can't run the test program: $!";
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
665 @c{keys %newc}=values %newc;
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
666
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
667 @c{qw(stacklow intlow numlow strlow pmclow)} = lowbitmask(@c{qw(stackchunk iregchunk nregchunk sregchunk pregchunk)});
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
668
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
669 cleantestc("testparrotsizes");
670 unlink('testparrotsizes.c');
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
671 unlink("include/parrot/vtable.h");
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
672 }
673
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
674
675 #
676 # Rewrite the config file with the updated info
677 #
678
679 print <<"END";
680
681 Updating include/parrot/config.h:
682
683 END
684
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
685 buildfile("config_h", "include/parrot");
686
083fd66 Nuke all object files in the parrot tree that matter when configuring.
Dan Sugalski authored
687 # Toss old .o files
688 foreach my $dir ("./", "classes/", "encodings/", "chartypes/") {
689 foreach my $file (glob($dir . "*". $c{o})) {
690 1 while unlink $file;
691 }
692 }
693
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
694
695 #
696 # Wrap up:
697 #
698
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
699 print <<"END";
700
701 Okay, we're done!
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
702
703 You can now use `make' (or your platform's equivalent to `make') to build your
704 Parrot. After that, you can use `make test' to run the test suite.
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
705
706 Happy Hacking,
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
707
708 The Parrot Team
709
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
710 END
711
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
712 exit(0);
713
714
715 ###############################################################################
716 ###############################################################################
717 ##
718 ## Support Subroutines
719 ##
720 ###############################################################################
721 ###############################################################################
722
723
724 #
725 # defineifdef()
726 #
727 # Give us the #define we may need for header X
728 #
729
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
730 sub defineifdef {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
731 my $thing=shift;
732
733 if($Config{"i_$thing"}) {
734 return "#define HAS_HEADER_\U$thing\E\n";
735 }
736 else {
737 return "#undef HAS_HEADER_\U$thing\E\n"; #XXX do we want this?
738 }
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
739 }
740
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
741
742 #
743 # prompt()
744 #
745 # Prompt for something from the user.
746 #
747
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
748 sub prompt {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
749 return if $opt_defaults;
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
750
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
751 my($message, $field)=(@_);
752 my($input);
753 print "$message [$c{$field}] ";
754 chomp($input=<STDIN>);
633d178 It adds a prompt to Configure asking for a list of opcode files
Dan Sugalski authored
755
71472c5 @simoncozens Gobble the + before catenating.
simoncozens authored
756 if($input =~ s/^\+//) {
fd337a3 @brentdax Fixes the + thing in prompts, plus adds a synonym (:add{foo}) and a n…
brentdax authored
757 $input="$c{$field} $input";
758 }
759 else {
760 if($input =~ s/:rem\{(.*?)\}//) {
761 $c{$field} =~ s/$_//g for split / /, $1;
762 }
763
764 if($input =~ s/:add\{(.*?)\}//) {
765 $input="$c{$field} $1 $input";
766 }
767 }
768
769 $c{$field}=$input||$c{$field};
633d178 It adds a prompt to Configure asking for a list of opcode files
Dan Sugalski authored
770
fd337a3 @brentdax Fixes the + thing in prompts, plus adds a synonym (:add{foo}) and a n…
brentdax authored
771 print "$field=$c{$field}\n";
11b744f @simoncozens Configure system from Brent Dax <brentdax@cpan.org>
simoncozens authored
772 }
773
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
774
775 #
776 # buildfile()
777 #
778
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
779 sub buildfile {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
780 my($source_filename, $path)=@_;
781 $path||='.';
782
783 my $target_filename = $source_filename;
784 $target_filename =~ s/_/./; #config_h => config.h
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
785
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
786 printf " Building %-30s from %s...\n", "$path/$target_filename",
787 "$source_filename.in";
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
788
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
789 local $/;
790 open(IN, "<$source_filename.in") or die "Can't open $source_filename.in: $!";
791 my $text=<IN>;
792 close(IN) or die "Can't close $source_filename.in: $!";
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
793
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
794 $text =~ s/\$\{(\w+)\}/$c{$1}/g;
f2133f9 Minor Win32 tweaks. Tossed -Wtraditional, too
Dan Sugalski authored
795 $text =~ s/\cM//g; # Potental drek on Win32
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
796 open(OUT, ">$path/$target_filename") or die "Can't open $path/$target_filename: $!";
797 print OUT $text;
798 close(OUT) or die "Can't close $target_filename: $!";
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
799 }
800
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
801
802 #
803 # buildconfigpm()
804 #
805
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
806 sub buildconfigpm {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
807 unless($DDOK) {
808 print <<"END";
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
809
810 Your system doesn't have Data::Dumper installed, so I couldn't
811 build Parrot::Config. If you want Parrot::Config installed,
812 use CPAN.pm to install Data::Dumper and run this script again.
813 END
814
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
815 return;
816 }
817
ae993d1 @rspier Updates related to moving files around
rspier authored
818 printf " Building %-30s from %s...\n", "lib/Parrot/Config.pm",
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
819 "Config_pm.in";
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
820
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
821 my %C=%c;
822 delete $C{headers};
823 my $dd=new Data::Dumper([\%C]);
824 $dd->Names(['*PConfig']);
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
825
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
826 local $/;
827 open(IN, "<Config_pm.in") or die "Can't open Config_pm.in: $!";
828 my $text=<IN>;
829 close(IN) or die "Can't close Config.pm_in: $!";
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
830
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
831 $text =~ s/#DUMPER OUTPUT HERE/$dd->Dump()/eg;
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
832
ae993d1 @rspier Updates related to moving files around
rspier authored
833 open(OUT, ">lib/Parrot/Config.pm") or die "Can't open file lib/Parrot/Config.pm: $!";
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
834 print OUT $text;
ae993d1 @rspier Updates related to moving files around
rspier authored
835 close(OUT) or die "Can't close file lib/Parrot/Config.pm: $!";
1d93957 @simoncozens Configure now generates Makefile
simoncozens authored
836 }
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
837
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
838
839 #
840 # check_manifest()
841 #
842
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
843 sub check_manifest {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
844 print "\n";
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
845
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
846 my(@missing)=manicheck();
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
847
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
848 if(@missing) {
849 print <<"END";
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
850
851 Ack, some files were missing! I can't continue running
19fa0d4 @tomhughes Stop Configure trying to make op_info.c and op.h as op_info.c no longer
tomhughes authored
852 without everything here. Please try to find the above
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
853 files and then try running Configure again.
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
854
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
855 END
59345b3 @brentdax Fix issues with ivsize and nvsize
brentdax authored
856
07a9afe @simoncozens Die on broken manifest.
simoncozens authored
857 exit 1;
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
858 }
859 else {
860 print <<"END";
19fa0d4 @tomhughes Stop Configure trying to make op_info.c and op.h as op_info.c no longer
tomhughes authored
861 Okay, we found everything. Next you'll need to answer
633d178 It adds a prompt to Configure asking for a list of opcode files
Dan Sugalski authored
862 a few questions about your system. Defaults are in square
863 brackets, and you can hit enter to accept them. If you
864 don't want the default, type a new value in. If that new
865 value starts with a '+', it will be concatenated to the
866 default value.
205f653 @brentdax Win32 compatibility, Configure hints, 5.005 compatibility, MANIFEST c…
brentdax authored
867
868 END
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
869 }
62bace3 Committed some files that were missed in the last *.h moving commmit.
Gregor N. Purdy authored
870 }
5cac2b3 @brentdax Cleaner VMS support, more info for Parrot::Config to remember, more f…
brentdax authored
871
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
872
873 #
874 # compiletestc()
875 #
876
5cac2b3 @brentdax Cleaner VMS support, more info for Parrot::Config to remember, more f…
brentdax authored
877 sub compiletestc {
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
878 my ($name) = @_;
879
880 my $cmd = "$c{cc} $c{ccflags} -I./include -c $c{ld_out} $name$c{o} $name.c";
881 system($cmd) and die "C compiler died! Command was '$cmd'\n";
882
883 $cmd = "$c{ld} $c{ldflags} $c{libs} $name$c{o} $c{cc_exe_out}$name$c{exe}";
884 system($cmd) and die "Linker died! Command was '$cmd'\n";
5cac2b3 @brentdax Cleaner VMS support, more info for Parrot::Config to remember, more f…
brentdax authored
885 }
886
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
887
888 #
889 # runtestc()
890 #
891
5cac2b3 @brentdax Cleaner VMS support, more info for Parrot::Config to remember, more f…
brentdax authored
892 sub runtestc {
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
893 my ($name) = @_;
894
895 my $cmd = "$name$c{exe}";
896 `./$cmd`;
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
897 }
898
43a606a This patch allows parrot to mostly-build with tcc. It allows one to …
Dan Sugalski authored
899 #
900 # cleantestc
901 #
902
903 sub cleantestc {
904 my ($name) = @_;
905
906 unlink("$name$c{o}", "$name$c{exe}");
907 }
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
908
909 #
910 # lowbitmas()
911 #
912 # Find the bitmask for the low bits of any passed-in size.
913 #
914
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
915 sub lowbitmask {
916 my @returns;
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
917
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
918 foreach (@_) {
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
919 my $vector = unpack("b*", pack("V", $_));
920 my $offset = rindex($vector, "1")+1;
921 my $mask = 2**$offset - 1;
cd97417 Updated 64-bit patch
Dan Sugalski authored
922 push @returns, "(~0x".sprintf("%x", $mask).$c{ptrconst}.")";
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
923 }
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
924
9d000b4 Made the changes to figure out mask bits for various register and stack
Dan Sugalski authored
925 return @returns;
926 }
a3cd162 Build enhancements. Originally to support building shared libraries, …
Gregor N. Purdy authored
927
Something went wrong with that request. Please try again.