Developer Notes¶
-
The distributed
ares_build.hin the official release tarballs is only intended to be used on systems which can also not run the also distributedconfigureorCMakescripts. It is generated as a copy ofares_build.h.distas can be seen in the code repository. -
If you check out from git on a non-
configureorCMakeplatform, you must run the appropriatebuildconf*script to set upares_build.hand other local files before being able to compile the library. There are pre-made makefiles for a subset of such systems such as Watcom, NMake, and MinGW Makefiles. -
On systems capable of running the
configureorCMakescripts, the process will overwrite the distributedares_build.hfile with one that is suitable and specific to the library being configured and built, this new file is generated from theares_build.h.inandares_build.h.cmaketemplate files. -
If you intend to distribute an already compiled c-ares library you MUST also distribute along with it the generated
ares_build.hwhich has been used to compile it. Otherwise, the library will be of no use for the users of the library that you have built. It is your responsibility to provide this file. No one at the c-ares project can know how you have built the library. The generated file includes platform and configuration dependent info, and must not be modified by anyone. -
We support both the AutoTools
configurebased build system as well as theCMakebuild system. Any new code changes must work with both. -
The files that get compiled and are present in the distribution are referenced in the
Makefile.incin the current directory. This file gets included in every build system supported by c-ares so that the list of files doesn't need to be maintained per build system. Don't forget to reference new header files otherwise they won't be included in the official release tarballs. -
We cannot assume anything else but very basic C89 compiler features being present. The lone exception is the requirement for 64bit integers which is not a requirement for C89 compilers to support. Please do not use any extended features released by later standards.
-
Newlines must remain unix-style for older compilers' sake.
-
Comments must be written in the old-style
/* unnested C-fashion */ -
Try to keep line lengths below 80 columns and formatted as the existing code. There is a
.clang-formatin the repository that can be used to run the automated code formatter as such:clang-format -i */*.c */*.h */*/*.c */*/*.h