Include version number, passed down from GNU autoconf.

Add a -V argument to iscsi-target (and iscsi-harness), which will print
the utility name, version number, and destination for all bug reports,
and then exit the utility.

Modify the documentation accordingly.

Re-run autoconf and autoheader to pick up the necessary autoconf glue.
This commit is contained in:
agc 2006-03-04 21:56:11 +00:00
parent a70556aee7
commit 7717b41470
7 changed files with 92 additions and 37 deletions

View File

@ -7,6 +7,12 @@
/* Define to 1 if you have the <asm/byteorder.h> header file. */
/* #undef HAVE_ASM_BYTEORDER_H */
/* Define to 1 if you have the `asnprintf' function. */
/* #undef HAVE_ASNPRINTF */
/* Define to 1 if you have the `asprintf' function. */
#define HAVE_ASPRINTF 1
/* Define to 1 if you have the `bswap64' function. */
#define HAVE_BSWAP64 1
@ -115,20 +121,29 @@
/* Define to 1 if you have the <utime.h> header file. */
#define HAVE_UTIME_H 1
/* Define to 1 if you have the `vasnprintf' function. */
/* #undef HAVE_VASNPRINTF */
/* Define to 1 if you have the `vasprintf' function. */
#define HAVE_VASPRINTF 1
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
#define PACKAGE_BUGREPORT "Alistair Crooks <agc@NetBSD.org>"
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
#define PACKAGE_NAME "netbsd-iscsi"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
#define PACKAGE_STRING "netbsd-iscsi 20060304"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
#define PACKAGE_TARNAME "netbsd-iscsi"
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
#define PACKAGE_VERSION "20060304"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

View File

