automake
[Top][All Lists]
Advanced

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

choosing a source file based on configure


From: Bryan VanDeVen
Subject: choosing a source file based on configure
Date: Wed, 29 Nov 2000 15:15:29 -0600

Hey guys,

what is the best way to use a different source file based on the outcome of 
configure? We would like to normailly produce a stubbed out version of a lib 
function, and only use the real version when building inside the closed 
space

So, we tried:

configure.in:

dnl
dnl Check for LFBL
dnl
AC_MSG_CHECKING(whether to classified lfbl database )
AC_ARG_ENABLE(lfbl,
[  --enable-lfbl           turn on real lfbl support (default is disabled)],
[
        AC_MSG_RESULT(yes)
        LFBLCODE="REALFILE"
], [
        AC_MSG_RESULT(no)
        LFBLCODE="STUBFILE"
])
AC_SUBST(LFBLCODE)          

and then in Makefile.am:

REALFILE = getlfbl.c
STUBFILE = getlfbl_stub.c
lib_LTLIBRARIES =       liblfbl.la
liblfbl_la_SOURCES =    bit_unpack.c \
                        fixpos.c \
                        getcentr.c \
                        $(@LFBLCODE@) \
                        getlfbla.c \
                        getlfbld.c 

which DOES seem to put the right thing in the Makefile, namely:

REALFILE = getlfbl.c
STUBFILE = getlfbl_stub.c
lib_LTLIBRARIES = liblfbl.la      
liblfbl_la_SOURCES = bit_unpack.c                       cloself.c             
          fillfbl.c                       fixpos.c                        
getcentr.c                      $(STUBFILE)      etc, etc

but then whenever we run "make" it ignores this (I think) shell substitution.

I know this kind of thing has been done before, I just need a pointer on the 
best or usual way to accomplish it.

Thanks!

-- 
Bryan Van de Ven
Applied Research Labs
University of Texas, Austin



reply via email to

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