[lug] Automake question: Checking for subdirs?

Scott A. Herod herod at interact-tv.com
Mon Mar 4 17:51:17 MST 2002


"Scott A. Herod" wrote:
> 
> Tom Tromey wrote:
> > Ordinarily if you want to conditionally build a subdirectory, you do
> > the checking in configure and define SUBDIRS based on the results.
> 
> So, if I understand this, in configure.in I call
> 
> AC_CONFIG_SUBDIRS(all possible subdirectories)
> 
> I see where those directories appear in the created configure but
> don't see that the directories that it actually found is saved.
> Do I need to call AC_CHECK_FILES for each directory and save the
> results?  subdirs contains the entire list of subdirectories.
> 
> Scott

I ended up using AC_CHECK_FILES as mentioned above.  It was pretty
easy if not the official way to do it:

In configure.in:

AC_CHECK_FILES(my list of all possible subdirectories,
EXIST_SUBDIRS="$EXIST_SUBDIRS $ac_file")

AC_SUBST(EXIST_SUBDIRS)

In Makefile.am:

SUBDIRS = @EXIST_SUBDIRS@

Scott



More information about the LUG mailing list