Messages in this thread Patch in this message | | | From | Andrzej Krzysztofowicz <> | Subject | Re: 2.3.41 is dep_bool officially broken? [PATCH] | Date | Tue, 1 Feb 2000 20:37:31 +0100 (CET) |
| |
> On Mon, 31 Jan 2000, Michael Elizabeth Chastain wrote: > > > > Andrzej or someone else, would you like to inherit the job? > > FYI -- I fixed the dep_bool problems for all permutations. Patch coming > as soon as I can hook my laptop to the net.
Jeff, Please look at the patch below and (eventually) merge it with your changes...
Regards Andrzej
*********************** patch for 2.3.42 ************************ diff -u --recursive linux-2.3.42/Documentation/kbuild/config-language.txt linux/Documentation/kbuild/config-language.txt --- linux-2.3.42/Documentation/kbuild/config-language.txt Mon Oct 25 19:51:31 1999 +++ linux/Documentation/kbuild/config-language.txt Tue Feb 1 20:19:13 2000 @@ -120,6 +120,7 @@ Dependent statements: dep_bool /prompt/ /symbol/ /dep/ ... + depm_bool /prompt/ /symbol/ /dep/ ... dep_hex /prompt/ /symbol/ /word/ /dep/ ... dep_int /prompt/ /symbol/ /word/ /dep/ ... dep_string /prompt/ /symbol/ /word/ /dep/ ... @@ -386,8 +387,8 @@ Example: - # Not from the corpus - define_int CONFIG_UID_TORVALDS 2026 + # drivers/char/ftape/Config.in + define_int CONFIG_FT_ALPHA_CLOCK 0 @@ -424,10 +425,15 @@ Example: - # not from the corpus - if [ "$CONFIG_ZFTAPE" != "n" ]; then - comment 'The compressor will be built as a module only!' - define_tristate CONFIG_ZFT_COMPRESSOR m + # drivers/video/Config.in + if [ "$CONFIG_FB_AMIGA" = "y" ]; then + define_tristate CONFIG_FBCON_AFB y + define_tristate CONFIG_FBCON_ILBM y + else + if [ "$CONFIG_FB_AMIGA" = "m" ]; then + define_tristate CONFIG_FBCON_AFB m + define_tristate CONFIG_FBCON_ILBM m + fi fi @@ -438,6 +444,36 @@ Any dependency which has a value of "y" does not restrict the input range. Any dependency which has an empty value is ignored. Any dependency which has a value of "n", or which has some other value, +(like "m") restricts the input range to "n". Quoting dependencies is not +allowed. Using dependencies with an empty value possible is not +recommended. See also depm_bool below. + +If the input range is restricted to the single choice "n", dep_bool +silently assigns "n" to /symbol/. If the input range has more than +one choice, dep_bool displays /prompt/ to the user, accepts a value +from the user, and assigns that value to /symbol/. + +Configure: implemented +Menuconfig: implemented +XConfig: implemented +mconfig: implemented + +Example: + + # drivers/net/Config.in + dep_bool 'Aironet 4500/4800 PCI support 'CONFIG_AIRONET4500_PCI $CONFIG_PCI + +Known bugs: +- Xconfig does not write "# foo is not set" to .config (as well as + "#unset foo" to autoconf.h) if command is disabled by its dependencies. + + +=== depm_bool /prompt/ /symbol/ /dep/ ... + +This verb evaluates all of the dependencies in the dependency list. +Any dependency which has a value of "y" or "m" does not restrict the +input range. Any dependency which has an empty value is ignored. +Any dependency which has a value of "n", or which has some other value, restricts the input range to "n". Quoting dependencies is not allowed. Using dependencies with an empty value possible is not recommended. @@ -446,13 +482,18 @@ one choice, dep_bool displays /prompt/ to the user, accepts a value from the user, and assigns that value to /symbol/. +Notice that the only difference between dep_bool and depm_bool +is in the way of treating the "m" value as a dependency. + Configure: implemented Menuconfig: implemented XConfig: implemented -mconfig: implemented +mconfig: not implemented - # not from the corpus - dep_bool 'RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000 $CONFIG_PCI +Example: + + # Not from the corpus + depm_bool 'Packet socket: mmapped IO' CONFIG_PACKET_MMAP $CONFIG_PACKET Known bugs: - Xconfig does not write "# foo is not set" to .config (as well as @@ -492,6 +533,11 @@ Xconfig: implemented mconfig: implemented +Example: + + # drivers/char/Config.in + dep_tristate 'Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT + Known bugs: - Xconfig does not write "# foo is not set" to .config (as well as "#unset foo" to autoconf.h) if command is disabled by its dependencies. @@ -508,6 +554,13 @@ Xconfig: implemented (with bugs) mconfig: implemented +Example: + + # arch/mips/config.in + unset CONFIG_PCI + unset CONFIG_MIPS_JAZZ + unset CONFIG_VIDEO_G364 + === choice /prompt/ /word/ /word/ @@ -538,6 +591,14 @@ Xconfig: implemented mconfig: implemented +Example: + + # arch/i386/config.in + choice ' PCI access mode' \ + "BIOS CONFIG_PCI_GOBIOS \ + Direct CONFIG_PCI_GODIRECT \ + Any CONFIG_PCI_GOANY" Any + === nchoice /prompt/ /symbol/ /prompt/ /symbol/ ... @@ -602,9 +663,6 @@ Xconfig has some known bugs, and probably some unknown bugs too: - literals with an empty "" value are not properly handled. - -- tkparse gives the wrong precedence to -o, -a, and !. Don't use both - -o and -a in an expression. Don't use ! at all. diff -u --recursive linux-2.3.42/fs/Config.in linux/fs/Config.in --- linux-2.3.42/fs/Config.in Tue Jan 25 20:45:02 2000 +++ linux/fs/Config.in Tue Feb 1 19:14:28 2000 @@ -16,7 +16,7 @@ dep_tristate 'Apple Macintosh filesystem support (EXPERIMENTAL)' CONFIG_HFS_FS $CONFIG_EXPERIMENTAL dep_tristate 'BFS filesystem (read only) support (EXPERIMENTAL)' CONFIG_BFS_FS $CONFIG_EXPERIMENTAL -dep_bool ' BFS filesystem write support (DANGEROUS)' CONFIG_BFS_FS_WRITE $CONFIG_BFS_FS +depm_bool ' BFS filesystem write support (DANGEROUS)' CONFIG_BFS_FS_WRITE $CONFIG_BFS_FS # msdos filesystems tristate 'DOS FAT fs support' CONFIG_FAT_FS @@ -28,17 +28,12 @@ tristate 'Compressed ROM filessytem support' CONFIG_CRAMFS tristate 'ISO 9660 CDROM filesystem support' CONFIG_ISO9660_FS -if [ "$CONFIG_ISO9660_FS" != "n" ]; then - bool ' Microsoft Joliet CDROM extensions' CONFIG_JOLIET -else - # needed by nls/Config.in - define_bool CONFIG_JOLIET n -fi +depm_bool ' Microsoft Joliet CDROM extensions' CONFIG_JOLIET $CONFIG_ISO9660_FS tristate 'Minix fs support' CONFIG_MINIX_FS tristate 'NTFS filesystem support (read only)' CONFIG_NTFS_FS -dep_bool ' NTFS write support (DANGEROUS)' CONFIG_NTFS_RW $CONFIG_NTFS_FS $CONFIG_EXPERIMENTAL +depm_bool ' NTFS write support (DANGEROUS)' CONFIG_NTFS_RW $CONFIG_NTFS_FS $CONFIG_EXPERIMENTAL tristate 'OS/2 HPFS filesystem support' CONFIG_HPFS_FS @@ -51,20 +46,20 @@ dep_bool '/dev/pts filesystem for Unix98 PTYs' CONFIG_DEVPTS_FS $CONFIG_UNIX98_PTYS dep_tristate 'QNX4 filesystem support (read only) (EXPERIMENTAL)' CONFIG_QNX4FS_FS $CONFIG_EXPERIMENTAL -dep_bool ' QNX4FS write support (DANGEROUS)' CONFIG_QNX4FS_RW $CONFIG_QNX4FS_FS +depm_bool ' QNX4FS write support (DANGEROUS)' CONFIG_QNX4FS_RW $CONFIG_QNX4FS_FS tristate 'ROM filesystem support' CONFIG_ROMFS_FS tristate 'Second extended fs support' CONFIG_EXT2_FS tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS -dep_bool ' SYSV filesystem write support (DANGEROUS)' CONFIG_SYSV_FS_WRITE $CONFIG_SYSV_FS $CONFIG_EXPERIMENTAL +depm_bool ' SYSV filesystem write support (DANGEROUS)' CONFIG_SYSV_FS_WRITE $CONFIG_SYSV_FS $CONFIG_EXPERIMENTAL tristate 'UDF filesystem support (read only)' CONFIG_UDF_FS -dep_bool ' UDF write support (DANGEROUS)' CONFIG_UDF_RW $CONFIG_UDF_FS $CONFIG_EXPERIMENTAL +depm_bool ' UDF write support (DANGEROUS)' CONFIG_UDF_RW $CONFIG_UDF_FS $CONFIG_EXPERIMENTAL tristate 'UFS filesystem support (read only)' CONFIG_UFS_FS -dep_bool ' UFS filesystem write support (DANGEROUS)' CONFIG_UFS_FS_WRITE $CONFIG_UFS_FS $CONFIG_EXPERIMENTAL +depm_bool ' UFS filesystem write support (DANGEROUS)' CONFIG_UFS_FS_WRITE $CONFIG_UFS_FS $CONFIG_EXPERIMENTAL if [ "$CONFIG_NET" = "y" ]; then @@ -79,7 +74,7 @@ dep_bool ' Root file system on NFS' CONFIG_ROOT_NFS $CONFIG_NFS_FS $CONFIG_IP_PNP tristate 'NFS server support' CONFIG_NFSD - dep_bool ' Provide NFSv3 server support (EXPERIMENTAL)' CONFIG_NFSD_V3 $CONFIG_NFSD $CONFIG_EXPERIMENTAL + depm_bool ' Provide NFSv3 server support (EXPERIMENTAL)' CONFIG_NFSD_V3 $CONFIG_NFSD $CONFIG_EXPERIMENTAL if [ "$CONFIG_NFS_FS" = "y" -o "$CONFIG_NFSD" = "y" ]; then define_tristate CONFIG_SUNRPC y @@ -99,7 +94,13 @@ tristate 'NCP filesystem support (to mount NetWare volumes)' CONFIG_NCP_FS if [ "$CONFIG_NCP_FS" != "n" ]; then source fs/ncpfs/Config.in + else + # needed by fs/nls/Config.in + define_bool CONFIG_NCPFS_NLS n fi +else + # needed by fs/nls/Config.in + define_bool CONFIG_NCPFS_NLS n fi endmenu diff -u --recursive linux-2.3.42/scripts/Configure linux/scripts/Configure --- linux-2.3.42/scripts/Configure Thu Oct 28 19:16:02 1999 +++ linux/scripts/Configure Tue Feb 1 16:32:18 2000 @@ -311,6 +311,26 @@ bool "$ques" "$var" } +function depm_bool () { + ques=$1 + var=$2 + shift 2 + while [ $# -gt 0 ]; do + case "$1" in + n) + define_bool "$var" "n" + return + ;; + m) + eval "$var=y" + ;; + esac + shift + done + + bool "$ques" "$var" +} + # # define_int sets the value of a integer argument # diff -u --recursive linux-2.3.42/scripts/Menuconfig linux/scripts/Menuconfig --- linux-2.3.42/scripts/Menuconfig Tue Dec 7 01:25:34 1999 +++ linux/scripts/Menuconfig Tue Feb 1 16:40:12 2000 @@ -258,6 +258,26 @@ fi } +function depm_bool () { + ques="$1" + var="$2" + dep=y + shift 2 + while [ $# -gt 0 ]; do + if [ "$1" = y -o "$1" = m ]; then + shift + else + dep=n + shift $# + fi + done + if [ "$dep" = y ]; then + bool "$ques" "$var" + else + define_bool "$var" n + fi +} + # # Add a menu item which will call our local int function. # @@ -1075,6 +1095,20 @@ shift 2 while [ $# -gt 0 ]; do if [ "$1" = y ]; then + shift + else + x=n; shift $# + fi + done + define_bool "$var" "$x" + } + + function depm_bool () { + set_x_info "$2" "n" + var="$2" + shift 2 + while [ $# -gt 0 ]; do + if [ "$1" = y -o "$1" = m ]; then shift else x=n; shift $# diff -u --recursive linux-2.3.42/scripts/header.tk linux/scripts/header.tk --- linux-2.3.42/scripts/header.tk Sat Oct 2 16:49:30 1999 +++ linux/scripts/header.tk Tue Feb 1 18:39:47 2000 @@ -249,17 +249,19 @@ return $var } -proc sync_bool { var dep } { +proc sync_bool { var dep modset } { set var [sync_tristate $var $dep] - if {$dep == 2} then { - set var 0 + if {$dep == 2 && $var == 2} then { + set var $modset } return $var } -proc write_tristate { file1 file2 varname variable deplist } { +proc write_tristate { file1 file2 varname variable deplist modset } { set variable [sync_tristate $variable [effective_dep $deplist]] - if { $variable == 1 }\ + if { $variable == 2 } \ + then { set variable $modset } + if { $variable == 1 } \ then { puts $file1 "$varname=y"; \ puts $file2 "#define $varname 1" } \ elseif { $variable == 2 } \ diff -u --recursive linux-2.3.42/scripts/tkcond.c linux/scripts/tkcond.c --- linux-2.3.42/scripts/tkcond.c Sat Oct 2 16:49:30 1999 +++ linux/scripts/tkcond.c Tue Feb 1 16:52:40 2000 @@ -54,6 +54,7 @@ || cfg->token == token_define_tristate || cfg->token == token_dep_bool || cfg->token == token_dep_tristate + || cfg->token == token_depm_bool || cfg->token == token_hex || cfg->token == token_int || cfg->token == token_string @@ -517,6 +518,7 @@ case token_dep_bool: case token_dep_tristate: + case token_depm_bool: /* * Same as the other simple statements, plus an additional * condition for the dependency. diff -u --recursive linux-2.3.42/scripts/tkgen.c linux/scripts/tkgen.c --- linux-2.3.42/scripts/tkgen.c Sat Oct 2 16:49:30 1999 +++ linux/scripts/tkgen.c Tue Feb 1 19:33:47 2000 @@ -343,12 +343,16 @@ */ if ( line_num >= -1 ) { + int modtoyes = 0; + switch ( cfg->token ) { default: printf( " }\n" ); break; + case token_depm_bool: + modtoyes = 1; case token_dep_bool: printf( "\n" ); for ( tmp = cfg->depend; tmp; tmp = tmp->next ) @@ -359,10 +363,13 @@ printf( "\tset tmpvar_dep [effective_dep [list" ); for ( tmp = cfg->depend; tmp; tmp = tmp->next ) printf( " $%s", tmp->name ); - printf( "]];set %s [sync_bool $%s $tmpvar_dep];", - vartable[cfg->nameindex].name, vartable[cfg->nameindex].name ); - printf( "if {$tmpvar_dep != 1} then {" ); - printf( "configure_entry .menu%d.config.f.x%d disabled {y};", + printf( "]];set %s [sync_bool $%s $tmpvar_dep %d];", + vartable[cfg->nameindex].name, vartable[cfg->nameindex].name, + modtoyes ); + printf( "if {$tmpvar_dep != 1" ); + if (modtoyes) + printf( " && $tmpvar_dep != 2" ); + printf( "} then {configure_entry .menu%d.config.f.x%d disabled {y};", menu_num, line_num ); printf( "} else {" ); printf( "configure_entry .menu%d.config.f.x%d normal {y};", @@ -474,12 +481,16 @@ } else { + int modtoyes = 0; + switch ( cfg->token ) { default: printf( " }\n" ); break; + case token_depm_bool: + modtoyes = 1; case token_dep_bool: printf( "\n" ); for ( tmp = cfg->depend; tmp; tmp = tmp->next ) @@ -490,8 +501,9 @@ printf( "\tset tmpvar_dep [effective_dep [list" ); for ( tmp = cfg->depend; tmp; tmp = tmp->next ) printf( " $%s", tmp->name ); - printf( "]];set %s [sync_bool $%s $tmpvar_dep];", - vartable[cfg->nameindex].name, vartable[cfg->nameindex].name ); + printf( "]];set %s [sync_bool $%s $tmpvar_dep %d];", + vartable[cfg->nameindex].name, vartable[cfg->nameindex].name, + modtoyes ); case token_bool: if ( cfg->token == token_bool ) printf( "\n\t" ); @@ -604,6 +616,7 @@ { struct condition * cond; struct dependency * tmp; + int depmod = 2; /* * Generate global declaration for this symbol. @@ -705,7 +718,7 @@ case token_bool: case token_tristate: - printf( "write_tristate $cfg $autocfg %s $%s [list $notmod]", + printf( "write_tristate $cfg $autocfg %s $%s [list $notmod] 2", vartable[cfg->nameindex].name, vartable[cfg->nameindex].name ); if ( cfg->cond != NULL ) printf( " }" ); @@ -724,7 +737,7 @@ cfg1 != NULL && cfg1->token == token_choice_item; cfg1 = cfg1->next ) { - printf("\n\tif { $tmpvar_%d == \"%s\" } then { write_tristate $cfg $autocfg %s 1 [list $notmod] } else { write_tristate $cfg $autocfg %s 0 [list $notmod] }", + printf("\n\tif { $tmpvar_%d == \"%s\" } then { write_tristate $cfg $autocfg %s 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg %s 0 [list $notmod] 2 }", -(cfg->nameindex), cfg1->label, vartable[cfg1->nameindex].name, vartable[cfg1->nameindex].name ); @@ -751,23 +764,25 @@ case token_define_tristate: if ( cfg->cond == NULL ) { - printf( "write_tristate $cfg $autocfg %s $%s [list $notmod]\n", + printf( "write_tristate $cfg $autocfg %s $%s [list $notmod] 2\n", vartable[cfg->nameindex].name, vartable[cfg->nameindex].name ); } else { - printf( "write_tristate $cfg $autocfg %s $%s [list $notmod] }\n", + printf( "write_tristate $cfg $autocfg %s $%s [list $notmod] 2 }\n", vartable[cfg->nameindex].name, cfg->value ); } break; + case token_depm_bool: + depmod = 1; case token_dep_bool: case token_dep_tristate: printf( "write_tristate $cfg $autocfg %s $%s [list", vartable[cfg->nameindex].name, vartable[cfg->nameindex].name ); for ( tmp = cfg->depend; tmp; tmp = tmp->next ) printf( " $%s", tmp->name ); - printf( "]" ); + printf( "] %d", depmod ); if ( cfg->cond != NULL ) printf( " }" ); printf( "\n" ); @@ -887,6 +902,7 @@ case token_define_string: case token_dep_bool: case token_dep_tristate: + case token_depm_bool: case token_int: case token_hex: case token_mainmenu_option: @@ -1121,6 +1137,7 @@ case token_choice_item: case token_dep_bool: case token_dep_tristate: + case token_depm_bool: case token_hex: case token_int: case token_string: @@ -1222,6 +1239,7 @@ break; case token_dep_bool: + case token_depm_bool: cfg->menu_line = menu_line++; printf( "\tdep_bool $w.config.f %d %d \"%s\" %s\n", cfg->menu_number, cfg->menu_line, cfg->label, @@ -1300,6 +1318,7 @@ case token_choice_item: case token_dep_bool: case token_dep_tristate: + case token_depm_bool: case token_tristate: if ( ! vartable[cfg->nameindex].global_written ) { @@ -1376,6 +1395,7 @@ case token_define_tristate: case token_dep_bool: case token_dep_tristate: + case token_depm_bool: case token_hex: case token_int: case token_string: diff -u --recursive linux-2.3.42/scripts/tkparse.c linux/scripts/tkparse.c --- linux-2.3.42/scripts/tkparse.c Sat Oct 2 16:49:30 1999 +++ linux/scripts/tkparse.c Tue Feb 1 18:15:13 2000 @@ -387,6 +387,7 @@ match_token( token_define_tristate, "define_tristate" ); match_token( token_dep_bool, "dep_bool" ); match_token( token_dep_tristate, "dep_tristate" ); + match_token( token_depm_bool, "depm_bool" ); break; case 'e': @@ -550,6 +551,7 @@ case token_dep_bool: case token_dep_tristate: + case token_depm_bool: pnt = get_qstring ( pnt, &cfg->label ); pnt = get_string ( pnt, &buffer ); cfg->nameindex = get_varnum( buffer ); @@ -585,7 +587,7 @@ } else { - syntax_error( "can't handle dep_bool/dep_tristate condition" ); + syntax_error( "can't handle dep_bool/depm_bool/dep_tristate condition" ); } dep_ptr = &(*dep_ptr)->next; while ( *pnt == ' ' || *pnt == '\t' ) @@ -623,12 +625,12 @@ *cond_ptr = malloc( sizeof(struct condition) ); memset( *cond_ptr, 0, sizeof(struct condition) ); (*cond_ptr)->op = op_lparen; - if ( token == token_dep_tristate ) - sprintf( fake_if, "[ \"$%s\" = \"y\" -o \"$%s\" = \"m\" -o \"$%s\" = \"\" ]; then", - dep->name, dep->name, dep->name ); - else + if ( token == token_dep_bool ) sprintf( fake_if, "[ \"$%s\" = \"y\" -o \"$%s\" = \"\" ]; then", dep->name, dep->name ); + else + sprintf( fake_if, "[ \"$%s\" = \"y\" -o \"$%s\" = \"m\" -o \"$%s\" = \"\" ]; then", + dep->name, dep->name, dep->name ); (*cond_ptr)->next = tokenize_if( fake_if ); while ( *cond_ptr ) cond_ptr = &(*cond_ptr)->next; diff -u --recursive linux-2.3.42/scripts/tkparse.h linux/scripts/tkparse.h --- linux-2.3.42/scripts/tkparse.h Sat Oct 2 16:49:30 1999 +++ linux/scripts/tkparse.h Tue Feb 1 16:51:39 2000 @@ -20,6 +20,7 @@ token_define_tristate, token_dep_bool, token_dep_tristate, + token_depm_bool, token_else, token_endmenu, token_fi, @@ -77,7 +78,7 @@ }; /* - * Dependency list for dep_bool, dep_tristate + * Dependency list for dep_bool, depm_bool, dep_tristate */ struct dependency *********************** end of patch **************************** -- ======================================================================= Andrzej M. Krzysztofowicz ankry@mif.pg.gda.pl phone (48)(58) 347 14 61 Faculty of Applied Phys. & Math., Technical University of Gdansk - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |