Permalink
Browse files

Configure.pl 2.0.

git-svn-id: https://svn.parrot.org/parrot/trunk@1526 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent cd206e9 commit 0fc6ac68e985ea3b44b63ddf38e1b1cce3349b49 @brentdax brentdax committed May 24, 2002
Showing with 2,105 additions and 1,015 deletions.
  1. +189 −957 Configure.pl
  2. +47 −25 MANIFEST
  3. +2 −1 MANIFEST.SKIP
  4. +35 −0 config/auto/byteorder.pl
  5. +22 −0 config/auto/byteorder/test_c.in
  6. +48 −0 config/auto/cgoto.pl
  7. 0 testcomputedgoto_c.in → config/auto/cgoto/test_c.in
  8. +47 −0 config/auto/format.pl
  9. +37 −0 config/auto/funcptr.pl
  10. 0 testparrotfuncptr.c → config/auto/funcptr/test_c.in
  11. +96 −0 config/auto/gcc.pl
  12. 0 test_gnuc.c → config/auto/gcc/test_c.in
  13. +19 −0 config/auto/headers.pl
  14. +71 −0 config/auto/jit.pl
  15. +76 −0 config/auto/pack.pl
  16. +30 −0 config/auto/sizes.pl
  17. 0 { → config/auto/sizes}/test_c.in
  18. +31 −0 config/gen/config_h.pl
  19. +5 −2 { → config/gen/config_h}/config_h.in
  20. +25 −0 config/gen/config_pm.pl
  21. +1 −1 { → config/gen/config_pm}/Config_pm.in
  22. +21 −0 config/gen/makefiles.pl
  23. +84 −0 config/gen/makefiles/classes.in
  24. +22 −0 config/gen/makefiles/docs.in
  25. +97 −0 config/gen/makefiles/jako.in
  26. +21 −0 config/gen/makefiles/languages.in
  27. +78 −0 config/gen/makefiles/miniperl.in
  28. 0 Makefile.in → config/gen/makefiles/root.in
  29. +81 −0 config/gen/makefiles/scheme.in
  30. +25 −0 config/gen/platform.pl
  31. +117 −0 config/gen/platform/generic.c
  32. +44 −0 config/gen/platform/generic.h
  33. +114 −0 config/gen/platform/win32.c
  34. +50 −0 config/gen/platform/win32.h
  35. +75 −0 config/init/data.pl
  36. +22 −0 config/init/hints.pl
  37. +3 −0 config/init/hints/cygwin.pl
  38. +13 −0 config/init/hints/darwin.pl
  39. +3 −0 config/init/hints/dec_osf.pl
  40. +63 −0 config/init/hints/mswin32.pl
  41. +12 −0 config/init/hints/os2.pl
  42. +18 −0 config/init/hints/vms.pl
  43. +28 −0 config/init/manifest.pl
  44. +28 −0 config/inter/exp.pl
  45. +50 −0 config/inter/ops.pl
  46. +69 −0 config/inter/progs.pl
  47. +39 −0 config/inter/types.pl
  48. +1 −0 include/parrot/.cvsignore
  49. +0 −1 lib/Parrot/.cvsignore
  50. +53 −0 lib/Parrot/Configure/RunSteps.pm
  51. +88 −0 lib/Parrot/Configure/Step.pm
  52. +5 −4 Types_pm.in → lib/Parrot/Types.pm
  53. +0 −24 testparrotsizes_c.in
