use ExtUtils::MakeMaker; use 5.005; use Config; $|=1; $DEFINE = ""; $DEFINE .= " -DHAVE_MMAP" if $Config{d_mmap} eq "define" && $Config{d_munmap} eq "define"; if ($^O =~ /win32/i) { $DEFINE = " -DCORO_LOOSE"; } elsif ($^O =~ /linux/) { $iface = "l"; } elsif ($^O =~ /solaris/) { $iface = "s"; } elsif (-e "/usr/include/ucontext.h") { $iface = "u"; } else { $iface = "s"; } print < =~ /^\s*y/i) { print "\nExperimental context sharing enabled.\n\n"; $DEFINE .= " -DCORO_LAZY_STACK"; } if ($iface) { print <; $iface = lc $1 if $r =~ /(\S)/; if ($iface eq "u") { $DEFINE .= " -DCORO_UCONTEXT"; print "\nUsing ucontext implementation\n\n"; } elsif ($iface eq "s") { $DEFINE .= " -DCORO_SJLJ"; print "\nUsing setjmp/longjmp/sigaltstack implementation\n\n"; } elsif ($iface eq "l") { $DEFINE .= " -DCORO_LINUX"; print "\nUsing linux-specific implementation\n\n"; } else { print "\nUnknown implementation \"$iface\"\n"; goto retry; } } else { print "\nUsing microsoft coroutine implementation\n\n"; } WriteMakefile( NAME => "Coro::State", VERSION_FROM => "State.pm", DEFINE => $DEFINE, DIR => [], PM => { 'State.pm' => '$(INST_LIBDIR)/State.pm', 'MakeMaker.pm' => '$(INST_LIBDIR)/MakeMaker.pm', 'CoroAPI.h' => '$(INST_LIBDIR)/CoroAPI.h', 'Cont.pm' => '$(INST_LIBDIR)/Cont.pm', 'Specific.pm' => '$(INST_LIBDIR)/Specific.pm', 'Signal.pm' => '$(INST_LIBDIR)/Signal.pm', 'Channel.pm' => '$(INST_LIBDIR)/Channel.pm', 'Semaphore.pm' => '$(INST_LIBDIR)/Semaphore.pm', 'RWLock.pm' => '$(INST_LIBDIR)/RWLock.pm', }, );