[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Broken example in autoconf manual
From: |
Nick Bowler |
Subject: |
Re: Broken example in autoconf manual |
Date: |
Thu, 16 Mar 2017 18:26:10 -0400 |
Hello,
On 2017-03-16, Max Horn <address@hidden> wrote:
> on
> https://www.gnu.org/software/autoconf/manual/autoconf.html#Using-System-Type
>
> this example is given:
>
> case $host in
> alpha*-*-*) AC_CONFIG_LINKS([dither.c:alpha/dither.c]) ;;
> powerpc*-*-*) AC_CONFIG_LINKS([dither.c:powerpc/dither.c]) ;;
> *-*-*) AC_CONFIG_LINKS([dither.c:generic/dither.c]) ;;
> esac
>
> But that doesn't actually work; inserting it into configure.ac leads to this
> error:
>
> configure.ac:396: error: `dither.c' is already registered with
> AC_CONFIG_LINKS.
Nice catch.
[...]
> Which leaves me wondering how to achieve equivalent behavior correctly?
Probably the example could be written something like this (untested):
case $host in
alpha*-*-*) dither_src=alpha ;;
powerpc*-*-*) dither_src=powerpc ;;
*-*-*) dither_src=generic ;;
esac
AC_CONFIG_LINKS([dither.c:$dither_src/dither.c]) ;;
Cheers,
Nick