[asterisk-dev] rhino dahdi drivers and DAHDI_VER

Shaun Ruffell sruffell at digium.com
Mon Nov 1 07:26:20 CDT 2010


On 11/01/2010 07:10 AM, Tzafrir Cohen wrote:
> Hi
> 
> While reviewing some patches to the Elastix packages of DAHDI (most of
> them not submitted upstream. Why oh why?) I noticed a one that includes
> include/dahdi/version.h to be installed. The changelog mentioned that it
> was required for Rhino drivers to build.
> 
> I suppose that installing that file is not such a bad thing. But is the
> information in it useful?
> 
> This file includes a single #define, DAHDI_VER . Its content is the
> content of .version . For a released version, it is the version number.
> For a branch, it is SVN-$BRANCH-$REV (e.g. SVN-branch-2.3-r9455).
> 
> The way it is used in the drivers of Rhino is something such as:
> 
>   #if DAHDI_VER >= KERNEL_VERSION(2,4,0)

Not that it really concerns me, but this doesn't make any sense to me.
I didn't know the preprocessor does comparisons between strings
("SVN-branch-2.3-r9455") and integers ("#define KERNEL_VERSION(a,b,c)
(((a) << 16) + ((b) << 8) + (c))").

Something sounds broken there.  My guess is that the Makefile is just
overwriting include/dahdi/version.h unless there is also another patch
for the Makefile or build_tools/make_version_h.

> This works well for a released version, I guess. But I suspect it will
> completely break building with a subversion build.
> 
> So:
> 
> 1. Please report bugs. Upstream. Don't keep secret fixes.
> 2. If you have any creative fixes that don't break anything, patches are
>    welcomed.
> 

+1

-- 
Shaun Ruffell
Digium, Inc. | Linux Kernel Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list