Commit 105aa319 authored by Petri Hintukainen's avatar Petri Hintukainen Committed by Jean-Baptiste Kempf

configure: generate version.h

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 752bbae6
ACLOCAL_AMFLAGS = -Im4
AM_CPPFLAGS = -I$(top_srcdir)/src $(CSS_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src/dvdread $(CSS_CFLAGS)
dist_doc_DATA = AUTHORS ChangeLog COPYING NEWS README TODO
......@@ -46,7 +46,8 @@ pkginclude_HEADERS = \
src/dvdread/ifo_types.h \
src/dvdread/nav_print.h \
src/dvdread/nav_read.h \
src/dvdread/nav_types.h
src/dvdread/nav_types.h \
src/dvdread/version.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = misc/dvdread.pc
......
AC_INIT(libdvdread, 5.0.4)
dnl library version number
m4_define([dvdread_major], 5)
m4_define([dvdread_minor], 0)
m4_define([dvdread_micro], 3)
m4_define([dvdread_version],[dvdread_major.dvdread_minor.dvdread_micro])
AC_INIT(libdvdread, dvdread_version)
AC_CONFIG_SRCDIR([src/dvd_reader.c])
AC_PREREQ(2.53)
......@@ -105,6 +112,14 @@ AS_IF([test "x$ac_cv_c_compiler_gnu" = "xyes"], [
AC_DEFINE([UNUSED], [], [Unused parameter annotation])
])
dnl export library version number
DVDREAD_VERSION_MAJOR=dvdread_major()
DVDREAD_VERSION_MINOR=dvdread_minor()
DVDREAD_VERSION_MICRO=dvdread_micro()
AC_SUBST(DVDREAD_VERSION_MAJOR)
AC_SUBST(DVDREAD_VERSION_MINOR)
AC_SUBST(DVDREAD_VERSION_MICRO)
dnl ---------------------------------------------
dnl Output configuration files
dnl ---------------------------------------------
......@@ -112,4 +127,5 @@ AC_OUTPUT([
Makefile
doc/doxygen.cfg
misc/dvdread.pc
src/dvdread/version.h
])
......@@ -43,7 +43,7 @@
/**
* The current version.
*/
#define DVDREAD_VERSION 50400
#include "version.h"
/**
* The length of one Logical Block of a DVD.
......
/*
* This file is part of libdvdread
* Copyright (C) 2015 VideoLAN
*
* This file 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 file 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, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef DVDREAD_VERSION_H_
#define DVDREAD_VERSION_H_
#define DVDREAD_VERSION_CODE(major, minor, micro) \
(((major) * 10000) + \
((minor) * 100) + \
((micro) * 1))
#define DVDREAD_VERSION_MAJOR @DVDREAD_VERSION_MAJOR@
#define DVDREAD_VERSION_MINOR @DVDREAD_VERSION_MINOR@
#define DVDREAD_VERSION_MICRO @DVDREAD_VERSION_MICRO@
#define DVDREAD_VERSION_STRING "@DVDREAD_VERSION_MAJOR@.@DVDREAD_VERSION_MINOR@.@DVDREAD_VERSION_MICRO@"
#define DVDREAD_VERSION \
DVDREAD_VERSION_CODE(DVDREAD_VERSION_MAJOR, DVDREAD_VERSION_MINOR, DVDREAD_VERSION_MICRO)
#endif /* DVDREAD_VERSION_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment