From 02fec4701cee79f875c1d02b8b4aee09380dbcb8 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 4 Jan 2001 20:04:45 +0000 Subject: integrate dietlibc/stdio per default for cdrom and disk only installs --- mdk-stage1/insmod-busybox/Makefile | 29 +++++++++++++++++++++++------ mdk-stage1/insmod-busybox/busybox.h | 4 +--- mdk-stage1/insmod-busybox/insmod.c | 13 +++++-------- mdk-stage1/insmod-busybox/utility.c | 24 ++++++++++++------------ 4 files changed, 41 insertions(+), 29 deletions(-) (limited to 'mdk-stage1/insmod-busybox') diff --git a/mdk-stage1/insmod-busybox/Makefile b/mdk-stage1/insmod-busybox/Makefile index 451e3b262..ca05279e9 100644 --- a/mdk-stage1/insmod-busybox/Makefile +++ b/mdk-stage1/insmod-busybox/Makefile @@ -8,30 +8,47 @@ # #***************************************************************************** +top_dir = .. -all: insmod libinsmod.a +include $(top_dir)/Makefile.common + + +all: insmod libinsmod.a libinsmod-DIET.a clean: - rm -f *.o insmod libinsmod.a + rm -f *.o insmod libinsmod.a libinsmod-DIET.a + FLAGS = -c -Wall -Os -fomit-frame-pointer -D_GNU_SOURCE -DBB_VER='"0.47"' -DBB_BT='"2000.12.06-14:02+0000"' + insmod: insmod-frontend.o insmod.o utility-standalone.o gcc -o $@ $^ + $(STRIPCMD) $@ libinsmod.a: insmod.o utility.o ar cru $@ $^ ranlib $@ +libinsmod-DIET.a: insmod-DIET.o utility-DIET.o + ar cru $@ $^ + ranlib $@ + insmod-frontend.o: insmod-frontend.c busybox.h - gcc $(FLAGS) insmod-frontend.c + gcc $(FLAGS) $(GLIBC_INCLUDES) insmod-frontend.c utility.o: utility.c busybox.h - gcc $(FLAGS) utility.c + gcc $(FLAGS) $(GLIBC_INCLUDES) utility.c + +utility-DIET.o: utility.c busybox.h + gcc $(FLAGS) $(DIETLIBC_INCLUDES) -o $@ utility.c utility-standalone.o: utility.c busybox.h - gcc $(FLAGS) -o $@ -D_STANDALONE_ utility.c + gcc $(FLAGS) $(GLIBC_INCLUDES) -o $@ -D_STANDALONE_ utility.c insmod.o: insmod.c busybox.h - gcc $(FLAGS) insmod.c + gcc $(FLAGS) $(GLIBC_INCLUDES) insmod.c + +insmod-DIET.o: insmod.c busybox.h + gcc $(FLAGS) $(DIETLIBC_INCLUDES) -o $@ insmod.c diff --git a/mdk-stage1/insmod-busybox/busybox.h b/mdk-stage1/insmod-busybox/busybox.h index 69f455435..72d5e0a69 100644 --- a/mdk-stage1/insmod-busybox/busybox.h +++ b/mdk-stage1/insmod-busybox/busybox.h @@ -37,8 +37,6 @@ #include #include #include -#include -#include /* for the _syscall() macros */ #include #include @@ -394,7 +392,7 @@ extern void print_file(FILE *file); extern int print_file_by_name(char *filename); extern char process_escape_sequence(char **ptr); extern char *get_last_path_component(char *path); -extern void xregcomp(regex_t *preg, const char *regex, int cflags); +// extern void xregcomp(regex_t *preg, const char *regex, int cflags); #ifndef DMALLOC extern void *xmalloc (size_t size); diff --git a/mdk-stage1/insmod-busybox/insmod.c b/mdk-stage1/insmod-busybox/insmod.c index ac5f191fb..86c9ad181 100644 --- a/mdk-stage1/insmod-busybox/insmod.c +++ b/mdk-stage1/insmod-busybox/insmod.c @@ -45,7 +45,6 @@ #include #include #include -#include #include //---------------------------------------------------------------------------- @@ -2926,13 +2925,11 @@ extern int insmod_main( int argc, char **argv) } obj_allocate_commons(f); - if (optind < argc) { - if (m_has_modinfo - ? !new_process_module_arguments(f, argc - optind, argv + optind) - : !old_process_module_arguments(f, argc - optind, argv + optind)) - { - goto out; - } + if (m_has_modinfo + ? !new_process_module_arguments(f, argc-1, argv+1) + : !old_process_module_arguments(f, argc-1, argv+1)) + { + goto out; } arch_create_got(f); diff --git a/mdk-stage1/insmod-busybox/utility.c b/mdk-stage1/insmod-busybox/utility.c index c5f26b8d9..89e460dd0 100644 --- a/mdk-stage1/insmod-busybox/utility.c +++ b/mdk-stage1/insmod-busybox/utility.c @@ -78,30 +78,30 @@ const char mtab_file[] = "/dev/mtab"; #endif #ifdef _STANDALONE_ -extern void errorMsg(const char *s, ...) +void errorMsg(const char *s, ...) { va_list p; - va_start(p, s); fflush(stdout); - fprintf(stderr, "busybox: "); - vfprintf(stderr, s, p); - fprintf(stderr, "\n"); + printf("busybox: "); + va_start(p, s); + vprintf(s, p); va_end(p); - fflush(stderr); + printf("\n"); + fflush(stdout); } -extern void fatalError(const char *s, ...) +void fatalError(const char *s, ...) { va_list p; - va_start(p, s); fflush(stdout); - fprintf(stderr, "busybox: "); - vfprintf(stderr, s, p); - fprintf(stderr, "\n"); + fprintf(stdout, "busybox: "); + va_start(p, s); + vfprintf(stdout, s, p); va_end(p); - fflush(stderr); + fprintf(stdout, "\n"); + fflush(stdout); exit(FALSE); } #else /* _STANDALONE_ */ -- cgit v1.2.1