aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-02-10 23:27:55 -0600
committerRob Landley <rob@landley.net>2016-02-10 23:27:55 -0600
commitdf07fb73be98dc1087346c184877666970a88f4a (patch)
tree32771caccb0008ccced29c99dbeeab0cef88f5ec /scripts
parent187649de817b618c967d234f0707008e90e52504 (diff)
downloadtoybox-df07fb73be98dc1087346c184877666970a88f4a.tar.gz
Wean scripts/install.c off toys.h so cross compiling less brittle.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/install.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/scripts/install.c b/scripts/install.c
index a9a05500..3ffb867d 100644
--- a/scripts/install.c
+++ b/scripts/install.c
@@ -3,28 +3,26 @@
* Copyright 2006 Rob Landley <rob@landley.net>
*/
-#include "toys.h"
+#include <stdio.h>
+#include "generated/config.h"
+#include "lib/toyflags.h"
-#undef NEWTOY
-#undef OLDTOY
-#define NEWTOY(name, opts, flags) {#name, 0, 0, flags},
-#define OLDTOY(name, oldname, flags) {#name, 0, 0, flags},
+#define NEWTOY(name, opts, flags) {#name, flags},
+#define OLDTOY(name, oldname, flags) {#name, flags},
// Populate toy_list[].
-struct toy_list toy_list[] = {
+struct {char *name; int flags;} toy_list[] = {
#include "generated/newtoys.h"
};
-#define TOY_LIST_LEN (sizeof(toy_list)/sizeof(struct toy_list))
-
int main(int argc, char *argv[])
{
static char *toy_paths[]={"usr/","bin/","sbin/",0};
int i, len = 0;
// Output list of applets.
- for (i=1; i<TOY_LIST_LEN; i++) {
+ for (i=1; i<sizeof(toy_list)/sizeof(*toy_list); i++) {
int fl = toy_list[i].flags;
if (fl & TOYMASK_LOCATION) {
if (argc>1) {