diff options
author | Isaac Dunham <ibid.ag@gmail.com> | 2014-11-19 16:38:46 -0600 |
---|---|---|
committer | Isaac Dunham <ibid.ag@gmail.com> | 2014-11-19 16:38:46 -0600 |
commit | 46ddf0e34b03f7711a9c80f7a70dc8cbf732f782 (patch) | |
tree | 4f69c03c7da6c6f3fd977182ebb93c89703d47a8 /scripts | |
parent | 159a7f1621eecf6cf3c2824ffb762a19bf5f7667 (diff) | |
download | toybox-46ddf0e34b03f7711a9c80f7a70dc8cbf732f782.tar.gz toybox-46ddf0e34b03f7711a9c80f7a70dc8cbf732f782.tar.bz2 toybox-46ddf0e34b03f7711a9c80f7a70dc8cbf732f782.zip |
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.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/genconfig.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh index b50c32b..e040aea 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 <utmpx.h> + #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 <pty.h> + int main(int argc, char *argv[]) { + int master; return forkpty(&master, NULL, NULL, NULL); + } +EOF + + probesymbol TOYBOX_SHADOW -c << EOF + #include <shadow.h> + int main(int argc, char *argv[]) { + struct spwd *a = getspnam("root"); return 0; + } +EOF } genconfig() |