From: Rémi Denis-Courmont Date: Sat, 21 Aug 2010 16:17:18 +0000 (+0300) Subject: libvlc_version.h: build-time version macros X-Git-Tag: 1.2.0-pre1~5376 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=20703d1eb24516fd4cebadc038db3f30d14f5abc;p=vlc libvlc_version.h: build-time version macros --- diff --git a/include/vlc/libvlc_version.h.in b/include/vlc/libvlc_version.h.in new file mode 100644 index 0000000000..61518f7fb7 --- /dev/null +++ b/include/vlc/libvlc_version.h.in @@ -0,0 +1,55 @@ +/***************************************************************************** + * libvlc_version.h + ***************************************************************************** + * Copyright (C) 2010 Rémi Denis-Courmont + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +/** + * \file + * This file defines version macros for LibVLC. + * Those macros are primilarly intended for conditional (pre)compilation. + * To get the run-time LibVLC version, use libvlc_get_version() instead + * (the run-time version may be more recent than build-time one, thanks to + * backward binary compatibility). + * + * \version This header file is available in LibVLC 1.1.4 and higher. + */ + +#ifndef LIBVLC_VERSION_H +# define LIBVLC_VERSION_H 1 + +/** LibVLC major version number */ +# define LIBVLC_VERSION_MAJOR (@VERSION_MAJOR@) + +/** LibVLC minor version number */ +# define LIBVLC_VERSION_MINOR (@VERSION_MINOR@) + +/** LibVLC revision */ +# define LIBVLC_VERSION_REVISION (@VERSION_REVISION@) + +# define LIBVLC_VERSION_EXTRA (0) + +/** Makes a single integer from a LibVLC version numbers */ +# define LIBVLC_VERSION(maj,min,rev,extra) \ + ((maj << 24) | (min << 16) | (rev << 8) | (extra)) + +/** LibVLC full version as a single integer (for comparison) */ +# define LIBVLC_VERSION_INT \ + LIBVLC_VERSION(LIBVLC_VERSION_MAJOR, LIBVLC_VERSION_MINOR, \ + LIBVLC_VERSION_EXTRA, LIBVLC_VERSION_EXTRA) + +#endif diff --git a/src/Makefile.am b/src/Makefile.am index 00da87aa9c..09bb0853fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -13,7 +13,9 @@ EXTRA_DIST = extras/COPYING \ libvlc.sym \ libvlccore.sym -BUILT_SOURCES = ../include/vlc_about.h +BUILT_SOURCES = \ + $(nodist_pkginclude_HEADERS) \ + ../include/vlc_about.h CLEANFILES = $(BUILT_SOURCES) SUFFIXES = .pc.in .pc .rc.in .rc @@ -38,6 +40,7 @@ pkginclude_HEADERS = \ ../include/vlc/libvlc_structures.h \ ../include/vlc/libvlc_vlm.h \ $(NULL) +nodist_pkginclude_HEADERS = ../include/vlc/libvlc_version.h pluginsinclude_HEADERS = \ ../include/vlc_access.h \ @@ -132,6 +135,9 @@ noinst_HEADERS = \ ../include/vlc_windows_interfaces.h \ $(NULL) +../include/vlc/libvlc_version.h: ../include/vlc/libvlc_version.h.in $(top_builddir)/config.status + $(SHELL) $(top_builddir)/config.status --file=$@ + ../include/vlc_about.h: Makefile.am $(top_srcdir)/COPYING $(top_srcdir)/THANKS $(top_srcdir)/AUTHORS $(AM_V_at)rm -f -- "$@.tmp" $(AM_V_at)mkdir -p -- ../include