Add a DKP_CHECK_VERSION macro which we can use in client tools

This commit is contained in:
Richard Hughes 2009-07-03 10:41:32 +01:00
parent cb702d0736
commit 77c767edf4
5 changed files with 50 additions and 0 deletions

View file

@ -9,6 +9,9 @@ AM_MAINTAINER_MODE
# enable nice build output on automake1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
# use this in dkp-version.h
AC_SUBST(VERSION)
# libtool versioning - this applies to devkit-power-gobject
#
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
@ -187,6 +190,7 @@ doc/man/Makefile
doc/dbus/Makefile
policy/Makefile
devkit-power-gobject/Makefile
devkit-power-gobject/dkp-version.h
po/Makefile.in
])

View file

@ -8,4 +8,5 @@
*.gcov
*.gcda
*.gcno
dkp-version.h

View file

@ -14,6 +14,7 @@ lib_LTLIBRARIES = \
libdevkit_power_includedir = $(includedir)/DeviceKit-power/devkit-power-gobject
libdevkit_power_include_HEADERS = \
devicekit-power.h \
dkp-version.h \
dkp-client.h \
dkp-device.h \
dkp-wakeups.h \
@ -25,6 +26,7 @@ libdevkit_power_include_HEADERS = \
libdevkit_power_gobject_la_SOURCES = \
devicekit-power.h \
dkp-version.h \
dkp-client.c \
dkp-client.h \
dkp-device.c \
@ -53,6 +55,9 @@ libdevkit_power_gobject_la_LDFLAGS = \
-no-undefined \
-export-symbols-regex '^dkp_.*'
EXTRA_DIST = \
dkp-version.h.in
clean-local:
rm -f *~

View file

@ -28,6 +28,7 @@
#define __DEVICEKIT_POWER_H_INSIDE__
#include <devkit-power-gobject/dkp-version.h>
#include <devkit-power-gobject/dkp-client.h>
#include <devkit-power-gobject/dkp-device.h>
#include <devkit-power-gobject/dkp-enum.h>

View file

@ -0,0 +1,39 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2009 Richard Hughes <richard@hughsie.com>
*
* Licensed under the GNU General Public License Version 2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#if !defined (__DEVICEKIT_POWER_H_INSIDE__) && !defined (DKP_COMPILATION)
#error "Only <devicekit-power.h> can be included directly."
#endif
#ifndef __DKP_VERSION_H
#define __DKP_VERSION_H
/* compile time version
*/
#define DKP_COMPILE_VERSION (@VERSION@)
/* check whether a the version is above the compile time version.
*/
#define DKP_CHECK_VERSION(ver) \
(DKP_COMPILE_VERSION > (ver) || \
(DKP_COMPILE_VERSION == (ver)))
#endif /* __DKP_VERSION_H */