diff options
| author | Roy Marples <roy@marples.name> | 2013-02-18 21:25:07 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2013-02-18 21:25:07 +0000 |
| commit | 237e8234a7e576a62d80271459d1bb5914692ceb (patch) | |
| tree | a21e4eff3497a09bd0c775d8398a28ba2c2927c0 /configure | |
| parent | e6d25175623a7ec71a7a2ea0cc0bdc192acd463f (diff) | |
| download | dhcpcd-237e8234a7e576a62d80271459d1bb5914692ceb.tar.xz | |
Change from ppoll(2) to pollts(2).
I was going to go with ppoll(2) because I would guess the Open Group
would prefer the name of it over pollts(2) if they ever standardised it.
However that causes a problem with _GNU_SOURCE and my code base so I've
gone to pollts(2) and suck in the compat header for Linux users to avoid
that sillyness.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 57 |
1 files changed, 31 insertions, 26 deletions
@@ -57,7 +57,8 @@ for x do --without-getline) GETLINE=no;; --without-strlcpy) STRLCPY=no;; --without-posix_spawn) POSIX_SPAWN=no;; - --without-ppoll) PPOLL=no;; + --without-pollts) POLLTS=no;; + --with-pollts) POLLTS=$var;; --serviceexists) SERVICEEXISTS=$var;; --servicecmd) SERVICECMD=$var;; --servicestatus) SERVICESTATUS=$var;; @@ -525,46 +526,47 @@ else echo "#include <spawn.h>" >>$CONFIG_H fi -if [ -z "$PPOLL" ]; then - printf "Testing for ppoll ... " - cat <<EOF >_ppoll.c +if [ -z "$POLLTS" ]; then + printf "Testing for pollts ... " + cat <<EOF >_pollts.c #include <poll.h> +#include <signal.h> #include <stdlib.h> +#include <time.h> int main(void) { - ppoll(NULL, 0, NULL, NULL); + pollts(NULL, 0, NULL, NULL); return 0; } EOF - if $XCC _ppoll.c -o _ppoll 2>/dev/null; then - PPOLL=yes + if $XCC _pollts.c -o _pollts 2>/dev/null; then + POLLTS=yes else - PPOLL=no + POLLTS=no fi - echo "$PPOLL" - rm -f _ppoll.c _ppoll + echo "$POLLTS" + rm -f _pollts.c _pollts fi -if [ "$PPOLL" = no ]; then - printf "Testing for pollts ... " - cat <<EOF >_pollts.c +if [ "$POLLTS" = no ]; then + printf "Testing for ppoll ... " + cat <<EOF >_ppoll.c #include <poll.h> -#include <signal.h> #include <stdlib.h> -#include <time.h> int main(void) { - pollts(NULL, 0, NULL, NULL); + ppoll(NULL, 0, NULL, NULL); return 0; } EOF - if $XCC _pollts.c -o _pollts 2>/dev/null; then - PPOLL=pollts + if $XCC _ppoll.c -o _ppoll 2>/dev/null; then + POLLTS=ppoll echo "yes" else - PPOLL=no + POLLTS=no echo "no" fi - rm -f _pollts.c _pollts + echo "$POLLTS" + rm -f _ppoll.c _ppoll fi -if [ "$PPOLL" = no ]; then +if [ "$POLLTS" = no ]; then printf "Testing for pselect ... " cat <<EOF >_pselect.c #include <sys/select.h> @@ -575,17 +577,20 @@ int main(void) { } EOF if $XCC _pselect.c -o _pselect 2>/dev/null; then - PPOLL=pselect + POLLTS=pselect echo "yes" else - PPOLL=no + POLLTS=no echo "no" fi rm -f _pselect.c _pselect fi -case "$PPOLL" in -pollts) - echo "#define ppoll pollts" >>$CONFIG_H +case "$POLLTS" in +yes) + ;; +ppoll) + echo "#include \"compat/ppoll.h\"" >>$CONFIG_H + echo "#define pollts ppoll" >>$CONFIG_H ;; pselect) echo "COMPAT_SRCS+= compat/pselect.c" >>$CONFIG_MK |
