Add a warning about a seemingly common form of PEBKAC.  If you're trying to
hash passwords for user logins, you want crypto_scrypt, not scryptenc.


git-svn-id: http://scrypt.googlecode.com/svn/trunk@32 4dbf38cc-6022-0410-aae9-1d1eeb228fa7
rename maintainer-only BSD make file: use bmake -f BSDmakefile
rm autocrap/Makefile.am autocrap/acscrypt.m4 autocrap/configure.ac (dups)
configure.ac version

autoconf gets annoyed if configure.ac does not contain a literal
version argument in AC_INIT.  The upstream code tries to figure out
the version from the directory name and include it in.  This has a few problems:

* The code to do this is in Makefile, and is overwritten by autotools.
* The code doesn't work in Debian because the directory name does
  not necessarily encode the version.
* The file containing the version is not present in the upstream sources,
  and must be created by running "make", and autoconf fails if it is not
  found.
* The Makefile in the sources uses a syntactic extension not supported
  by GNU make, which errors out with "missing separator".

This patch passes a literal version number to AC_INIT.

BE SURE TO UPDATE FOR A NEW UPSTREAM VERSION!
automake options

Add two automake options.  The first, subdir-objects, is to avoid
zillions of warnings concerning refering to source files in
subdirectories.  The second, -Wall, has no discernible effect, which
is good.
configure.ac clock_gettime

Instead of always including -lrt when linking with it provides
clock_gettime, only link to it when clock_gettime is not available
without -lrt.  This is the recommended procedure.  To quote the
autoconf 2.69 info pages:

     'AC_CHECK_LIB' requires some care ... it is normally better to
     use 'AC_SEARCH_LIBS([gethostbyname], [nsl])' instead of
     'AC_CHECK_LIB([nsl], [gethostbyname])'.
configure.ac updates

Check that autoconf is running in the right directory, for safety.
Look for macros in m4/.
Flush the deprecated AM_MAINTAINER_MODE.
configure.ac CHECK_SYSCTL_HW_USERMEM

acscrypt.m4 contains the macro CHECK_SYSCTL_HW_USERMEM.  Move this
to m4/check_sysctl_hw_usermem.m4 so it can be found automatically
by autoconf.  The alternative would be to explicitly include acscrypt.m4
from configure.ac.
configure.ac libcrypto

Migrate -lcrypto from Makefile.am to configure.ac, and actually test
that it provides the desired AES API.
Makefile.am sse2

Use automake conditional for enabling/disabling sse2.  This gets the right
files into "make dist" and is more robust.  Basically, the approved
mechanism.  It also slightly clarifies the sse2 option in configure.ac,
which has to be tweaked to use AM_CONDITIONAL instead of AC_SUBST.
Makefile.am update

Update Makefile.am in a few ways.  Let GNU Emacs choose the format of
multiline assignments.  Avoid gratuitous use of scrypt_* automake
variables.  Include all the files in the "make dist" tarball, e.g.,
include *.h by adding them to _SOURCES, as discussed in the automake
info pages.  Avoid stepping on CFLAGS which is reserved for the user,
instead use AM_...
configure.ac standardize

Add standard constructs and comments and do things in standard ways
and in the standard order.
configure.ac detect sse2
cache ax_ext.m4

$ apt-get install autoconf-archive
$ mv /usr/share/aclocal/ax_ext.m4 m4/