summaryrefslogtreecommitdiff
path: root/mcon/U/d_socker_get.U
blob: 3d7ae230669bb9d9dc49d20a80d7159156ca2577 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
?RCS: $Id$
?RCS:
?RCS: Copyright (c) 2006, Christian Biere
?RCS:
?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?MAKE:d_socker_get sockercflags sockerldflags: Trylink cat ccflags ldflags
?MAKE:	-pick add $@ %<
?S:d_socker_get:
?S:	This variable conditionally defines the HAS_SOCKER_GET symbol, which
?S:	indicates to the C program that socker_get() support is available.
?S:.
?S:sockercflags:
?S:	This variable holds the compiler flags required to compile with socker.
?S:.
?S:sockerldflags:
?S:	This variable holds the linker flags required to link against socker.
?S:.
?C:HAS_SOCKER_GET:
?C:	This symbol is defined when socker_get() can be used to get sockets
?C:	bound to privileged ports.
?C:.
?H:#$d_socker_get HAS_SOCKER_GET
?H:.
?T:saved_ccflags saved_ldflags
?LINT:change ccflags ldflags
?LINT:set d_socker_get
: determine whether socker_get is available
case "$d_socker_get" in
"$undef") echo " "; echo "socker support is disabled." >&4;;
*)
	$cat >try.c <<'EOC'
#include <sys/types.h>
#include <socker.h>
int main(void)
{
  static int ret;
  ret |= socker_get(1, 2, 3, "", 5);
  return ret ? 0 : 1;
}
EOC
	sockercflags=`socker-config --cflags 2>/dev/null`
	sockerldflags=`socker-config --libs 2>/dev/null`
	saved_ccflags=$ccflags
	saved_ldflags=$ldflags
	ccflags="$ccflags $sockercflags"
	ldflags="$ldflags $sockerldflags"
	cyn="whether socket_get() allows binding to privileged ports"
	set d_socker_get
	eval $trylink
	ccflags=$saved_ccflags
	ldflags=$saved_ldflags
	case "$d_socker_get" in
	"$undef")
		sockercflags=''
		sockerldflags=''
		;;
	esac
	;;
esac