This is the mail archive of the gsl-discuss@sourceware.org mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Conditional compilation based on GSL version


Hi,

Could GSL expose some facility in gsl_version.h to compare the version 
of GSL at compile time for dumb clients which don't want to impose 
special build system requirements?  The current GSL_VERSION define 
exports a string like "1.12", but that's not so useful for testing 
against versions using the C preprocessor at compile time.  Something 
simple like GSL_VERSION_MAJOR and GSL_VERSION_MINOR defines would go a 
long way.  Or perhaps a more complex macro like 
GSL_VERSION_IS_COMPATIBLE(major,minor) would be preferable.

My current workaround is to grab the GSL version string using 
pkg-config, split it into major and minor version numbers, and pass 
those in as preprocessor defines.  It's rather ugly, possibly error 
prone, and of course there's also the pkg-config requirement, so it's 
not really ideal.  I did look in the manual, but if I'm missing the 
obvious solution please whack me with your stout clue stick.  :)

Cheers,

Joonas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]