moved BB_BANNER to applets/version.c file: make kernel like version,
author"Vladimir N. Oleynik" <dzo@simtreas.ru>
Thu, 16 Feb 2006 15:40:24 +0000 (15:40 -0000)
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>
Thu, 16 Feb 2006 15:40:24 +0000 (15:40 -0000)
removed depend loop: busybox.h depend with BB_BT, and all sources depend with busybox.h

applets/Makefile.in
include/busybox.h
libbb/messages.c
scripts/bb_mkdep.c
shell/ash.c
shell/hush.c
shell/lash.c
shell/msh.c
sysklogd/klogd.c
sysklogd/syslogd.c

index a4890c2fb7206fdca11981968d32e33d259887ff..02bcda93b774106c27c1612ca3f1db6d47b38e72 100644 (file)
@@ -10,7 +10,7 @@ APPLETS_DIR:=$(top_builddir)/applets/
 endif
 srcdir=$(top_srcdir)/applets
 
-APPLET_SRC:= $(patsubst %,$(srcdir)/%,applets.c busybox.c)
+APPLET_SRC:= $(patsubst %,$(srcdir)/%,applets.c busybox.c version.c)
 APPLET_OBJ:= $(patsubst $(srcdir)/%.c,$(APPLETS_DIR)%.o, $(APPLET_SRC))
 
 APPLET_SRC-y+=$(APPLET_SRC)
index 9fb95036ead68b767a85fd3428aba28e6c8ef2a7..18f9dd56ef13d99b7e6c2cb329c90a9695d1761b 100644 (file)
 #error "Sorry, this libc version is not supported :("
 #endif
 
-#ifndef BB_EXTRA_VERSION
-#define BB_BANNER "BusyBox v" BB_VER " (" BB_BT ")"
-#else
-#define BB_BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")"
-#endif
+extern const char BB_BANNER[];
 
 #include <features.h>
 
index e11dddc50f87933d33fe61598a17fce590dffc73..23f0ea2ba0f8d28780aa26256a995a3b47cf1a19 100644 (file)
 #include "libbb.h"
 
 #ifdef L_full_version
-       const char * const bb_msg_full_version = BB_BANNER " multi-call binary";
+#ifndef BB_EXTRA_VERSION
+#define LIBBB_BANNER "BusyBox's library v" BB_VER " (" BB_BT ")"
+#else
+#define LIBBB_BANNER "BusyBox's library v" BB_VER " (" BB_EXTRA_VERSION ")"
+#endif
+       const char * const libbb_msg_full_version = LIBBB_BANNER;
 #endif
 #ifdef L_memory_exhausted
        const char * const bb_msg_memory_exhausted = "memory exhausted";
index a4f97c211cc3c0636ce6198c7bdb777bd5964919..943745e283d76ec50977e268bfd0f0f6476559a8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Another fast dependencies generator for Makefiles, Version 4.1
+ * Another fast dependencies generator for Makefiles, Version 4.2
  *
  * Copyright (C) 2005,2006 by Vladimir Oleynik <dzo@simtreas.ru>
  *
@@ -1261,6 +1261,7 @@ static void parse_inc(const char *include, const char *fname)
     llist_t *lo;
     char *ap;
     size_t key_sz;
+    struct stat st;
 
     if(*include == '/') {
        lo = NULL;
@@ -1284,8 +1285,18 @@ static void parse_inc(const char *include, const char *fname)
            free(ap);
            return;
        }
-       if(access(ap, F_OK) == 0) {
+       if(stat(ap, &st) == 0) {
            /* found */
+           llist_t *cfl;
+
+           for(cfl = configs; cfl; cfl = cfl->link) {
+               struct stat *config = (struct stat *)cfl->data;
+
+               if (st.st_dev == config->st_dev && st.st_ino == config->st_ino) {
+                       /* skip depend with bb_configs.h */
+                       return NULL;
+               }
+           }
            p_i = ap;
            break;
        } else if(lo == NULL) {
@@ -1501,7 +1512,7 @@ parse_chd(const char *fe, const char *p, size_t dirlen)
            struct stat *config = (struct stat *)cfl->data;
 
            if (st.st_dev == config->st_dev && st.st_ino == config->st_ino) {
-               /* skip already parsed configs.h */
+               /* skip already parsed bb_configs.h */
                return NULL;
            }
        }
index e9e6def22e73b390281d721763c1248e3cf5b93d..9eb395fd9b697d8bfc0f51dc3f7373b1cd259e47 100644 (file)
@@ -11833,8 +11833,9 @@ setinteractive(int on)
 
                                if(!do_banner) {
                                        out1fmt(
-                       "\n\n" BB_BANNER " Built-in shell (ash)\n"
-                       "Enter 'help' for a list of built-in commands.\n\n");
+                       "\n\n%s Built-in shell (ash)\n"
+                       "Enter 'help' for a list of built-in commands.\n\n",
+                                       BB_BANNER);
                                        do_banner++;
                                }
                }
