grep . default, , Type "Help", . C, . C Python .
Python $ grep 'Type \\"help\\"' . -Ir
./Modules/main.c: "Type \"help\", \"copyright\", \"credits\" or \"license\" " \
Modules/main.c, Py_Main(). :
fprintf(stderr, "Python %s on %s\n",
Py_GetVersion(), Py_GetPlatform());
"on" , Py_GetPlatform() linux Py_GetVersion() ...
Python $ grep Py_GetVersion . -Irl
...
./Python/getversion.c
...
...
PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
Py_GetBuildInfo(), ...
Python $ grep Py_GetBuildInfo . -Irl
...
./Modules/getbuildinfo.c
...
.
const char *
Py_GetBuildInfo(void)
{
static char buildinfo[50 + sizeof(HGVERSION) +
((sizeof(HGTAG) > sizeof(HGBRANCH)) ?
sizeof(HGTAG) : sizeof(HGBRANCH))];
const char *revision = _Py_hgversion();
const char *sep = *revision ? ":" : "";
const char *hgid = _Py_hgidentifier();
if (!(*hgid))
hgid = "default";
PyOS_snprintf(buildinfo, sizeof(buildinfo),
"%s%s%s, %.20s, %.9s", hgid, sep, revision,
DATE, TIME);
return buildinfo;
}
, default - Mercurial. make , , HGTAG. makefile HGTAG , . ,
Python
Python $ ./configure
Python $ make HGTAG='echo awesome'
Python $ ./python
Python 3.2.3 (awesome, May 1 2013, 21:33:27)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>