… | |
… | |
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) { |
14 | $DEFINE = " -DCORO_LOOSE"; |
14 | $DEFINE = " -DCORO_LOOSE"; |
|
|
15 | } elsif ($^O =~ /irix/) { |
|
|
16 | $iface = "i"; |
15 | } elsif ($^O =~ /linux/) { |
17 | } elsif ($^O =~ /linux/) { |
16 | $iface = "l"; |
18 | $iface = "l"; |
17 | } elsif ($^O =~ /solaris/) { |
19 | } elsif ($^O =~ /solaris/) { |
18 | $iface = "s"; |
20 | $iface = "s"; |
19 | } elsif (-e "/usr/include/ucontext.h") { |
21 | } elsif (-e "/usr/include/ucontext.h") { |
… | |
… | |
62 | creation is rather slow, but switching is very fast as well (often much |
64 | creation is rather slow, but switching is very fast as well (often much |
63 | faster than with the ucontext functions). Unfortunately, glibc-2.1 and |
65 | faster than with the ucontext functions). Unfortunately, glibc-2.1 and |
64 | below don't even feature a working sigaltstack. |
66 | below don't even feature a working sigaltstack. |
65 | |
67 | |
66 | l Older GNU/Linux systems (glibc-2.1 and below) need this hack. Since it is |
68 | l Older GNU/Linux systems (glibc-2.1 and below) need this hack. Since it is |
67 | very linux-specific it is also quite fast for newer versions; when it works, |
69 | very linux-specific it is also quite fast for newer versions; when it |
68 | that is... |
70 | works, that is... |
|
|
71 | |
|
|
72 | 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 |
|
|
74 | and safe (althogh s and u should also work now). |
69 | |
75 | |
70 | EOF |
76 | EOF |
71 | |
77 | |
72 | retry: |
78 | retry: |
73 | print "Use which implementation (s, u, l) [$iface]? "; |
79 | print "Use which implementation,\n", |
|
|
80 | "<s>etjmp/longjump, <u>context, <i>rix or <l>inux [$iface]? "; |
|
|
81 | |
74 | my $r = <>; |
82 | my $r = <>; |
75 | $iface = lc $1 if $r =~ /(\S)/; |
83 | $iface = lc $1 if $r =~ /(\S)/; |
76 | |
84 | |
77 | if ($iface eq "u") { |
85 | if ($iface eq "u") { |
78 | $DEFINE .= " -DCORO_UCONTEXT"; |
86 | $DEFINE .= " -DCORO_UCONTEXT"; |
… | |
… | |
81 | $DEFINE .= " -DCORO_SJLJ"; |
89 | $DEFINE .= " -DCORO_SJLJ"; |
82 | print "\nUsing setjmp/longjmp/sigaltstack implementation\n\n"; |
90 | print "\nUsing setjmp/longjmp/sigaltstack implementation\n\n"; |
83 | } elsif ($iface eq "l") { |
91 | } elsif ($iface eq "l") { |
84 | $DEFINE .= " -DCORO_LINUX"; |
92 | $DEFINE .= " -DCORO_LINUX"; |
85 | print "\nUsing linux-specific implementation\n\n"; |
93 | print "\nUsing linux-specific implementation\n\n"; |
|
|
94 | } elsif ($iface eq "i") { |
|
|
95 | $DEFINE .= " -DCORO_IRIX"; |
|
|
96 | print "\nUsing irix-specific implementation\n\n"; |
86 | } else { |
97 | } else { |
87 | print "\nUnknown implementation \"$iface\"\n"; |
98 | print "\nUnknown implementation \"$iface\"\n"; |
88 | goto retry; |
99 | goto retry; |
89 | } |
100 | } |
90 | } else { |
101 | } else { |