Commit graph

98 commits

Author SHA1 Message Date
37c69a3a7a Clarify build requirements
Document the need for the XSI Extension.  Don't list curses as
required, it's actually optional.  Correct advice for Solaris.  Add
advice for AIX.  Drop references to C89; we actually require C99, and
POSIX.1-2001 provides it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-23 07:08:21 +01:00
d6c5c263b9 Fix build for systems that don't provide POSIX.1-2001 by default
We require POSIX.1-2001.  Some systems provide it only with feature
test macro _POSIX_C_SOURCE defined to 200112L.  Since we don't define
it, the build fails there.  Observed on Solaris 10.

We actually require the XSI extension.  The GNU C Library provides it
by default.  With _POSIX_C_SOURCE 200112L, however, you have to define
feature test macro _XOPEN_SOURCE to get it.  But then _POSIX_C_SOURCE
is redundant.

Make configure put #define _XOPEN_SOURCE 600 into config.h.  Drop the
two existing #define _XOPEN_SOURCE 500 in .c files.

Now Solaris cc refuses to play ball unless switched to C99.  Replace
AC_PROG_CC by AC_PROG_CC_STDC to mollify it.

Unfortunately, use of _XOPEN_SOURCE exposes bugs in AIX libc and old
versions of GNU libc:

* AIX defines struct in6_addr's member s6_addr as a macro expanding
  into the actual member.  Without _ALL_SOURCE (the default), the
  expansion is wrong and doesn't compile.  Observed with AIX V7.2.

* GNU lib's IN6_IS_ADDR_V4MAPPED() is unusable without
  _DEFAULT_SOURCE (default) or _GNU_SOURCE.  Observed with Debian 8.
  Tracked at <https://sourceware.org/bugzilla/show_bug.cgi?id=16421>,
  fixed in version 2.25.

Affects just sockaddr_ntop()'s special case from commit 372cdb136 "Use
IPv4 format for IPv4-mapped addresses", v4.3.31.  Disable the special
case and use IPv6 format on such systems.  This is a very minor
usability regression.  Could be avoided, I guess, but it's not worth
the trouble.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-23 07:08:03 +01:00
8e00a61812 client: Drop use of getpass()
getpass() is traditional Unix, but has been withdrawn from POSIX.  We
still use it when it's available, and fall back to portable code only
when it's not.

The portable code behaves differently: it reads stdin instead of
/dev/tty, and in noncanonical mode.

Simplify things: always use the replacement.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-23 07:08:03 +01:00
4a1ec06364 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:28 +01:00
d111522fe8 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2018-04-29 10:33:19 +02:00
8e8bed5865 configure: Fix botched fix of .tarball-version access
Commit ece998e fixed .tarball-version access from separate build tree
by adding $srcdir/ to it.  That's wrong in m4_esyscmd(), because there
it runs at autoconf time, where $srcdir isn't necessary and doesn't
exist.  Revert that part.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 07:39:11 +02:00
ece998e064 configure: Fix .tarball-version access from separate build tree
configure reads .tarball-version when the source tree isn't
git-controlled.  Fails when the build tree is separate.  Fix it to
read $srcdir/.tarball-version.

The occurence in Make.mk isn't wrong, because VPATH applies there.
Change it anyway, for consistency and a bit of extra robustness.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-02 15:00:14 +02:00
afe5001a23 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-07 09:38:32 +02:00
d3a64a4f6e Merge branch 'readline' 2017-08-07 09:37:44 +02:00
1ec9b94f74 configure Make: More detailed version information
Version information is in output of commands version, xdump version,
and in program output for option -v.  Looks like this:

    Wolfpack Empire 4.3.33

The version number is defined in configure.ac, and incremented
manually.  It identifies only the base release (here: 4.3.33).  Fine
when this is an unmodified released version.  Pretty much useless
during development.

Add a suffix to the version number that describes it further:

    V               Unmodified release V (same as before)
    V.N-H           Modified release built from a clean git tree
                    N is the number of additional commits, and
                    H is the abbreviated commit hash
    V.N-H-dirty     Same, but the working tree is dirty
    V-dirty         Modified release built from a tarball

A git tree is clean when the contents of its files are unchanged.
Changing only the their timestamps doesn't count.  It does count when
building from a tarball, because tracking contents isn't implemented
there.

Also use this suffixed version for tarball names.

The version reported by configure is fixed at configure generation
time, i.e. it is usually out of date during development.  Ensuring a
release tarball contains one with a current version is manual for now.
Running autoconf -f should do the trick.

Elsewhere, the version is determined at build time, so it is always
current.

Dirty tracking isn't implemented in the standalone client build.  If
you start with a clean tarball, the version will not change from V to
V-dirty when you build with modifications.

