From 46ddf0e34b03f7711a9c80f7a70dc8cbf732f782 Mon Sep 17 00:00:00 2001 From: Isaac Dunham Date: Wed, 19 Nov 2014 16:38:46 -0600 Subject: probe for getspnam(), forkpty(), utmpx, replace sethostname() Android is missing all of these; we need to probe for some so we have a config symbol to depend on. sethostname() is easily replaced. We got termios.h via pty.h; now it's not included in configure-step tools, so we need termios.h to generate globals. --- scripts/genconfig.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'scripts/genconfig.sh') diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh index b50c32bb..e040aea5 100755 --- a/scripts/genconfig.sh +++ b/scripts/genconfig.sh @@ -44,6 +44,34 @@ EOF int main(int argc, char *argv[]) { return posix_fallocate(0,0,0); } EOF + + # Android and some other platforms miss utmpx + probesymbol TOYBOX_UTMPX -c << EOF + #include + #ifndef BOOT_TIME + #error nope + #endif + int main(int argc, char *argv[]) { + struct utmpx *a; + if (0 != (a = getutxent())) return 0; + return 1; + } +EOF + + # Android is missing shadow.h and pty.h + probesymbol TOYBOX_PTY -c << EOF + #include + int main(int argc, char *argv[]) { + int master; return forkpty(&master, NULL, NULL, NULL); + } +EOF + + probesymbol TOYBOX_SHADOW -c << EOF + #include + int main(int argc, char *argv[]) { + struct spwd *a = getspnam("root"); return 0; + } +EOF } genconfig() -- cgit v1.2.3