LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2008, 09:20 AM   #1
JudyL
LQ Newbie
 
Registered: Aug 2007
Location: Florida, USA
Distribution: Ubuntu
Posts: 29

Rep: Reputation: 15
conditional build using kdevelop


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
 
Old 05-08-2008, 10:35 AM   #2
JudyL
LQ Newbie
 
Registered: Aug 2007
Location: Florida, USA
Distribution: Ubuntu
Posts: 29

Original Poster
Rep: Reputation: 15
Sorry, forgot my versions:

Ubuntu 7.04
KDevelop 4.3.4
Automake 1.1.10
Autoconf 2.61-3
 
Old 05-09-2008, 01:41 PM   #3
JudyL
LQ Newbie
 
Registered: Aug 2007
Location: Florida, USA
Distribution: Ubuntu
Posts: 29

Original Poster
Rep: Reputation: 15
More info - it looks like the AM_CONDITIONAL just flat out doesn't work with how KDevelop builds. If I change the line in the configure.in to

AM_CONDITIONAL(MY_USE_SPI, test 1 = 1)

thereby removing any screwups in how I test for the config option, it still doesn't make all the subprojects.

Now it's a more basic question - do AM_CONDITIONALs work with KDevelop?

Judy
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional execution tostay2003 Programming 5 12-28-2007 03:01 PM
Kdevelop : Error with INSTALL after Build Project michellembrodeur Linux - Software 0 02-10-2007 10:40 AM
Conditional Compilation oulevon Programming 3 02-26-2006 08:21 PM
KDevelop error messages -- cannot build applications vharishankar Debian 0 04-08-2005 06:33 AM
kdevelop stuck on recursive build.... rpg_code_master Programming 0 01-16-2004 08:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration