Commit 8155b293 authored by Karl Wette's avatar Karl Wette
Browse files

Common generation of VCS/build information headers and sources

Original: 4e2e9bb537145f22a2a6880ae1bdb7ad1a2a6771
parent 893aa055
......@@ -162,10 +162,10 @@ def get_vcs_info(repo_dir, git_path='git'):
return info
def generate_vcs_info(dst_file, src_file, git_path='git'):
def generate_vcs_info(pkg_name, dst_file, src_file, git_path='git'):
"""
Generates a version info file 'dst_file' from a template 'src_file',
by running 'git_path' on the repository containing 'src_file'.
Generates a version info file 'dst_file' from a template 'src_file' for
'pkg_name', by running 'git_path' on the repository containing 'src_file'.
Returns True if 'dst_file' was modified, False otherwise.
"""
......@@ -182,7 +182,19 @@ def generate_vcs_info(dst_file, src_file, git_path='git'):
info = get_vcs_info(repo_dir, git_path)
# construct dictionary of replacements
if pkg_name.lower() == 'lalapps':
pkg_vcs_info_header = '%sVCSInfo.h' % pkg_name
pkg_config_header = 'config.h'
else:
pkg_vcs_info_header = 'lal/%sVCSInfo.h' % pkg_name
pkg_config_header = 'lal/%sConfig.h' % pkg_name
replacements = {
'@PACKAGE_NAME@' : pkg_name,
'@PACKAGE_NAME_UCASE@' : pkg_name.upper(),
'@PACKAGE_NAME_LCASE@' : pkg_name.lower(),
'@PACKAGE_NAME_NOLAL@' : re.sub(r'^LAL', '', pkg_name),
'@PACKAGE_VCS_INFO_HEADER@' : pkg_vcs_info_header,
'@PACKAGE_CONFIG_HEADER@' : pkg_config_header,
'@ID@' : info.id,
'@DATE@' : info.date,
'@BRANCH@' : info.branch,
......@@ -224,7 +236,7 @@ def generate_vcs_info(dst_file, src_file, git_path='git'):
if __name__ == "__main__":
# usage information
usage = '%prog [--git-path=/path/to/git] [--am-v-gen=$(AM_V_GEN)] output_file source_file'
usage = '%prog [--git-path=/path/to/git] [--am-v-gen=$(AM_V_GEN)] package_name output_file source_file'
# define option parser
parser = optparse.OptionParser(usage=usage)
......@@ -237,13 +249,14 @@ if __name__ == "__main__":
am_v_gen = opts.am_v_gen
# check for positional arguments
if (len(args) != 2):
if (len(args) != 3):
parser.error('incorrect number of command line options specified')
dst_file = args[0]
src_file = args[1]
pkg_name = args[0]
dst_file = args[1]
src_file = args[2]
# generate version info
modified = generate_vcs_info(dst_file, src_file, git_path)
modified = generate_vcs_info(pkg_name, dst_file, src_file, git_path)
# print generation message
if modified and len(am_v_gen) > 0:
......
......@@ -200,20 +200,13 @@ AC_DEFUN([LALSUITE_CHECK_GIT_REPO],[
])
# conditional for git and building from a git repository
AM_CONDITIONAL(HAVE_GIT_REPO,[test "x${have_git_repo}" = xyes])
# command line for version information generation script
AM_COND_IF(HAVE_GIT_REPO,[
m4_pattern_allow([AM_DEFAULT_VERBOSITY])
m4_pattern_allow([AM_V_GEN])
AC_SUBST([genvcsinfo_],["\$(genvcsinfo_\$(AM_DEFAULT_VERBOSITY))"])
AC_SUBST([genvcsinfo_0],["--am-v-gen='\$(AM_V_GEN)'"])
GENERATE_VCS_INFO="\$(PYTHON) \$(top_srcdir)/../gnuscripts/generate_vcs_info.py --git-path='\$(GIT)' \$(genvcsinfo_\$(V))"
],[GENERATE_VCS_INFO=false])
AC_SUBST(GENERATE_VCS_INFO)
])
AC_DEFUN([LALSUITE_VERSION_CONFIGURE_INFO],[
# $0: define version/configure info
m4_pushdef([uppercase],m4_translit(AC_PACKAGE_NAME, [a-z], [A-Z]))
m4_pushdef([lowercase],m4_translit(AC_PACKAGE_NAME, [A-Z], [a-z]))
m4_pushdef([withoutlal],m4_bpatsubst(AC_PACKAGE_NAME, [^LAL], []))
version_major=`echo "$VERSION" | cut -d. -f1`
version_minor=`echo "$VERSION" | cut -d. -f2`
version_micro=`echo "$VERSION" | cut -d. -f3`
......@@ -228,7 +221,12 @@ AC_DEFUN([LALSUITE_VERSION_CONFIGURE_INFO],[
AC_DEFINE_UNQUOTED(uppercase[_VERSION_DEVEL],[$version_devel],AC_PACKAGE_NAME[ Version Devel Number])
AC_SUBST([ac_configure_args])
AC_SUBST([configure_date])
AC_SUBST([PACKAGE_NAME_UCASE],uppercase)
AC_SUBST([PACKAGE_NAME_LCASE],lowercase)
AC_SUBST([PACKAGE_NAME_NOLAL],withoutlal)
m4_popdef([uppercase])
m4_popdef([lowercase])
m4_popdef([withoutlal])
# end $0
])
......@@ -511,12 +509,12 @@ AC_DEFUN([LALSUITE_CHECK_OPT_LIB],[
AC_DEFUN([LALSUITE_HEADER_LIBRARY_MISMATCH_CHECK],[
AC_MSG_CHECKING([whether $1 headers match the library])
lib_structure=`echo $1 | sed 's/LAL/lal/'`VCSInfo
header_structure=`echo $1 | sed 's/LAL/lal/'`HeaderVCSInfo
header_structure=`echo $1 | sed 's/LAL/lal/'`VCSInfoHeader
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <string.h>
#include <stdlib.h>
#include <lal/$1VCSInfo.h>
#include <lal/$1VCSInfoHeader.h>
int main(void) { exit(XLALVCSInfoCompare(&$lib_structure, &$header_structure) ? 1 : 0); }
]])],
[
......
.PHONY: force-vcs-info-generation
if HAVE_GIT_REPO
BUILT_SOURCES += $(vcs_info_sources)
MOSTLYCLEANFILES += $(vcs_info_sources)
$(vcs_info_sources): force-vcs-info-generation
$(AM_V_at)$(PYTHON) $(top_srcdir)/../gnuscripts/generate_vcs_info.py --git-path='$(GIT)' --am-v-gen='$(AM_V_GEN)' '$(PACKAGE_NAME)' $@ $(srcdir)/$@.git
endif # HAVE_GIT_REPO
MOSTLYCLEANFILES += $(build_info_source)
$(build_info_source): Makefile
$(AM_V_GEN)echo '/* $@: generated by Makefile */' >$@; \
echo 'const char *const lal$(PACKAGE_NAME_NOLAL)ConfigureArgs = "'"$(ac_configure_args)"'";' >>$@; \
echo 'const char *const lal$(PACKAGE_NAME_NOLAL)ConfigureDate = "'"$(configure_date)"'";' >>$@; \
echo 'const char *const lal$(PACKAGE_NAME_NOLAL)BuildDate = "'`date +"%Y-%m-%dT%H:%M:%S%z"`'";' >>$@
......@@ -47,7 +47,9 @@ lal.spec
lib/lal/.vcsinfo
lib/lal/LALBuildInfo.c
lib/lal/LALConfig.h
lib/lal/LALVCSInfo.c
lib/lal/LALVCSInfo.h
lib/lal/LALVCSInfoHeader.h
lib/lal/git_info.sed
lib/lal/git_version
lib/lal/lal-version
......
......@@ -15,6 +15,8 @@ AC_CONFIG_FILES([ \
include/Makefile \
include/lal/Makefile \
lib/Makefile \
lib/lal/LALVCSInfo.c \
lib/lal/LALVCSInfo.h \
lib/lal/Makefile \
lib/lalsupport/Makefile \
lib/lalsupport/doc/Makefile \
......
../../gnuscripts/lalsuite_vcs_info.am
\ No newline at end of file
/*
* LALBuildInfo.h - LAL Build Information Header
*
* 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 with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright (C) 2013 Karl Wette
*/
#ifndef _LALBUILDINFO_H
#define _LALBUILDINFO_H
#ifdef __cplusplus
extern "C" {
#endif
/* configure arguments */
extern const char *const lalConfigureArgs;
/* configure date */
extern const char *const lalConfigureDate;
/* build date */
extern const char *const lalBuildDate;
#ifdef __cplusplus
}
#endif
#endif /* _LALBUILDINFO_H */
/*
* LALAppsVCSInfo.c - LALApps VCS Information
* @PACKAGE_NAME@VCSInfo.c - @PACKAGE_NAME@ VCS Information
*
* 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
......@@ -16,45 +16,43 @@
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright (C) 2009,2010 Adam Mercer
* Copyright (C) 2009-2013 Adam Mercer
* Copyright (C) 2014 Karl Wette
*/
#include <config.h>
#include <lal/LALVCSInfo.h>
#include <LALAppsVCSInfo.h>
#include <lal/LALVCSInfoType.h>
#include "@PACKAGE_NAME@VCSInfoHeader.h"
/* global variables for vcs information */
const char *const lalAppsVCSVersion = LALAPPS_VERSION;
const char *const lalAppsVCSId = LALAPPS_VCS_ID;
const char *const lalAppsVCSDate = LALAPPS_VCS_DATE;
const char *const lalAppsVCSBranch = LALAPPS_VCS_BRANCH;
const char *const lalAppsVCSTag = LALAPPS_VCS_TAG;
const char *const lalAppsVCSAuthor = LALAPPS_VCS_AUTHOR;
const char *const lalAppsVCSCommitter = LALAPPS_VCS_COMMITTER;
const char *const lalAppsVCSStatus = LALAPPS_VCS_STATUS;
const char *const lal@PACKAGE_NAME_NOLAL@VCSVersion = @PACKAGE_NAME_UCASE@_VERSION;
const char *const lal@PACKAGE_NAME_NOLAL@VCSId = @PACKAGE_NAME_UCASE@_VCS_ID;
const char *const lal@PACKAGE_NAME_NOLAL@VCSDate = @PACKAGE_NAME_UCASE@_VCS_DATE;
const char *const lal@PACKAGE_NAME_NOLAL@VCSBranch = @PACKAGE_NAME_UCASE@_VCS_BRANCH;
const char *const lal@PACKAGE_NAME_NOLAL@VCSTag = @PACKAGE_NAME_UCASE@_VCS_TAG;
const char *const lal@PACKAGE_NAME_NOLAL@VCSAuthor = @PACKAGE_NAME_UCASE@_VCS_AUTHOR;
const char *const lal@PACKAGE_NAME_NOLAL@VCSCommitter = @PACKAGE_NAME_UCASE@_VCS_COMMITTER;
const char *const lal@PACKAGE_NAME_NOLAL@VCSStatus = @PACKAGE_NAME_UCASE@_VCS_STATUS;
/* global variables for vcs information - identable */
const char *const lalAppsVCSIdentId = LALAPPS_VCS_IDENT_ID;
const char *const lalAppsVCSIdentDate = LALAPPS_VCS_IDENT_DATE;
const char *const lalAppsVCSIdentBranch = LALAPPS_VCS_IDENT_BRANCH;
const char *const lalAppsVCSIdentTag = LALAPPS_VCS_IDENT_TAG;
const char *const lalAppsVCSIdentAuthor = LALAPPS_VCS_IDENT_AUTHOR;
const char *const lalAppsVCSIdentCommitter = LALAPPS_VCS_IDENT_COMMITTER;
const char *const lalAppsVCSIdentStatus = LALAPPS_VCS_IDENT_STATUS;
const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentId = @PACKAGE_NAME_UCASE@_VCS_IDENT_ID;
const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentDate = @PACKAGE_NAME_UCASE@_VCS_IDENT_DATE;
const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentBranch = @PACKAGE_NAME_UCASE@_VCS_IDENT_BRANCH;
const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentTag = @PACKAGE_NAME_UCASE@_VCS_IDENT_TAG;
const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentAuthor = @PACKAGE_NAME_UCASE@_VCS_IDENT_AUTHOR;
const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentCommitter = @PACKAGE_NAME_UCASE@_VCS_IDENT_COMMITTER;
const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentStatus = @PACKAGE_NAME_UCASE@_VCS_IDENT_STATUS;
/* vcs information structure */
const struct tagLALVCSInfo lalAppsVCSInfo = { \
LALAPPS_VCS_NAME, \
LALAPPS_VERSION, \
LALAPPS_VCS_ID, \
LALAPPS_VCS_DATE, \
LALAPPS_VCS_BRANCH, \
LALAPPS_VCS_TAG, \
LALAPPS_VCS_AUTHOR, \
LALAPPS_VCS_COMMITTER, \
LALAPPS_VCS_STATUS \
/* library vcs information structure */
const struct tagLALVCSInfo lal@PACKAGE_NAME_NOLAL@VCSInfo = { \
@PACKAGE_NAME_UCASE@_NAME, \
@PACKAGE_NAME_UCASE@_VERSION, \
@PACKAGE_NAME_UCASE@_VCS_ID, \
@PACKAGE_NAME_UCASE@_VCS_DATE, \
@PACKAGE_NAME_UCASE@_VCS_BRANCH, \
@PACKAGE_NAME_UCASE@_VCS_TAG, \
@PACKAGE_NAME_UCASE@_VCS_AUTHOR, \
@PACKAGE_NAME_UCASE@_VCS_COMMITTER, \
@PACKAGE_NAME_UCASE@_VCS_STATUS \
};
/*
......
/*
* LALPulsarVCSInfo.h - LALPulsar VCS Information Header
* @PACKAGE_NAME@VCSInfo.h - @PACKAGE_NAME@ VCS Information
*
* 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
......@@ -17,55 +17,54 @@
* MA 02111-1307 USA
*
* Copyright (C) 2009-2013 Adam Mercer
* Copyright (C) 2014 Karl Wette
*/
#ifndef _LALPULSARVCSINFO_H
#define _LALPULSARVCSINFO_H
#ifndef _@PACKAGE_NAME_UCASE@VCSINFO_H
#define _@PACKAGE_NAME_UCASE@VCSINFO_H
#include <lal/LALVCSInfo.h>
#include <lal/LALPulsarLibVCSInfo.h>
#include <lal/LALVCSInfoType.h>
#ifdef __cplusplus
extern "C" {
#endif
/* vcs information defines */
#define LALPULSAR_VCS_NAME "LALPulsar"
#define LALPULSAR_VCS_ID "@ID@"
#define LALPULSAR_VCS_DATE "@DATE@"
#define LALPULSAR_VCS_BRANCH "@BRANCH@"
#define LALPULSAR_VCS_TAG "@TAG@"
#define LALPULSAR_VCS_AUTHOR "@AUTHOR@"
#define LALPULSAR_VCS_COMMITTER "@COMMITTER@"
#define LALPULSAR_VCS_STATUS "@STATUS@"
/* global variables for vcs information */
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSVersion;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSId;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSDate;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSBranch;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSTag;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSAuthor;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSCommitter;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSStatus;
/* vcs information defines - identable*/
#define LALPULSAR_VCS_IDENT_ID "$" "LALPulsarId: @ID@ " "$"
#define LALPULSAR_VCS_IDENT_DATE "$" "LALPulsarDate: @DATE@ " "$"
#define LALPULSAR_VCS_IDENT_BRANCH "$" "LALPulsarBranch: @BRANCH@ " "$"
#define LALPULSAR_VCS_IDENT_TAG "$" "LALPulsarTag: @TAG@ " "$"
#define LALPULSAR_VCS_IDENT_AUTHOR "$" "LALPulsarAuthor: @AUTHOR@ " "$"
#define LALPULSAR_VCS_IDENT_COMMITTER "$" "LALPulsarCommitter: @COMMITTER@ " "$"
#define LALPULSAR_VCS_IDENT_STATUS "$" "LALPulsarStatus: @STATUS@ " "$"
/* global variables for vcs information - identable */
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentId;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentDate;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentBranch;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentTag;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentAuthor;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentCommitter;
extern const char *const lal@PACKAGE_NAME_NOLAL@VCSIdentStatus;
/* vcs information structures */
static const struct tagLALVCSInfo lalPulsarHeaderVCSInfo = { \
LALPULSAR_VCS_NAME, \
LALPULSAR_VERSION, \
LALPULSAR_VCS_ID, \
LALPULSAR_VCS_DATE, \
LALPULSAR_VCS_BRANCH, \
LALPULSAR_VCS_TAG, \
LALPULSAR_VCS_AUTHOR, \
LALPULSAR_VCS_COMMITTER, \
LALPULSAR_VCS_STATUS \
};
/* library vcs information structure */
extern const struct tagLALVCSInfo lal@PACKAGE_NAME_NOLAL@VCSInfo;
/* configure arguments */
extern const char *const lal@PACKAGE_NAME_NOLAL@ConfigureArgs;
/* configure date */
extern const char *const lal@PACKAGE_NAME_NOLAL@ConfigureDate;
/* build date */
extern const char *const lal@PACKAGE_NAME_NOLAL@BuildDate;
#ifdef __cplusplus
}
#endif
#endif /* _LALPULSARVCSINFO_H */
#endif /* _@PACKAGE_NAME_UCASE@VCSINFO_H */
/*
* vim: tw=0 ts=2 et
......
/*
* LALVCSInfo.h - LAL VCS Information Header
* @PACKAGE_NAME@VCSInfo.h - @PACKAGE_NAME@ VCS Information Header
*
* 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
......@@ -17,61 +17,57 @@
* MA 02111-1307 USA
*
* Copyright (C) 2009-2013 Adam Mercer
* Copyright (C) 2014 Karl Wette
*/
#ifndef _LALVCSINFO_H
#define _LALVCSINFO_H
#ifndef _@PACKAGE_NAME_UCASE@VCSINFOHEADER_H
#define _@PACKAGE_NAME_UCASE@VCSINFOHEADER_H
#include <lal/LALLibVCSInfo.h>
#include <lal/LALVCSInfoType.h>
#include <@PACKAGE_VCS_INFO_HEADER@>
#include <@PACKAGE_CONFIG_HEADER@>
#ifdef __cplusplus
extern "C" {
#endif
/* vcs information defines */
#define LAL_NAME "LAL"
#define LAL_VCS_ID "@ID@"
#define LAL_VCS_DATE "@DATE@"
#define LAL_VCS_BRANCH "@BRANCH@"
#define LAL_VCS_TAG "@TAG@"
#define LAL_VCS_AUTHOR "@AUTHOR@"
#define LAL_VCS_COMMITTER "@COMMITTER@"
#define LAL_VCS_STATUS "@STATUS@"
#define @PACKAGE_NAME_UCASE@_NAME "@PACKAGE_NAME@"
#define @PACKAGE_NAME_UCASE@_VCS_ID "@ID@"
#define @PACKAGE_NAME_UCASE@_VCS_DATE "@DATE@"
#define @PACKAGE_NAME_UCASE@_VCS_BRANCH "@BRANCH@"
#define @PACKAGE_NAME_UCASE@_VCS_TAG "@TAG@"
#define @PACKAGE_NAME_UCASE@_VCS_AUTHOR "@AUTHOR@"
#define @PACKAGE_NAME_UCASE@_VCS_COMMITTER "@COMMITTER@"
#define @PACKAGE_NAME_UCASE@_VCS_STATUS "@STATUS@"
/* vcs information defines - identable*/
#define LAL_VCS_IDENT_ID "$" "LALId: @ID@ " "$"
#define LAL_VCS_IDENT_DATE "$" "LALDate: @DATE@ " "$"
#define LAL_VCS_IDENT_BRANCH "$" "LALBranch: @BRANCH@ " "$"
#define LAL_VCS_IDENT_TAG "$" "LALTag: @TAG@ " "$"
#define LAL_VCS_IDENT_AUTHOR "$" "LALAuthor: @AUTHOR@ " "$"
#define LAL_VCS_IDENT_COMMITTER "$" "LALCommitter: @COMMITTER@ " "$"
#define LAL_VCS_IDENT_STATUS "$" "LALStatus: @STATUS@ " "$"
#define @PACKAGE_NAME_UCASE@_VCS_IDENT_ID "$" "@PACKAGE_NAME@Id: @ID@ " "$"
#define @PACKAGE_NAME_UCASE@_VCS_IDENT_DATE "$" "@PACKAGE_NAME@Date: @DATE@ " "$"
#define @PACKAGE_NAME_UCASE@_VCS_IDENT_BRANCH "$" "@PACKAGE_NAME@Branch: @BRANCH@ " "$"
#define @PACKAGE_NAME_UCASE@_VCS_IDENT_TAG "$" "@PACKAGE_NAME@Tag: @TAG@ " "$"
#define @PACKAGE_NAME_UCASE@_VCS_IDENT_AUTHOR "$" "@PACKAGE_NAME@Author: @AUTHOR@ " "$"
#define @PACKAGE_NAME_UCASE@_VCS_IDENT_COMMITTER "$" "@PACKAGE_NAME@Committer: @COMMITTER@ " "$"
#define @PACKAGE_NAME_UCASE@_VCS_IDENT_STATUS "$" "@PACKAGE_NAME@Status: @STATUS@ " "$"
/* header vcs information structure */
static const struct tagLALVCSInfo lalHeaderVCSInfo = { \
LAL_NAME, \
LAL_VERSION, \
LAL_VCS_ID, \
LAL_VCS_DATE, \
LAL_VCS_BRANCH, \
LAL_VCS_TAG, \
LAL_VCS_AUTHOR, \
LAL_VCS_COMMITTER, \
LAL_VCS_STATUS \
static const struct tagLALVCSInfo lal@PACKAGE_NAME_NOLAL@VCSInfoHeader = { \
@PACKAGE_NAME_UCASE@_NAME, \
@PACKAGE_NAME_UCASE@_VERSION, \
@PACKAGE_NAME_UCASE@_VCS_ID, \
@PACKAGE_NAME_UCASE@_VCS_DATE, \
@PACKAGE_NAME_UCASE@_VCS_BRANCH, \
@PACKAGE_NAME_UCASE@_VCS_TAG, \
@PACKAGE_NAME_UCASE@_VCS_AUTHOR, \
@PACKAGE_NAME_UCASE@_VCS_COMMITTER, \
@PACKAGE_NAME_UCASE@_VCS_STATUS \
};
/*
* function prototypes
*/
/* function to compare two LALVCSInfo structures */
int XLALVCSInfoCompare(const LALVCSInfo *header, const LALVCSInfo *library);
#ifdef __cplusplus
}
#endif
#endif /* _LALVCSINFO_H */
#endif /* _@PACKAGE_NAME_UCASE@VCSINFOHEADER_H */
/*
* vim: tw=0 ts=2 et
......
BUILT_SOURCES =
MOSTLYCLEANFILES =
include $(top_srcdir)/gnuscripts/lallibs_header_links.am
include $(top_srcdir)/gnuscripts/lalsuite_vcs_info.am
lib_LTLIBRARIES = liblal.la
pkginclude_HEADERS = \
LALBuildInfo.h \
LALConfig.h \
LALLibVCSInfo.h \
LALVCSInfo.h
LALVCSInfo.h \
LALVCSInfoHeader.h
liblal_la_SOURCES = \
LALEmpty.c \
......@@ -34,21 +36,6 @@ lal_version_LDADD = liblal.la
TESTS = lal-version
BUILT_SOURCES =
MOSTLYCLEANFILES =
if HAVE_GIT_REPO
BUILT_SOURCES += LALVCSInfo.h
MOSTLYCLEANFILES += LALVCSInfo.h
LALVCSInfo.h .PHONY : gen-LALVCSInfo.h
gen-LALVCSInfo.h :
$(AM_V_at)$(GENERATE_VCS_INFO) LALVCSInfo.h $(srcdir)/LALVCSInfo.h.git
endif
MOSTLYCLEANFILES += LALBuildInfo.c
LALBuildInfo.c: Makefile $(liblal_la_DEPENDENCIES)
$(AM_V_GEN)echo '/* $@: generated by Makefile */' >$@; \
echo 'const char *const lalConfigureArgs = "'"$(ac_configure_args)"'";' >>$@; \
echo 'const char *const lalConfigureDate = "'"$(configure_date)"'";' >>$@; \
echo 'const char *const lalBuildDate = "'`date +"%Y-%m-%dT%H:%M:%S%z"`'";' >>$@
vcs_info_sources = LALVCSInfoHeader.h
build_info_source = LALBuildInfo.c
$(build_info_source): $(liblal_la_DEPENDENCIES)
/*
* LALLibVCSInfo.h - LAL VCS Information Header
* LALVCSInfoType.h - LAL VCS Information Type
*
* 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
......@@ -16,28 +16,16 @@
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright (C) 2009,2010 Adam Mercer
* Copyright (C) 2009-2013 Adam Mercer
*/
#ifndef _LALLIBVCSINFO_H
#define _LALLIBVCSINFO_H
#include <lal/LALConfig.h>
#ifndef _LALVCSINFOTYPE_H
#define _LALVCSINFOTYPE_H
#ifdef __cplusplus
extern "C" {
#endif
/* global variables for vcs information, defined in LALVCSInfo.c */
extern const char *const lalVCSVersion;
extern const char *const lalVCSId;
extern const char *const lalVCSDate;
extern const char *const lalVCSBranch;
extern const char *const lalVCSTag;
extern const char *const lalVCSAuthor;
extern const char *const lalVCSCommitter;
extern const char *const lalVCSStatus;
/* define vcs information structure */
typedef struct tagLALVCSInfo
{
......@@ -52,14 +40,14 @@ typedef struct tagLALVCSInfo
const char *const vcsStatus;
} LALVCSInfo;
/* library vcs information structure */
extern const struct tagLALVCSInfo lalVCSInfo;
/* function to compare two LALVCSInfo structures */
int XLALVCSInfoCompare(const LALVCSInfo *header, const LALVCSInfo *library);
#ifdef __cplusplus
}
#endif
#endif /* _LALLIBVCSINFO_H */
#endif /* _LALVCSINFOTYPE_H */
/*
* vim: tw=0 ts=2 et
......
......@@ -20,6 +20,7 @@ pkginclude_HEADERS = \
LALStdio.h \
LALStdlib.h \
LALString.h \
LALVCSInfoType.h \
LALVersion.h \
StringInput.h \
XLALError.h \
......
/*
* LALVCSInfo.c - LAL VCS Information
* LALVCSInfoType.c - LAL VCS Information Type
*
* 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
......@@ -16,44 +16,11 @@
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright (C) 2009,2010 Adam Mercer
* Copyright (C) 2009-2013 Adam Mercer
*/
#include <string.h>
#include "config.h"
#include <LALVCSInfo.h>