summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2012-11-10 16:38:53 +0000
committerRoy Marples <roy@marples.name>2012-11-10 16:38:53 +0000
commit34a7563e0f74f55355e106cd6715c4a0d23ccd97 (patch)
tree6d303558d67bc59ada42e1fc419e6e256cb4e4e9 /configure
parent5c08c0c4cad951fb3727efde4f1e314df68e7d91 (diff)
downloaddhcpcd-34a7563e0f74f55355e106cd6715c4a0d23ccd97.tar.xz
Add a pselect(2) shim for systems that lack support for it.
When building, warn that it's not entirely race condition safe.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure25
1 files changed, 25 insertions, 0 deletions
diff --git a/configure b/configure
index 233f23c1..32a4dfd0 100755
--- a/configure
+++ b/configure
@@ -50,6 +50,8 @@ for x do
--without-closefrom) CLOSEFROM=no;;
--without-getline) GETLINE=no;;
--without-strlcpy) STRLCPY=no;;
+ --without-posix_spawn) POSIX_SPAWN=no;;
+ --without-pselect) PSELECT=no;;
--serviceexists) SERVICEEXISTS=$var;;
--servicecmd) SERVICECMD=$var;;
--servicestatus) SERVICESTATUS=$var;;
@@ -437,6 +439,29 @@ else
echo "#include <spawn.h>" >>$CONFIG_H
fi
+if [ -z "$PSELECT" ]; then
+ printf "Testing for pselect ... "
+ cat <<EOF >_pselect.c
+#include <sys/select.h>
+#include <stdlib.h>
+int main(void) {
+ pselect(0, NULL, NULL, NULL, NULL, NULL);
+ return 0;
+}
+EOF
+ if $XCC _pselect.c -o _pselect 2>/dev/null; then
+ PSELECT=yes
+ else
+ PSELECT=no
+ fi
+ echo "$PSELECT"
+ rm -f _pselect.c _pselect
+fi
+if [ "$PSELECT" = no ]; then
+ echo "COMPAT_SRCS+= compat/pselect.c" >>$CONFIG_MK
+ echo "#include \"compat/pselect.h\"" >>$CONFIG_H
+fi
+
if [ -z "$SERVICECMD" ]; then
printf "Checking for OpenRC ... "
if [ -x /sbin/rc-service ]; then