noloader / cryptopp-autotools

Autotools files for Crypto++ project
9 stars 9 forks source link

Remove cryptestcwd binary #3

Closed noloader closed 5 years ago

noloader commented 5 years ago

The Autotools project includes two binaries. The first is cryptest and the second is cryptestcwd. They are the same program in different configurations for historical reasons.

The historical reason is, Crypto++ did not have a configurable "data directory" for the longest time. The only place the test programs would run was from the directory where Crypto++ was unpacked. It was lame and caused a lot of problems for Linux users, packagers and maintainers.

Around Crypto++ 5.6.3 we added CRYPTOPP_DATA_DIRECTORY which allowed one to specify a data directory. One could make -DCRYPTOPP_DATA_DIRECTORY="..." and the test program could run once installed.

make -DCRYPTOPP_DATA_DIRECTORY="..." was also lame because it was "pick your poison". If absent, then the test program could run from the current working directory. If present, then the test program could run from the install directory. You could not have both.

Because we needed a test program that could run from both the current directory and install directory two executables were built - cryptest and cryptestcwd. cryptestcwd could test the library after building to ensure it worked, then cryptest could be installed and run.

The two test programs were still kind of lame so we closed the gap with an origin based search for the data files at Crypto++ 8.0. The origin is $ORIGIN as the linker understands it. For the test program, it just means the program also looks in ../share/cryptopp for data files. The origin search path supports install directories and staged installs using DESTDIR. Also see Issue 760.

Now that we have a cryptest programs that runs from both the current directory and install directory we no longer need cryptestcwd. This ticket will track removal of cryptestcwd binary from Autotools.

Also see DataDir on the Crypto++ wiki.