Re: AC_PROG_EGREP and $EGREP_TRADITIONAL and shell conditional statements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That's close enough, yes. You actually don't need the "else" though, it's
enough to isolate the first call to egrep:

  % cat >configure.ac <<'EOF'
  AC_INIT([test], [0])

  AC_PROG_CPP
  AC_PROG_EGREP

  # uncomment to make this work on new autoconf
  # m4_ifdef([_AC_PROG_EGREP_TRADITIONAL], [_AC_PROG_EGREP_TRADITIONAL])

  if false; then
    AC_EGREP_HEADER([printf], [stdio.h])
  fi

  AC_MSG_CHECKING([if stuff works])
  AC_EGREP_HEADER([malloc], [stdlib.h],
    [AC_MSG_RESULT([ok])], [AC_MSG_RESULT([nope])])


  AC_OUTPUT
EOF


On Tue, Mar 28, 2023 at 7:04 PM Nick Bowler <nbowler@xxxxxxxxxx> wrote:

> On 2023-03-28, Zack Weinberg <zack@xxxxxxxxxxxx> wrote:
> > Can someone who understands the problem described at
> > https://lists.gnu.org/archive/html/autoconf/2022-11/msg00129.html
> > please construct a minimal, self-contained configure.ac that
> > reproduces that problem?  It is difficult for me to tell whether
> > anything needs to be fixed in Autoconf from this report, and I don't
> > have time in the foreseeable future to try to cut down APR's gigantic
> > configure.ac myself.
>
> This should be a good approximation:
>
>   % cat >configure.ac <<'EOF'
>   AC_INIT([test], [0])
>
>   AC_PROG_CPP
>   AC_PROG_EGREP
>
>   # uncomment to make this work on new autoconf
>   # m4_ifdef([_AC_PROG_EGREP_TRADITIONAL], [_AC_PROG_EGREP_TRADITIONAL])
>
>   if false; then
>     AC_EGREP_HEADER([printf], [stdio.h])
>   else
>     AC_MSG_CHECKING([if stuff works])
>     AC_EGREP_HEADER([malloc], [stdlib.h],
>       [AC_MSG_RESULT([ok])], [AC_MSG_RESULT([nope])])
>   fi
>
>   AC_OUTPUT
> EOF
>
> This works in autoconf 2.69, not in current master (though it works if
> you uncomment the indicated line).
>
> IMO it is reasonable to fix this in Autoconf, because it just seems
> weird to me that AC_PROG_EGREP does not include the necessary egrep
> setup for AC_EGREP_HEADER to work (it used to).
>
> Cheers,
>   Nick
>
>




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux