diff --git a/configure.ac b/configure.ac index d42b71c..d2d06c0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,11 @@ +# Versioning. +m4_define([dc_version_major],[0]) +m4_define([dc_version_minor],[0]) +m4_define([dc_version_micro],[0]) + # Initialize autoconf. AC_PREREQ([2.60]) -AC_INIT([libdivecomputer], [0.1]) +AC_INIT([libdivecomputer],[dc_version_major.dc_version_minor.dc_version_micro]) AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADERS([config.h]) @@ -52,10 +57,16 @@ AM_CONDITIONAL([IRDA], [test "$irda_win32" = "yes" || test "$irda_linux" = "yes" # Checks for library functions. AC_CHECK_FUNCS([localtime_r gmtime_r]) +# Versioning. +AC_SUBST([DC_VERSION_MAJOR],[dc_version_major]) +AC_SUBST([DC_VERSION_MINOR],[dc_version_minor]) +AC_SUBST([DC_VERSION_MICRO],[dc_version_micro]) + AC_CONFIG_FILES([ libdivecomputer.pc Makefile src/Makefile + src/version.h examples/Makefile ]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index a10ba70..bf7e293 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,6 +4,7 @@ libdivecomputerdir = $(includedir)/libdivecomputer libdivecomputer_HEADERS = \ + version.h \ utils.h \ buffer.h \ device.h \ diff --git a/src/version.h.in b/src/version.h.in new file mode 100644 index 0000000..e45aa7b --- /dev/null +++ b/src/version.h.in @@ -0,0 +1,37 @@ +/* + * libdivecomputer + * + * Copyright (C) 2010 Jef Driesen + * + * 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.1 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef DC_VERSION_H +#define DC_VERSION_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#define DC_VERSION_MAJOR @DC_VERSION_MAJOR@ +#define DC_VERSION_MINOR @DC_VERSION_MINOR@ +#define DC_VERSION_MICRO @DC_VERSION_MICRO@ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* DC_VERSION_H */