kconfig/nconf.h
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Wed Dec 14 16:55:22 2011 +0100 (2011-12-14)
branch1.13
changeset 2848 1ff89596dab0
permissions -rw-r--r--
libc/eglibc: fix localedef 2.14 build

The localedef of eglibc 2.14 requires NOT_IN_libc to be defined in order to
compile intl/l10nflist.c.

This is because localedef is built separately from eglibc and uses some parts of
eglibc that don't compile in standalone without this preprocessor definition.

This fixes the following error:

[ALL ] gcc -g -O2 -DNO_SYSCONF -DNO_UNCOMPRESS
-DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"'
-DLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"'
-DCHARMAP_PATH='"/usr/share/i18n/charmaps"'
-DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"'
-DLOCSRCDIR='"/usr/share/i18n/locales"' -Iglibc/locale/programs -Iglibc/locale
-I/<snip>/.build/src/eglibc-localedef-2_14/include
-I/<snip>/.build/src/eglibc-localedef-2_14 -I.
-include /<snip>/.build/src/eglibc-localedef-2_14/include/always.h -Wall
-Wno-format -c -o locarchive.o glibc/locale/programs/locarchive.c
[ALL ] glibc/locale/programs/locarchive.c: In function 'enlarge_archive':
[ALL ] glibc/locale/programs/locarchive.c:303:21: warning: variable
'oldlocrectab' set but not used [-Wunused-but-set-variable]
[ALL ] In file included from glibc/locale/programs/locarchive.c:651:0:
[ALL ] glibc/locale/programs/../../intl/l10nflist.c: In function
'_nl_normalize_codeset':
[ERROR] glibc/locale/programs/../../intl/l10nflist.c:342:9: error:
'_nl_C_locobj_ptr' undeclared (first use in this function)
[ALL ] glibc/locale/programs/../../intl/l10nflist.c:342:9: note: each
undeclared identifier is reported only once for each function it appears in
[ALL ] glibc/locale/programs/locarchive.c: In function
'add_locales_to_archive':
[ALL ] glibc/locale/programs/locarchive.c:1450:7: warning: passing argument
1 of '__xpg_basename' discards 'const' qualifier from pointer target type
[enabled by default]
[ALL ] /usr/include/libgen.h:35:14: note: expected 'char *' but argument is
of type 'const char *'
[ERROR] make[1]: *** [locarchive.o] Error 1

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
(transplanted from 4cd9134739b594451794cf61a6e1b137422cdafd)
     1 /*
     2  * Copyright (C) 2008 Nir Tzachar <nir.tzachar@gmail.com?
     3  * Released under the terms of the GNU GPL v2.0.
     4  *
     5  * Derived from menuconfig.
     6  *
     7  */
     8 
     9 #include <ctype.h>
    10 #include <errno.h>
    11 #include <fcntl.h>
    12 #include <limits.h>
    13 #include <stdarg.h>
    14 #include <stdlib.h>
    15 #include <string.h>
    16 #include <unistd.h>
    17 #include <locale.h>
    18 #include <curses.h>
    19 #include <menu.h>
    20 #include <panel.h>
    21 #include <form.h>
    22 
    23 #include <stdio.h>
    24 #include <time.h>
    25 #include <sys/time.h>
    26 
    27 #include "ncurses.h"
    28 
    29 #define max(a, b) ({\
    30 		typeof(a) _a = a;\
    31 		typeof(b) _b = b;\
    32 		_a > _b ? _a : _b; })
    33 
    34 #define min(a, b) ({\
    35 		typeof(a) _a = a;\
    36 		typeof(b) _b = b;\
    37 		_a < _b ? _a : _b; })
    38 
    39 typedef enum {
    40 	NORMAL = 1,
    41 	MAIN_HEADING,
    42 	MAIN_MENU_BOX,
    43 	MAIN_MENU_FORE,
    44 	MAIN_MENU_BACK,
    45 	MAIN_MENU_GREY,
    46 	MAIN_MENU_HEADING,
    47 	SCROLLWIN_TEXT,
    48 	SCROLLWIN_HEADING,
    49 	SCROLLWIN_BOX,
    50 	DIALOG_TEXT,
    51 	DIALOG_MENU_FORE,
    52 	DIALOG_MENU_BACK,
    53 	DIALOG_BOX,
    54 	INPUT_BOX,
    55 	INPUT_HEADING,
    56 	INPUT_TEXT,
    57 	INPUT_FIELD,
    58 	FUNCTION_TEXT,
    59 	FUNCTION_HIGHLIGHT,
    60 	ATTR_MAX
    61 } attributes_t;
    62 extern attributes_t attributes[];
    63 
    64 typedef enum {
    65 	F_HELP = 1,
    66 	F_SYMBOL = 2,
    67 	F_INSTS = 3,
    68 	F_CONF = 4,
    69 	F_BACK = 5,
    70 	F_SAVE = 6,
    71 	F_LOAD = 7,
    72 	F_SEARCH = 8,
    73 	F_EXIT = 9,
    74 } function_key;
    75 
    76 void set_colors(void);
    77 
    78 /* this changes the windows attributes !!! */
    79 void print_in_middle(WINDOW *win,
    80 		int starty,
    81 		int startx,
    82 		int width,
    83 		const char *string,
    84 		chtype color);
    85 int get_line_length(const char *line);
    86 int get_line_no(const char *text);
    87 const char *get_line(const char *text, int line_no);
    88 void fill_window(WINDOW *win, const char *text);
    89 int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...);
    90 int dialog_inputbox(WINDOW *main_window,
    91 		const char *title, const char *prompt,
    92 		const char *init, char *result, int result_len);
    93 void refresh_all_windows(WINDOW *main_window);
    94 void show_scroll_win(WINDOW *main_window,
    95 		const char *title,
    96 		const char *text);