home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.utils.bug
- Path: sparky!uunet!cis.ohio-state.edu!unidata.ucar.edu!steve
- From: steve@unidata.ucar.edu (Steve Emmerson)
- Subject: autoconf 1.1: bug defining `const' to empty string
- Message-ID: <199209031602.AA19994@unidata.ucar.edu>
- Sender: gnulists@ai.mit.edu
- Organization: UCAR/Unidata
- Distribution: gnu
- Date: Thu, 3 Sep 1992 04:02:38 GMT
- Approved: bug-gnu-utils@prep.ai.mit.edu
- Lines: 95
-
- Greetings,
-
- PROBLEM STATEMENT:
-
- autoconf version 1.1 does not correctly define the keyword `const' to
- be the empty string in environments that do not support `const'.
-
- REPEAT BY:
-
- The following was executed on a DECstaton 3100 running ULTRIX 4.2:
-
- % cat configure.in
- AC_INIT(configure.in)
- AC_CONFIG_HEADER(config.h)
- AC_CONST
- AC_OUTPUT(Makefile)
- % cat config.h.in
- #undef const
- #define const const
- % autoconf --version
- Autoconf version 1.1
- % CC=cc ./configure
- checking for working const
- creating config.status
- creating Makefile
- creating config.h
- % cat config.h
- /* config.h. Generated automatically by configure. */
- #undef const
- #define const const
- %
-
- In the specified environment, the last two lines in file `config.h'
- should have been
-
- # define const
- # define const
-
- That this is so can be seen from the relevant lines in file
- `config.status':
-
- % sed -n 15,16p config.status
- DEFS='#define const
- '
- %
-
- POSSIBLE FIX:
-
- Apply the following patch to file `acgeneral.m4':
-
- % diff -c acgeneral.m4.dist acgeneral.m4
- *** acgeneral.m4.dist Sun Aug 23 19:15:02 1992
- --- acgeneral.m4 Thu Sep 3 09:00:51 1992
- ***************
- *** 476,492 ****
- BEGIN { filenum = 1 }
- filenum == 1 && <<$>>1 == "#define" \
- { defs[<<$>>2] = <<$>>3
- for (i = 4; i <= NF; i++)
- defs[<<$>>2] = defs[<<$>>2] " " <<$>>i
- }
- /END_OF_DEFS/ { filenum = 2; next }
- filenum == 2 && <<$>>1 == "#define" && \
- ! defs[<<$>>2] != "" {
- <<$>>3 = defs[<<$>>2]
- print; next
- }
- filenum == 2 && <<$>>1 == "#undef" && \
- ! defs[<<$>>2] != "" {
- <<$>>1 = "#define"
- <<$>>2 = <<$>>2 " " defs[<<$>>2]
- print; next
- --- 476,493 ----
- BEGIN { filenum = 1 }
- filenum == 1 && <<$>>1 == "#define" \
- { defs[<<$>>2] = <<$>>3
- + hasdef[<<$>>2] = 1
- for (i = 4; i <= NF; i++)
- defs[<<$>>2] = defs[<<$>>2] " " <<$>>i
- }
- /END_OF_DEFS/ { filenum = 2; next }
- filenum == 2 && <<$>>1 == "#define" && \
- ! hasdef[<<$>>2] == 1 {
- <<$>>3 = defs[<<$>>2]
- print; next
- }
- filenum == 2 && <<$>>1 == "#undef" && \
- ! hasdef[<<$>>2] == 1 {
- <<$>>1 = "#define"
- <<$>>2 = <<$>>2 " " defs[<<$>>2]
- print; next
-
- Regards,
- Steve Emmerson <steve@unidata.ucar.edu>
-
-