home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / utils / bug / 2482 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  6.9 KB

  1. Path: sparky!uunet!stanford.edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!ma2s2.mathematik.uni-karlsruhe.de!haible
  2. From: haible@ma2s2.mathematik.uni-karlsruhe.de (Bruno Haible)
  3. Newsgroups: gnu.utils.bug
  4. Subject: autoconf 1.3
  5. Date: 26 Jan 1993 21:59:05 -0500
  6. Organization: GNUs Not Usenet
  7. Lines: 192
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-gnu-utils@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <9301261049.AA22445@ma2s2.mathematik.uni-karlsruhe.de>
  12.  
  13. I had some problems when switching from autoconf 1.2 to autoconf 1.3.
  14.  
  15.  
  16. 1)
  17. Autoconf 1.3 claims to "require GNU m4". In fact, it requires
  18. GNU m4 1.0.3. An older version of GNU m4 (no version number, but contains the
  19. string "Copyright (C) 1989, 1990, 1991 Free Software Foundation") dumps core
  20. when autoconf 1.3 is called.
  21.  
  22.  
  23. 2)
  24. When my config.h.in contains a default like
  25. #define FEATURE
  26. (an empty definition!) which is to be overriden by AC_DEFINE(FEATURE,something)
  27. the sed commands from config.status fail to change this to
  28. #define FEATURE something
  29.  
  30. Here is a simple patch for it:
  31.  
  32. diff -c3 -r ./acgeneral.m4 /usr/local/lib/acgeneral.m4
  33. *** ./acgeneral.m4    Tue Jan 19 18:16:09 1993
  34. --- /usr/local/lib/acgeneral.m4    Mon Jan 25 00:28:47 1993
  35. ***************
  36. *** 242,260 ****
  37.   dnl
  38.   dnl Don't compare $2 to a blank, so we can support "-Dfoo=".
  39.   dnl If creating a configuration header file, we add
  40. ! dnl commands to SEDDEFS to define the variable.  SED[due][ABCD]
  41.   dnl get defined in config.status.  Here we just insert the
  42.   dnl variable parts of the string: the variable name to define
  43.   dnl and the value to give it.
  44.   define(AC_DEFINE,
  45.   [ifelse($#, 2, ifelse(regexp($2, \W), -1, DEFS="$DEFS -D$1=$2", DEFS="$DEFS -D'$1=$2'"), DEFS="$DEFS -D$1=1")ifdef([AC_CONFIG_NAME],
  46.   [
  47.   ifelse($#, 2, [SEDDEFS="${SEDDEFS}\${SEDdA}$1\${SEDdB}$1\${SEDdC}$2\${SEDdD}
  48.   \${SEDuA}$1\${SEDuB}$1\${SEDuC}$2\${SEDuD}
  49.   \${SEDeA}$1\${SEDeB}$1\${SEDeC}$2\${SEDeD}
  50.   "], [SEDDEFS="${SEDDEFS}\${SEDdA}$1\${SEDdB}$1\${SEDdC}1\${SEDdD}
  51.   \${SEDuA}$1\${SEDuB}$1\${SEDuC}1\${SEDuD}
  52.   \${SEDeA}$1\${SEDeB}$1\${SEDeC}1\${SEDeD}
  53.   "])])])dnl
  54.   dnl
  55.   define(AC_BEFORE,
  56. --- 242,262 ----
  57.   dnl
  58.   dnl Don't compare $2 to a blank, so we can support "-Dfoo=".
  59.   dnl If creating a configuration header file, we add
  60. ! dnl commands to SEDDEFS to define the variable.  SED[duef][ABCD]
  61.   dnl get defined in config.status.  Here we just insert the
  62.   dnl variable parts of the string: the variable name to define
  63.   dnl and the value to give it.
  64.   define(AC_DEFINE,
  65.   [ifelse($#, 2, ifelse(regexp($2, \W), -1, DEFS="$DEFS -D$1=$2", DEFS="$DEFS -D'$1=$2'"), DEFS="$DEFS -D$1=1")ifdef([AC_CONFIG_NAME],
  66.   [
  67.   ifelse($#, 2, [SEDDEFS="${SEDDEFS}\${SEDdA}$1\${SEDdB}$1\${SEDdC}$2\${SEDdD}
  68.   \${SEDuA}$1\${SEDuB}$1\${SEDuC}$2\${SEDuD}
  69.   \${SEDeA}$1\${SEDeB}$1\${SEDeC}$2\${SEDeD}
  70. + \${SEDfA}$1\${SEDfB}$1\${SEDfC}$2\${SEDfD}
  71.   "], [SEDDEFS="${SEDDEFS}\${SEDdA}$1\${SEDdB}$1\${SEDdC}1\${SEDdD}
  72.   \${SEDuA}$1\${SEDuB}$1\${SEDuC}1\${SEDuD}
  73.   \${SEDeA}$1\${SEDeB}$1\${SEDeC}1\${SEDeD}
  74. + \${SEDfA}$1\${SEDfB}$1\${SEDfC}1\${SEDfD}
  75.   "])])])dnl
  76.   dnl
  77.   define(AC_BEFORE,
  78. ***************
  79. *** 564,569 ****
  80. --- 572,582 ----
  81.   SEDeB='<<$>>@\1#\2define\3'
  82.   SEDeC=' '
  83.   SEDeD='@g'
  84. + # SEDf turns "#define NAME" without trailing blanks into "#define NAME VALUE".
  85. + SEDfA='s@^\([     ]*\)#\([     ]*\)define\([     ][     ]*\)'
  86. + SEDfB='<<$>>@\1#\2define\3'
  87. + SEDfC=' '
  88. + SEDfD='@g'
  89.   changequote([,])dnl
  90.   rm -f conftest.sed
  91.   cat > conftest.sed <<CONFEOF
  92.  
  93.  
  94. 3)
  95. A spurious #endif should be removed:
  96.  
  97. diff -c3 -r ./acgeneral.m4 /usr/local/lib/acgeneral.m4
  98. *** ./acgeneral.m4    Tue Jan 19 18:16:09 1993
  99. --- /usr/local/lib/acgeneral.m4    Mon Jan 25 00:28:47 1993
  100. ***************
  101. *** 410,416 ****
  102.   #endif
  103.   ],
  104.   $2, $3)])dnl
  105. - #endif
  106.   ])dnl
  107.   dnl
  108.   define(AC_HAVE_FUNCS,
  109. --- 412,417 ----
  110.  
  111.  
  112. 4)
  113. What was the purpose of removing "-O" from the CC options when
  114. the compiler is known to be GCC?
  115.  
  116. diff -c3 -r ./acspecific.m4 /usr/local/lib/acspecific.m4
  117. *** ./acspecific.m4    Thu Jan 14 21:59:13 1993
  118. --- /usr/local/lib/acspecific.m4    Sun Jan 24 01:36:15 1993
  119. ***************
  120. *** 34,39 ****
  121. --- 34,40 ----
  122.   ${CC-cc} -E conftest.c > conftest.out 2>&1
  123.   if egrep yes conftest.out >/dev/null 2>&1; then
  124.     GCC=1 # For later tests.
  125. +   CC="$CC -O"
  126.   fi
  127.   rm -f conftest*
  128.   ])dnl
  129.  
  130.  
  131. 5)
  132. Defining RANLIB as '@:' is a Makefile usually produces a syntax error.
  133. Defining it as '\#' avoids this (at least with some shells).
  134.  
  135. diff -c3 -r ./acspecific.m4 /usr/local/lib/acspecific.m4
  136. *** ./acspecific.m4    Thu Jan 14 21:59:13 1993
  137. --- /usr/local/lib/acspecific.m4    Sun Jan 24 01:36:15 1993
  138. ***************
  139. *** 68,74 ****
  140.   rm -f conftest*
  141.   ])dnl
  142.   dnl
  143. ! define(AC_PROG_RANLIB, [AC_PROGRAM_CHECK(RANLIB, ranlib, ranlib, @:)])dnl
  144.   dnl
  145.   define(AC_PROG_AWK, [AC_PROGRAMS_CHECK(AWK, mawk gawk nawk awk,)])dnl
  146.   dnl
  147. --- 69,75 ----
  148.   rm -f conftest*
  149.   ])dnl
  150.   dnl
  151. ! define(AC_PROG_RANLIB, [AC_PROGRAM_CHECK(RANLIB, ranlib, ranlib, [\\\#])])dnl
  152.   dnl
  153.   define(AC_PROG_AWK, [AC_PROGRAMS_CHECK(AWK, mawk gawk nawk awk,)])dnl
  154.   dnl
  155.  
  156.  
  157. 6)
  158. An AC_DEFINE(FEATURE,void*) or AC_DEFINE(FEATURE,[void*]) results in
  159. -D'FEATURE=void*' being added to DEFS. Even gcc 2.3.3 complains about such
  160. an option. -DFEATURE=void* works, probably because no wildcard expansion
  161. takes place.
  162.  
  163. diff -c3 -r ./acgeneral.m4 /usr/local/lib/acgeneral.m4
  164. *** ./acgeneral.m4    Tue Jan 19 18:16:09 1993
  165. --- /usr/local/lib/acgeneral.m4    Mon Jan 25 00:28:47 1993
  166. ***************
  167. *** 242,256 ****
  168.   dnl
  169.   dnl Don't compare $2 to a blank, so we can support "-Dfoo=".
  170.   dnl If creating a configuration header file, we add
  171.   dnl commands to SEDDEFS to define the variable.  SED[due][ABCD]
  172.   dnl get defined in config.status.  Here we just insert the
  173.   dnl variable parts of the string: the variable name to define
  174.   dnl and the value to give it.
  175.   define(AC_DEFINE,
  176. ! [ifelse($#, 2, ifelse(regexp($2, \W), -1, DEFS="$DEFS -D$1=$2", DEFS="$DEFS -D'$1=$2'"), DEFS="$DEFS -D$1=1")ifdef([AC_CONFIG_NAME],
  177.   [
  178.   ifelse($#, 2, [SEDDEFS="${SEDDEFS}\${SEDdA}$1\${SEDdB}$1\${SEDdC}$2\${SEDdD}
  179.   \${SEDuA}$1\${SEDuB}$1\${SEDuC}$2\${SEDuD}
  180.   \${SEDeA}$1\${SEDeB}$1\${SEDeC}$2\${SEDeD}
  181. --- 242,254 ----
  182.   dnl
  183.   dnl Don't compare $2 to a blank, so we can support "-Dfoo=".
  184.   dnl If creating a configuration header file, we add
  185.   dnl commands to SEDDEFS to define the variable.  SED[due][ABCD]
  186.   dnl get defined in config.status.  Here we just insert the
  187.   dnl variable parts of the string: the variable name to define
  188.   dnl and the value to give it.
  189.   define(AC_DEFINE,
  190. ! [ifelse($#, 2, DEFS="$DEFS -D$1=$2", DEFS="$DEFS -D$1=1")ifdef([AC_CONFIG_NAME],
  191.   [
  192.   ifelse($#, 2, [SEDDEFS="${SEDDEFS}\${SEDdA}$1\${SEDdB}$1\${SEDdC}$2\${SEDdD}
  193.   \${SEDuA}$1\${SEDuB}$1\${SEDuC}$2\${SEDuD}
  194.   \${SEDeA}$1\${SEDeB}$1\${SEDeC}$2\${SEDeD}
  195.  
  196.  
  197. In any case, now I am happy with autoconf 1.3, especially since it removes the
  198. dependence on awk. Consensys' awk didn't succeed in building a correct config.h.
  199.  
  200.  
  201. Regards,
  202.                  Bruno Haible
  203.                  haible@ma2s2.mathematik.uni-karlsruhe.de
  204.  
  205.