From 3193a8747492eccac75a245e5075644469cfbfef Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Wed, 24 Jun 2009 07:34:17 +0800 Subject: [PATCH] Add ibusversion.h.in --- configure.ac | 3 ++- src/Makefile.am | 6 ++++++ src/ibus.h | 1 + src/ibusversion.h.in | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/ibusversion.h.in diff --git a/configure.ac b/configure.ac index eae4763..8595e6d 100644 --- a/configure.ac +++ b/configure.ac @@ -215,7 +215,7 @@ AC_ARG_ENABLE(qt4-immodule, if test x"$IBUS_HAS_QT4" != x"yes"; then enable_qt4=no fi -enable_qt4=no +# enable_qt4=no AM_CONDITIONAL(IBUS_BUILD_QT4, [test x"$enable_qt4" = x"yes" ]) # check for dbus-python @@ -279,6 +279,7 @@ client/x11/Makefile setup/Makefile setup/ibus-setup src/Makefile +src/ibusversion.h bus/Makefile bindings/Makefile bindings/python/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index c52d99b..ea68d97 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,6 +39,7 @@ ibus_built_sources = \ $(NULL) ibus_public_h_sources = \ ibus.h \ + ibusversion.h \ ibusshare.h \ ibusdebug.h \ ibusobject.h \ @@ -205,6 +206,7 @@ ibusmarshalers.c: ibusmarshalers.list && rm -f xgen-gmc EXTRA_DIST = \ + ibusversion.h.in \ ibusmarshalers.list \ ibusenumtypes.h.template \ ibusenumtypes.c.template \ @@ -215,3 +217,7 @@ CLEANFILES = \ stamp-ibusmarshalers.h \ stamp-ibusenumtypes.h \ $(NULL) + +DISTCLEANFILES = \ + ibusversion.h \ + $(NULL) diff --git a/src/ibus.h b/src/ibus.h index ddfd164..ef92673 100644 --- a/src/ibus.h +++ b/src/ibus.h @@ -20,6 +20,7 @@ #ifndef __IBUS_H_ #define __IBUS_H_ +#include #include #include #include diff --git a/src/ibusversion.h.in b/src/ibusversion.h.in new file mode 100644 index 0000000..5b85026 --- /dev/null +++ b/src/ibusversion.h.in @@ -0,0 +1,39 @@ +/* vim:set et sts=4: */ +/* ibus - The Input Bus + * Copyright (C) 2008-2009 Huang Peng + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef __IBUS_VERSION_H_ +#define __IBUS_VERSION_H_ + +/* compile time version + */ +#define IBUS_MAJOR_VERSION (@PACKAGE_VERSION_MAJOR@) +#define IBUS_MINOR_VERSION (@PACKAGE_VERSION_MINOR@) +#define IBUS_MICRO_VERSION (@PACKAGE_VERSION_MICRO@) + +/* check whether a Gtk+ version equal to or greater than + * major.minor.micro is present. + */ +#define IBUS_CHECK_VERSION(major,minor,micro) \ + (IBUS_MAJOR_VERSION > (major) || \ + (IBUS_MAJOR_VERSION == (major) && IBUS_MINOR_VERSION > (minor)) || \ + (IBUS_MAJOR_VERSION == (major) && IBUS_MINOR_VERSION == (minor) && \ + IBUS_MICRO_VERSION >= (micro))) + +#endif + -- 2.7.4