diff options
author | Manoj Srivastava <srivasta@debian.org> | 2020-05-19 20:02:56 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2020-05-19 20:36:47 -0700 |
commit | 0664966ad710d299c3ab43a8fe06d141306a0e68 (patch) | |
tree | 35d29604717f974049e6f4fc4267c61cb7f0778e /mcon | |
parent | cc8dafd4c41256a693f980bd8f48c1a51e58defd (diff) | |
parent | 303867b2c314107cc81618561c3be69df19a4c9a (diff) |
Merge branch 'upstream'
Diffstat (limited to 'mcon')
-rw-r--r-- | mcon/U/Assert.U | 3 | ||||
-rw-r--r-- | mcon/U/Checkcc.U | 8 | ||||
-rw-r--r-- | mcon/U/Config_sh.U | 2 | ||||
-rw-r--r-- | mcon/U/Finish.U | 2 | ||||
-rw-r--r-- | mcon/U/Getfile.U | 2 | ||||
-rw-r--r-- | mcon/U/Head.U | 4 | ||||
-rw-r--r-- | mcon/U/Obsol_h.U | 2 | ||||
-rw-r--r-- | mcon/U/Obsol_sh.U | 2 | ||||
-rw-r--r-- | mcon/U/Specific.U | 26 | ||||
-rw-r--r-- | mcon/U/Trylink.U | 2 | ||||
-rw-r--r-- | mcon/U/ccflags.U | 8 | ||||
-rw-r--r-- | mcon/U/d_bfd_section.U | 49 | ||||
-rw-r--r-- | mcon/U/d_fast_assert.U | 85 | ||||
-rw-r--r-- | mcon/U/d_memrchr.U | 40 | ||||
-rw-r--r-- | mcon/U/d_tminsys.U | 2 | ||||
-rw-r--r-- | mcon/U/gccvers.U | 7 | ||||
-rw-r--r-- | mcon/U/nis.U | 12 | ||||
-rw-r--r-- | mcon/U/voidflags.U | 2 | ||||
-rwxr-xr-x | mcon/man/mconfig.SH | 189 | ||||
-rwxr-xr-x | mcon/man/mlint.SH | 107 | ||||
-rwxr-xr-x | mcon/man/mxref.SH | 58 | ||||
-rwxr-xr-x | mcon/mconfig.SH | 4 | ||||
-rwxr-xr-x | mcon/mxref.SH | 5 | ||||
-rw-r--r-- | mcon/pl/lint.pl | 23 |
24 files changed, 356 insertions, 288 deletions
diff --git a/mcon/U/Assert.U b/mcon/U/Assert.U index 76de54d..1a38e49 100644 --- a/mcon/U/Assert.U +++ b/mcon/U/Assert.U @@ -20,7 +20,6 @@ ?X: There is no need to link the file to spot the assertion failure. ?X: $cat >static_assert.h <<'EOC' -#define STATIC_ASSERT(expr) \ - do { switch (0) { case ((expr) ? 1 : 0): case 0: break; } } while(0) +#define STATIC_ASSERT(expr) ((void) sizeof(char[1 - 2*!(expr)])) EOC diff --git a/mcon/U/Checkcc.U b/mcon/U/Checkcc.U index 3cae05c..ce0dc62 100644 --- a/mcon/U/Checkcc.U +++ b/mcon/U/Checkcc.U @@ -37,10 +37,10 @@ ?INIT:ccname='' ?INIT:ccversion='' : generate the trygcc script for later perusal -cat <<EOS >trygcc +$cat <<EOS >trygcc $startsh EOS -cat <<'EOSC' >>trygcc +$cat <<'EOSC' >>trygcc case "$cc" in '') ;; *) $rm -f try try.* @@ -100,10 +100,10 @@ esac EOSC : generate the checkcc script for later perusal -cat <<EOS >checkcc +$cat <<EOS >checkcc $startsh EOS -cat <<'EOSC' >>checkcc +$cat <<'EOSC' >>checkcc case "$cc" in '') ;; *) $rm -f try try.* diff --git a/mcon/U/Config_sh.U b/mcon/U/Config_sh.U index bb47b7b..1b3b0c6 100644 --- a/mcon/U/Config_sh.U +++ b/mcon/U/Config_sh.U @@ -32,7 +32,7 @@ ?MAKE: -pick add.Config_sh $@ %< ?MAKE: -pick add $@ ./Obsol_sh ?MAKE: -pick close.Config_sh $@ %< -?F:!config.over !config.arch +?F:!config.over !config.arch config.sh ?T:file sfile xsed ?LINT:unclosed EOT : back to where it started diff --git a/mcon/U/Finish.U b/mcon/U/Finish.U index cf5a364..51039c4 100644 --- a/mcon/U/Finish.U +++ b/mcon/U/Finish.U @@ -35,7 +35,7 @@ ?X: SH files, which among other things produce config.h and (usually) Makefile. ?X: It offers to do a make depend if the Makefile contains that target. ?X: -?MAKE:Finish: Chk_MANI Extract Myread Oldsym Magic_h cat rm contains \ +?MAKE:Finish: Chk_MANI Extract Specific Myread Oldsym Magic_h cat rm contains \ test package make ?MAKE: -pick add $@ %< ?F:!config.sh diff --git a/mcon/U/Getfile.U b/mcon/U/Getfile.U index f5cf49b..641ea30 100644 --- a/mcon/U/Getfile.U +++ b/mcon/U/Getfile.U @@ -48,7 +48,7 @@ ?X: those are prefixes for the filename. Unless $gfpthkeep is set to 'y', ?X: gfpth is cleared on return from Getfile. ?X: -?X: If is is followed by a ~, then ~name substitution will occur. Upon return, +?X: If it is followed by a ~, then ~name substitution will occur. Upon return, ?X: $ans is set with the filename value. If a / is specified, then only a full ?X: path name is accepted (but ~ substitution occurs before, if needed). The ?X: expanded path name is returned in that case. diff --git a/mcon/U/Head.U b/mcon/U/Head.U index 933e489..0b8a98e 100644 --- a/mcon/U/Head.U +++ b/mcon/U/Head.U @@ -77,8 +77,8 @@ ?X: # Note: this Configure script was generated automatically. Rather than # working with this copy of Configure, you may wish to get metaconfig. -# The dist package (which contains metaconfig) is available via SVN: -# svn co https://svn.code.sf.net/p/dist/code/trunk/dist +# The dist package (which contains metaconfig) is available via git: +# git clone git@github.com:rmanfredi/dist.git ?X: ?X: NOTA BENE: ?X: If you develop you own version of metaconfig based on this work, diff --git a/mcon/U/Obsol_h.U b/mcon/U/Obsol_h.U index fc59938..c19c5a4 100644 --- a/mcon/U/Obsol_h.U +++ b/mcon/U/Obsol_h.U @@ -20,7 +20,7 @@ ?MAKE: -pick prepend $@ ./Obsol_h ?LINT:nocomment /* - * The following symbols are obsolete. They are mapped to the the new + * The following symbols are obsolete. They are mapped to the new * symbols only to ease the transition process. The sources should be * updated so as to use the new symbols only, as the support for these * obsolete symbols may end without notice. diff --git a/mcon/U/Obsol_sh.U b/mcon/U/Obsol_sh.U index de1a1e1..3b3f0d6 100644 --- a/mcon/U/Obsol_sh.U +++ b/mcon/U/Obsol_sh.U @@ -20,7 +20,7 @@ ?MAKE: -pick prepend $@ ./Obsol_sh ?LINT:nocomment # -# The following symbols are obsolete. They are mapped to the the new +# The following symbols are obsolete. They are mapped to the new # symbols only to ease the transition process. The sources should be # updated so as to use the new symbols only, since supporting of those # obsolete symbols may end without notice. diff --git a/mcon/U/Specific.U b/mcon/U/Specific.U new file mode 100644 index 0000000..feb189b --- /dev/null +++ b/mcon/U/Specific.U @@ -0,0 +1,26 @@ +?RCS: +?RCS: Copyright (c) 2018, Raphael Manfredi +?RCS: +?RCS: You may redistribute only under the terms of the Artistic License, +?RCS: as specified in the README file that comes with the distribution. +?RCS: You may reuse parts of this distribution only within the terms of +?RCS: that same Artistic License; a copy of which may be found at the root +?RCS: of the source tree for dist 4.0. +?RCS: +?X: +?X: This unit is intended to be a project-specific hook. +?X: By default, it is therefore empty, meant to be copied to your private +?X: unit directory (U) and seasoned to taste. +?X: +?X: If you need specific code generation to happen once the configuration +?X: is finished and config.sh was generated, but before the extraction of +?X: the .SH files begins, then this is the place to put these special +?X: code that the .SH files will require to run properly. +?X: +?X: When this unit triggers, Configure is back to the top directory. +?X: +?MAKE:Specific: Config_sh +?MAKE: -pick add $@ %< +?X: +?X: Keep the above ?MAKE: lines and then append your specific code here. +?X: diff --git a/mcon/U/Trylink.U b/mcon/U/Trylink.U index e38e0b2..9b2a380 100644 --- a/mcon/U/Trylink.U +++ b/mcon/U/Trylink.U @@ -74,7 +74,7 @@ case "$cyn" in "") echo "--- $var ---" >> "$file";; *) echo " "; $echo $n "Checking $msg...$c" >&4; - echo "--- $var --- ($msg)" >>"$file" + echo "--- $var --- ($msg)" >> "$file" ;; esac; $cat try.c >> "$file"; diff --git a/mcon/U/ccflags.U b/mcon/U/ccflags.U index 942e462..b134f57 100644 --- a/mcon/U/ccflags.U +++ b/mcon/U/ccflags.U @@ -174,11 +174,11 @@ dflt='' case "$hint" in default|recommended) case "$gccversion" in - 1*) dflt='-fpcc-struct-return' ;; + 1) dflt='-fpcc-struct-return' ;; esac ?X: check for POSIXized ISC case "$gccversion" in - 2*) if test -d /etc/conf/kconfig.d && + 2) if test -d /etc/conf/kconfig.d && $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 then dflt="$dflt -posix" @@ -187,7 +187,7 @@ default|recommended) esac ?X: turn warnings on if they're using gcc case "$gccversion" in - 1*|2*) dflt="$dflt -Wall";; + 1|2) dflt="$dflt -Wall";; ?X: starting with version 3, add "-W -Wall -Wformat=2 -Wshadow" by default *) dflt="$dflt -W -Wall -Wformat=2 -Wshadow";; esac @@ -265,7 +265,7 @@ esac : the following weeds options from ccflags that are of no interest to cpp cppflags="$ccflags" case "$gccversion" in -1*) cppflags="$cppflags -D__GNUC__" +1) cppflags="$cppflags -D__GNUC__" esac case "$mips_type" in '');; diff --git a/mcon/U/d_bfd_section.U b/mcon/U/d_bfd_section.U new file mode 100644 index 0000000..d876541 --- /dev/null +++ b/mcon/U/d_bfd_section.U @@ -0,0 +1,49 @@ +?RCS: $Id$ +?RCS: +?RCS: Copyright (c) 2020, Raphael Manfredi +?RCS: +?RCS: You may redistribute only under the terms of the Artistic License, +?RCS: as specified in the README file that comes with the distribution. +?RCS: You may reuse parts of this distribution only within the terms of +?RCS: that same Artistic License; a copy of which may be found at the root +?RCS: of the source tree for dist 4.0. +?RCS: +?MAKE:d_bfd_section: Trylink cat d_bfd_lib +?MAKE: -pick add $@ %< +?S:d_bfd_section: +?S: This variable conditionally defines the HAS_BFD_SECTION_1ARG symbol, +?S: which indicates to the C program that the bfd_section_xxx() accessors +?S: from the BFD library exists and taks only one argument. +?S:. +?C:HAS_BFD_SECTION_1ARG: +?C: This symbol, if defined, indicates that the bfd_section_xxx() accessors +?C: from the BFD library takes only one argument, which is the new behaviour +?C: starting from BFD 2.34. +?C:. +?H:#$d_bfd_section HAS_BFD_SECTION_1ARG /**/ +?H:. +: see whether bfd_section_vma exists and takes 1 argument +case "$d_bfd_lib" in +$undef) + d_bfd_section=$undef + ;; +*) + $cat >try.c <<EOC +?X: See d_bfd_lib.U to understand why we have to define these symbols. +#define PACKAGE +#define PACKAGE_VERSION +#include <bfd.h> +int main(void) +{ + bfd *b = 0; + asection *sec = 0; + + return 0 == bfd_section_vma(sec); +} +EOC + cyn="whether bfd_section_vma() takes 1 argument" + set d_bfd_section + eval $trylink + ;; +esac + diff --git a/mcon/U/d_fast_assert.U b/mcon/U/d_fast_assert.U deleted file mode 100644 index dba5132..0000000 --- a/mcon/U/d_fast_assert.U +++ /dev/null @@ -1,85 +0,0 @@ -?RCS: $Id$ -?RCS: -?RCS: Copyright (c) 2006, Christian Biere -?RCS: -?RCS: You may redistribute only under the terms of the Artistic License, -?RCS: as specified in the README file that comes with the distribution. -?RCS: You may reuse parts of this distribution only within the terms of -?RCS: that same Artistic License; a copy of which may be found at the root -?RCS: of the source tree for dist 4.0. -?RCS: -?MAKE:d_fast_assert: Myread Setvar cat gccversion spackage \ - sed +ccflags +cc +ldflags +optimize -?MAKE: -pick add $@ %< -?S:d_fast_assert: -?S: This variable conditionally defines FAST_ASSERTIONS. -?S:. -?C:FAST_ASSERTIONS: -?C: This symbol, when defined, indicates that the program should make -?C: use of its own asserting and failure reporting code, instead of -?C: the one from GLib. -?C:. -?H:#$d_fast_assert FAST_ASSERTIONS /**/ -?H:. -?F:!try.c !try -?LINT:set d_fast_assert -?LINT:change ccflags -: determine whether to enable fast assertions -echo " " -case "$d_fast_assert" in -"$undef") - dflt=n;; -*) - dflt=y;; -esac -$cat <<EOM -$spackage contains code called "fast assertions" which are lightweight -assertions in terms of code space used. They use much less code than -their GLib counterpart, and therefore should be more efficient. - -EOM -rp='Shall I enable "fast assertions"' -. ./myread -case "$ans" in -y) val="$define";; -*) val="$undef";; -esac -set d_fast_assert -eval $setvar -?X: When gcc is used, see whether we can use -momit-leaf-frame-pointer -?X: This is useful for tail routines containing assertions if they use -?X: "fast assertions", given that the code is not calling any routine. -case "$gccversion" in -'') ;; -*) - case "$d_fast_assert" in - "$define") - $cat >try.c <<'EOC' -int main() -{ - return 0; -} -EOC - if $cc $ccflags -momit-leaf-frame-pointer $ldflags -o try try.c >/dev/null 2>&1 - then - case "$ccflags $optimize" in - *-momit-leaf-frame-pointer*) ;; - *-O0*) ;; - *-O*) - ccflags="-momit-leaf-frame-pointer $ccflags" - echo "Added -momit-leaf-frame-pointer to the cc flags." >&4 - ;; - esac - else - case "$ccflags" in - *-momit-leaf-frame-pointer*) - echo "Stripping -momit-leaf-frame-pointer from cc flags." >&4 - ccflags=`echo $ccflags | $sed 's/ *-momit-leaf-frame-pointer//'` - ;; - esac - fi - ;; - esac -;; -esac - diff --git a/mcon/U/d_memrchr.U b/mcon/U/d_memrchr.U new file mode 100644 index 0000000..c7b1c01 --- /dev/null +++ b/mcon/U/d_memrchr.U @@ -0,0 +1,40 @@ +?RCS: +?RCS: Copyright (c) 2018 Raphael Manfredi +?RCS: +?RCS: You may redistribute only under the terms of the Artistic License, +?RCS: as specified in the README file that comes with the distribution. +?RCS: You may reuse parts of this distribution only within the terms of +?RCS: that same Artistic License; a copy of which may be found at the root +?RCS: of the source tree for dist 4.0. +?RCS: +?MAKE:d_memrchr: Trylink cat +?MAKE: -pick add $@ %< +?S:d_memrchr: +?S: This variable conditionally defines the HAS_MEMRCHR symbol, which +?S: indicates to the C program that the memrchr() routine is available +?S: to scan a block of memory backwards for a character. +?S:. +?C:HAS_MEMRCHR: +?C: This symbol, if defined, indicates that the memrchr routine is available +?C: to scan a block of memory backwards for a character. +?C: If undefined, roll your own. +?C:. +?H:#$d_memrchr HAS_MEMRCHR /**/ +?H:. +?LINT:set d_memrchr +: see if memrchr exists +$cat >try.c <<EOC +#include <string.h> +int main(void) +{ + static char s[] = "xxx"; + static size_t n = sizeof(s); + void *p; + p = memrchr(s, 'x', n); + return p ? 0 : 1; +} +EOC +cyn=memrchr +set d_memrchr +eval $trylink + diff --git a/mcon/U/d_tminsys.U b/mcon/U/d_tminsys.U index 60fc95a..548a014 100644 --- a/mcon/U/d_tminsys.U +++ b/mcon/U/d_tminsys.U @@ -20,7 +20,7 @@ ?S:. ?C:TM_IN_SYS (TMINSYS): ?C: This symbol is defined if this system declares "struct tm" in -?C: in <sys/time.h> rather than <time.h>. We can't just say +?C: <sys/time.h> rather than <time.h>. We can't just say ?C: -I/usr/include/sys because some systems have both time files, and ?C: the -I trick gets the wrong one. ?C:. diff --git a/mcon/U/gccvers.U b/mcon/U/gccvers.U index 702a5e9..b5abb47 100644 --- a/mcon/U/gccvers.U +++ b/mcon/U/gccvers.U @@ -17,6 +17,9 @@ ?S: If GNU cc (gcc) is used, this variable holds '1' or '3' (for instance) ?S: to indicate whether the compiler is version 1 or 3. This is used in ?S: setting some of the default cflags. It is set to '' if not gcc. +?S: Note that it only contains the major version number, and, when using +?S: case statements to do different things depending on the major, do not +?S: use statements like "1*)" because it will match version 1, 10, 11, etc. ?S:. ?S:gccosandvers: ?S: If GNU cc (gcc) is used, this variable the operating system and @@ -58,7 +61,7 @@ else fi $rm -f try try.* case "$gccversion" in -1*) cpp=`./loc gcc-cpp $cpp $pth` ;; +1) cpp=`./loc gcc-cpp $cpp $pth` ;; esac case "$gccversion" in '') gccosandvers='' ;; @@ -99,7 +102,7 @@ esac : gcc 3.1 complains about adding -Idirectories that it already knows about, : so we will take those off from locincpth. case "$gccversion" in -3*) +3) echo "main(){}">try.c for incdir in `$cc -v -c try.c 2>&1 | \ sed '1,/^#include <\.\.\.>/d;/^End of search list/,$d;s/^ //'` ; do diff --git a/mcon/U/nis.U b/mcon/U/nis.U index 7332545..06e4c47 100644 --- a/mcon/U/nis.U +++ b/mcon/U/nis.U @@ -165,16 +165,4 @@ case "$passcat" in '') passcat=':' $test -f /etc/passwd && passcat='cat /etc/passwd';; esac -case "$hostcat" in -'') hostcat='cat /etc/hosts';; -*) ;; -esac -case "$groupcat" in -'') groupcat='cat /etc/group';; -*) ;; -esac -case "$passcat" in -'') passcat='cat /etc/passwd';; -*) ;; -esac diff --git a/mcon/U/voidflags.U b/mcon/U/voidflags.U index 0e0f49c..5db1db9 100644 --- a/mcon/U/voidflags.U +++ b/mcon/U/voidflags.U @@ -111,6 +111,8 @@ sub() { hue = buf; if (doit()) iptr = hue; +?X: Avoid "variable set but not used" compilation warning + (void) iptr; #endif doit(); } diff --git a/mcon/man/mconfig.SH b/mcon/man/mconfig.SH index bf49fe9..1dd8a97 100755 --- a/mcon/man/mconfig.SH +++ b/mcon/man/mconfig.SH @@ -18,88 +18,88 @@ echo "Extracting mcon/man/metaconfig.$manext (with variable substitutions)" $rm -f metaconfig.$manext $spitshell >metaconfig.$manext <<!GROK!THIS! .TH METACONFIG $manext "Version $VERSION PL$PATCHLEVEL" -''' @(#) Manual page for metaconfig -''' -''' $Id$ -''' -''' Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi -''' -''' You may redistribute only under the terms of the Artistic Licence, -''' as specified in the README file that comes with the distribution. -''' You may reuse parts of this distribution only within the terms of -''' that same Artistic Licence; a copy of which may be found at the root -''' of the source tree for dist 4.0. -''' -''' $Log: mconfig.SH,v $ -''' Revision 3.0.1.17 1997/02/28 16:29:31 ram -''' patch61: documents the runnning environment and the src.U unit -''' patch61: added warnings for $_a and $_o, as well as "startsh" -''' -''' Revision 3.0.1.16 1995/09/25 09:17:48 ram -''' patch59: documented new ?Y: directive -''' patch59: fixed my e-mail address -''' -''' Revision 3.0.1.15 1995/07/25 14:18:24 ram -''' patch56: added extra nroff escapes at line heads to keep leading dots -''' patch56: documented new -G option -''' patch56: extended description of the Csym.U unit -''' patch56: now mentions what a compile-link test line should look like -''' -''' Revision 3.0.1.14 1995/05/12 12:25:02 ram -''' patch54: documented new -K switch for knowledgeable users -''' -''' Revision 3.0.1.13 1995/01/30 14:46:39 ram -''' patch49: documented new special units Prefixit.U and Prefixup.U -''' -''' Revision 3.0.1.12 1995/01/11 15:39:16 ram -''' patch45: documents new -O option and new Getfile escape supports -''' patch45: documents the & escape in Myread and the new cc symbol lookup -''' -''' Revision 3.0.1.11 1994/10/29 16:32:38 ram -''' patch36: added nroff protection for lines beginning with '.' -''' patch36: documents new ?F: line for file declarations -''' patch36: added example showing how ./loc can be used -''' -''' Revision 3.0.1.10 1994/08/29 16:33:40 ram -''' patch32: documented new Typedef.U unit for typedef lookup -''' -''' Revision 3.0.1.9 1994/06/20 07:10:14 ram -''' patch30: added -L option for easier unit testing -''' patch30: new -D and -U options supported by Configure -''' -''' Revision 3.0.1.8 1994/05/13 15:29:16 ram -''' patch27: now understands macro definitions in ?H: lines -''' -''' Revision 3.0.1.7 1994/05/06 15:19:25 ram -''' patch23: documented the new 'p' option in Getfile.U -''' -''' Revision 3.0.1.6 1994/01/24 14:19:47 ram -''' patch16: symbols defined in a unit can be tagged "internal use only" -''' patch16: documents new MailList.U special unit -''' patch16: new general <\$variable> macro substitution -''' -''' Revision 3.0.1.5 1993/10/16 13:51:50 ram -''' patch12: new option -M to activate ?M: lines -''' patch12: documents new ?M: lines format -''' patch12: new internal Makefile command cm_h_weed for ?M: support -''' patch12: documents usage for new confmagic.h file -''' -''' Revision 3.0.1.4 1993/09/09 11:50:35 ram -''' patch9: lots of typo fixes and abusive variable substitution problems -''' -''' Revision 3.0.1.3 1993/08/30 08:53:51 ram -''' patch8: wrongly stated that patchlevel.h should not be part of MANIFEST.new -''' -''' Revision 3.0.1.2 1993/08/24 12:13:32 ram -''' patch3: typo fixes -''' -''' Revision 3.0.1.1 1993/08/19 06:42:23 ram -''' patch1: leading config.sh searching was not aborting properly -''' -''' Revision 3.0 1993/08/18 12:10:14 ram -''' Baseline for dist 3.0 netwide release. -''' -''' +.\" @(#) Manual page for metaconfig +.\" +.\" $Id$ +.\" +.\" Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi +.\" +.\" You may redistribute only under the terms of the Artistic Licence, +.\" as specified in the README file that comes with the distribution. +.\" You may reuse parts of this distribution only within the terms of +.\" that same Artistic Licence; a copy of which may be found at the root +.\" of the source tree for dist 4.0. +.\" +.\" $Log: mconfig.SH,v $ +.\" Revision 3.0.1.17 1997/02/28 16:29:31 ram +.\" patch61: documents the runnning environment and the src.U unit +.\" patch61: added warnings for $_a and $_o, as well as "startsh" +.\" +.\" Revision 3.0.1.16 1995/09/25 09:17:48 ram +.\" patch59: documented new ?Y: directive +.\" patch59: fixed my e-mail address +.\" +.\" Revision 3.0.1.15 1995/07/25 14:18:24 ram +.\" patch56: added extra nroff escapes at line heads to keep leading dots +.\" patch56: documented new -G option +.\" patch56: extended description of the Csym.U unit +.\" patch56: now mentions what a compile-link test line should look like +.\" +.\" Revision 3.0.1.14 1995/05/12 12:25:02 ram +.\" patch54: documented new -K switch for knowledgeable users +.\" +.\" Revision 3.0.1.13 1995/01/30 14:46:39 ram +.\" patch49: documented new special units Prefixit.U and Prefixup.U +.\" +.\" Revision 3.0.1.12 1995/01/11 15:39:16 ram +.\" patch45: documents new -O option and new Getfile escape supports +.\" patch45: documents the & escape in Myread and the new cc symbol lookup +.\" +.\" Revision 3.0.1.11 1994/10/29 16:32:38 ram +.\" patch36: added nroff protection for lines beginning with '.' +.\" patch36: documents new ?F: line for file declarations +.\" patch36: added example showing how ./loc can be used +.\" +.\" Revision 3.0.1.10 1994/08/29 16:33:40 ram +.\" patch32: documented new Typedef.U unit for typedef lookup +.\" +.\" Revision 3.0.1.9 1994/06/20 07:10:14 ram +.\" patch30: added -L option for easier unit testing +.\" patch30: new -D and -U options supported by Configure +.\" +.\" Revision 3.0.1.8 1994/05/13 15:29:16 ram +.\" patch27: now understands macro definitions in ?H: lines +.\" +.\" Revision 3.0.1.7 1994/05/06 15:19:25 ram +.\" patch23: documented the new 'p' option in Getfile.U +.\" +.\" Revision 3.0.1.6 1994/01/24 14:19:47 ram +.\" patch16: symbols defined in a unit can be tagged "internal use only" +.\" patch16: documents new MailList.U special unit +.\" patch16: new general <\$variable> macro substitution +.\" +.\" Revision 3.0.1.5 1993/10/16 13:51:50 ram +.\" patch12: new option -M to activate ?M: lines +.\" patch12: documents new ?M: lines format +.\" patch12: new internal Makefile command cm_h_weed for ?M: support +.\" patch12: documents usage for new confmagic.h file +.\" +.\" Revision 3.0.1.4 1993/09/09 11:50:35 ram +.\" patch9: lots of typo fixes and abusive variable substitution problems +.\" +.\" Revision 3.0.1.3 1993/08/30 08:53:51 ram +.\" patch8: wrongly stated that patchlevel.h should not be part of MANIFEST.new +.\" +.\" Revision 3.0.1.2 1993/08/24 12:13:32 ram +.\" patch3: typo fixes +.\" +.\" Revision 3.0.1.1 1993/08/19 06:42:23 ram +.\" patch1: leading config.sh searching was not aborting properly +.\" +.\" Revision 3.0 1993/08/18 12:10:14 ram +.\" Baseline for dist 3.0 netwide release. +.\" +.\" .de Ex \" Start of Example .sp .in +5 @@ -541,9 +541,9 @@ The \fIfile\fR can contain blank lines, comment lines introduced with '#', and lines containing a single symbol. If this option is not supplied, any \fI$exclusions_file\fR variable in \fI.package\fR is honored instead. -''' -''' T u t o r i a l -''' +.\" +.\" T u t o r i a l +.\" .SH TUTORIAL This (long) section is an introduction to \fImetaconfig\fR, in which we will learn all the basics. If you already know how to use \fImetaconfig\fR, you @@ -1742,6 +1742,25 @@ before prompting via \fIgetfile\fR for instance. If the prefix does not make use of ~name expanstion, then the above will be a no-op on the \fI$dflt\fR variable, naturally. .TP +Specific.U +This unit is empty by default. It is meant as a project-specific hook +to have shell code executed by \fIConfigure\fR after \fIconfig.sh\fR was +generated but before the extraction of .SH files. +.sp +Copy the unit to your project's \fIU/\fR directory and customize it. +.sp +Here is what the \fIdist\fR project uses it for (showing only the unit's code, +not the full unit here): +.Ex +: project-specific code +file=revision.h +echo " " +echo "Generating \$file..." >&4 +bin/svn-revision . \$file +.Ef +That shell code is executed when \fIConfigure\fR is back to the top directory +of the source tree. +.TP Typedef.U This unit produces the \fI\$typedef\fR shell variable, used internally by \fIConfigure\fR to check whether a typedef exists or not. A typical diff --git a/mcon/man/mlint.SH b/mcon/man/mlint.SH index 4f4177a..bdf80c8 100755 --- a/mcon/man/mlint.SH +++ b/mcon/man/mlint.SH @@ -18,54 +18,54 @@ echo "Extracting mcon/man/metalint.$manext (with variable substitutions)" $rm -f metalint.$manext $spitshell >metalint.$manext <<!GROK!THIS! .TH METALINT $manext "Version $VERSION PL$PATCHLEVEL" -''' @(#) Manual page for metalint -''' -''' $Id$ -''' -''' Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi -''' -''' You may redistribute only under the terms of the Artistic Licence, -''' as specified in the README file that comes with the distribution. -''' You may reuse parts of this distribution only within the terms of -''' that same Artistic Licence; a copy of which may be found at the root -''' of the source tree for dist 4.0. -''' -''' $Log: mlint.SH,v $ -''' Revision 3.0.1.9 1997/02/28 16:30:25 ram -''' patch61: new "create" and "empty" lint directives -''' patch61: documented new messages -''' -''' Revision 3.0.1.8 1995/09/25 09:18:07 ram -''' patch59: documented new ?Y: directive -''' patch59: fixed my e-mail address -''' -''' Revision 3.0.1.7 1995/07/25 14:18:51 ram -''' patch56: added two new warnings for : comments lines in Configure -''' -''' Revision 3.0.1.6 1994/10/29 16:33:56 ram -''' patch36: documents new ?F: lines and the related metalint warnings -''' patch36: removed statement in BUGS since all warnings may now be shut -''' -''' Revision 3.0.1.5 1994/05/06 15:20:30 ram -''' patch23: added -L switch to override public unit repository path -''' patch23: two new warnings concerning last unit lines -''' -''' Revision 3.0.1.4 1994/01/24 14:20:39 ram -''' patch16: can now easily suppress warning about made "special units" -''' -''' Revision 3.0.1.3 1993/11/10 17:37:39 ram -''' patch14: documents stale ?M: dependency check -''' -''' Revision 3.0.1.2 1993/10/16 13:52:23 ram -''' patch12: added support for ?M: lines and fixed some typos -''' -''' Revision 3.0.1.1 1993/08/19 06:42:24 ram -''' patch1: leading config.sh searching was not aborting properly -''' -''' Revision 3.0 1993/08/18 12:10:15 ram -''' Baseline for dist 3.0 netwide release. -''' -''' +.\" @(#) Manual page for metalint +.\" +.\" $Id$ +.\" +.\" Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi +.\" +.\" You may redistribute only under the terms of the Artistic Licence, +.\" as specified in the README file that comes with the distribution. +.\" You may reuse parts of this distribution only within the terms of +.\" that same Artistic Licence; a copy of which may be found at the root +.\" of the source tree for dist 4.0. +.\" +.\" $Log: mlint.SH,v $ +.\" Revision 3.0.1.9 1997/02/28 16:30:25 ram +.\" patch61: new "create" and "empty" lint directives +.\" patch61: documented new messages +.\" +.\" Revision 3.0.1.8 1995/09/25 09:18:07 ram +.\" patch59: documented new ?Y: directive +.\" patch59: fixed my e-mail address +.\" +.\" Revision 3.0.1.7 1995/07/25 14:18:51 ram +.\" patch56: added two new warnings for : comments lines in Configure +.\" +.\" Revision 3.0.1.6 1994/10/29 16:33:56 ram +.\" patch36: documents new ?F: lines and the related metalint warnings +.\" patch36: removed statement in BUGS since all warnings may now be shut +.\" +.\" Revision 3.0.1.5 1994/05/06 15:20:30 ram +.\" patch23: added -L switch to override public unit repository path +.\" patch23: two new warnings concerning last unit lines +.\" +.\" Revision 3.0.1.4 1994/01/24 14:20:39 ram +.\" patch16: can now easily suppress warning about made "special units" +.\" +.\" Revision 3.0.1.3 1993/11/10 17:37:39 ram +.\" patch14: documents stale ?M: dependency check +.\" +.\" Revision 3.0.1.2 1993/10/16 13:52:23 ram +.\" patch12: added support for ?M: lines and fixed some typos +.\" +.\" Revision 3.0.1.1 1993/08/19 06:42:24 ram +.\" patch1: leading config.sh searching was not aborting properly +.\" +.\" Revision 3.0 1993/08/18 12:10:15 ram +.\" Baseline for dist 3.0 netwide release. +.\" +.\" .SH NAME metalint \- a metaconfig unit consistency checker .SH SYNOPSIS @@ -260,11 +260,20 @@ The file is listed more than once on the ?F: line, under the same name. This does not appear when declaring both a private UU file and a public file with the same name, for instance. .TP -"(?F) UU file $uufile in non-special unit ignored." +"(?F) UU file 'xxx' in non-special unit ignored." Private UU files (i.e. files like the \fImyread\fR script created for later perusal by \fIConfigure\fR) may only be created in special units. Exceptions allowed if the ?F: line is preceded by a proper ?LINT: hint. .TP +"(?F) file 'xxx' already exported by yyy.U." +The listed file 'xxx' is already reported exported (listed likewise) in +the other unit yyy.U and is conflicting. An exported file is a generated +file above the UU directory. +.TP +"(?F) UU file 'xxx' already created by yyy.U." +The listed file 'xxx' is already created in the UU directory by the other +unit yyy.U. A created file is listed as ./xxx on the ?F: line. +.TP "(?T) temporary symbol '\$xxx' multiply declared." Self explanatory. .TP diff --git a/mcon/man/mxref.SH b/mcon/man/mxref.SH index 359f959..229341e 100755 --- a/mcon/man/mxref.SH +++ b/mcon/man/mxref.SH @@ -18,35 +18,35 @@ echo "Extracting mcon/man/metaxref.$manext (with variable substitutions)" $rm -f metaxref.$manext $spitshell >metaxref.$manext <<!GROK!THIS! .TH METAXREF $manext "Version $VERSION PL$PATCHLEVEL" -''' @(#) Manual page for metaxref -''' -''' $Id$ -''' -''' Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi -''' -''' You may redistribute only under the terms of the Artistic Licence, -''' as specified in the README file that comes with the distribution. -''' You may reuse parts of this distribution only within the terms of -''' that same Artistic Licence; a copy of which may be found at the root -''' of the source tree for dist 4.0. -''' -''' $Log: mxref.SH,v $ -''' Revision 3.0.1.4 1997/02/28 16:30:39 ram -''' patch61: new -L option to match metaconfig and metalint -''' -''' Revision 3.0.1.3 1994/10/29 16:34:26 ram -''' patch36: the leading .TH was referring to metaconfig -''' -''' Revision 3.0.1.2 1993/10/16 13:52:46 ram -''' patch12: added BUGS section -''' -''' Revision 3.0.1.1 1993/08/19 06:42:25 ram -''' patch1: leading config.sh searching was not aborting properly -''' -''' Revision 3.0 1993/08/18 12:10:15 ram -''' Baseline for dist 3.0 netwide release. -''' -''' +.\" @(#) Manual page for metaxref +.\" +.\" $Id$ +.\" +.\" Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi +.\" +.\" You may redistribute only under the terms of the Artistic Licence, +.\" as specified in the README file that comes with the distribution. +.\" You may reuse parts of this distribution only within the terms of +.\" that same Artistic Licence; a copy of which may be found at the root +.\" of the source tree for dist 4.0. +.\" +.\" $Log: mxref.SH,v $ +.\" Revision 3.0.1.4 1997/02/28 16:30:39 ram +.\" patch61: new -L option to match metaconfig and metalint +.\" +.\" Revision 3.0.1.3 1994/10/29 16:34:26 ram +.\" patch36: the leading .TH was referring to metaconfig +.\" +.\" Revision 3.0.1.2 1993/10/16 13:52:46 ram +.\" patch12: added BUGS section +.\" +.\" Revision 3.0.1.1 1993/08/19 06:42:25 ram +.\" patch1: leading config.sh searching was not aborting properly +.\" +.\" Revision 3.0 1993/08/18 12:10:15 ram +.\" Baseline for dist 3.0 netwide release. +.\" +.\" .SH NAME metaxref \- builds cross-reference file/unit/item information .SH SYNOPSIS diff --git a/mcon/mconfig.SH b/mcon/mconfig.SH index 4917e43..42a3dc1 100755 --- a/mcon/mconfig.SH +++ b/mcon/mconfig.SH @@ -70,8 +70,6 @@ chop($date = `date`); use Getopt::Std; &usage unless getopts("dhkmostvwGMVL:X:"); -my %excluded_symbol; -read_exclusions($opt_X); $MC = $opt_L if $opt_L; # May override public library path $MC = &tilda_expand($MC); # ~name expansion chop($WD = `pwd`); # Working directory @@ -93,6 +91,8 @@ unlink 'Wanted' unless $opt_w; # Wanted rebuilt if no -w unlink 'Obsolete' unless $opt_w; # Obsolete file rebuilt if no -w &readpackage; # Merely get the package's name &init; # Various initializations +my %excluded_symbol; +read_exclusions($opt_X); # Load -X or .package equivalent `mkdir .MT 2>&1` unless -d '.MT'; # For private temporary files &locate_units; # Fill in @ARGV with a unit list diff --git a/mcon/mxref.SH b/mcon/mxref.SH index 3433edc..fa9e44e 100755 --- a/mcon/mxref.SH +++ b/mcon/mxref.SH @@ -64,8 +64,6 @@ use Getopt::Std; chop($date = `date`); chop($WD = `pwd`); # Working directory -my %excluded_symbol; -read_exclusions($opt_X); $MC = $opt_L if $opt_L; # May override library path $MC = &tilda_expand($MC); # ~name expansion chdir $MC || die "Can't chdir to $MC: $!\n"; @@ -81,7 +79,10 @@ if ($opt_V) { $NEWMANI = $opt_f || (-f 'MANIFEST.new' ? 'MANIFEST.new' : 'MANIFEST'); +&readpackage; # Merely get the package's name &init; # Various initializations +my %excluded_symbol; +read_exclusions($opt_X); # Load -X or .package equivalent `mkdir .MT 2>&1` unless -d '.MT'; # For private temporary files unlink 'Obsolete'; # Obsolete file rebuilt diff --git a/mcon/pl/lint.pl b/mcon/pl/lint.pl index 0120c51..e73f0fd 100644 --- a/mcon/pl/lint.pl +++ b/mcon/pl/lint.pl @@ -78,6 +78,7 @@ sub init_extraction { %filetmp = (); # Local temporary files in ?F: directives %filesetin = (); # Lists units defining a temporary file %filecreated = (); # Records files created in this unit + %filedefined = (); # Records units that export a given file %prodfile = (); # Unit where a given file is said to be created %defseen = (); # Symbol defintions claimed %lintset = (); # Symbols declared set by a ?LINT: line @@ -622,15 +623,30 @@ sub p_file { } $prodfile{$file} .= "$unit " if $fileseen{$file} == 1; ($uufile = $file) =~ s|^\./(\S+)$|$1|; - next if $file eq $uufile; # Don't care about non-UU files + if ($file eq $uufile) { + # This is a non-UU files created and not a temporary file + # It is meant to be exported by Configure + if (exists $filedefined{$file}) { + my $other = $filedefined{$file}; + warn "$where: file '$file' already exported by $other.U.\n"; + } else { + $filedefined{$file} = $unit; + } + next; + } unless ($is_special || $lintcreated{$uufile}) { warn "$where: UU file '$uufile' in non-special unit ignored.\n"; delete $lintcreated{$uufile}; # Detect spurious LINT next; } delete $lintcreated{$uufile} if !$is_special; # Detect spurious LINT - $filemaster{$uufile} = $unit unless defined $filemaster{$uufile}; - $filecreated{$uufile} = 'a'; # Will be automagically incremented + if (exists $filemaster{$uufile}) { + my $other = $filemaster{$uufile}; + warn "$where: UU file '$uufile' already created by $other.U.\n"; + } else { + $filemaster{$uufile} = $unit; + $filecreated{$uufile} = 'a'; # Will be automagically incremented + } } } @@ -1308,6 +1324,7 @@ sub sanity_checks { undef %shspecial; undef %shvisible; undef %filemaster; + undef %filedefined; # Spot multiply defined C symbols foreach $sym (keys %cmaster) { |