path: root/mcon/U/d_socker_get.U
diff options
Diffstat (limited to 'mcon/U/d_socker_get.U')
1 files changed, 65 insertions, 0 deletions
diff --git a/mcon/U/d_socker_get.U b/mcon/U/d_socker_get.U
new file mode 100644
index 0000000..72675b4
--- /dev/null
+++ b/mcon/U/d_socker_get.U
@@ -0,0 +1,65 @@
+?RCS: $Id: d_socker_get.U 167 2013-05-08 17:58:00Z rmanfredi $
+?RCS: Copyright (c) 2006, Christian Biere
+?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.
+?MAKE:d_socker_get sockercflags sockerldflags: Trylink cat ccflags ldflags
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines the HAS_SOCKER_GET symbol, which
+?S: indicates to the C program that socker_get() support is available.
+?S: This variable holds the compiler flags required to compile with socker.
+?S: This variable holds the linker flags required to link against socker.
+?C: This symbol is defined when socker_get() can be used to get sockets
+?C: bound to privileged ports.
+?H:#$d_socker_get HAS_SOCKER_GET
+?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;
+ 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
+ ;;