… | |
… | |
8 | |
8 | |
9 | $DEFINE = ""; |
9 | $DEFINE = ""; |
10 | |
10 | |
11 | $DEFINE .= " -DHAVE_MMAP" if $Config{d_mmap} eq "define" && $Config{d_munmap} eq "define"; |
11 | $DEFINE .= " -DHAVE_MMAP" if $Config{d_mmap} eq "define" && $Config{d_munmap} eq "define"; |
12 | |
12 | |
13 | if ($^O =~ /win32/i) { |
13 | if ($^O =~ /win32/i or $^O =~ /cygwin/) { |
14 | $DEFINE = " -DCORO_LOOSE"; |
14 | $DEFINE = " -DCORO_LOOSE"; |
15 | } elsif ($^O =~ /irix/) { |
15 | } elsif ($^O =~ /irix/) { |
16 | $iface = "i"; |
16 | $iface = "i"; |
17 | } elsif ($^O =~ /linux/) { |
17 | } elsif ($^O =~ /linux/) { |
18 | $iface = "l"; |
18 | $iface = "l"; |
… | |
… | |
48 | } |
48 | } |
49 | |
49 | |
50 | if ($iface) { |
50 | if ($iface) { |
51 | print <<EOF; |
51 | print <<EOF; |
52 | |
52 | |
53 | Coro has the option of using two different ways to implement coroutines |
53 | Coro can use various ways to implement coroutines at the C level: |
54 | at the C level: |
|
|
55 | |
54 | |
56 | u The unix ucontext functions are newer and not implemented in older |
55 | u The unix ucontext functions are newer and not implemented in older |
57 | unices (or broken libc's like glibc-2.2.2 and below). They allow very |
56 | unices (or broken libc's like glibc-2.2.2 and below). They allow very |
58 | fast coroutine creation and fast switching, and, most importantly, are |
57 | fast coroutine creation and fast switching, and, most importantly, are |
59 | very stable. |
58 | very stable. |
… | |
… | |
68 | l Older GNU/Linux systems (glibc-2.1 and below) need this hack. Since it is |
67 | l Older GNU/Linux systems (glibc-2.1 and below) need this hack. Since it is |
69 | very linux-specific it is also quite fast for newer versions; when it |
68 | very linux-specific it is also quite fast for newer versions; when it |
70 | works, that is... |
69 | works, that is... |
71 | |
70 | |
72 | i IRIX. For some reason, SGI really does not like to follow the unix |
71 | i IRIX. For some reason, SGI really does not like to follow the unix |
73 | standard (does that surprise you?), so this techniquee should be fast |
72 | standard (does that surprise you?), so this workaround might be needed |
74 | and safe (althogh s and u should also work now). |
73 | (it's fast), although s and u should also work now. |
75 | |
74 | |
76 | EOF |
75 | EOF |
77 | |
76 | |
78 | retry: |
77 | retry: |
79 | print "Use which implementation,\n", |
78 | print "Use which implementation,\n", |
… | |
… | |
99 | } else { |
98 | } else { |
100 | print "\nUnknown implementation \"$iface\"\n"; |
99 | print "\nUnknown implementation \"$iface\"\n"; |
101 | goto retry; |
100 | goto retry; |
102 | } |
101 | } |
103 | } else { |
102 | } else { |
104 | print "\nUsing microsoft coroutine implementation\n\n"; |
103 | print "\nUsing microsoft compatible coroutines\n\n"; |
105 | } |
104 | } |
106 | |
105 | |
107 | WriteMakefile( |
106 | WriteMakefile( |
108 | NAME => "Coro::State", |
107 | NAME => "Coro::State", |
109 | VERSION_FROM => "State.pm", |
108 | VERSION_FROM => "State.pm", |
… | |
… | |
117 | |
116 | |
118 | 'Cont.pm' => '$(INST_LIBDIR)/Cont.pm', |
117 | 'Cont.pm' => '$(INST_LIBDIR)/Cont.pm', |
119 | |
118 | |
120 | 'Specific.pm' => '$(INST_LIBDIR)/Specific.pm', |
119 | 'Specific.pm' => '$(INST_LIBDIR)/Specific.pm', |
121 | |
120 | |
|
|
121 | 'Timer.pm' => '$(INST_LIBDIR)/Timer.pm', |
122 | 'Signal.pm' => '$(INST_LIBDIR)/Signal.pm', |
122 | 'Signal.pm' => '$(INST_LIBDIR)/Signal.pm', |
123 | 'Channel.pm' => '$(INST_LIBDIR)/Channel.pm', |
123 | 'Channel.pm' => '$(INST_LIBDIR)/Channel.pm', |
124 | 'Semaphore.pm' => '$(INST_LIBDIR)/Semaphore.pm', |
124 | 'Semaphore.pm' => '$(INST_LIBDIR)/Semaphore.pm', |
125 | 'SemaphoreSet.pm' => '$(INST_LIBDIR)/SemaphoreSet.pm', |
125 | 'SemaphoreSet.pm' => '$(INST_LIBDIR)/SemaphoreSet.pm', |
126 | 'RWLock.pm' => '$(INST_LIBDIR)/RWLock.pm', |
126 | 'RWLock.pm' => '$(INST_LIBDIR)/RWLock.pm', |
… | |
… | |
143 | print "to Marc Lehmann <pcg\@goof.com>: operating system name, version,\n"; |
143 | print "to Marc Lehmann <pcg\@goof.com>: operating system name, version,\n"; |
144 | print "architecture name and this string '$sp|$ss'. Thanks a lot!\n";#d# |
144 | print "architecture name and this string '$sp|$ss'. Thanks a lot!\n";#d# |
145 | print "*****************************************************************************\n\n"; |
145 | print "*****************************************************************************\n\n"; |
146 | |
146 | |
147 | unlink "a.out"; |
147 | unlink "a.out"; |
|
|
148 | unlink "conftestval"; |
148 | } |
149 | } |
149 | |
150 | |
150 | |
151 | |