Prepare for a more flexible versioning system.

This commit is contained in:
Jef Driesen 2010-03-09 15:18:25 +00:00
parent 33dbf8034f
commit f265c04161
3 changed files with 50 additions and 1 deletions

View File

@ -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

View File

@ -4,6 +4,7 @@
libdivecomputerdir = $(includedir)/libdivecomputer
libdivecomputer_HEADERS = \
version.h \
utils.h \
buffer.h \
device.h \

37
src/version.h.in Normal file
View File

@ -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 */