[oi-dev] Specifying GCC as a compiler in a Makefile for simple library
Denys Rtveliashvili
denys at rtveliashvili.name
Sun May 15 23:19:56 UTC 2016
Hello,
I am trying to build a very simple library.
That library has a Makefile and the correct way to build it on Illumos
would be to do this:
CC=gcc make library
So I wrote a Makefile for a oi-userland package with the following in it:
COMPILER= gcc
> include $(WS_MAKE_RULES)/prep.mk
> include $(WS_MAKE_RULES)/justmake.mk
> include $(WS_MAKE_RULES)/ips.mk
However, gmake build fails:
> symlink cloning
> /root/oi-userland/components/library/http-parser/http-parser-2.1 to
> /root/oi-userland/components/library/http-parser/build/i86
> (cd /root/oi-userland/components/library/http-parser/build/i86;
> /usr/bin/env LD_OPTIONS="-M /usr/lib/ld/map.noexstk -M
> /usr/lib/ld/map.noexdata -M /usr/lib/ld/map.pagealign -Bdirect -z
> ignore" LD_EXEC_OPTIONS="-z aslr=disable" CCACHE="/usr/bin/ccache"
> _CC_gcc_32_="/usr/gcc/4.9/bin/gcc" CC_gcc_64="/usr/gcc/4.9/bin/gcc"
> CXX_gcc_32="/usr/gcc/4.9/bin/g++" CXX_gcc_64="/usr/gcc/4.9/bin/g++"
> CCACHE_BASEDIR="/root/oi-userland/components/library/http-parser/build/i86"
> /usr/gnu/bin/make library)
> make[1]: Entering directory
> '/root/oi-userland/components/library/http-parser/build/i86'
> _cc_ -I. -DHTTP_PARSER_STRICT=0 -Wall -Wextra -Werror -O3 -fPIC -c
> http_parser.c -o libhttp_parser.o
> cc: -W option with unknown program all
So it is clear that it makes use of the "COMPILER" variable, otherwise
it would not have had "CC_gcc_32" in the messages. However, it looks
like it does not pass CC variable to the Makefile it eventually calls,
so that Makefile is using the default (and incompatible) compiler.
Please can you suggest something?
With kind regards,
Denys Rtveliashvili
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openindiana.org/pipermail/oi-dev/attachments/20160516/04013c2e/attachment-0004.html>
More information about the oi-dev
mailing list