Steal build-aux/git-version-gen from autoconf 2.69 to help with
computing the version string.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:17 +02:00
db055aa8bc configure: Bump required autoconf version to 2.69
2.69 is more than four years old now.  Nobody has tested with 2.64 in
quite some time.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:17 +02:00
56f426ae9e client: New configure --with-readline
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 11:22:29 +02:00
1cbda2c7dd client: Rewrite readline configuration
AX_LIB_READLINE tries to cope with systems where readline lacks
history support, or lacks headers, or needs headers included in
unorthodox ways.  It puts six HAVE_ macros into config.h, and its
usage example takes 24 lines of code just to include two headers.

Way too complicated for my taste.  Replace with new MY_LIB_READLINE,
which succeeds only when you have a sane readline, and then defines
*one* macro: HAVE_LIBREADLINE.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 11:22:29 +02:00
Martin Haukeli
f1fc0df03d client: Add readline support to empire client
Readline provides fancy command line editing such as <Arrow Up> for
previous commands and CTRL+A to jump to the beginning of the line.

This patch does not add any completion on <tab> key, a TODO, if you
will.

A new command line flag, -H, turns on saving the history to disk.
This may have security implications on shared computers, as all
commands are saved as-is.  Thus "change re 1234" would be logged
directly to the file.

Signed-off-by: Martin Haukeli <martin.haukeli@gmail.com>

Rebase on top of preparatory work, fix a few bugs, and tidy up:

* Update the standalone client build, too.

* Fix the Windows build.

* Keep command line options sorted case-insensitively.

* Error out when $HOME is unset and getpwuid() fails, just like we do
  for $LOGNAME.

* Give @input_from_rl, @has_rl_input static linkage.

* @has_rl_input is a flag, not a counter, set and test it accordingly.

* Save all input in history, not just commands.  Martin's attempt to
  recognize commands works only as long as the server sends prompts
  faster than the user sends input.  Drop that part, and update commit
  message accordingly.

* Fix recv_input() not to truncate value of strlen() to int, and to
  use memmove() for updating @input_from_rl in place.

* Clean up whitespace in a few places.

* Tweak commit message.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 11:22:29 +02:00
bae3f5447e Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-07-02 17:45:44 +02:00
9645caf6ff configure: Use -fstack-protector-strong when available
Testing whether the compiler supports it is a bit tricky.

The obvious AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
doesn't suffice, since some ports of the GNU toolchain reportedly pass
this test, then fail to link.  That's because the compiler accepts the
flag, duly emits references to helper code in libc, but libc doesn't
provide, and linking fails.

Instead, use AX_APPEND_LINK_FLAGS with an input source that makes the
compiler emit the extra stack checking code.  This requires the latest
version from the autoconf-archive, so update m4/ax* to commit e3d948b.
Also update m4/my_append_compile_flags.m4 to keep it in sync with
upstream's ax_append_compile_flags.m4.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 13:19:38 +01:00
3f86dd2ecf configure: Use -fno-strict-aliasing -fno-strict-overflow
Contemporary compilers can squeeze out some extra performance by
assuming the program never executes code that has undefined behavior
according to the C standard.  Unfortunately, this can break programs.
Pointing out that these programs are non-conforming is as correct as
it is unhelpful, at least as long as the compiler is unable to
diagnose the non-conformingness.

Since keeping our programs working is a lot more important to us than
running them as fast as possible, forbid some assumptions that are
known to break real-world programs:

* Aliasing: perfectly clean programs don't engage in type-punning, and
  perfectly conforming programs do it only in full accordance with the
  standard's (subtle!) aliasing rules.  Neither kind of perfection is
  realistic for us, therefore -fno-strict-aliasing.

* Signed integer overflow: perfectly clean programs won't ever do
  signed integer arithmetic that overflows.  This is an imperfect
  program, therefore -fno-strict-overflow.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 13:19:38 +01:00
5cff5022a9 configure: Suppress Clang warning on carg()
Renaming carg() would be smarter, but I'd rather do that as part of a
consistent renaming of all command functions, and I'm not up to that
right now.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:11:37 +01:00
b824134240 configure: Enable -Wformat-security
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:11:37 +01:00
d9837728c2 configure: Enable more gcc warnings
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:11:37 +01:00
23373d01d9 configure: Test compiler flags
When AC_PROG_CC detects GCC, Make.mk adds a bunch of flags to CFLAGS.
Works only for flags that any version of gcc in use accepts.

Instead, make configure add the flags that actually work to CFLAGS.
This will let us add flags that work only for some compilers.

The new autoconf macros are from autoconf-archive v2015.02.24.

