Background: I've got a KDevelop automake project that contains 5 sub-projects. One of these projects (A) contains conditional-compilation code. I've set up two configurations in KDevelop, each with the appropriate -D switch in the Project Options. My problem is that the other 4 projects are quite large and take a while to build. So ... I'd like to have one configuration just build the A project (with the appropriate -D switch, of course) and the other project build all projects with the other -D switch.
I'm trying to do this using the AM_CONDITIONAL statement and supplying different config options through the Project Options => Configure Options screen.
options for configuration "debug"
configure arguments: --enable-debug=full --enable-pch
compiler flags: -DSPI_OPTION1
options for configuration "debug_nospi"
configure arguments: --enable-debug=full --enable-pch --enable-nospi
compiler flags: -DSPI_OPTION0
configure.in file:
Code:
AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(MySystem, 0.1)
AC_LANG_CPLUSPLUS
AC_PROG_CXX
AM_PROG_LIBTOOL
AC_OUTPUT(Makefile MyDllSo/Makefile MyService/Makefile \
MyTrace/Makefile MyDemo/Makefile MyInstall/Makefile)
# set variable used in makefiles based on KDevelop configuration
AC_ARG_ENABLE(nospi,
[ --enable-nopsi Spi option 0],
[nospi=yes],
[nospi=no])
AM_CONDITIONAL(MY_USE_SPI, test x$nospi = xno)
Makefile.am (in the root of project):
Code:
# not a GNU package. You can remove this line, if
# have all needed files, that a GNU package needs
AUTOMAKE_OPTIONS = foreign 1.4
# only build the DLL / SO is built for the noSPI configuration
if MY_USE_SPI
SPI_BUILD_ALL = MyService MyTrace MyDemo MyInstall
endif
SUBDIRS = MyDllSo $(SPI_BUILD_ALL)
Something in this doesn't work. I get the exact same thing whether I build "debug" or "debug-nospi" configuration - only the MyDllSo project is built. The compiler switches are correct for each configuration but the conditional is not controlling the makefile. When I look in the Makefiles in the debug and debug_nospi directories created by automake / config, It sees the conditional - each file contains the line
@MY_USE_SPI_TRUE@SPI_BUILD_ALL = MyService MyTrace MyDemo MyInstall
but apparently the condition doesn't become true for the debug build.
Any ideas on how to get this conditional to go true?
Thanks,
Judy