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.
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 @@
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()