File: pthread

package info (click to toggle)
firedns 0.9.12-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,192 kB
  • ctags: 322
  • sloc: ansic: 4,026; sh: 964; makefile: 6
file content (32 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (6)
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
#require compiletest
#require cflags
#phase init
#after init_cflags
#phase header
case $PHASE in
	init)
		dispn "Checking for pthread method..."
		PROGRAM="#include <pthread.h>

void *nothing(void *v) {
	return NULL;
}

int main () {
	pthread_t thread;
	pthread_create(&thread,NULL,nothing,NULL);
	return 0;
}"
		compile_test_wrapper "$PROGRAM" "-pthread" "" "" || \
		compile_test_wrapper "$PROGRAM" "" "" "-lpthread" || \
		{
			disp "not found, unable to continue"
			exit 1
		}
		;;
	header)
		disp "Adding \"#include <pthread.h>\" to header"
		$ECHO "#include <pthread.h>"
		;;
esac