mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-14 15:34:35 +00:00
909b9d852b
While testing fixes, it's sometimes confusing to rebuild only one C file (e.g. a mux) and not to have the correct commit ID reported in "haproxy -v" nor on the stats page. This patch adds a new "version.c" file which is always rebuilt. It's very small and contains only 3 variables derived from the various version strings. These variables are used instead of the macros at the few places showing the version. This way the output version of the running code is always correct for the parts that were rebuilt.
75 lines
2.0 KiB
C
75 lines
2.0 KiB
C
/*
|
|
* include/common/version.h
|
|
* This file serves as a template for future include files.
|
|
*
|
|
* Copyright (C) 2000-2010 Willy Tarreau - w@1wt.eu
|
|
*
|
|
* 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, version 2.1
|
|
* exclusively.
|
|
*
|
|
* 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 _COMMON_VERSION_H
|
|
#define _COMMON_VERSION_H
|
|
|
|
#include <common/config.h>
|
|
|
|
#ifdef CONFIG_PRODUCT_NAME
|
|
#define PRODUCT_NAME CONFIG_PRODUCT_NAME
|
|
#else
|
|
#define PRODUCT_NAME "HAProxy"
|
|
#endif
|
|
|
|
#ifdef CONFIG_PRODUCT_BRANCH
|
|
#define PRODUCT_BRANCH CONFIG_PRODUCT_BRANCH
|
|
#else
|
|
#define PRODUCT_BRANCH "2.0"
|
|
#endif
|
|
|
|
#ifdef CONFIG_PRODUCT_URL
|
|
#define PRODUCT_URL CONFIG_PRODUCT_URL
|
|
#else
|
|
#define PRODUCT_URL "http://www.haproxy.org/"
|
|
#endif
|
|
|
|
#ifdef CONFIG_PRODUCT_URL_UPD
|
|
#define PRODUCT_URL_UPD CONFIG_PRODUCT_URL_UPD
|
|
#else
|
|
#define PRODUCT_URL_UPD "http://www.haproxy.org/#down"
|
|
#endif
|
|
|
|
#ifdef CONFIG_PRODUCT_URL_DOC
|
|
#define PRODUCT_URL_DOC CONFIG_PRODUCT_URL_DOC
|
|
#else
|
|
#define PRODUCT_URL_DOC "http://www.haproxy.org/#docs"
|
|
#endif
|
|
|
|
#ifdef CONFIG_HAPROXY_VERSION
|
|
#define HAPROXY_VERSION CONFIG_HAPROXY_VERSION
|
|
#else
|
|
#error "Must define CONFIG_HAPROXY_VERSION"
|
|
#endif
|
|
|
|
#ifdef CONFIG_HAPROXY_DATE
|
|
#define HAPROXY_DATE CONFIG_HAPROXY_DATE
|
|
#else
|
|
#error "Must define CONFIG_HAPROXY_DATE"
|
|
#endif
|
|
|
|
extern const char *haproxy_version;
|
|
extern const char *haproxy_date;
|
|
extern const char *stats_version_string;
|
|
|
|
#endif /* _COMMON_VERSION_H */
|
|
|