autoconf
[Top][All Lists]
Advanced

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

RE: How to omit files from AC_OUTPUT?


From: Tim Van Holder
Subject: RE: How to omit files from AC_OUTPUT?
Date: Mon, 30 Apr 2001 22:50:08 +0200

> I have a list of 'test' directories containing Makefiles. I want to
> omit two of those tests if GNU Bison is not found, because they
> depend on GNU bison. How do I do this?
> 
>   AC_CHECK_PROG(BISON,bison,bison)
> 
>   dnl Below, I want the last two directories to be omitted.
>   dnl I could do it with two calls to AC_OUTPUT, wrapped in an
>   dnl if/else statement, but it would look really messy.
>   dnl Is there a way to build this list beforehand, then add to it
>   dnl only if bison is found?
> 
>   AC_OUTPUT(Makefile test-1/Makefile test-2/Makefile
>             test-bison1/Makefile test-bison2/Makefile)
> 
In current CVS autoconf (and the soon-to-be-released 2.50), this is
easy.  Simply conditionally use AC_CONFIG_FILES:

AC_CONFIG_FILES(Makefile test-1/Makefile test-2/Makefile)
if test x$ac_cv_prog_BISON = xbison; then
  AC_CONFIG_FILES(test-bison1/Makefile test-bison2/Makefile)
fi
AC_OUTPUT

In autoconf 2.13, you might get away with:

if test x$ac_cv_prog_BISON = xbison; then
  extra_makefiles="test-bison1/Makefile test-bison2/Makefile"
fi
AC_OUTPUT(Makefile test-1/Makefile test-2/Makefile $extra_makefiles)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]