Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#! /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