@ -1,6 +1,8 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
# Generated by GNU Autoconf 2.59 for netbsd-iscsi 20060304.
#
# Report bugs to <Alistair Crooks <agc@NetBSD.org>>.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
@ -265,11 +267,11 @@ SHELL=${CONFIG_SHELL-/bin/sh}
: ${ac_max_here_lines=38}
# Identity of this package.
PACKAGE_NAME=
PACKAGE_TARNAME=
PACKAGE_VERSION=
PACKAGE_STRING=
PACKAGE_BUGREPORT=
PACKAGE_NAME='netbsd-iscsi'
PACKAGE_TARNAME='netbsd-iscsi'
PACKAGE_VERSION='20060304'
PACKAGE_STRING='netbsd-iscsi 20060304'
PACKAGE_BUGREPORT='Alistair Crooks <agc@NetBSD.org>'
ac_unique_file="iscsi.c"
# Factoring default headers for most tests.
@ -778,7 +780,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures this package to adapt to many kinds of systems.
\`configure' configures netbsd-iscsi 20060304 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -834,7 +836,9 @@ _ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of netbsd-iscsi 20060304:";;
esac
cat <<\_ACEOF
Some influential environment variables:
@ -849,6 +853,7 @@ Some influential environment variables:
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <Alistair Crooks <agc@NetBSD.org>>.
_ACEOF
fi
@ -944,6 +949,8 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
netbsd-iscsi configure 20060304
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@ -956,7 +963,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
It was created by netbsd-iscsi $as_me 20060304, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@ -1276,6 +1283,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
@ -3021,9 +3037,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists. ##
## ------------------------------------------ ##
## ----------------------------------------------- ##
## Report this to Alistair Crooks <agc@NetBSD.org> ##
## ----------------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
@ -3174,9 +3190,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists. ##
## ------------------------------------------ ##
## ----------------------------------------------- ##
## Report this to Alistair Crooks <agc@NetBSD.org> ##
## ----------------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
@ -3326,9 +3342,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists. ##
## ------------------------------------------ ##
## ----------------------------------------------- ##
## Report this to Alistair Crooks <agc@NetBSD.org> ##
## ----------------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
@ -3487,9 +3503,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists. ##
## ------------------------------------------ ##
## ----------------------------------------------- ##
## Report this to Alistair Crooks <agc@NetBSD.org> ##
## ----------------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
@ -4294,7 +4310,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by $as_me, which was
This file was extended by netbsd-iscsi $as_me 20060304, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -4354,7 +4370,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
netbsd-iscsi config.status 20060304
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

View File

@ -1,5 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(iscsi.c)
AC_PREREQ(2.57)
AC_INIT([netbsd-iscsi],[20060304],[Alistair Crooks <agc@NetBSD.org>])
AC_CONFIG_SRCDIR([iscsi.c])
AC_CONFIG_HEADER(../include/config.h)
dnl Checks for programs.

View File

@ -1,4 +1,4 @@
.\" $NetBSD: iscsi-harness.8,v 1.1.1.1 2006/02/08 18:56:20 agc Exp $
.\" $NetBSD: iscsi-harness.8,v 1.2 2006/03/04 21:56:11 agc Exp $
.\"
.\" Copyright © 2006 Alistair Crooks. All rights reserved.
.\"
@ -26,7 +26,7 @@
.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd January 22, 2006
.Dd March 4, 2006
.Dt ISCSI-HARNESS 8
.Os
.Sh NAME
@ -55,6 +55,14 @@ service, and performs a discovery session,
then sends data of various sizes to the target, and reads
data of various sizes from the target.
.Pp
Options and operands available for
.Nm iscsi-harness :
.Bl -tag -width Ds
.It Fl V
.Nm
will print the utility name and version number,
and the address for bug reports, and then exit.
.It Fl a Ar authentication type
The authentication type can be one of
.Ar chap ,
.Ar Kerberos ,
@ -63,7 +71,7 @@ or
.Ar none .
The default value is
.Ar none .
.Pp
.It Fl d Ar digest type
The digest type can be one of
.Ar header ,
.Ar data ,
@ -74,6 +82,7 @@ or
.Ar none .
The default value is
.Ar none .
.El
.Sh FILES
.Bl -tag -width /var/run/iscsi-target.pid -compact
.It Pa /etc/iscsi/targets

View File

@ -91,8 +91,12 @@ main(int argc, char **argv)
auth_type = AuthNone;
mutual_auth = 0;
while ((i = getopt(argc, argv, "a:d:h:l:n:t:u:")) != -1) {
while ((i = getopt(argc, argv, "Va:d:h:l:n:t:u:")) != -1) {
switch(i) {
case 'V':
(void) printf("\"%s\" %s\nPlease send all bug reports to %s\n", PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_BUGREPORT);
exit(EXIT_SUCCESS);
/* NOTREACHED */
case 'a':
if (strcasecmp(optarg, "chap") == 0) {
auth_type = AuthCHAP;

View File

@ -1,4 +1,4 @@
.\" $NetBSD: iscsi-target.8,v 1.2 2006/02/09 23:36:48 agc Exp $
.\" $NetBSD: iscsi-target.8,v 1.3 2006/03/04 21:56:11 agc Exp $
.\"
.\" Copyright © 2006 Alistair Crooks. All rights reserved.
.\"
@ -26,7 +26,7 @@
.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd January 30, 2006
.Dd March 4, 2006
.Dt ISCSI-TARGET 8
.Os
.Sh NAME
@ -35,6 +35,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl D
.Op Fl V
.Op Fl b Ar block length
.Op Fl f Ar configuration file
.Op Fl p Ar port number
@ -62,6 +63,10 @@ When this option is specified,
will not detach itself from the controlling tty, and will
not become a daemon.
This can be useful for debugging purposes.
.It Fl V
.Nm
will print the utility name and version number,
and the address for bug reports, and then exit.
.It Fl f Ar configfile
Use the named file as the configuration file.
The default file can be found in

View File

@ -1,4 +1,4 @@
/* $NetBSD: iscsi-target.c,v 1.4 2006/02/14 20:08:37 agc Exp $ */
/* $NetBSD: iscsi-target.c,v 1.5 2006/03/04 21:56:11 agc Exp $ */
/*
* Copyright © 2006 Alistair Crooks. All rights reserved.
@ -84,11 +84,15 @@ main(int argc, char **argv)
cf = _PATH_ISCSI_TARGETS;
while ((i = getopt(argc, argv, "Db:f:p:t:v:")) != -1) {
while ((i = getopt(argc, argv, "DVb:f:p:t:v:")) != -1) {
switch (i) {
case 'D':
detach_me_harder = 0;
break;
case 'V':
(void) printf("\"%s\" %s\nPlease send all bug reports to %s\n", PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_BUGREPORT);
exit(EXIT_SUCCESS);
/* NOTREACHED */
case 'b':
device_set_var("blocklen", optarg);
break;