New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding support for clang compilation in compile.sh #19
Conversation
Fix no default "cc" compiler being used.
I have update Install.txt. Clang is a very good compiler (fast and clean code generated). compiler.sh parameter is optionnal. The script version allows to detect earlier missing gcc or clang executable before trying to use it. |
I'd like to add that testing this results in the library being built using gcc regardless of parameters, and regardless of gcc being installed. That line is not changed in this commit, and due to the lack of ${COMPILER} variable there, gcc will always be used. Additionally, the COMPILER variable should have a default value, so as to not result in NO compiler being used (the consequence which can be seen here https://github.com/jmrenouard/whitedb/commit/14d65ee92bf12fdeb0e14da8ff7e4307639730cc#diff-0f8ed536b6067bbcef0adc6e88ab88d5R21 is probably not very useful) |
Fix compilation not working correctly with other compilers than gcc.
Hello, The last pull request with additional PR from necrophcodr. It fixes unset COMPILER var issue. Br. |
IMHO 'compile.sh' will never be portable. It was not meant to, rather the user was meant to edit it to their needs. Still, I'll merge this if you guys feel it makes things more convinient for clang users :-) Thanks. |
adding support for clang compilation in compile.sh
I've noticed that this shell script syntax is rather fragile. It seems to break on a system I'd expect to be quite common, 12.04 Ubuntu LTS. Rather than attempt to fix this, I'd propose this: How would you feel about running CC=clang ./compile.sh instead? I should have proposed this from the start but was preoccupied with other things and didn't divert much attention here. You can then also export CC=clang and I can add support for this to other shell scripts as well (such as Python/compile.sh, the examples etc). |
Ensure that all compile*.sh scripts use the CC env var (enhances pull request #19)
compile.sh support also clang compilation.
Clang compilation works perfectly.
Howto compile with gcc
./compile.sh or ./compile.sh gcc
Howto compile with clang
./compile.sh clang