Rev 20 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | magnus | 1 | #! /bin/sh |
2 | ## 11_pthread_stub.dpatch by Magnus Holmgren <holmgren@debian.org> |
||
3 | ## |
||
4 | ## DP: Add check for stubbiness of pthread_atfork(). |
||
5 | |||
6 | dpatch_patch() { |
||
7 | perl -pi - src/configure <<'END_PERL' |
||
8 | $already_patched = 1 if (/^\Q#if defined(__stub_pthread_atfork)\E/); |
||
9 | if (/\Qpthread_atfork(0,0,0)\E/ && !$already_patched) { |
||
10 | $found = 1; print <<'EOT'; |
||
11 | #if defined(__stub_pthread_atfork) || defined(__stub___pthread_atfork) |
||
12 | #error pthread_atfork is just a stub |
||
13 | #endif |
||
14 | EOT |
||
15 | } |
||
16 | END { exit !$found } |
||
17 | END_PERL |
||
18 | } |
||
19 | |||
20 | dpatch_unpatch() { |
||
21 | perl -pi - src/configure <<'END_PERL' |
||
22 | if (/\Q#if defined(__stub_pthread_atfork)\E/ .. /#endif/) { |
||
23 | $found = 1; $_ = ''; |
||
24 | } |
||
25 | END { exit !$found } |
||
26 | END_PERL |
||
27 | } |
||
28 | |||
29 | |||
30 | DPATCH_LIB_NO_DEFAULT=1 |
||
31 | |||
32 | . /usr/share/dpatch/dpatch.lib.sh |