Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359245
b: refs/heads/master
c: 77bdcfe
h: refs/heads/master
i:
  359243: 21d2c36
v: v3
  • Loading branch information
Wang YanQing authored and Yann E. MORIN committed Dec 27, 2012
1 parent 2b12cf9 commit ada551b
Show file tree
Hide file tree
Showing 25 changed files with 389 additions and 407 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 62dc989921df2a98d1a73aacd085abe941cb9828
refs/heads/master: 77bdcfe5484fef0da899ec8e74b08dd21b031f66
23 changes: 23 additions & 0 deletions trunk/Documentation/kbuild/kconfig-language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,26 @@ config FOO
depends on BAR && m

limits FOO to module (=m) or disabled (=n).

Kconfig symbol existence
~~~~~~~~~~~~~~~~~~~~~~~~
The following two methods produce the same kconfig symbol dependencies
but differ greatly in kconfig symbol existence (production) in the
generated config file.

case 1:

config FOO
tristate "about foo"
depends on BAR

vs. case 2:

if BAR
config FOO
tristate "about foo"
endif

In case 1, the symbol FOO will always exist in the config file (given
no other dependencies). In case 2, the symbol FOO will only exist in
the config file if BAR is enabled.
6 changes: 0 additions & 6 deletions trunk/Documentation/kbuild/kconfig.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ KCONFIG_OVERWRITECONFIG
If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not
break symlinks when .config is a symlink to somewhere else.

CONFIG_
--------------------------------------------------
If you set CONFIG_ in the environment, Kconfig will prefix all symbols
with its value when saving the configuration, instead of using the default,
"CONFIG_".

______________________________________________________________________
Environment variables for '{allyes/allmod/allno/rand}config'

Expand Down
3 changes: 0 additions & 3 deletions trunk/scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ else
Kconfig := Kconfig
endif

# We need this, in case the user has it in its environment
unexport CONFIG_

xconfig: $(obj)/qconf
$< $(Kconfig)

Expand Down
7 changes: 1 addition & 6 deletions trunk/scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ enum input_mode {
} input_mode = oldaskconfig;

static int indent = 1;
static int tty_stdio;
static int valid_stdin = 1;
static int sync_kconfig;
static int conf_cnt;
Expand Down Expand Up @@ -109,8 +108,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
case oldaskconfig:
fflush(stdout);
xfgets(line, 128, stdin);
if (!tty_stdio)
printf("\n");
return 1;
default:
break;
Expand Down Expand Up @@ -498,8 +495,6 @@ int main(int ac, char **av)
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);

tty_stdio = isatty(0) && isatty(1) && isatty(2);

while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
input_mode = (enum input_mode)opt;
switch (opt) {
Expand Down Expand Up @@ -626,7 +621,7 @@ int main(int ac, char **av)
return 1;
}
}
valid_stdin = tty_stdio;
valid_stdin = isatty(0) && isatty(1) && isatty(2);
}

