iodine/src/osflags

56 lines
1.0 KiB
Plaintext
Raw Normal View History

2008-07-12 15:42:19 +03:00
#!/bin/sh
: "${PKG_CONFIG:=pkg-config}"
2009-01-25 18:28:17 +02:00
case $2 in
2008-07-12 15:42:19 +03:00
link)
2009-01-25 18:28:17 +02:00
case $1 in
2008-07-12 15:42:19 +03:00
SunOS | solaris)
echo '-lsocket -lnsl';
;;
BeOS)
echo '-lsocket -lbind -lbsd';
;;
Haiku)
echo '-lnetwork';
;;
windows32)
echo '-lws2_32 -liphlpapi';
;;
Linux)
FLAGS="";
[ -e /usr/include/selinux/selinux.h ] && FLAGS="$FLAGS -lselinux";
"$PKG_CONFIG" --exists libsystemd-daemon && FLAGS="$FLAGS $($PKG_CONFIG --libs libsystemd-daemon)";
"$PKG_CONFIG" --exists libsystemd && FLAGS="$FLAGS $($PKG_CONFIG --libs libsystemd)";
echo $FLAGS;
;;
2008-07-12 15:42:19 +03:00
esac
;;
cflags)
2009-01-25 18:28:17 +02:00
case $1 in
windows32)
echo '-DWINVER=0x0501';
;;
BeOS)
echo '-Dsocklen_t=int';
;;
2015-06-28 23:52:33 +03:00
Darwin)
echo '-D__APPLE_USE_RFC_3542';
;;
Linux)
FLAGS="-D_GNU_SOURCE"
[ -e /usr/include/selinux/selinux.h ] && FLAGS="$FLAGS -DHAVE_SETCON";
"$PKG_CONFIG" --exists libsystemd-daemon && FLAGS="$FLAGS -DHAVE_SYSTEMD";
"$PKG_CONFIG" --exists libsystemd && FLAGS="$FLAGS -DHAVE_SYSTEMD";
echo $FLAGS;
;;
GNU/kFreeBSD|GNU)
echo '-D_GNU_SOURCE'
;;
esac
;;
2008-07-12 15:42:19 +03:00
*)
;;
esac