Merge pull request #57 from NLnetLabs/show-build-options

Introduce `-V` option to print the version number and build options.
This commit is contained in:
Wouter Wijngaards 2019-08-14 12:47:42 +02:00 committed by GitHub
commit b266db3920
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 69 additions and 33 deletions

View file

@ -15,6 +15,9 @@
/* Do sha512 definitions in config.h */ /* Do sha512 definitions in config.h */
#undef COMPAT_SHA512 #undef COMPAT_SHA512
/* Command line arguments used with configure */
#undef CONFCMDLINE
/* Pathname to the Unbound configuration file */ /* Pathname to the Unbound configuration file */
#undef CONFIGFILE #undef CONFIGFILE

29
configure vendored
View file

@ -2,7 +2,7 @@
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for unbound 1.9.3. # Generated by GNU Autoconf 2.69 for unbound 1.9.3.
# #
# Report bugs to <unbound-bugs@nlnetlabs.nl>. # Report bugs to <unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues>.
# #
# #
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@ -275,10 +275,11 @@ fi
$as_echo "$0: be upgraded to zsh 4.3.4 or later." $as_echo "$0: be upgraded to zsh 4.3.4 or later."
else else
$as_echo "$0: Please tell bug-autoconf@gnu.org and $as_echo "$0: Please tell bug-autoconf@gnu.org and
$0: unbound-bugs@nlnetlabs.nl about your system, including $0: unbound-bugs@nlnetlabs.nl or
$0: any error possibly output before this message. Then $0: https://github.com/NLnetLabs/unbound/issues about your
$0: install a modern shell, or manually run the script $0: system, including any error possibly output before this
$0: under such a shell if you do have one." $0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi fi
exit 1 exit 1
fi fi
@ -592,7 +593,7 @@ PACKAGE_NAME='unbound'
PACKAGE_TARNAME='unbound' PACKAGE_TARNAME='unbound'
PACKAGE_VERSION='1.9.3' PACKAGE_VERSION='1.9.3'
PACKAGE_STRING='unbound 1.9.3' PACKAGE_STRING='unbound 1.9.3'
PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl' PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues'
PACKAGE_URL='' PACKAGE_URL=''
# Factoring default headers for most tests. # Factoring default headers for most tests.
@ -1665,7 +1666,7 @@ Some influential environment variables:
Use these variables to override the choices made by `configure' or to help Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations. it to find libraries and programs with nonstandard names/locations.
Report bugs to <unbound-bugs@nlnetlabs.nl>. Report bugs to <unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues>.
_ACEOF _ACEOF
ac_status=$? ac_status=$?
fi fi
@ -1887,9 +1888,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
( $as_echo "## ---------------------------------------- ## ( $as_echo "## --------------------------------------------------------------------------------------- ##
## Report this to unbound-bugs@nlnetlabs.nl ## ## Report this to unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues ##
## ---------------------------------------- ##" ## --------------------------------------------------------------------------------------- ##"
) | sed "s/^/$as_me: WARNING: /" >&2 ) | sed "s/^/$as_me: WARNING: /" >&2
;; ;;
esac esac
@ -2887,6 +2888,12 @@ LIBUNBOUND_AGE=1
cat >>confdefs.h <<_ACEOF
#define CONFCMDLINE "$@"
_ACEOF
CFLAGS="$CFLAGS" CFLAGS="$CFLAGS"
ac_ext=c ac_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
@ -21843,7 +21850,7 @@ $config_headers
Configuration commands: Configuration commands:
$config_commands $config_commands
Report bugs to <unbound-bugs@nlnetlabs.nl>." Report bugs to <unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues>."
_ACEOF _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1

View file

@ -12,7 +12,7 @@ sinclude(dnscrypt/dnscrypt.m4)
m4_define([VERSION_MAJOR],[1]) m4_define([VERSION_MAJOR],[1])
m4_define([VERSION_MINOR],[9]) m4_define([VERSION_MINOR],[9])
m4_define([VERSION_MICRO],[3]) m4_define([VERSION_MICRO],[3])
AC_INIT(unbound, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), unbound-bugs@nlnetlabs.nl, unbound) AC_INIT(unbound, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues, unbound)
AC_SUBST(UNBOUND_VERSION_MAJOR, [VERSION_MAJOR]) AC_SUBST(UNBOUND_VERSION_MAJOR, [VERSION_MAJOR])
AC_SUBST(UNBOUND_VERSION_MINOR, [VERSION_MINOR]) AC_SUBST(UNBOUND_VERSION_MINOR, [VERSION_MINOR])
AC_SUBST(UNBOUND_VERSION_MICRO, [VERSION_MICRO]) AC_SUBST(UNBOUND_VERSION_MICRO, [VERSION_MICRO])
@ -112,6 +112,8 @@ AC_SUBST(LIBUNBOUND_CURRENT)
AC_SUBST(LIBUNBOUND_REVISION) AC_SUBST(LIBUNBOUND_REVISION)
AC_SUBST(LIBUNBOUND_AGE) AC_SUBST(LIBUNBOUND_AGE)
AC_DEFINE_UNQUOTED(CONFCMDLINE, "$@", [Command line arguments used with configure])
CFLAGS="$CFLAGS" CFLAGS="$CFLAGS"
AC_AIX AC_AIX
if test "$ac_cv_header_minix_config_h" = "yes"; then if test "$ac_cv_header_minix_config_h" = "yes"; then

View file

@ -88,31 +88,20 @@
# include "nss.h" # include "nss.h"
#endif #endif
/** print usage. */ /** print build options. */
static void usage(void) static void
print_build_options(void)
{ {
const char** m; const char** m;
const char *evnm="event", *evsys="", *evmethod=""; const char *evnm="event", *evsys="", *evmethod="";
time_t t; time_t t;
struct timeval now; struct timeval now;
struct ub_event_base* base; struct ub_event_base* base;
printf("usage: unbound [options]\n"); printf("Version %s\n\n", PACKAGE_VERSION);
printf(" start unbound daemon DNS resolver.\n"); printf("Configure line: %s\n", CONFCMDLINE);
printf("-h this help\n");
printf("-c file config file to read instead of %s\n", CONFIGFILE);
printf(" file format is described in unbound.conf(5).\n");
printf("-d do not fork into the background.\n");
printf("-p do not create a pidfile.\n");
printf("-v verbose (more times to increase verbosity)\n");
#ifdef UB_ON_WINDOWS
printf("-w opt windows option: \n");
printf(" install, remove - manage the services entry\n");
printf(" service - used to start from services control panel\n");
#endif
printf("Version %s\n", PACKAGE_VERSION);
base = ub_default_event_base(0,&t,&now); base = ub_default_event_base(0,&t,&now);
ub_get_event_sys(base, &evnm, &evsys, &evmethod); ub_get_event_sys(base, &evnm, &evsys, &evmethod);
printf("linked libs: %s %s (it uses %s), %s\n", printf("Linked libs: %s %s (it uses %s), %s\n",
evnm, evsys, evmethod, evnm, evsys, evmethod,
#ifdef HAVE_SSL #ifdef HAVE_SSL
# ifdef SSLEAY_VERSION # ifdef SSLEAY_VERSION
@ -126,16 +115,39 @@ static void usage(void)
"nettle" "nettle"
#endif #endif
); );
printf("linked modules:"); printf("Linked modules:");
for(m = module_list_avail(); *m; m++) for(m = module_list_avail(); *m; m++)
printf(" %s", *m); printf(" %s", *m);
printf("\n"); printf("\n");
#ifdef USE_DNSCRYPT #ifdef USE_DNSCRYPT
printf("DNSCrypt feature available\n"); printf("DNSCrypt feature available\n");
#endif #endif
ub_event_base_free(base);
printf("\nBSD licensed, see LICENSE in source package for details.\n");
printf("Report bugs to %s\n", PACKAGE_BUGREPORT);
}
/** print usage. */
static void
usage(void)
{
printf("usage: unbound [options]\n");
printf(" start unbound daemon DNS resolver.\n");
printf("-h this help.\n");
printf("-c file config file to read instead of %s\n", CONFIGFILE);
printf(" file format is described in unbound.conf(5).\n");
printf("-d do not fork into the background.\n");
printf("-p do not create a pidfile.\n");
printf("-v verbose (more times to increase verbosity).\n");
printf("-V show version number and build options.\n");
#ifdef UB_ON_WINDOWS
printf("-w opt windows option: \n");
printf(" install, remove - manage the services entry\n");
printf(" service - used to start from services control panel\n");
#endif
printf("\nVersion %s\n", PACKAGE_VERSION);
printf("BSD licensed, see LICENSE in source package for details.\n"); printf("BSD licensed, see LICENSE in source package for details.\n");
printf("Report bugs to %s\n", PACKAGE_BUGREPORT); printf("Report bugs to %s\n", PACKAGE_BUGREPORT);
ub_event_base_free(base);
} }
#ifndef unbound_testbound #ifndef unbound_testbound
@ -720,7 +732,7 @@ main(int argc, char* argv[])
log_ident_default = strrchr(argv[0],'/')?strrchr(argv[0],'/')+1:argv[0]; log_ident_default = strrchr(argv[0],'/')?strrchr(argv[0],'/')+1:argv[0];
log_ident_set(log_ident_default); log_ident_set(log_ident_default);
/* parse the options */ /* parse the options */
while( (c=getopt(argc, argv, "c:dhpvw:")) != -1) { while( (c=getopt(argc, argv, "c:dhpvw:V")) != -1) {
switch(c) { switch(c) {
case 'c': case 'c':
cfgfile = optarg; cfgfile = optarg;
@ -741,6 +753,9 @@ main(int argc, char* argv[])
case 'w': case 'w':
winopt = optarg; winopt = optarg;
break; break;
case 'V':
print_build_options();
return 0;
case '?': case '?':
case 'h': case 'h':
default: default:

View file

@ -1,6 +1,12 @@
14 August 2019: Wouter 14 August 2019: Wouter
- Generate configlexer with newer flex. - Generate configlexer with newer flex.
12 August 2019: George
- Introduce `-V` option to print the version number and build options.
Previously reported build options like linked libs and linked modules
are now moved from `-h` to `-V` as well for consistency.
- PACKAGE_BUGREPORT now also includes link to GitHub issues.
1 August 2019: Wouter 1 August 2019: Wouter
- For #52 #53, second context does not close logfile override. - For #52 #53, second context does not close logfile override.
- Fix #52 #53, fix for example fail program. - Fix #52 #53, fix for example fail program.

View file

@ -54,7 +54,7 @@ resolvers are using the same port number (53).
The available options are: The available options are:
.TP .TP
.B \-h .B \-h
Show the version and commandline option help. Show the version number and commandline option help, and exit.
.TP .TP
.B \-c\fI cfgfile .B \-c\fI cfgfile
Set the config file with settings for unbound to read instead of reading the Set the config file with settings for unbound to read instead of reading the
@ -76,6 +76,9 @@ concurrently.
.B \-v .B \-v
Increase verbosity. If given multiple times, more information is logged. Increase verbosity. If given multiple times, more information is logged.
This is in addition to the verbosity (if any) from the config file. This is in addition to the verbosity (if any) from the config file.
.TP
.B \-V
Show the version number and build options, and exit.
.SH "SEE ALSO" .SH "SEE ALSO"
\fIunbound.conf\fR(5), \fIunbound.conf\fR(5),
\fIunbound\-checkconf\fR(8), \fIunbound\-checkconf\fR(8),