Skip to content
Snippets Groups Projects
Commit ce20076d authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Use plain autotools to generate version headers

parent 53ce801e
Branches
Tags
No related merge requests found
......@@ -3,15 +3,18 @@
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([src/knot/main.c])
# We extract version numbers from src/libknot/libknot.h
define([gv],[./getver.sh ]$1)
m4_define([libknot_MAJOR],esyscmd(gv(MAJOR)))dnl
m4_define([libknot_MINOR],esyscmd(gv(MINOR)))dnl
m4_define([libknot_PATCH],esyscmd(gv(PATCH)))dnl
m4_define([libknot_EXTRA],esyscmd(gv(EXTRA)))dnl
m4_define([libknot_PKG_VERSION],[libknot_MAJOR.libknot_MINOR.libknot_PATCH]libknot_EXTRA)]dnl
AC_INIT([knot], libknot_PKG_VERSION, [knot-dns@labs.nic.cz])
m4_define([knot_VERSION_MAJOR],2)
m4_define([knot_VERSION_MINOR],1)
m4_define([knot_VERSION_PATCH],0)
m4_define([knot_VERSION_EXTRA],-dev)
m4_define([knot_PKG_VERSION],[knot_VERSION_MAJOR.knot_VERSION_MINOR.knot_VERSION_PATCH]knot_VERSION_EXTRA)]
AC_SUBST([KNOT_VERSION_MAJOR], knot_VERSION_MAJOR)
AC_SUBST([KNOT_VERSION_MINOR], knot_VERSION_MINOR)
AC_SUBST([KNOT_VERSION_PATCH], knot_VERSION_PATCH)
AC_SUBST([KNOT_VERSION_EXTRA], knot_VERSION_EXTRA)
AC_INIT([knot], knot_PKG_VERSION, [knot-dns@labs.nic.cz])
AM_INIT_AUTOMAKE([gnits subdir-objects no-dist-gzip dist-xz -Wall -Werror])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([src/config.h])
......@@ -19,6 +22,10 @@ AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS([_GNU_SOURCE])
AC_CANONICAL_HOST
AC_CONFIG_FILES([src/libknot/version.h
src/zscanner/version.h
src/dnssec/lib/dnssec/version.h])
# Here are a set of rules to help you update your library version
# information:
#
......
#!/bin/sh
awk '/^#define LIBKNOT_VERSION_'$1'/ { print $3 }' src/libknot/version.h | tr -d '"\n'
......@@ -118,7 +118,8 @@ nobase_libknot_la_HEADERS = \
libknot/rrtype/tsig.h \
libknot/rrtype/txt.h \
libknot/tsig-op.h \
libknot/tsig.h
libknot/tsig.h \
libknot/version.h
# dynamic: libknot sources
libknot_la_SOURCES = \
......
......@@ -70,7 +70,8 @@ include_dnssec_HEADERS = \
lib/dnssec/nsec.h \
lib/dnssec/random.h \
lib/dnssec/sign.h \
lib/dnssec/tsig.h
lib/dnssec/tsig.h \
lib/dnssec/version.h
libdnssec_la_SOURCES = \
lib/binary.c \
......
/*!
* \file libknot.h
* \file version.h
*
* \author Ondřej Surý <ondrej.sury@nic.cz>
*
* \brief Convenience header with version number
*
* \addtogroup libknot
* @{
*/
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
......@@ -30,10 +29,10 @@
* gcc so each #define line in this group must also be splittable on
* whitespace, take the form LIBKNOT_*_VERSION and contain the magical
* trailing comment. */
#define LIBKNOT_VERSION_MAJOR 2
#define LIBKNOT_VERSION_MINOR 1
#define LIBKNOT_VERSION_PATCH 0
#define LIBKNOT_VERSION_EXTRA "-dev"
#define LIBKNOT_VERSION_MAJOR @KNOT_VERSION_MAJOR@
#define LIBKNOT_VERSION_MINOR @KNOT_VERSION_MINOR@
#define LIBKNOT_VERSION_PATCH @KNOT_VERSION_PATCH@
#define LIBKNOT_VERSION_EXTRA "@KNOT_VERSION_EXTRA"
#define LIBKNOT_VERSION_HEX ((LIBKNOT_VERSION_MAJOR << 16) | \
(LIBKNOT_VERSION_MINOR << 8) | \
......
/*!
* \file version.h
*
* \author Ondřej Surý <ondrej.sury@nic.cz>
*
* \brief Convenience header with version number
*
* @{
*/
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
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 3 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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Version information. This gets parsed by build scripts as well as
* gcc so each #define line in this group must also be splittable on
* whitespace, take the form LIBKNOT_*_VERSION and contain the magical
* trailing comment. */
#define LIBKNOT_VERSION_MAJOR @KNOT_VERSION_MAJOR@
#define LIBKNOT_VERSION_MINOR @KNOT_VERSION_MINOR@
#define LIBKNOT_VERSION_PATCH @KNOT_VERSION_PATCH@
#define LIBKNOT_VERSION_EXTRA "@KNOT_VERSION_EXTRA"
#define LIBKNOT_VERSION_HEX ((LIBKNOT_VERSION_MAJOR << 16) | \
(LIBKNOT_VERSION_MINOR << 8) | \
(LIBKNOT_VERSION_PATCH))
/* End parsable section. */
/*! @} */
......@@ -8,7 +8,8 @@ lib_LTLIBRARIES = libzscanner.la
zscanner_ladir = $(includedir)/zscanner
nobase_zscanner_la_HEADERS = \
error.h \
scanner.h
scanner.h \
version.h
# pkg-config
pkgconfig_DATA = libzscanner.pc
......
/*!
* \file version.h
*
* \author Ondřej Surý <ondrej.sury@nic.cz>
*
* \brief Convenience header with version number
*
* @{
*/
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
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 3 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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Version information. This gets parsed by build scripts as well as
* gcc so each #define line in this group must also be splittable on
* whitespace, take the form LIBKNOT_*_VERSION and contain the magical
* trailing comment. */
#define LIBKNOT_VERSION_MAJOR @KNOT_VERSION_MAJOR@
#define LIBKNOT_VERSION_MINOR @KNOT_VERSION_MINOR@
#define LIBKNOT_VERSION_PATCH @KNOT_VERSION_PATCH@
#define LIBKNOT_VERSION_EXTRA "@KNOT_VERSION_EXTRA"
#define LIBKNOT_VERSION_HEX ((LIBKNOT_VERSION_MAJOR << 16) | \
(LIBKNOT_VERSION_MINOR << 8) | \
(LIBKNOT_VERSION_PATCH))
/* End parsable section. */
/*! @} */
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