Unfortunately, AX_APPEND_COMPILE_FLAGS doesn't work reliably for
-Wno-*: gcc complains about unknown -Wno-foo only when other
diagnostics are being produced.  Test -Wfoo instead of -Wno-foo, and
rename to MY_APPEND_COMPILE_FLAGS.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-11-22 10:23:54 +01:00
35f34581be configure: Drop unused AC_C_CHAR_UNSIGNED test
Unused since commit 0c8c169. v4.3.3.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-06-06 15:49:28 +02:00
87d08a4584 Bump version to 4.3.34
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-06-04 10:52:11 +02:00
deabb8eda6 Belatedly bump version to 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 21:16:27 +01:00
b14f5276ab Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:21:34 +01:00
bb467c335d Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:48 +01:00
6f6bd9fbfe Bump version to 4.3.32
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-05-20 17:41:08 +02:00
fded50a09c Refresh autoconf macros from autoconf-archive-2013.04.06 2013-05-08 14:35:04 +02:00
fad8e7f7b9 Move auxiliary build tools to build-aux/ 2013-05-08 14:35:04 +02:00
df4925d696 Update copyright notice 2013-01-12 17:45:01 +01:00
1118f1c0ca Update copyright notice 2012-06-10 10:52:22 +02:00
ec41e85ad3 Bump version to 4.3.31 2012-06-10 10:42:17 +02:00
f7533451d0 Put home page URL into configure --help 2012-02-20 07:34:34 +01:00
39c4e957a4 Bump version to 4.3.30 2012-02-20 07:34:32 +01:00
a990d90b84 Bump version to 4.3.29 2011-08-03 20:36:28 +02:00
6dd3097e78 Bump version to 4.3.28 2011-04-22 17:24:05 +02:00
98cd2a3a70 Update known contributors comments 2011-04-14 20:21:23 +02:00
7e2008e7f4 License upgrade to GPL version 3 or later
Why upgrade?  I'm not a lawyer, but here's my take on the differences
to version 2:

* Software patents: better protection against abuse of patents to
  prevent users from exercising the rights under the GPL.  I doubt
  we'll get hit with a patent suit, but it's a good move just on
  general principles.

* License compatibility: compatible with more free licenses, i.e. can
  "steal" more free software for use in Empire.  I don't expect to steal
  much, but it's nice to have the option.

* Definition of "source code": modernization of some details for today's
  networked world, to make it easier to distribute the software.  Not
  really relevant to us now, as we normally distribute full source code.

* Tivoization: this is about putting GPL-licensed software in hardware,
  then make the hardware refuse to run modified software.  "Neat" trick
  to effectively deny its users their rights under the GPL.  Abuse was
  "pioneered" by TiVo (popular digital video recorders).  GPLv3 forbids
  it.  Unlikely to become a problem for us.

* Internationalization: more careful wording, to harden the license
  outside the US.  The lawyers tell us it better be done that way.

* License violations: friendlier way to deal with license violations.
  This has come out of past experience enforcing the GPL.

* Additional permissions: Probably not relevant to us.

Also include myself in the list of principal authors.
2011-04-12 21:20:58 +02:00
8a0d117d45 Bump version to 4.3.27 2010-06-03 16:43:38 +02:00
aad6855094 Bump version to 4.3.26 2010-03-27 12:49:08 +01:00
b55c56afaf Bump version to 4.3.25 2010-02-06 21:27:17 +01:00
73e25ff21e Update copyright notice 2010-01-19 08:40:17 +01:00
de5c0b1c6b Bump version to 4.3.24 2009-12-26 10:20:21 +01:00
a2557a1dec Bump version to 4.3.23 2009-04-30 21:16:56 +02:00
70a9a44bbc Fix autoconfiguration of libraries
configure checked for library functions with LIBS instead of
LIBS_server, which could break detection of getaddrinfo() on systems
where LIB_SOCKET isn't empty.

GNUmakefile put @PTHREAD_LIBS@ only in LDLIBS, which breaks linking of
server and possibly client on systems where it is not empty.

Broken in commit 8b778634.
2009-04-25 13:57:45 +02:00
a78476fcb9 Make configure print a configuration summary 2009-04-19 15:47:40 +02:00
dfb6620203 Autoconfigure use of terminfo
New configure --with-terminfo.  Before, terminfo was assumed to be
available everywhere but on Windows.
2009-04-19 15:42:19 +02:00
8b7786340e Clean up autoconfiguration of libraries
Make configure compute three sets of libraries: LIBS_client for the
client, LIBS_server for the server, and LIBS for the rest.  This
replaces termlibs.

Unfortunately, LIBS doesn't work with Windows, because
src/lib/w32/posixio.c pulls in socket stuff.  Temporary workaround:
use LIBS_server instead.
2009-04-13 12:55:15 +02:00
c02468fd69 Simplify autoconfiguration for Windows
Checking Windows libraries with autoconf is cumbersome, because
linking often fails unless you include the header, and AC_SEARCH_LIBS
doesn't permit that.

Just detect the Windows API instead, with new MY_WINDOWS_API.
2009-04-13 12:51:24 +02:00
8c3b8d107d Replace missing getpass()
getpass() is traditional Unix, but has been withdrawn from POSIX.  As
such, it may be missing.  Check for that, and provide ersatz.  It's
not a real replacement, because it doesn't do the special magic
getpass() is supposed to do: read from /dev/tty without echo.

This bypasses our existing getpass() for Windows.  In contrast to the
portable getpass(), the Windows one tries to turn off echo, but that
doesn't work for me (MinGW & Wine).  Remove it.
2009-04-10 19:09:57 +02:00