summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch')
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch912
1 files changed, 912 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch
new file mode 100644
index 0000000..4559a11
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch
@@ -0,0 +1,912 @@
1Pulled from
2http://www.eglibc.org/archives/patches/msg01042.html
3
4Upstream-Status: Pending
5Signed-off-by: Khem
6
7Hi,
8
9This patch adds 'make menuconfig' support to EGLIBC.
10
11
12EGLIBC can re-use the Linux kernel kconfig host tools ('conf' and 'mconf') unmodified, by passing appropriate environment variables and with some pre- and post-processing on the input/output config files.
13
14There are three new make targets supported, which all are defined in the new libc/options-config/Makefile, which is included by the top-level libc/Makefile:
15
16- 'make defconfig'. This passes 'libc/option-groups.defaults' to 'conf' as a default config, and outputs 'option-groups.config' to the top-level build directory, which will be the same as the default config.
17
18- 'make config'. This is the same line-oriented interface as in the Linux kernel. Input and output is 'option-groups.config' in the top-level build directory.
19
20- 'make menuconfig'. This is the same menu-based interface as in the Linux kernel. Input and output is 'option-groups.config' in the top-level build directory.
21
22
23Pre-Processing:
24
25
26The Linux kernel kconfig tools expect a prefix of "CONFIG_" on all config option names, but EGLIBC expects a prefix of "OPTION_". The pre-processing script, libc/options-config/config-preproc.pl, simply replaces "CONFIG_ with "OPTION_" in the given config file. The libc/options-config/Makefile passes the script output to a temporary config file, which is then passed to 'conf' or 'mconf'.
27
28Post-Processing (libc/options-config/config-postproc.pl):
29
30
31- Disabled options are output as a comment line of the form "# CONFIG_FOO is not set". This needs to be changed to an explicit "CONFIG_FOO=n" in order to be compatible with 'option-groups.awk' which generates the option-groups.h header.
32
33- "CONFIG_" prefix is changed back to "OPTION_".
34
35
36- The kconfig tools will not output anything for options that depend on a parent option, when the parent option is disabled. This implicit disable must be converted to an explicit "CONFIG_FOO=n" in order to be compatible with the way EGLIBC overrides the default option settings in 'libc/option-groups.defaults' with those in 'option-groups.config'.
37
38
39A new configure option, '--with-kconfig=<PATH>', tells EGLIBC where to find the pre-built 'conf' and 'mconf' host tools from Linux kernel builds.
40
41libc/EGLIBC.cross-building is updated to include instructions for using '--with-kconfig' for the final EGLIBC build, and shows how and when to run 'make *config'.
42
43libc/EGLIBC.option-groups is updated to include new information on the menuconfig support.
44
45Thanks,
46
47attached is the updated patch to address above issues.
48
49Steve
50
51--
52Steve Longerbeam | Senior Embedded Engineer, ESD Services
53Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538
54P 510.354.5838 | M 408.410.2735
55Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS
56
57
58Index: libc/EGLIBC.cross-building
59===================================================================
60--- libc.orig/EGLIBC.cross-building
61+++ libc/EGLIBC.cross-building
62@@ -243,9 +243,29 @@ full EGLIBC build:
63 > $src/libc/configure \
64 > --prefix=/usr \
65 > --with-headers=$sysroot/usr/include \
66+ > --with-kconfig=$obj/linux/scripts/kconfig \
67 > --build=$build \
68 > --host=$target \
69 > --disable-profile --without-gd --without-cvs --enable-add-ons
70+
71+Note the additional '--with-kconfig' option. This tells EGLIBC where to
72+find the host config tools used by the kernel 'make config' and 'make
73+menuconfig'. These tools can be re-used by EGLIBC for its own 'make
74+*config' support, which will create 'option-groups.config' for you.
75+But first make sure those tools have been built by running some
76+dummy 'make *config' calls in the kernel directory:
77+
78+ $ cd $obj/linux
79+ $ PATH=$tools/bin:$PATH make config \
80+ > ARCH=$linux_arch CROSS_COMPILE=$target- \
81+ $ PATH=$tools/bin:$PATH make menuconfig \
82+ > ARCH=$linux_arch CROSS_COMPILE=$target- \
83+
84+Now we can configure and build the full EGLIBC:
85+
86+ $ cd $obj/eglibc
87+ $ PATH=$tools/bin:$PATH make defconfig
88+ $ PATH=$tools/bin:$PATH make menuconfig
89 $ PATH=$tools/bin:$PATH make
90 $ PATH=$tools/bin:$PATH make install install_root=$sysroot
91
92Index: libc/configure.ac
93===================================================================
94--- libc.orig/configure.ac
95+++ libc/configure.ac
96@@ -127,6 +127,16 @@ AC_ARG_WITH([headers],
97 [sysheaders=''])
98 AC_SUBST(sysheaders)
99
100+AC_ARG_WITH([kconfig],
101+ AC_HELP_STRING([--with-kconfig=PATH],
102+ [location of kconfig tools to use (from Linux
103+ kernel builds) to re-use for configuring EGLIBC
104+ option groups]),
105+ [KCONFIG_TOOLS=$withval],
106+ [KCONFIG_TOOLS=''])
107+AC_SUBST(KCONFIG_TOOLS)
108+
109+
110 AC_SUBST(use_default_link)
111 AC_ARG_WITH([default-link],
112 AC_HELP_STRING([--with-default-link],
113Index: libc/config.make.in
114===================================================================
115--- libc.orig/config.make.in
116+++ libc/config.make.in
117@@ -45,6 +45,8 @@ sysincludes = @SYSINCLUDES@
118 c++-sysincludes = @CXX_SYSINCLUDES@
119 all-warnings = @all_warnings@
120
121+kconfig_tools = @KCONFIG_TOOLS@
122+
123 have-z-combreloc = @libc_cv_z_combreloc@
124 have-z-execstack = @libc_cv_z_execstack@
125 have-Bgroup = @libc_cv_Bgroup@
126Index: libc/options-config/config-postproc.pl
127===================================================================
128--- /dev/null
129+++ libc/options-config/config-postproc.pl
130@@ -0,0 +1,54 @@
131+#!/usr/bin/perl
132+
133+$usage = "usage: $0 <default config file> <config file>\n";
134+
135+die "$usage" unless @ARGV;
136+$defaults = shift @ARGV;
137+die "$usage" unless @ARGV;
138+die "Could not open $ARGV[0]" unless -T $ARGV[0];
139+
140+sub yank {
141+ @option = grep($_ ne $_[0], @option);
142+}
143+
144+open(DEFAULTS, $defaults) || die "Could not open $defaults\n";
145+
146+# get the full list of available options using the default config file
147+$i = 0;
148+while (<DEFAULTS>) {
149+ if (/^\s*OPTION_(\w+)\s*=/) {
150+ $option[$i++] = $1;
151+ }
152+}
153+
154+# now go through the config file, making the necessary changes
155+while (<>) {
156+ if (/Linux Kernel Configuration/) {
157+ # change title
158+ s/Linux Kernel/Option Groups/;
159+ print;
160+ } elsif (/^\s*CONFIG_(\w+)\s*=/) {
161+ # this is an explicit option set line, change CONFIG_ to OPTION_
162+ # before printing and remove this option from option list
163+ $opt = $1;
164+ yank($opt);
165+ s/CONFIG_/OPTION_/g;
166+ print;
167+ } elsif (/^\s*#\s+CONFIG_(\w+) is not set/) {
168+ # this is a comment line, change CONFIG_ to OPTION_, remove this
169+ # option from option list, and convert to explicit OPTION_FOO=n
170+ $opt = $1;
171+ yank($opt);
172+ s/CONFIG_/OPTION_/g;
173+ print "OPTION_$opt=n\n";
174+ } else {
175+ print;
176+ }
177+}
178+
179+# any options left in @options, are options that were not mentioned in
180+# the config file, and implicitly that means the option must be set =n,
181+# so do that here.
182+foreach $opt (@option) {
183+ print "OPTION_$opt=n\n";
184+}
185Index: libc/options-config/config-preproc.pl
186===================================================================
187--- /dev/null
188+++ libc/options-config/config-preproc.pl
189@@ -0,0 +1,8 @@
190+#!/usr/bin/perl
191+
192+if (@ARGV) {
193+ while (<>) {
194+ s/OPTION_/CONFIG_/g;
195+ print;
196+ }
197+}
198Index: libc/options-config/Makefile
199===================================================================
200--- /dev/null
201+++ libc/options-config/Makefile
202@@ -0,0 +1,55 @@
203+# ===========================================================================
204+# EGLIBC option-groups configuration targets
205+# These targets are included from top-level makefile
206+
207+ifneq ($(kconfig_tools),)
208+ifneq (no,$(PERL))
209+
210+ocdir := options-config
211+
212+OconfigDefaults := option-groups.defaults
213+OconfigDefaults_tmp := $(common-objpfx).tmp.defconfig
214+OconfigDef := option-groups.def
215+Oconfig := $(common-objpfx)option-groups.config
216+Oconfig_tmp := $(common-objpfx).tmp.config
217+
218+conf := $(kconfig_tools)/conf
219+mconf := $(kconfig_tools)/mconf
220+
221+preproc := $(PERL) $(ocdir)/config-preproc.pl
222+postproc := $(PERL) $(ocdir)/config-postproc.pl
223+
224+PHONY += defconfig config menuconfig
225+
226+defconfig: $(conf) $(OconfigDefaults) $(OconfigDef)
227+ rm -f $(OconfigDefaults_tmp)
228+ rm -f $(Oconfig_tmp)
229+ $(preproc) $(OconfigDefaults) > $(OconfigDefaults_tmp)
230+ KCONFIG_CONFIG=$(Oconfig_tmp) $< --defconfig=$(OconfigDefaults_tmp) \
231+ $(OconfigDef)
232+ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig)
233+ rm $(Oconfig_tmp)
234+ rm $(OconfigDefaults_tmp)
235+
236+config: $(conf) $(OconfigDefaults) $(OconfigDef)
237+ rm -f $(Oconfig_tmp)
238+ $(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp)
239+ KCONFIG_CONFIG=$(Oconfig_tmp) $< --oldaskconfig $(OconfigDef)
240+ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig)
241+ rm $(Oconfig_tmp)
242+
243+menuconfig: $(mconf) $(OconfigDefaults) $(OconfigDef)
244+ rm -f $(Oconfig_tmp)
245+ $(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp)
246+ KCONFIG_CONFIG=$(Oconfig_tmp) $< $(OconfigDef)
247+ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig)
248+ rm $(Oconfig_tmp)
249+
250+# Help text used by make help
251+help:
252+ @echo ' defconfig - New config with default from default config'
253+ @echo ' config - Update current config utilising a line-oriented program'
254+ @echo ' menuconfig - Update current config utilising a menu based program'
255+
256+endif
257+endif
258Index: libc/option-groups.def
259===================================================================
260--- libc.orig/option-groups.def
261+++ libc/option-groups.def
262@@ -4,19 +4,19 @@
263 #
264 # An entry of the form:
265 #
266-# config OPTION_GROUP_NAME
267+# config GROUP_NAME
268 # bool "one-line explanation of what this option group controls"
269 # help
270 # Multi-line help explaining the option group's meaning in
271 # some detail, terminated by indentation level.
272 #
273-# defines an option group whose variable is OPTION_GROUP_NAME, with
274+# defines an option group whose variable is GROUP_NAME, with
275 # meaningful values 'y' (enabled) and 'n' (disabled). The
276 # documentation is formatted to be consumed by some sort of
277 # interactive configuration interface, but EGLIBC doesn't have such an
278 # interface yet.
279 #
280-# An option may have a 'depends' line, indicating which other options
281+# An option may have a 'depends on' line, indicating which other options
282 # must also be enabled if this option is. At present, EGLIBC doesn't
283 # check that these dependencies are satisfied.
284 #
285@@ -41,9 +41,9 @@
286 # although this simply reestablishes the value already set by
287 # 'option-groups.defaults'.
288
289-config OPTION_EGLIBC_ADVANCED_INET6
290+config EGLIBC_ADVANCED_INET6
291 bool "IPv6 Advanced Sockets API support (RFC3542)"
292- depends OPTION_EGLIBC_INET
293+ depends on EGLIBC_INET
294 help
295 This option group includes the functions specified by RFC 3542,
296 "Advanced Sockets Application Program Interface (API) for
297@@ -71,7 +71,7 @@ config OPTION_EGLIBC_ADVANCED_INET6
298 inet6_rth_segments
299 inet6_rth_space
300
301-config OPTION_EGLIBC_BACKTRACE
302+config EGLIBC_BACKTRACE
303 bool "Functions for producing backtraces"
304 help
305 This option group includes functions for producing a list of
306@@ -85,7 +85,7 @@ config OPTION_EGLIBC_BACKTRACE
307 backtrace_symbols
308 backtrace_symbols_fd
309
310-config OPTION_EGLIBC_BIG_MACROS
311+config EGLIBC_BIG_MACROS
312 bool "Use extensive inline code"
313 help
314 This option group specifies whether certain pieces of code
315@@ -93,7 +93,7 @@ config OPTION_EGLIBC_BIG_MACROS
316 group is not selected, function calls will be used instead,
317 hence reducing the library footprint.
318
319-config OPTION_EGLIBC_BSD
320+config EGLIBC_BSD
321 bool "BSD-specific functions, and their compatibility stubs"
322 help
323 This option group includes functions specific to BSD kernels.
324@@ -109,10 +109,9 @@ config OPTION_EGLIBC_BSD
325 revoke
326 setlogin
327
328-config OPTION_EGLIBC_CXX_TESTS
329+config EGLIBC_CXX_TESTS
330 bool "Tests that link against the standard C++ library."
331- depends OPTION_POSIX_WIDE_CHAR_DEVICE_IO
332- depends OPTION_EGLIBC_LIBM
333+ depends on POSIX_WIDE_CHAR_DEVICE_IO && EGLIBC_LIBM
334 help
335 This option group does not include any C library functions;
336 instead, it controls which EGLIBC tests an ordinary 'make
337@@ -121,23 +120,22 @@ config OPTION_EGLIBC_CXX_TESTS
338 run.
339
340 The standard C++ library depends on the math library 'libm' and
341- the wide character I/O functions included in EGLIBC. If those
342- option groups are disabled, this test must also be disabled.
343+ the wide character I/O functions included in EGLIBC. So those
344+ option groups must be enabled if this test is enabled.
345
346-config OPTION_EGLIBC_CATGETS
347+config EGLIBC_CATGETS
348 bool "Functions for accessing message catalogs"
349- depends OPTION_EGLIBC_LOCALE_CODE
350+ depends on EGLIBC_LOCALE_CODE
351 help
352 This option group includes functions for accessing message
353 catalogs: catopen, catclose, and catgets.
354
355- This option group depends on the OPTION_EGLIBC_LOCALE_CODE
356- option group; if you disable that, you must also disable this.
357+ This option group depends on the EGLIBC_LOCALE_CODE
358+ option group.
359
360-config OPTION_EGLIBC_CHARSETS
361+config EGLIBC_CHARSETS
362 bool "iconv/gconv character set conversion libraries"
363 help
364-
365 This option group includes support for character sets other
366 than ASCII (ANSI_X3.4-1968) and Unicode and ISO-10646 in their
367 various encodings. This affects both the character sets
368@@ -198,16 +196,16 @@ config OPTION_EGLIBC_CHARSETS
369 WCHAR_T - EGLIBC's internal form (target-endian,
370 32-bit ISO 10646)
371
372-config OPTION_EGLIBC_CRYPT
373+config EGLIBC_CRYPT
374 bool "Encryption library"
375 help
376 This option group includes the `libcrypt' library which
377 provides functions for one-way encryption. Supported
378 encryption algorithms include MD5, SHA-256, SHA-512 and DES.
379
380-config OPTION_EGLIBC_CRYPT_UFC
381+config EGLIBC_CRYPT_UFC
382 bool "Ultra fast `crypt' implementation"
383- depends OPTION_EGLIBC_CRYPT
384+ depends on EGLIBC_CRYPT
385 help
386 This option group provides ultra fast DES-based implementation of
387 the `crypt' function. When this option group is disabled,
388@@ -216,7 +214,7 @@ config OPTION_EGLIBC_CRYPT_UFC
389 errno to ENOSYS if /salt/ passed does not correspond to either MD5,
390 SHA-256 or SHA-512 algorithm.
391
392-config OPTION_EGLIBC_DB_ALIASES
393+config EGLIBC_DB_ALIASES
394 bool "Functions for accessing the mail aliases database"
395 help
396 This option group includues functions for looking up mail
397@@ -233,7 +231,7 @@ config OPTION_EGLIBC_DB_ALIASES
398 When this option group is disabled, the NSS service libraries
399 also lack support for querying their mail alias tables.
400
401-config OPTION_EGLIBC_ENVZ
402+config EGLIBC_ENVZ
403 bool "Functions for handling envz-style environment vectors."
404 help
405 This option group contains functions for creating and operating
406@@ -248,7 +246,7 @@ config OPTION_EGLIBC_ENVZ
407 envz_entry envz_remove
408 envz_get envz_strip
409
410-config OPTION_EGLIBC_FCVT
411+config EGLIBC_FCVT
412 bool "Functions for converting floating-point numbers to strings"
413 help
414 This option group includes functions for converting
415@@ -262,14 +260,14 @@ config OPTION_EGLIBC_FCVT
416 fcvt_r qfcvt_r
417 gcvt qgcvt
418
419-config OPTION_EGLIBC_FMTMSG
420+config EGLIBC_FMTMSG
421 bool "Functions for formatting messages"
422 help
423 This option group includes the following functions:
424
425 addseverity fmtmsg
426
427-config OPTION_EGLIBC_FSTAB
428+config EGLIBC_FSTAB
429 bool "Access functions for 'fstab'"
430 help
431 This option group includes functions for reading the mount
432@@ -283,7 +281,7 @@ config OPTION_EGLIBC_FSTAB
433 getfsent setfsent
434 getfsfile
435
436-config OPTION_EGLIBC_FTRAVERSE
437+config EGLIBC_FTRAVERSE
438 bool "Functions for traversing file hierarchies"
439 help
440 This option group includes functions for traversing file
441@@ -297,9 +295,9 @@ config OPTION_EGLIBC_FTRAVERSE
442 fts_set nftw64
443 fts_close
444
445-config OPTION_EGLIBC_GETLOGIN
446+config EGLIBC_GETLOGIN
447 bool "The getlogin function"
448- depends OPTION_EGLIBC_UTMP
449+ depends on EGLIBC_UTMP
450 help
451 This function group includes the 'getlogin' and 'getlogin_r'
452 functions, which return the user name associated by the login
453@@ -309,17 +307,17 @@ config OPTION_EGLIBC_GETLOGIN
454 fall back on 'getlogin' to find the user's login name for tilde
455 expansion when the 'HOME' environment variable is not set.
456
457-config OPTION_EGLIBC_IDN
458+config EGLIBC_IDN
459 bool "International domain names support"
460 help
461 This option group includes the `libcidn' library which
462 provides support for international domain names.
463
464-config OPTION_EGLIBC_INET
465+config EGLIBC_INET
466 bool "Networking support"
467 help
468 This option group includes networking-specific functions and
469- data. With OPTION_EGLIBC_INET disabled, the EGLIBC
470+ data. With EGLIBC_INET disabled, the EGLIBC
471 installation and API changes as follows:
472
473 - The following libraries are not installed:
474@@ -439,14 +437,14 @@ config OPTION_EGLIBC_INET
475 use Unix-domain sockets to communicate with the syslog daemon;
476 syslog is valuable in non-networked contexts.
477
478-config OPTION_EGLIBC_INET_ANL
479+config EGLIBC_INET_ANL
480 bool "Asynchronous name lookup"
481- depends OPTION_EGLIBC_INET
482+ depends on EGLIBC_INET
483 help
484 This option group includes the `libanl' library which
485 provides support for asynchronous name lookup.
486
487-config OPTION_EGLIBC_LIBM
488+config EGLIBC_LIBM
489 bool "libm (math library)"
490 help
491 This option group includes the 'libm' library, containing
492@@ -464,7 +462,7 @@ config OPTION_EGLIBC_LIBM
493 group, you will not be able to build 'libstdc++' against the
494 resulting EGLIBC installation.
495
496-config OPTION_EGLIBC_LOCALES
497+config EGLIBC_LOCALES
498 bool "Locale definitions"
499 help
500 This option group includes all locale definitions other than
501@@ -472,17 +470,17 @@ config OPTION_EGLIBC_LOCALES
502 only the "C" locale is supported.
503
504
505-config OPTION_EGLIBC_LOCALE_CODE
506+config EGLIBC_LOCALE_CODE
507 bool "Locale functions"
508- depends OPTION_POSIX_C_LANG_WIDE_CHAR
509+ depends on POSIX_C_LANG_WIDE_CHAR
510 help
511 This option group includes locale support functions, programs,
512- and libraries. With OPTION_EGLIBC_LOCALE_FUNCTIONS disabled,
513+ and libraries. With EGLIBC_LOCALE_CODE disabled,
514 EGLIBC supports only the 'C' locale (also known as 'POSIX'),
515 and ignores the settings of the 'LANG' and 'LC_*' environment
516 variables.
517
518- With OPTION_EGLIBC_LOCALE_CODE disabled, the following
519+ With EGLIBC_LOCALE_CODE disabled, the following
520 functions are omitted from libc:
521
522 duplocale localeconv nl_langinfo rpmatch strfmon_l
523@@ -491,46 +489,43 @@ config OPTION_EGLIBC_LOCALE_CODE
524 Furthermore, only the LC_CTYPE and LC_TIME categories of the
525 standard "C" locale are available.
526
527- The OPTION_EGLIBC_CATGETS option group depends on this option
528- group; if you disable OPTION_EGLIBC_LOCALE_CODE, you must also
529- disable OPTION_EGLIBC_CATGETS.
530+ The EGLIBC_CATGETS option group depends on this option group.
531+
532
533-config OPTION_EGLIBC_MEMUSAGE
534+config EGLIBC_MEMUSAGE
535 bool "Memory profiling library"
536 help
537 This option group includes the `libmemusage' library and
538 the `memusage' and `memusagestat' utilities.
539 These components provide memory profiling functions.
540
541- OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
542+ EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
543
544 Libmemusage library buffers the profiling data in memory
545 before writing it out to disk. By default, the library
546 allocates 1.5M buffer, which can be substantial for some
547- systems. OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE option
548+ systems. EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE option
549 allows to change the default buffer size. It specifies
550 the number of entries the buffer should have.
551 On most architectures one buffer entry amounts to 48 bytes,
552 so setting this option to the value of 512 will reduce the size of
553 the memory buffer to 24K.
554
555-config OPTION_EGLIBC_NIS
556+config EGLIBC_NIS
557 bool "Support for NIS, NIS+, and the special 'compat' services."
558- depends OPTION_EGLIBC_INET
559- depends OPTION_EGLIBC_SUNRPC
560+ depends on EGLIBC_INET && EGLIBC_SUNRPC
561 help
562 This option group includes the NIS, NIS+, and 'compat' Name
563 Service Switch service libraries. When it is disabled, those
564 services libraries are not installed; you should remove any
565 references to them from your 'nsswitch.conf' file.
566
567- This option group depends on the OPTION_EGLIBC_INET option
568+ This option group depends on the EGLIBC_INET option
569 group; you must enable that to enable this option group.
570
571-config OPTION_EGLIBC_NSSWITCH
572+config EGLIBC_NSSWITCH
573 bool "Name service switch (nsswitch) support"
574 help
575-
576 This option group includes support for the 'nsswitch' facility.
577 With this option group enabled, all EGLIBC functions for
578 accessing various system databases (passwords and groups;
579@@ -544,12 +539,12 @@ config OPTION_EGLIBC_NSSWITCH
580 'option-groups.config' file must set the following two
581 variables:
582
583- OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG
584+ EGLIBC_NSSWITCH_FIXED_CONFIG
585
586 Set this to the name of a file whose contents observe the
587 same syntax as an ordinary '/etc/nsswitch.conf' file. The
588 EGLIBC build process parses this file just as EGLIBC would
589- at run time if OPTION_EGLIBC_NSSWITCH were enabled, and
590+ at run time if EGLIBC_NSSWITCH were enabled, and
591 produces a C library that uses the nsswitch service
592 libraries to search for database entries as this file
593 specifies, instead of consulting '/etc/nsswitch.conf' at run
594@@ -567,7 +562,7 @@ config OPTION_EGLIBC_NSSWITCH
595 you will probably want to delete references to databases not
596 needed on your system.
597
598- OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS
599+ EGLIBC_NSSWITCH_FIXED_FUNCTIONS
600
601 The EGLIBC build process uses this file to decide which
602 functions to make available from which service libraries.
603@@ -585,28 +580,28 @@ config OPTION_EGLIBC_NSSWITCH
604 Be sure to mention each function in each service you wish to
605 use. If you do not mention a service's function here, the
606 EGLIBC database access functions will not find it, even if
607- it is listed in the OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG
608+ it is listed in the EGLIBC_NSSWITCH_FIXED_CONFIG
609 file.
610
611- In this arrangement, EGLIBC will not use the 'dlopen' and
612- 'dlsym' functions to find database access functions. Instead,
613- libc hard-codes references to the service libraries' database
614- access functions. You must explicitly link your program
615- against the name service libraries (those whose names start
616- with 'libnss_', in the sysroot's '/lib' directory) whose
617- functions you intend to use. This arrangement helps
618- system-wide static analysis tools decide which functions a
619- system actually uses.
620-
621- Note that some nsswitch service libraries require other option
622- groups to be enabled; for example, the OPTION_EGLIBC_INET
623- option group must be enabled to use the 'libnss_dns.so.2'
624- service library, which uses the Domain Name System network
625- protocol to answer queries.
626+ In this arrangement, EGLIBC will not use the 'dlopen' and
627+ 'dlsym' functions to find database access functions. Instead,
628+ libc hard-codes references to the service libraries' database
629+ access functions. You must explicitly link your program
630+ against the name service libraries (those whose names start
631+ with 'libnss_', in the sysroot's '/lib' directory) whose
632+ functions you intend to use. This arrangement helps
633+ system-wide static analysis tools decide which functions a
634+ system actually uses.
635+
636+ Note that some nsswitch service libraries require other option
637+ groups to be enabled; for example, the EGLIBC_INET
638+ option group must be enabled to use the 'libnss_dns.so.2'
639+ service library, which uses the Domain Name System network
640+ protocol to answer queries.
641
642-config OPTION_EGLIBC_RCMD
643+config EGLIBC_RCMD
644 bool "Support for 'rcmd' and related library functions"
645- depends OPTION_EGLIBC_INET
646+ depends on EGLIBC_INET
647 help
648 This option group includes functions for running commands on
649 remote machines via the 'rsh' protocol, and doing authentication
650@@ -622,7 +617,7 @@ config OPTION_EGLIBC_RCMD
651 rresvport ruserpass
652 rresvport_af
653
654-config OPTION_EGLIBC_RTLD_DEBUG
655+config EGLIBC_RTLD_DEBUG
656 bool "Runtime linker debug print outs"
657 help
658 This option group enables debug output of the runtime linker
659@@ -633,7 +628,7 @@ config OPTION_EGLIBC_RTLD_DEBUG
660 the `ldd' utility which may also be used by the prelinker.
661 In particular, the `--unused' ldd option will not work correctly.
662
663-config OPTION_EGLIBC_SPAWN
664+config EGLIBC_SPAWN
665 bool "Support for POSIX posix_spawn functions"
666 help
667 This option group includes the POSIX functions for executing
668@@ -669,7 +664,7 @@ config OPTION_EGLIBC_SPAWN
669 disabled, those programs will only operate on uncompressed
670 charmap files.
671
672-config OPTION_EGLIBC_STREAMS
673+config EGLIBC_STREAMS
674 bool "Support for accessing STREAMS."
675 help
676 This option group includes functions for reading and writing
677@@ -685,14 +680,14 @@ config OPTION_EGLIBC_STREAMS
678 isastream fdetach
679 putmsg
680
681-config OPTION_EGLIBC_SUNRPC
682+config EGLIBC_SUNRPC
683 bool "Support for the Sun 'RPC' protocol."
684- depends OPTION_EGLIBC_INET
685+ depends on EGLIBC_INET
686 help
687 This option group includes support for the Sun RPC protocols,
688 including the 'rpcgen' and 'rpcinfo' programs.
689
690-config OPTION_EGLIBC_UTMP
691+config EGLIBC_UTMP
692 bool "Older access functions for 'utmp' login records"
693 help
694 This option group includes the older 'utent' family of
695@@ -719,9 +714,9 @@ config OPTION_EGLIBC_UTMP
696
697 libutil.so (and libutil.a)
698
699-config OPTION_EGLIBC_UTMPX
700+config EGLIBC_UTMPX
701 bool "POSIX access functions for 'utmp' login records"
702- depends OPTION_EGLIBC_UTMP
703+ depends on EGLIBC_UTMP
704 help
705 This option group includes the POSIX functions for reading and
706 writing user login records in the 'utmp' file (usually
707@@ -742,21 +737,21 @@ config OPTION_EGLIBC_UTMPX
708 updwtmpx
709 utmpxname
710
711-config OPTION_EGLIBC_WORDEXP
712+config EGLIBC_WORDEXP
713 bool "Shell-style word expansion"
714 help
715 This option group includes the 'wordexp' function for
716 performing word expansion in the manner of the shell, and the
717 accompanying 'wordfree' function.
718
719-config OPTION_POSIX_C_LANG_WIDE_CHAR
720+config POSIX_C_LANG_WIDE_CHAR
721 bool "ISO C library wide character functions, excluding I/O"
722 help
723 This option group includes the functions defined by the ISO C
724 standard for working with wide and multibyte characters in
725 memory. Functions for reading and writing wide and multibyte
726 characters from and to files call in the
727- OPTION_POSIX_WIDE_CHAR_DEVICE_IO option group.
728+ POSIX_WIDE_CHAR_DEVICE_IO option group.
729
730 This option group includes the following functions:
731
732@@ -778,14 +773,14 @@ config OPTION_POSIX_C_LANG_WIDE_CHAR
733 mbrlen wcscoll wcstol
734 mbrtowc wcscpy wcstold
735
736-config OPTION_POSIX_REGEXP
737+config POSIX_REGEXP
738 bool "Regular expressions"
739 help
740 This option group includes the POSIX regular expression
741 functions, and the associated non-POSIX extensions and
742 compatibility functions.
743
744- With OPTION_POSIX_REGEXP disabled, the following functions are
745+ With POSIX_REGEXP disabled, the following functions are
746 omitted from libc:
747
748 re_comp re_max_failures regcomp
749@@ -799,9 +794,9 @@ config OPTION_POSIX_REGEXP
750 <regexp.h> header file, 'compile', 'step', and 'advance', is
751 omitted.
752
753-config OPTION_POSIX_REGEXP_GLIBC
754+config POSIX_REGEXP_GLIBC
755 bool "Regular expressions from GLIBC"
756- depends OPTION_POSIX_REGEXP
757+ depends on POSIX_REGEXP
758 help
759 This option group specifies which regular expression
760 library to use. The choice is between regex
761@@ -810,9 +805,9 @@ config OPTION_POSIX_REGEXP_GLIBC
762 optimized for speed; regex from libiberty is more than twice
763 as small while still is enough for most practical purposes.
764
765-config OPTION_POSIX_WIDE_CHAR_DEVICE_IO
766+config POSIX_WIDE_CHAR_DEVICE_IO
767 bool "Input and output functions for wide characters"
768- depends OPTION_POSIX_C_LANG_WIDE_CHAR
769+ depends on POSIX_C_LANG_WIDE_CHAR
770 help
771 This option group includes functions for reading and writing
772 wide characters to and from <stdio.h> streams.
773Index: libc/Makefile
774===================================================================
775--- libc.orig/Makefile
776+++ libc/Makefile
777@@ -24,6 +24,7 @@ endif
778
779 include Makeconfig
780
781+include options-config/Makefile
782
783 # This is the default target; it makes everything except the tests.
784 .PHONY: all
785Index: libc/configure
786===================================================================
787--- libc.orig/configure
788+++ libc/configure
789@@ -621,6 +621,7 @@ KSH
790 libc_cv_have_bash2
791 BASH_SHELL
792 libc_cv_gcc_static_libgcc
793+KCONFIG_TOOLS
794 CXX_SYSINCLUDES
795 SYSINCLUDES
796 AUTOCONF
797@@ -734,6 +735,7 @@ with_fp
798 with_binutils
799 with_selinux
800 with_headers
801+with_kconfig
802 with_default_link
803 enable_sanity_checks
804 enable_shared
805@@ -1438,6 +1440,9 @@ Optional Packages:
806 --with-selinux if building with SELinux support
807 --with-headers=PATH location of system headers to use (for example
808 /usr/src/linux/include) [default=compiler default]
809+ --with-kconfig=PATH location of kconfig tools to use (from Linux kernel
810+ builds) to re-use for configuring EGLIBC option
811+ groups
812 --with-default-link do not use explicit linker scripts
813 --with-cpu=CPU select code for CPU variant
814
815@@ -3401,6 +3406,14 @@ fi
816
817
818
819+# Check whether --with-kconfig was given.
820+if test "${with_kconfig+set}" = set; then
821+ withval=$with_kconfig; KCONFIG_TOOLS=$withval
822+else
823+ KCONFIG_TOOLS=''
824+fi
825+
826+
827
828 # Check whether --with-default-link was given.
829 if test "${with_default_link+set}" = set; then :
830Index: libc/EGLIBC.option-groups
831===================================================================
832--- libc.orig/EGLIBC.option-groups
833+++ libc/EGLIBC.option-groups
834@@ -56,33 +56,9 @@ disable option groups one by one, until
835
836 The Option Groups
837
838-EGLIBC currently implements the following option groups, also
839-documented in the file 'option-groups.def':
840-
841-OPTION_EGLIBC_CATGETS
842- This option group includes functions for accessing message
843- catalogs: catopen, catclose, and catgets.
844-
845-OPTION_EGLIBC_LOCALES
846- This option group includes all locale definitions other than
847- those for the "C" locale. If this option group is omitted, then
848- only the "C" locale is supported.
849-
850-OPTION_EGLIBC_LIBM
851- This option group includes the 'libm' library, containing
852- mathematical functions. If this option group is omitted, then
853- an EGLIBC installation does not include shared or unshared versions
854- of the math library.
855-
856- Note that this does not remove all floating-point related
857- functionality from EGLIBC; for example, 'printf' and 'scanf'
858- can still print and read floating-point values with this option
859- group disabled.
860-
861- Note that the ISO Standard C++ library 'libstdc++' depends on
862- EGLIBC's math library 'libm'. If you disable this option
863- group, you will not be able to build 'libstdc++' against the
864- resulting EGLIBC installation.
865+To see the current full list of implemented option groups, refer to the
866+file 'option-groups.def' at the top of the source tree, or run
867+'make menuconfig' from the top-level build directory.
868
869 The POSIX.1-2001 specification includes a suggested partition of all
870 the functions in the POSIX C API into option groups: math functions
871@@ -110,6 +86,18 @@ data, but include mathematical functions
872 OPTION_EGLIBC_LOCALES = n
873 OPTION_EGLIBC_LIBM = y
874
875+Like the Linux kernel, EGLIBC supports a similar set of '*config' make
876+targets to make it easier to create 'option-groups.config', with all
877+dependencies between option groups automatically satisfied. Run
878+'make help' to see the list of supported make config targets. For
879+example, 'make menuconfig' will update the current config utilising a
880+menu based program.
881+
882+The option group names and their type (boolean, int, hex, string), help
883+description, and dependencies with other option groups, are described by
884+'option-groups.def' at the top of the source tree, analogous to the
885+'Kconfig' files in the Linux kernel.
886+
887 In general, each option group variable controls whether a given set of
888 object files in EGLIBC is compiled and included in the final
889 libraries, or omitted from the build.
890@@ -132,22 +120,3 @@ under development.
891
892 We have used the system to subset some portions of EGLIBC's
893 functionality. It needs to be extended to cover more of the library.
894-
895-At the moment, EGLIBC performs no sanity checks on the contents of
896-'option-groups.config'; if an option group's name is mistyped, the
897-option group is silently included in the build. EGLIBC should check
898-that all variables set in 'option-groups.config' are proper option
899-group names, and that their values are appropriate.
900-
901-Some portions of EGLIBC depend on others; for example, the Sun Remote
902-Procedure Call functions in 'sunrpc' depend on the networking
903-functions in 'inet'. The sanity checking described above should check
904-that the selection configuration satisfies dependencies within EGLIBC,
905-and produce a legible error message if it does not. At the moment,
906-inconsistent configurations produce link errors late in the build
907-process.
908-
909-The Linux kernel's configuration system provides interactive
910-interfaces for creating and modifying configuration files (which also
911-perform the sanity checking and dependency tracking described above).
912-EGLIBC should provide similar interfaces.