switch (input_mode) {
Expand Down
10 changes: 5 additions & 5 deletions trunk/scripts/kconfig/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@

struct expr *expr_alloc_symbol(struct symbol *sym)
{
struct expr *e = xcalloc(1, sizeof(*e));
struct expr *e = calloc(1, sizeof(*e));
e->type = E_SYMBOL;
e->left.sym = sym;
return e;
}

struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
{
struct expr *e = xcalloc(1, sizeof(*e));
struct expr *e = calloc(1, sizeof(*e));
e->type = type;
e->left.expr = ce;
return e;
}

struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2)
{
struct expr *e = xcalloc(1, sizeof(*e));
struct expr *e = calloc(1, sizeof(*e));
e->type = type;
e->left.expr = e1;
e->right.expr = e2;
Expand All @@ -38,7 +38,7 @@ struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e

struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2)
{
struct expr *e = xcalloc(1, sizeof(*e));
struct expr *e = calloc(1, sizeof(*e));
e->type = type;
e->left.sym = s1;
e->right.sym = s2;
Expand Down Expand Up @@ -66,7 +66,7 @@ struct expr *expr_copy(const struct expr *org)
if (!org)
return NULL;

e = xmalloc(sizeof(*org));
e = malloc(sizeof(*org));
memcpy(e, org, sizeof(*org));
switch (org->type) {
case E_SYMBOL:
Expand Down
5 changes: 2 additions & 3 deletions trunk/scripts/kconfig/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {

#include <assert.h>
#include <stdio.h>
#include <sys/queue.h>
#include "list.h"
#ifndef __cplusplus
#include <stdbool.h>
#endif
Expand Down Expand Up @@ -175,12 +175,11 @@ struct menu {
#define MENU_ROOT 0x0002

struct jump_key {
CIRCLEQ_ENTRY(jump_key) entries;
struct list_head entries;
size_t offset;
struct menu *target;
int index;
};
CIRCLEQ_HEAD(jk_head, jump_key);

#define JUMP_NB 9

Expand Down
2 changes: 1 addition & 1 deletion trunk/scripts/kconfig/gconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# include <config.h>
#endif

#include <stdlib.h>
#include "lkc.h"
#include "images.c"

Expand All @@ -23,6 +22,7 @@
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <stdlib.h>

//#define DEBUG

Expand Down
91 changes: 91 additions & 0 deletions trunk/scripts/kconfig/list.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#ifndef LIST_H
#define LIST_H

/*
* Copied from include/linux/...
*/

#undef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)

/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
* @type: the type of the container struct this is embedded in.
* @member: the name of the member within the struct.
*
*/
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})


struct list_head {
struct list_head *next, *prev;
};


#define LIST_HEAD_INIT(name) { &(name), &(name) }

#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)

/**
* list_entry - get the struct for this entry
* @ptr: the &struct list_head pointer.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct.
*/
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)

/**
* list_for_each_entry - iterate over list of given type
* @pos: the type * to use as a loop cursor.
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*/
#define list_for_each_entry(pos, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member); \
&pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))

/**
* list_empty - tests whether a list is empty
* @head: the list to test.
*/
static inline int list_empty(const struct list_head *head)
{
return head->next == head;
}

/*
* Insert a new entry between two known consecutive entries.
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
static inline void __list_add(struct list_head *_new,
struct list_head *prev,
struct list_head *next)
{
next->prev = _new;
_new->next = next;
_new->prev = prev;
prev->next = _new;
}

/**
* list_add_tail - add a new entry
* @new: new entry to be added
* @head: list head to add it before
*
* Insert a new entry before the specified head.
* This is useful for implementing queues.
*/
static inline void list_add_tail(struct list_head *_new, struct list_head *head)
{
__list_add(_new, head->prev, head);
}

#endif
8 changes: 0 additions & 8 deletions trunk/scripts/kconfig/lkc.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ extern "C" {
#ifndef CONFIG_
#define CONFIG_ "CONFIG_"
#endif
static inline const char *CONFIG_prefix(void)
{
return getenv( "CONFIG_" ) ?: CONFIG_;
}
#undef CONFIG_
#define CONFIG_ CONFIG_prefix()

#define TF_COMMAND 0x0001
#define TF_PARAM 0x0002
Expand Down Expand Up @@ -122,8 +116,6 @@ void menu_set_type(int type);
/* util.c */
struct file *file_lookup(const char *name);
int file_write_dep(const char *name);
void *xmalloc(size_t size);
void *xcalloc(size_t nmemb, size_t size);

struct gstr {
size_t len;
Expand Down
4 changes: 2 additions & 2 deletions trunk/scripts/kconfig/lkc_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ P(menu_get_root_menu,struct menu *,(struct menu *menu));
P(menu_get_parent_menu,struct menu *,(struct menu *menu));
P(menu_has_help,bool,(struct menu *menu));
P(menu_get_help,const char *,(struct menu *menu));
P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct jk_head
P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct list_head
*head));
P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct jk_head
P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct list_head
*head));
P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));

Expand Down
1 change: 0 additions & 1 deletion trunk/scripts/kconfig/lxdialog/check-lxdialog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ ccflags()
{
if [ -f /usr/include/ncursesw/curses.h ]; then
echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"'
echo ' -DNCURSES_WIDECHAR=1'
elif [ -f /usr/include/ncurses/ncurses.h ]; then
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
elif [ -f /usr/include/ncurses/curses.h ]; then
Expand Down
1 change: 0 additions & 1 deletion trunk/scripts/kconfig/lxdialog/dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ int dialog_menu(const char *title, const char *prompt,
const void *selected, int *s_scroll);
int dialog_checklist(const char *title, const char *prompt, int height,
int width, int list_height);
extern char dialog_input_result[];
int dialog_inputbox(const char *title, const char *prompt, int height,
int width, const char *init);

Expand Down
Loading

0 comments on commit ada551b

Please sign in to comment.