[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Making a configure-time check add a -D define to CFLAGS
From:       Adriaan de Groot <adridg () cs ! kun ! nl>
Date:       2004-06-02 12:23:35
Message-ID: 200406021423.37150.adridg () cs ! kun ! nl
[Download RAW message or body]

I'm trying to make some code work for two different versions of libkcal - the 
version that comes with 3.2 and the upcoming HEAD version. So far, libkcal is 
unversioned, so there's no way for a program to know at compile time which 
version of libkcal is being used. This causes problems since in 3.3, you 
_must_ call readConfig() and load() on resource calendars, while in 3.2 those 
methods don't even exist.

An obvious thing to do would be to add a #define LIBKCAL_VERSION somewhere in 
libkcal - I can't quite think of _where_, though. Calendar.h comes to mind.

ALternatively, I'm doing:

AC_TRY_COMPILE(#include <calendarresources.h>,
        KCal::CalendarResources*testing;
        testing->readConfig();
        ,LIBKCAL_VERSION=0x30300
        ,LIBKCAL_VERSION=0x30000
        )

(Made up yet possibly sensible VERSIONs) But I don't know how to get this 
knowledge into my application - I'd like to add 

(1) #define LIBKCAL_VERSION to config.h, or
(2) -DLIBKCAL_VERSION to compile invocations

but can't seem to find how to do either in the autoconf and automake docs. 
Doing AC_SUBST(LIBKCAL_VERSION) doesn't seem to cut it.

Any auto* guru hints?

-- 
   "On top of that [watching KDE CVS] is interesting in a perverse 
    way, like watching sausage get made. By very smart people." - dkite
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic