2008-07-12 15:42:19 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-02-09 21:42:01 +02:00
|
|
|
: "${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';
|
|
|
|
;;
|
2008-08-07 19:53:59 +03:00
|
|
|
BeOS)
|
|
|
|
echo '-lsocket -lbind -lbsd';
|
|
|
|
;;
|
|
|
|
Haiku)
|
2023-11-18 19:19:14 +02:00
|
|
|
echo '-lnetwork -lbsd';
|
2008-08-07 19:53:59 +03:00
|
|
|
;;
|
2009-01-25 00:19:11 +02:00
|
|
|
windows32)
|
2009-02-22 16:27:10 +02:00
|
|
|
echo '-lws2_32 -liphlpapi';
|
2009-01-25 00:19:11 +02:00
|
|
|
;;
|
2009-06-24 20:28:13 +03:00
|
|
|
Linux)
|
2013-12-23 11:48:46 +02:00
|
|
|
FLAGS="";
|
2023-11-03 00:03:15 +02:00
|
|
|
"$PKG_CONFIG" --exists libselinux && FLAGS="$FLAGS $($PKG_CONFIG --libs libselinux)";
|
2019-02-09 21:42:01 +02:00
|
|
|
"$PKG_CONFIG" --exists libsystemd-daemon && FLAGS="$FLAGS $($PKG_CONFIG --libs libsystemd-daemon)";
|
|
|
|
"$PKG_CONFIG" --exists libsystemd && FLAGS="$FLAGS $($PKG_CONFIG --libs libsystemd)";
|
2013-12-23 11:48:46 +02:00
|
|
|
echo $FLAGS;
|
2009-06-24 20:28:13 +03:00
|
|
|
;;
|
2008-07-12 15:42:19 +03:00
|
|
|
esac
|
|
|
|
;;
|
2008-08-07 19:53:59 +03:00
|
|
|
cflags)
|
2009-01-25 18:28:17 +02:00
|
|
|
case $1 in
|
2014-02-06 23:50:23 +02:00
|
|
|
windows32)
|
|
|
|
echo '-DWINVER=0x0501';
|
|
|
|
;;
|
2009-03-07 02:00:58 +02:00
|
|
|
BeOS)
|
2008-08-07 19:53:59 +03:00
|
|
|
echo '-Dsocklen_t=int';
|
|
|
|
;;
|
2023-11-18 19:19:14 +02:00
|
|
|
Haiku)
|
|
|
|
echo '-D_DEFAULT_SOURCE';
|
|
|
|
;;
|
2015-06-28 23:52:33 +03:00
|
|
|
Darwin)
|
|
|
|
echo '-D__APPLE_USE_RFC_3542';
|
|
|
|
;;
|
2009-06-24 20:28:13 +03:00
|
|
|
Linux)
|
2014-05-29 19:37:40 +03:00
|
|
|
FLAGS="-D_GNU_SOURCE"
|
2023-11-03 00:03:15 +02:00
|
|
|
"$PKG_CONFIG" --exists libselinux && FLAGS="$FLAGS -DHAVE_SETCON";
|
2019-02-09 21:42:01 +02:00
|
|
|
"$PKG_CONFIG" --exists libsystemd-daemon && FLAGS="$FLAGS -DHAVE_SYSTEMD";
|
|
|
|
"$PKG_CONFIG" --exists libsystemd && FLAGS="$FLAGS -DHAVE_SYSTEMD";
|
2013-12-23 11:48:46 +02:00
|
|
|
echo $FLAGS;
|
2009-06-24 20:28:13 +03:00
|
|
|
;;
|
2015-01-23 10:50:41 +02:00
|
|
|
GNU/kFreeBSD|GNU)
|
|
|
|
echo '-D_GNU_SOURCE'
|
|
|
|
;;
|
2008-08-07 19:53:59 +03:00
|
|
|
esac
|
|
|
|
;;
|
2008-07-12 15:42:19 +03:00
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|