File: 11_pthread_stub.dpatch

package info (click to toggle)
pike7.6 7.6.112-dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 50,916 kB
  • ctags: 23,544
  • sloc: ansic: 257,802; xml: 82,717; makefile: 2,503; sh: 1,891; lisp: 655; asm: 237; pascal: 66; sed: 34; perl: 3
file content (32 lines) | stat: -rw-r--r-- 741 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/sh
## 11_pthread_stub.dpatch by Magnus Holmgren <holmgren@debian.org>
##
## DP: Add check for stubbiness of pthread_atfork().

dpatch_patch() {
    perl -pi - src/configure <<'END_PERL'
$already_patched = 1 if (/^\Q#if defined(__stub_pthread_atfork)\E/);
if (/\Qpthread_atfork(0,0,0)\E/ && !$already_patched) {
  $found = 1; print <<'EOT';
#if defined(__stub_pthread_atfork) || defined(__stub___pthread_atfork)
#error pthread_atfork is just a stub
#endif
EOT
}
END { exit !$found }
END_PERL
}

dpatch_unpatch() {
    perl -pi - src/configure <<'END_PERL'
if (/\Q#if defined(__stub_pthread_atfork)\E/ .. /#endif/) {
  $found = 1; $_ = '';
}
END { exit !$found }
END_PERL
}


DPATCH_LIB_NO_DEFAULT=1

. /usr/share/dpatch/dpatch.lib.sh