diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
commit | e95877ecfa1170d77b1ec1f66752725cdda01b64 (patch) | |
tree | 81940f62fdf7891f127a1d1ffa712ac1ea1c4c5c /mk/os-Linux.mk | |
download | external_dhcpcd-e95877ecfa1170d77b1ec1f66752725cdda01b64.zip external_dhcpcd-e95877ecfa1170d77b1ec1f66752725cdda01b64.tar.gz external_dhcpcd-e95877ecfa1170d77b1ec1f66752725cdda01b64.tar.bz2 |
Initial Contribution
Diffstat (limited to 'mk/os-Linux.mk')
-rw-r--r-- | mk/os-Linux.mk | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mk/os-Linux.mk b/mk/os-Linux.mk new file mode 100644 index 0000000..16f0f60 --- /dev/null +++ b/mk/os-Linux.mk @@ -0,0 +1,28 @@ +# Setup OS specific variables +# Copyright 2008 Roy Marples <roy@marples.name> + +SRC_PF= lpf.c +SRC_IF= if-linux.c + +CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=600 +LIBRT= -lrt + +# Work out if our fork() works or not. +# If cross-compiling, you'll need to set HAVE_FORK to yes or no depending +# on your target arch. +_HAVE_FORK_SH= if test "${HAVE_FORK}" = "yes"; then \ + echo ""; \ + elif test -n "${HAVE_FORK}"; then \ + echo "-DTHERE_IS_NO_FORK"; \ + else \ + printf '\#include <stdlib.h>\n\#include <unistd.h>\nint main (void) { pid_t pid = fork(); if (pid == -1) exit (-1); exit (0); }\n' > .fork.c; \ + ${CC} .fork.c -o .fork >/dev/null 2>&1; \ + if ./.fork; then \ + echo ""; \ + else \ + echo "-DTHERE_IS_NO_FORK"; \ + fi; \ + rm -f .fork.c .fork; \ + fi; +_HAVE_FORK!= ${_HAVE_FORK_SH} +CPPFLAGS+= ${_HAVE_FORK}$(shell ${_HAVE_FORK_SH}) |