mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-21 23:59:19 +02:00
ec5c89a368
src/osflags: fully fix cross-compilation
59 lines
1.1 KiB
Bash
Executable File
59 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
: "${PKG_CONFIG:=pkg-config}"
|
|
|
|
case $2 in
|
|
link)
|
|
|
|
case $1 in
|
|
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;
|
|
;;
|
|
esac
|
|
;;
|
|
cflags)
|
|
case $1 in
|
|
windows32)
|
|
echo '-DWINVER=0x0501';
|
|
;;
|
|
BeOS)
|
|
echo '-Dsocklen_t=int';
|
|
;;
|
|
Haiku)
|
|
echo '-D_DEFAULT_SOURCE';
|
|
;;
|
|
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
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|