Skip to content

rnvimserver: build fails because GNU make defaults CC to cc #606

Description

@ctm22396

Building rnvimserver with GNU can fail if CC is not set in the environment or if there is no "cc" the path that maps to a gcc-compatible compiler.

The following line in the Makefile fails to redefine CC as it is defined by default in GNU make to be "cc" (see info make).

CC ?= gcc

If CC is not defined by user, $(CC) will always evaluate to cc, and without a "cc" in the path, the build for rnvimserver will fail with the error cc: No such file or directory.

Just to confirm, I ran make on this simple test Makefile

test:
  echo $(CC)

and on both linux and windows it prints

echo cc
cc

It is possible that this could be a considered a windows-specific error, as a "cc" seems to always be included with gcc on linux. In my particular case on windows, I am using the build tools from rtools45, and it does not provide a companion cc for its gcc.

Is the purpose of the CC =? gcc check to allow users to set their preferred compiler in their environmental variables? It might need to be replaced with something more robust.

EDIT: The simplest fix for me was to just define CC in my environmental variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions