| 88 | | my $archlib = `pugs -V:installsitearch`; |
| 89 | | $archlib =~ /installsitearch:\s*(.+)/ or die "Cannot find sitearch"; |
| 90 | | my $core = "$1/CORE/pugs"; |
| 91 | | |
| 92 | | # XXX - Maybe enable -threaded based on config? |
| 93 | | # XXX - This chunk should be read off Pugs config anyway. |
| 94 | | my @ghc_flags = ( |
| 95 | | "-L$base", "-L$core", "-L$core/pcre", "-L$core/syck", "-L$core/cbits", |
| 96 | | "-I$base", "-I$core", "-I$core/pcre", "-I$core/syck", "-I$core/cbits", |
| 97 | | "-i$base", "-i$core", "-i$core/pcre", "-i$core/syck", "-i$core/cbits", |
| 98 | | qw(-static -Wall -fno-warn-unused-imports -fno-warn-unused-binds -fno-warn-missing-signatures -fno-warn-name-shadowing), |
| 99 | | ); |
| 100 | | |
| 101 | | if ($ENV{PUGS_EMBED} and $ENV{PUGS_EMBED} =~ /perl5/i) { |
| 102 | | push @ghc_flags, ("-I$Config{archlib}/CORE", "-L$Config{archlib}/CORE", "-i$Config{archlib}/CORE", "-lperl"); |
| 103 | | } |
| 104 | | |
| 105 | | push @ghc_flags, "$core/pcre/pcre.o"; |
| 106 | | push @ghc_flags, bsd_glob("$core/cbits/*.o"); |
| 107 | | push @ghc_flags, bsd_glob("$core/syck/*.o"); |
| 108 | | push @ghc_flags, "$core/UnicodeC.o"; |
| 109 | | |