ref: a7e814e3bfc6b7b8507c0e1083153611edb66748
parent: 417a9cb24ea0658cdb76ae28e9f86dc2347ee1d5
author: Petri Hintukainen <phintuka@gmail.com>
date: Wed Dec 16 06:21:42 EST 2015
generate version.h
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
ACLOCAL_AMFLAGS = -I m4
+AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src/dvdcss
EXTRA_DIST = msvc libdvdcss.spec INSTALL
@@ -46,7 +47,9 @@
test_dvd_region_CFLAGS = -I $(top_srcdir)/src
pkgincludedir = $(includedir)/dvdcss
-pkginclude_HEADERS = src/dvdcss/dvdcss.h
+pkginclude_HEADERS = \
+ src/dvdcss/dvdcss.h \
+ src/dvdcss/version.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = src/libdvdcss.pc
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,10 @@
-AC_INIT(libdvdcss, 1.3.99, , , https://www.videolan.org/developers/libdvdcss.html)
+dnl library version number
+m4_define([dvdcss_major], 1)
+m4_define([dvdcss_minor], 3)
+m4_define([dvdcss_micro], 99)
+m4_define([dvdcss_version],[dvdcss_major.dvdcss_minor.dvdcss_micro])
+
+AC_INIT(libdvdcss, dvdcss_version, , , https://www.videolan.org/developers/libdvdcss.html)
AC_CONFIG_SRCDIR([src/libdvdcss.c])
AC_PREREQ(2.50)
@@ -231,6 +237,14 @@
AC_PATH_PROG([GIT], [git])
AM_CONDITIONAL([GIT], [test "x$GIT" != "x"])
+dnl export library version number
+DVDCSS_VERSION_MAJOR=dvdcss_major()
+DVDCSS_VERSION_MINOR=dvdcss_minor()
+DVDCSS_VERSION_MICRO=dvdcss_micro()
+AC_SUBST(DVDCSS_VERSION_MAJOR)
+AC_SUBST(DVDCSS_VERSION_MINOR)
+AC_SUBST(DVDCSS_VERSION_MICRO)
+
AC_SUBST(DVDCSS_LDFLAGS)
AC_OUTPUT([
Makefile
@@ -237,4 +251,5 @@
libdvdcss.spec
doc/doxygen.cfg
src/libdvdcss.pc
+ src/dvdcss/version.h
])
--- a/src/dvdcss/dvdcss.h
+++ b/src/dvdcss/dvdcss.h
@@ -33,6 +33,8 @@
#include <stdint.h>
+#include "version.h"
+
#ifdef __cplusplus
extern "C" {
#endif
--- /dev/null
+++ b/src/dvdcss/version.h.in
@@ -1,0 +1,37 @@
+/*
+ * This file is part of libdvdcss
+ * 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 DVDCSS_VERSION_H_
+#define DVDCSS_VERSION_H_
+
+#define DVDCSS_VERSION_CODE(major, minor, micro) \
+ (((major) * 10000) + \
+ ((minor) * 100) + \
+ ((micro) * 1))
+
+#define DVDCSS_VERSION_MAJOR @DVDCSS_VERSION_MAJOR@
+#define DVDCSS_VERSION_MINOR @DVDCSS_VERSION_MINOR@
+#define DVDCSS_VERSION_MICRO @DVDCSS_VERSION_MICRO@
+
+#define DVDCSS_VERSION_STRING "@DVDCSS_VERSION_MAJOR@.@DVDCSS_VERSION_MINOR@.@DVDCSS_VERSION_MICRO@"
+
+#define DVDCSS_VERSION \
+ DVDCSS_VERSION_CODE(DVDCSS_VERSION_MAJOR, DVDCSS_VERSION_MINOR, DVDCSS_VERSION_MICRO)
+
+#endif /* DVDCSS_VERSION_H_ */