index 8b6cbe7c90957483fb9510aaf05e55487c6c2171..387b6cd7a3e5a962cdc9ed7011e75b5710288979 100644 (file)
 #include "standalone.h"
 #define hush_main main
 #undef CONFIG_FEATURE_SH_FANCY_PROMPT
-#define BB_BANNER
+#define BB_BANNER ""
 #endif
 #define SPECIAL_VAR_SYMBOL 03
 #define FLAG_EXIT_FROM_LOOP 1
@@ -2812,7 +2812,8 @@ int hush_main(int argc, char **argv)
        if (interactive) {
                /* Looks like they want an interactive shell */
 #ifndef CONFIG_FEATURE_SH_EXTRA_QUIET
-               printf( "\n\n" BB_BANNER " hush - the humble shell v0.01 (testing)\n");
+               printf( "\n\n%s hush - the humble shell v0.01 (testing)\n",
+                       BB_BANNER);
                printf( "Enter 'help' for a list of built-in commands.\n\n");
 #endif
                setup_job_control();
index 1b8aca506a4fdb1c43136bccb0fc76273b28e5d4..968396e413105aeb1cd59d1fe1a4e663c86bf948 100644 (file)
@@ -1661,7 +1661,7 @@ int lash_main(int argc_l, char **argv_l)
                //printf( "optind=%d  argv[optind]='%s'\n", optind, argv[optind]);
                /* Looks like they want an interactive shell */
 #ifndef CONFIG_FEATURE_SH_EXTRA_QUIET
-               printf( "\n\n" BB_BANNER " Built-in shell (lash)\n");
+               printf( "\n\n%s Built-in shell (lash)\n", BB_BANNER);
                printf( "Enter 'help' for a list of built-in commands.\n\n");
 #endif
        } else if (local_pending_command==NULL) {
index d56db571431b3fa251a38a4a8d9a31af8b19b634..375b1266e9daf8ce44ac3df036057538d24cb3b3 100644 (file)
@@ -956,9 +956,9 @@ extern int msh_main(int argc, char **argv)
                        interactive++;
 #ifndef CONFIG_FEATURE_SH_EXTRA_QUIET
 #ifdef MSHDEBUG
-                       printf("\n\n" BB_BANNER " Built-in shell (msh with debug)\n");
+                       printf("\n\n%s Built-in shell (msh with debug)\n", BB_BANNER);
 #else
-                       printf("\n\n" BB_BANNER " Built-in shell (msh)\n");
+                       printf("\n\n%s Built-in shell (msh)\n", BB_BANNER);
 #endif
                        printf("Enter 'help' for a list of built-in commands.\n\n");
 #endif
index b8d69c4450b5f4c16cba1deb65b76d34436f5c40..5be833f5ba613d598b42ddec2b25b3fedfb68a10 100644 (file)
@@ -61,7 +61,7 @@ static void doKlogd(const int console_log_level)
        if (console_log_level != -1)
                klogctl(8, NULL, console_log_level);
 
-       syslog(LOG_NOTICE, "klogd started: " BB_BANNER);
+       syslog(LOG_NOTICE, "klogd started: %s", BB_BANNER);
 
        while (1) {
                /* Use kernel syscalls */
index c827fd85a0c974ab01f698edd9280a467c8b4a2b..447d891bd814555cc1f89a00dc78a078bf025138 100644 (file)
@@ -568,7 +568,7 @@ static void doSyslogd(void)
        }
 #endif
 
-       logMessage(LOG_SYSLOG | LOG_INFO, "syslogd started: " BB_BANNER);
+       logMessage(LOG_SYSLOG | LOG_INFO, "syslogd started: " "BusyBox v" BB_VER );
 
        for (;;) {