RHash
RHash copied to clipboard
CMake-based build system for rhash
start on an alternative build system. This is far from finished and I want to implement some tests with it. This is an idea to help get things started. Comments and testing on your system are appreciated.
Todo:
- remove dependency upon GNU sed.
- make some build tests by translating most of the bash-based tests.
- Try to implement some of the other stuff from the ./configure Makefile system including that ccp-doc stuff (I just need to know what it was referring to).
- Test on MSYS. I have not yet done that.
As always, flames, comments, and criticism are welcome.
CppDoc2 was a good utility for generating JavaDoc-style documentation from sources. Regrettably its website cppdoc.com has expired in 2016. The last accessible version is https://web.archive.org/web/20151029190831/http://www.cppdoc.com/ .
We should drop cppdoc support, since it can't be downloaded now from a verified source.
I didn't see this PR and did a very minimalist pass for CMake just to support my own needs initially.
https://github.com/jrepp/RHash/tree/cmake-support
@JPeterMugaas A few changes I would propose to your much better pass on CMake support:
Improvements for embedding:
- Scope all the variables RHASH_ (rhash as a submodule in another cmake project)
- Allow the omitting of the executable (RHASH_LIBRARY_ONLY)
Consider using GLOB and file structures to cleanup the test/header-only/library use cases. Probably a bigger change and just listing the files is sufficient.
@JPeterMugaas cmake build fails on Ubuntu:
$ cmake . -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g") -- Found Gettext: /usr/bin/msgmerge (found version "0.19.7") -- Found Intl: /usr/include
-- RHash version: 1.3.6 -- OpenSSL Crypto Includes: /usr/include -- OpenSSL Crypto Library: /usr/lib/x86_64-linux-gnu/libcrypto.so -- Intl Includes: /usr/include -- Intl Library: Intl_LIBRARY-NOTFOUND -- CMAKE_EXECUTABLE_SUFFIX
-- SED /bin/sed -- Polyglotman (rman) /usr/bin/rman -- groff /usr/bin/groff CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: Intl_LIBRARY (ADVANCED) linked by target "rhash_exe" in directory /home/aleksey/Documents/private/RHash.GIT/build linked by target "rhash_lib" in directory /home/aleksey/Documents/private/RHash.GIT/build-- Configuring incomplete, errors occurred!
While the old ./configure script works:
$ ./configure Checking for target OS ... Linux Checking for cc version ... 5.4.0 Checking for linker support for -static ... yes Checking for linker support for dlopen ... yes Checking for linker support for --version-script ... yes Checking for gettext ... found Checking for OpenSSL ... runtime Checking for sources ... RHash 1.3.6 Writing config.mak Writing librhash/config.mak Writing dist/librhash.pc
The config.log shows how ./configure has found gettext:
============ Checking for gettext ============
----- source file: /tmp/rhash-configure-19883-15721/tmp.c -----
#include <libintl.h>
int main(void) { return 0; }
----- end of file: /tmp/rhash-configure-19883-15721/tmp.c -----
cc -O2 -pipe -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections -Wall -W -Wstrict-prototypes -Wnested-externs -Winline -Wpointer-arith -Wbad-function-cast -Wmissing-prototypes -Wmissing-declarations /tmp/rhash-configure-19883-15721/tmp.c -o /tmp/rhash-
configure-19883-15721/tmp -c
Compilation result: 0
----- source file: /tmp/rhash-configure-19883-15721/tmp.c -----
#include <libintl.h>
int main(void) {
gettext("");
return 0;
}
----- end of file: /tmp/rhash-configure-19883-15721/tmp.c -----
cc -O2 -pipe -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections -Wall -W -Wstrict-prototypes -Wnested-externs -Winline -Wpointer-arith -Wbad-function-cast -Wmissing-prototypes -Wmissing-declarations /tmp/rhash-configure-19883-15721/tmp.c -o /tmp/rhash-
configure-19883-15721/tmp
Compilation result: 0
Result is: found
=============================================
Sorry for my late reply but I wanted to do a lot more work on this to add more capabilities to the cmake-based system which I hope migh replace the configure script one of these days.
Alright, I did try to prefix most of the variables. The only ones I didn't prefix are for various syntax purposes or because of some things in CMake. I did try to provide some way to make a minimalist cmake for embedding in other projects but my main focus is on a giant distribution for developer package redistribution. I did try to provide some things for a NSIS installer and I wanted to work on some tests. There's still much to do in that regard to replace the ones based on the bash shell plus I'm still hoping to replace the .sed file with a cmake script so that this stuff can be more platform independent.
I also used Doxygen extensively for developer documentation in both HTML and man forms.
Now this having been said, I'm not sure what to think about the Intl issue on Linux but I hope look further at this later. Hopefully, retesting might help. I would have to probably update my Archlinux Virtual Machine to test that issue.
Alright, I did look at the documentation for the FindIntl module and this is what it said:
On some platforms, such as Linux with GNU libc, the gettext
functions are present in the C standard library and libintl
is not required. Intl_LIBRARIES
will be empty in this
case.
This is something that I did NOT take into account and I was not thinking about it because on Windows, there is an additional library that we have to link to if we are to compile an .EXE that uses that functionality. On Ubuntu and probably several other things, you do NOT need to link to an additional library. I will check in a patch for this but I'm not sure how well it would work. But please test this and let me know.
Hello, thank for fixing issues. I'm very busy with RL now, but I plan to review the pull request in the next coming months.
Please do not switch to CMake as build system, as CMake does not properly work on some platforms that may be supported now. One example is AIX, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89096#c9 Another example is Cygwin: Cygwin by itself does not want to have WIN32 defined, but CMake does define WIN32 by itself - which is just wrong.
I think that would depend upon what version of CMake. There was a change in cmake policies in that regard starting with cmake 2.83 (or something).
This is a big improvement upon the current custom build system. This enables me to build the librhash using Visual Studio. I propose to work on this cmake solution, unless somebody comes forward and create a proper autotools alternative.
There's something wrong with the PR, does it change line endings or something? Its like everything has been edited
Other than that, this should have been merged 2 years ago, but maybe people are willing to create a meson project for rhash now?