Hash :
6fa2870c
Author :
Date :
2009-05-31T23:13:38
version-etc: extend for packagers
Add three new configure options, intended for packagers:
--with-packager="packager name"
--with-packager-version="packager-specific version"
--with-packager-bug-reports="packager bug reporting"
An example with coreutils:
$ ./configure \
--with-packager=Gentoo \
--with-packager-bug-report=http://bugs.gentoo.org/ \
--with-packager-version="patchset 1.6"
$ ./src/ls --version | head -n3
ls (GNU coreutils) 7.1-dirty
Packaged by Gentoo (patchset 1.6)
Copyright (C) 2009 Free Software Foundation, Inc.
Note that the bug reporting info via --help doesn't show up because
coreutils uses its own custom emit_bug_reporting_address() implementation
in src/system.h. If it didn't, it'd look like:
$ ./src/ls --help | tail -n4
Report bugs to <bug-coreutils@gnu.org>.
Report Gentoo bugs to <http://bugs.gentoo.org/>.
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>.
General help using GNU software: <http://www.gnu.org/gethelp/>.
* lib/version-etc.c: Print new information, if provided.
* m4/version-etc.m4: New file.
* modules/version-etc (Files): Add m4/version-etc.m4.
(configure.ac): Add gl_VERSION_ETC.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
# version-etc.m4 serial 1
# Copyright (C) 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
dnl $1 - configure flag and define name
dnl $2 - human readable description
m4_define([gl_VERSION_ETC_FLAG],
[dnl
AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1], [$2])],
[dnl
case $withval in
yes|no) ;;
*) AC_DEFINE_UNQUOTED(AS_TR_CPP([PACKAGE_$1]), ["$withval"], [$2]) ;;
esac
])
])
AC_DEFUN([gl_VERSION_ETC],
[dnl
gl_VERSION_ETC_FLAG([packager],
[String identifying the packager of this software])
gl_VERSION_ETC_FLAG([packager-version],
[Packager-specific version information])
gl_VERSION_ETC_FLAG([packager-bug-reports],
[Packager info for bug reports (URL/e-mail/...)])
if test "X$with_packager" = "X" && \
test "X$with_packager_version$with_packager_bug_reports" != "X"
then
AC_MSG_ERROR([The --with-packager-{bug-reports,version} options require --with-packager])
fi
])