iodine/src/osflags

59 lines
1.1 KiB
Text
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 -lbsd';
;;
windows32)
echo '-lws2_32 -liphlpapi';
;;
Linux)
FLAGS="";
"$PKG_CONFIG" --exists libselinux && FLAGS="$FLAGS $($PKG_CONFIG --libs libselinux)";
"$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';
;;
Haiku)
echo '-D_DEFAULT_SOURCE';
;;
2015-06-28 23:52:33 +03:00
Darwin)
echo '-D__APPLE_USE_RFC_3542';
;;
Linux)
FLAGS="-D_GNU_SOURCE"
"$PKG_CONFIG" --exists libselinux && 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