View
1,146 Configure.pl

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,26 +1,22 @@
ChangeLog
-Config_pm.in
Configure.pl
DEVELOPING
KNOWN_ISSUES
LICENSES/Artistic
MANIFEST
MANIFEST.SKIP
-Makefile.in
NEWS
README
README.OS_X
RESPONSIBLE_PARTIES
TODO
-Types_pm.in
VERSION
assemble.pl
byteorder.c
chartype.c
chartypes/unicode.c
chartypes/usascii.c
check_source_standards.pl
-classes/Makefile.in
classes/array.pmc
classes/default.pmc
classes/genclass.pl
@@ -33,10 +29,52 @@ classes/perlnum.pmc
classes/perlstring.pmc
classes/perlundef.pmc
classes/pmc2c.pl
-config_h.in
+config/auto/byteorder.pl
+config/auto/byteorder/test_c.in
+config/auto/cgoto.pl
+config/auto/cgoto/test_c.in
+config/auto/format.pl
+config/auto/funcptr.pl
+config/auto/funcptr/test_c.in
+config/auto/gcc.pl
+config/auto/gcc/test_c.in
+config/auto/headers.pl
+config/auto/jit.pl
+config/auto/pack.pl
+config/auto/sizes.pl
+config/auto/sizes/test_c.in
+config/gen/config_h.pl
+config/gen/config_h/config_h.in
+config/gen/config_pm.pl
+config/gen/config_pm/Config_pm.in
+config/gen/makefiles.pl
+config/gen/makefiles/classes.in
+config/gen/makefiles/docs.in
+config/gen/makefiles/jako.in
+config/gen/makefiles/languages.in
+config/gen/makefiles/miniperl.in
+config/gen/makefiles/root.in
+config/gen/makefiles/scheme.in
+config/gen/platform.pl
+config/gen/platform/generic.c
+config/gen/platform/generic.h
+config/gen/platform/win32.c
+config/gen/platform/win32.h
+config/init/data.pl
+config/init/hints.pl
+config/init/hints/cygwin.pl
+config/init/hints/darwin.pl
+config/init/hints/dec_osf.pl
+config/init/hints/mswin32.pl
+config/init/hints/os2.pl
+config/init/hints/vms.pl
+config/init/manifest.pl
+config/inter/exp.pl
+config/inter/ops.pl
+config/inter/progs.pl
+config/inter/types.pl
core.ops
disassemble.pl
-docs/Makefile.in
docs/embed.pod
docs/faq.pod
docs/intro.pod
@@ -105,12 +143,6 @@ examples/mops/mops.scheme
exceptions.c
global_setup.c
hash.c
-hints/cygwin.pl
-hints/darwin.pl
-hints/dec_osf.pl
-hints/mswin32.pl
-hints/os2.pl
-hints/vms.pl
include/parrot/chartype.h
include/parrot/embed.h
include/parrot/encoding.h
@@ -174,7 +206,6 @@ languages/BASIC/sample4.bas
languages/BASIC/stackops.pasm
languages/BASIC/tokenize.pasm
languages/BASIC/wumpus.bas
-languages/Makefile.in
languages/cola/MAINTAINER
languages/cola/Makefile
languages/cola/README
@@ -194,7 +225,6 @@ languages/cola/semant.c
languages/cola/sym.c
languages/cola/type.c
languages/jako/MAINTAINER
-languages/jako/Makefile.in
languages/jako/bench.jako
languages/jako/euclid.jako
languages/jako/fact.jako
@@ -208,7 +238,6 @@ languages/jako/mops.jako
languages/jako/primes.jako
languages/jako/queens.jako
languages/jako/sub.jako
-languages/miniperl/Makefile.in
languages/miniperl/Miniperl.pm
languages/miniperl/Miniperl/Generator.pm
languages/miniperl/Miniperl/Makefile.PL
@@ -252,7 +281,6 @@ languages/regex/t/scanstar.t
languages/regex/t/star.t
languages/regex/t/staralt.t
languages/regex/test.pl
-languages/scheme/Makefile.in
languages/scheme/Scheme.pm
languages/scheme/Scheme/Generator.pm
languages/scheme/Scheme/Parser.pm
@@ -268,6 +296,8 @@ languages/scheme/t/logic/basic.t
lib/Parrot/Assembler.pm
lib/Parrot/Assembler/Utils.pm
lib/Parrot/BuildUtil.pm
+lib/Parrot/Configure/RunSteps.pm
+lib/Parrot/Configure/Step.pm
lib/Parrot/Makefile.PL
lib/Parrot/Op.pm
lib/Parrot/OpTrans.pm
@@ -285,6 +315,7 @@ lib/Parrot/PakFile2.pm
lib/Parrot/PakFile2.xs
lib/Parrot/String.pm
lib/Parrot/Test.pm
+lib/Parrot/Types.pm
lib/Parrot/Vtable.pm
lib/Test/Builder.pm
lib/Test/More.pm
@@ -309,10 +340,6 @@ parrot.c
parrot_coverage.pl
pbc2c.pl
pdump.c
-platforms/generic.c
-platforms/generic.h
-platforms/win32.c
-platforms/win32.h
pmc.c
pmc_pm.pl
register.c
@@ -344,12 +371,7 @@ t/pmc/perlarray.t
t/pmc/perlhash.t
t/pmc/perlstring.t
t/pmc/pmc.t
-test_c.in
-test_gnuc.c
test_main.c
-testcomputedgoto_c.in
-testparrotfuncptr.c
-testparrotsizes_c.in
trace.c
types/bignum.c
types/bignum.h
View
@@ -3,10 +3,10 @@
/\.cvsignore$
CVS/[^/]+$
^include/parrot/config\.h$
+^include/parrot/has_header\.h$
^include/parrot/platform\.h$
^Makefile$
/Makefile$
-^lib/Parrot/Types\.pm$
^lib/Parrot/Config\.pm$
^platform\.c$
^config.opt$
@@ -31,6 +31,7 @@ CVS/[^/]+$
^docs/packfile-c\.pod$
^docs/packfile-perl\.pod$
^docs/core_ops\.pod$
+^docs/io_ops\.pod$
^parrot$
^pdump$
View
@@ -0,0 +1,35 @@
+package Configure::Step;
+
+use strict;
+use vars qw($description @args);
+
+$description="Computing native byteorder for Parrot's wordsize...";
+
+@args=();
+
+sub runstep {
+ cc_gen('config/auto/byteorder/test_c.in');
+ cc_build();
+ my $byteorder=cc_run() or die "Can't run the byteorder testing program: $!";
+ cc_clean();
+
+ chomp $byteorder;
+
+ if($byteorder =~ /^1234/) {
+ Configure::Data->set(
+ byteorder => $byteorder,
+ bigendian => 0
+ );
+ }
+ elsif($byteorder =~ /^(8765|4321)/) {
+ Configure::Data->set(
+ byteorder => $byteorder,
+ bigendian => 1
+ );
+ }
+ else {
+ die "Unsupported byte-order [$byteorder]!";
+ }
+}
+
+1;
@@ -0,0 +1,22 @@
+int main() {
+ int i;
+ union W {
+ unsigned char b[sizeof(${iv})/sizeof(unsigned char)];
+ ${iv} w;
+ } w;
+ if(sizeof(w) == 4) {
+ w.w = 0x04030201;
+ }
+ else {
+ w.w = 0x08070605;
+ w.w <<= 32;
+ w.w |= 0x04030201;
+ }
+
+ for(i = 0; i < sizeof(w.b); i++) {
+ printf("%1u", w.b[i]);
+ }
+ printf("\n");
+ exit(0);
+ return 0;
+}
View
@@ -0,0 +1,48 @@
+package Configure::Step;
+
+use strict;
+use vars qw($description @args);
+use Parrot::Configure::Step ':auto';
+
+$description="Determining if your compiler supports computed goto...";
+
+@args=qw(cgoto);
+
+sub runstep {
+ my $test;
+
+ if(defined $_[0]) {
+ $test=$_[0];
+ }
+ else {
+ cc_gen('config/auto/cgoto/test_c.in');
+ $test=eval { cc_build(); 1; } || 0;
+ cc_clean();
+ }
+
+ if ($test) {
+ Configure::Data->set(
+ cg_h => '$(INC)/oplib/core_ops_cg.h',
+ cg_c => <<'EOF',
+core_ops_cg$(O): $(GENERAL_H_FILES) core_ops_cg.c
+
+core_ops_cg.c $(INC)/oplib/core_ops_cg.h: $(OPS_FILES) ops2cgc.pl lib/Parrot/OpsFile.pm lib/Parrot/Op.pm
+ $(PERL) ops2cgc.pl CGoto $(OPS_FILES)
+EOF
+ cg_o => 'core_ops_cg$(O)',
+ cg_r => '$(RM_F) $(INC)/oplib/core_ops_cg.h core_ops_cg.c',
+ cg_flag => '-DHAVE_COMPUTED_GOTO'
+ );
+ }
+ else {
+ Configure::Data->set(
+ cg_h => '',
+ cg_c => '',
+ cg_o => '',
+ cg_r => '',
+ cg_flag => ''
+ );
+ }
+}
+
+1;
File renamed without changes.
View
@@ -0,0 +1,47 @@
+package Configure::Step;
+
+use strict;
+use vars qw($description @args);
+use Parrot::Configure::Step;
+
+$description = "Figuring out what formats should be used for sprintf...";
+
+@args=();
+
+sub runstep {
+ my($ivformat, $nvformat, $nvsize);
+ my($iv, $nv, $floatsize, $doublesize, $ldsize)=Configure::Data->get(
+ qw(iv nv floatsize doublesize longdoublesize)
+ );
+
+ if ($iv eq "int") {
+ $ivformat = "%d";
+ } elsif (($iv eq "long") || ($iv eq "long int")) {
+ $ivformat = "%ld";
+ } elsif (($iv eq "long long") || ($iv eq "long long int")) {
+ $ivformat = "%lld";
+ } else {
+ die "Configure.pl: Can't find a printf-style format specifier for type \"$iv\"\n";
+ }
+
+ $nvsize = $floatsize;
+ if ($nv eq "double") {
+ $nvsize = $doublesize;
+ $nvformat = "%f";
+ } elsif ($nv eq "long double") {
+ # Stay way from long double for now (it may be 64 or 80 bits)
+ die "long double not supported at this time, use double.";
+ $nvsize = $ldsize;
+ $nvformat = "%lf";
+ } else {
+ die "Configure.pl: Can't find a printf-style format specifier for type \"$nv\"\n";
+ }
+
+ Configure::Data->set(
+ intvalfmt => $ivformat,
+ floatvalfmt => $nvformat,
+ nvsize => $nvsize
+ );
+}
+
+1;
View
@@ -0,0 +1,37 @@
+package Configure::Step;
+
+use strict;
+use vars qw($description @args);
+use Parrot::Configure::Step ':auto';
+
+$description="Verifying that the compiler supports function pointer casts...";
+
+@args=();
+
+sub runstep {
+ my $jitcapable=Configure::Data->get('jitcapable');
+
+ if ($jitcapable) {
+ cc_gen('config/auto/funcptr/test_c.in');
+ eval { cc_build(); };
+
+ if ($@ || cc_run() !~ /OK/) {
+ print <<"END";
+Although it is not required by the ANSI C standard,
+Parrot requires the ability to cast from void pointers to function
+pointers for its JIT support.
+
+Your compiler does not appear to support this behavior with the
+flags you have specified. You must adjust your settings in order
+to use the JIT code.
+
+If you wish to continue without JIT support, please re-run this script
+With the '--jitcapable=0' argument.
+END
+ exit(-1);
+ }
+ cc_clean();
+ }
+}
+
+1;
File renamed without changes.
Oops, something went wrong.

0 comments on commit 0fc6ac6

Please sign in to comment.