README 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. Intro
  2. =====
  3. This directory contains a few sets of files that are used for
  4. configuration in diverse ways:
  5. *.conf Target platform configurations, please read
  6. 'Configurations of OpenSSL target platforms' for more
  7. information.
  8. *.tmpl Build file templates, please read 'Build-file
  9. programming with the "unified" build system' as well
  10. as 'Build info files' for more information.
  11. *.pm Helper scripts / modules for the main `Configure`
  12. script. See 'Configure helper scripts for more
  13. information.
  14. Configurations of OpenSSL target platforms
  15. ==========================================
  16. Configuration targets are a collection of facts that we know about
  17. different platforms and their capabilities. We organise them in a
  18. hash table, where each entry represent a specific target.
  19. Note that configuration target names must be unique across all config
  20. files. The Configure script does check that a config file doesn't
  21. have config targets that shadow config targets from other files.
  22. In each table entry, the following keys are significant:
  23. inherit_from => Other targets to inherit values from.
  24. Explained further below. [1]
  25. template => Set to 1 if this isn't really a platform
  26. target. Instead, this target is a template
  27. upon which other targets can be built.
  28. Explained further below. [1]
  29. sys_id => System identity for systems where that
  30. is difficult to determine automatically.
  31. enable => Enable specific configuration features.
  32. This MUST be an array of words.
  33. disable => Disable specific configuration features.
  34. This MUST be an array of words.
  35. Note: if the same feature is both enabled
  36. and disabled, disable wins.
  37. as => The assembler command. This is not always
  38. used (for example on Unix, where the C
  39. compiler is used instead).
  40. asflags => Default assembler command flags [4].
  41. cpp => The C preprocessor command, normally not
  42. given, as the build file defaults are
  43. usually good enough.
  44. cppflags => Default C preprocessor flags [4].
  45. defines => As an alternative, macro definitions may be
  46. given here instead of in `cppflags' [4].
  47. If given here, they MUST be as an array of
  48. the string such as "MACRO=value", or just
  49. "MACRO" for definitions without value.
  50. includes => As an alternative, inclusion directories
  51. may be given here instead of in `cppflags'
  52. [4]. If given here, the MUST be an array
  53. of strings, one directory specification
  54. each.
  55. cc => The C compiler command, usually one of "cc",
  56. "gcc" or "clang". This command is normally
  57. also used to link object files and
  58. libraries into the final program.
  59. cxx => The C++ compiler command, usually one of
  60. "c++", "g++" or "clang++". This command is
  61. also used when linking a program where at
  62. least one of the object file is made from
  63. C++ source.
  64. cflags => Defaults C compiler flags [4].
  65. cxxflags => Default C++ compiler flags [4]. If unset,
  66. it gets the same value as cflags.
  67. (linking is a complex thing, see [3] below)
  68. ld => Linker command, usually not defined
  69. (meaning the compiler command is used
  70. instead).
  71. (NOTE: this is here for future use, it's
  72. not implemented yet)
  73. lflags => Default flags used when linking apps,
  74. shared libraries or DSOs [4].
  75. ex_libs => Extra libraries that are needed when
  76. linking shared libraries, DSOs or programs.
  77. The value is also assigned to Libs.private
  78. in $(libdir)/pkgconfig/libcrypto.pc.
  79. shared_cppflags => Extra C preprocessor flags used when
  80. processing C files for shared libraries.
  81. shared_cflag => Extra C compiler flags used when compiling
  82. for shared libraries, typically something
  83. like "-fPIC".
  84. shared_ldflag => Extra linking flags used when linking
  85. shared libraries.
  86. module_cppflags
  87. module_cflags
  88. module_ldflags => Has the same function as the corresponding
  89. `shared_' attributes, but for building DSOs.
  90. When unset, they get the same values as the
  91. corresponding `shared_' attributes.
  92. ar => The library archive command, the default is
  93. "ar".
  94. (NOTE: this is here for future use, it's
  95. not implemented yet)
  96. arflags => Flags to be used with the library archive
  97. command. On Unix, this includes the
  98. command letter, 'r' by default.
  99. ranlib => The library archive indexing command, the
  100. default is 'ranlib' it it exists.
  101. unistd => An alternative header to the typical
  102. '<unistd.h>'. This is very rarely needed.
  103. shared_extension => File name extension used for shared
  104. libraries.
  105. obj_extension => File name extension used for object files.
  106. On unix, this defaults to ".o" (NOTE: this
  107. is here for future use, it's not
  108. implemented yet)
  109. exe_extension => File name extension used for executable
  110. files. On unix, this defaults to "" (NOTE:
  111. this is here for future use, it's not
  112. implemented yet)
  113. shlib_variant => A "variant" identifier inserted between the base
  114. shared library name and the extension. On "unixy"
  115. platforms (BSD, Linux, Solaris, MacOS/X, ...) this
  116. supports installation of custom OpenSSL libraries
  117. that don't conflict with other builds of OpenSSL
  118. installed on the system. The variant identifier
  119. becomes part of the SONAME of the library and also
  120. any symbol versions (symbol versions are not used or
  121. needed with MacOS/X). For example, on a system
  122. where a default build would normally create the SSL
  123. shared library as 'libssl.so -> libssl.so.1.1' with
  124. the value of the symlink as the SONAME, a target
  125. definition that sets 'shlib_variant => "-abc"' will
  126. create 'libssl.so -> libssl-abc.so.1.1', again with
  127. an SONAME equal to the value of the symlink. The
  128. symbol versions associated with the variant library
  129. would then be 'OPENSSL_ABC_<version>' rather than
  130. the default 'OPENSSL_<version>'. The string inserted
  131. into symbol versions is obtained by mapping all
  132. letters in the "variant" identifier to upper case
  133. and all non-alphanumeric characters to '_'.
  134. thread_scheme => The type of threads is used on the
  135. configured platform. Currently known
  136. values are "(unknown)", "pthreads",
  137. "uithreads" (a.k.a solaris threads) and
  138. "winthreads". Except for "(unknown)", the
  139. actual value is currently ignored but may
  140. be used in the future. See further notes
  141. below [2].
  142. dso_scheme => The type of dynamic shared objects to build
  143. for. This mostly comes into play with
  144. engines, but can be used for other purposes
  145. as well. Valid values are "DLFCN"
  146. (dlopen() et al), "DLFCN_NO_H" (for systems
  147. that use dlopen() et al but do not have
  148. fcntl.h), "DL" (shl_load() et al), "WIN32"
  149. and "VMS".
  150. perlasm_scheme => The perlasm method used to create the
  151. assembler files used when compiling with
  152. assembler implementations.
  153. shared_target => The shared library building method used.
  154. This is a target found in Makefile.shared.
  155. build_scheme => The scheme used to build up a Makefile.
  156. In its simplest form, the value is a string
  157. with the name of the build scheme.
  158. The value may also take the form of a list
  159. of strings, if the build_scheme is to have
  160. some options. In this case, the first
  161. string in the list is the name of the build
  162. scheme.
  163. Currently recognised build scheme is "unified".
  164. For the "unified" build scheme, this item
  165. *must* be an array with the first being the
  166. word "unified" and the second being a word
  167. to identify the platform family.
  168. multilib => On systems that support having multiple
  169. implementations of a library (typically a
  170. 32-bit and a 64-bit variant), this is used
  171. to have the different variants in different
  172. directories.
  173. bn_ops => Building options (was just bignum options in
  174. the earlier history of this option, hence the
  175. name). This is a string of words that describe
  176. algorithms' implementation parameters that
  177. are optimal for the designated target platform,
  178. such as the type of integers used to build up
  179. the bignum, different ways to implement certain
  180. ciphers and so on. To fully comprehend the
  181. meaning, the best is to read the affected
  182. source.
  183. The valid words are:
  184. THIRTY_TWO_BIT bignum limbs are 32 bits,
  185. this is default if no
  186. option is specified, it
  187. works on any supported
  188. system [unless "wider"
  189. limb size is implied in
  190. assembly code];
  191. BN_LLONG bignum limbs are 32 bits,
  192. but 64-bit 'unsigned long
  193. long' is used internally
  194. in calculations;
  195. SIXTY_FOUR_BIT_LONG bignum limbs are 64 bits
  196. and sizeof(long) is 8;
  197. SIXTY_FOUR_BIT bignums limbs are 64 bits,
  198. but execution environment
  199. is ILP32;
  200. RC4_CHAR RC4 key schedule is made
  201. up of 'unsigned char's;
  202. RC4_INT RC4 key schedule is made
  203. up of 'unsigned int's;
  204. EXPORT_VAR_AS_FN for shared libraries,
  205. export vars as
  206. accessor functions.
  207. apps_aux_src => Extra source to build apps/openssl and other
  208. apps, as needed by the target and that can be
  209. collected in a library.
  210. apps_init_src => Init source to build apps/openssl and other
  211. apps, as needed by the target. This code
  212. cannot be placed in a library, as the rest
  213. of the code isn't expected to link to it
  214. explicitly.
  215. cpuid_asm_src => assembler implementation of cpuid code as
  216. well as OPENSSL_cleanse().
  217. Default to mem_clr.c
  218. bn_asm_src => Assembler implementation of core bignum
  219. functions.
  220. Defaults to bn_asm.c
  221. ec_asm_src => Assembler implementation of core EC
  222. functions.
  223. des_asm_src => Assembler implementation of core DES
  224. encryption functions.
  225. Defaults to 'des_enc.c fcrypt_b.c'
  226. aes_asm_src => Assembler implementation of core AES
  227. functions.
  228. Defaults to 'aes_core.c aes_cbc.c'
  229. bf_asm_src => Assembler implementation of core BlowFish
  230. functions.
  231. Defaults to 'bf_enc.c'
  232. md5_asm_src => Assembler implementation of core MD5
  233. functions.
  234. sha1_asm_src => Assembler implementation of core SHA1,
  235. functions, and also possibly SHA256 and
  236. SHA512 ones.
  237. cast_asm_src => Assembler implementation of core CAST
  238. functions.
  239. Defaults to 'c_enc.c'
  240. rc4_asm_src => Assembler implementation of core RC4
  241. functions.
  242. Defaults to 'rc4_enc.c rc4_skey.c'
  243. rmd160_asm_src => Assembler implementation of core RMD160
  244. functions.
  245. rc5_asm_src => Assembler implementation of core RC5
  246. functions.
  247. Defaults to 'rc5_enc.c'
  248. wp_asm_src => Assembler implementation of core WHIRLPOOL
  249. functions.
  250. cmll_asm_src => Assembler implementation of core CAMELLIA
  251. functions.
  252. Defaults to 'camellia.c cmll_misc.c cmll_cbc.c'
  253. modes_asm_src => Assembler implementation of cipher modes,
  254. currently the functions gcm_gmult_4bit and
  255. gcm_ghash_4bit.
  256. padlock_asm_src => Assembler implementation of core parts of
  257. the padlock engine. This is mandatory on
  258. any platform where the padlock engine might
  259. actually be built.
  260. [1] as part of the target configuration, one can have a key called
  261. 'inherit_from' that indicate what other configurations to inherit
  262. data from. These are resolved recursively.
  263. Inheritance works as a set of default values that can be overridden
  264. by corresponding key values in the inheriting configuration.
  265. Note 1: any configuration table can be used as a template.
  266. Note 2: pure templates have the attribute 'template => 1' and
  267. cannot be used as build targets.
  268. If several configurations are given in the 'inherit_from' array,
  269. the values of same attribute are concatenated with space
  270. separation. With this, it's possible to have several smaller
  271. templates for different configuration aspects that can be combined
  272. into a complete configuration.
  273. instead of a scalar value or an array, a value can be a code block
  274. of the form 'sub { /* your code here */ }'. This code block will
  275. be called with the list of inherited values for that key as
  276. arguments. In fact, the concatenation of strings is really done
  277. by using 'sub { join(" ",@_) }' on the list of inherited values.
  278. An example:
  279. "foo" => {
  280. template => 1,
  281. haha => "ha ha",
  282. hoho => "ho",
  283. ignored => "This should not appear in the end result",
  284. },
  285. "bar" => {
  286. template => 1,
  287. haha => "ah",
  288. hoho => "haho",
  289. hehe => "hehe"
  290. },
  291. "laughter" => {
  292. inherit_from => [ "foo", "bar" ],
  293. hehe => sub { join(" ",(@_,"!!!")) },
  294. ignored => "",
  295. }
  296. The entry for "laughter" will become as follows after processing:
  297. "laughter" => {
  298. haha => "ha ha ah",
  299. hoho => "ho haho",
  300. hehe => "hehe !!!",
  301. ignored => ""
  302. }
  303. [2] OpenSSL is built with threading capabilities unless the user
  304. specifies 'no-threads'. The value of the key 'thread_scheme' may
  305. be "(unknown)", in which case the user MUST give some compilation
  306. flags to Configure.
  307. [3] OpenSSL has three types of things to link from object files or
  308. static libraries:
  309. - shared libraries; that would be libcrypto and libssl.
  310. - shared objects (sometimes called dynamic libraries); that would
  311. be the engines.
  312. - applications; those are apps/openssl and all the test apps.
  313. Very roughly speaking, linking is done like this (words in braces
  314. represent the configuration settings documented at the beginning
  315. of this file):
  316. shared libraries:
  317. {ld} $(CFLAGS) {lflags} {shared_ldflag} -o libfoo.so \
  318. foo/something.o foo/somethingelse.o {ex_libs}
  319. shared objects:
  320. {ld} $(CFLAGS) {lflags} {module_ldflags} -o libeng.so \
  321. blah1.o blah2.o -lcrypto {ex_libs}
  322. applications:
  323. {ld} $(CFLAGS) {lflags} -o app \
  324. app1.o utils.o -lssl -lcrypto {ex_libs}
  325. [4] There are variants of these attribute, prefixed with `lib_',
  326. `dso_' or `bin_'. Those variants replace the unprefixed attribute
  327. when building library, DSO or program modules specifically.
  328. Historically, the target configurations came in form of a string with
  329. values separated by colons. This use is deprecated. The string form
  330. looked like this:
  331. "target" => "{cc}:{cflags}:{unistd}:{thread_cflag}:{sys_id}:{lflags}:{bn_ops}:{cpuid_obj}:{bn_obj}:{ec_obj}:{des_obj}:{aes_obj}:{bf_obj}:{md5_obj}:{sha1_obj}:{cast_obj}:{rc4_obj}:{rmd160_obj}:{rc5_obj}:{wp_obj}:{cmll_obj}:{modes_obj}:{padlock_obj}:{perlasm_scheme}:{dso_scheme}:{shared_target}:{shared_cflag}:{shared_ldflag}:{shared_extension}:{ranlib}:{arflags}:{multilib}"
  332. Build info files
  333. ================
  334. The build.info files that are spread over the source tree contain the
  335. minimum information needed to build and distribute OpenSSL. It uses a
  336. simple and yet fairly powerful language to determine what needs to be
  337. built, from what sources, and other relationships between files.
  338. For every build.info file, all file references are relative to the
  339. directory of the build.info file for source files, and the
  340. corresponding build directory for built files if the build tree
  341. differs from the source tree.
  342. When processed, every line is processed with the perl module
  343. Text::Template, using the delimiters "{-" and "-}". The hashes
  344. %config and %target are passed to the perl fragments, along with
  345. $sourcedir and $builddir, which are the locations of the source
  346. directory for the current build.info file and the corresponding build
  347. directory, all relative to the top of the build tree.
  348. To begin with, things to be built are declared by setting specific
  349. variables:
  350. PROGRAMS=foo bar
  351. LIBS=libsomething
  352. ENGINES=libeng
  353. SCRIPTS=myhack
  354. EXTRA=file1 file2
  355. Note that the files mentioned for PROGRAMS, LIBS and ENGINES *must* be
  356. without extensions. The build file templates will figure them out.
  357. For each thing to be built, it is then possible to say what sources
  358. they are built from:
  359. PROGRAMS=foo bar
  360. SOURCE[foo]=foo.c common.c
  361. SOURCE[bar]=bar.c extra.c common.c
  362. It's also possible to tell some other dependencies:
  363. DEPEND[foo]=libsomething
  364. DEPEND[libbar]=libsomethingelse
  365. (it could be argued that 'libsomething' and 'libsomethingelse' are
  366. source as well. However, the files given through SOURCE are expected
  367. to be located in the source tree while files given through DEPEND are
  368. expected to be located in the build tree)
  369. It's also possible to depend on static libraries explicitly:
  370. DEPEND[foo]=libsomething.a
  371. DEPEND[libbar]=libsomethingelse.a
  372. This should be rarely used, and care should be taken to make sure it's
  373. only used when supported. For example, native Windows build doesn't
  374. support building static libraries and DLLs at the same time, so using
  375. static libraries on Windows can only be done when configured
  376. 'no-shared'.
  377. One some platforms, shared libraries come with a name that's different
  378. from their static counterpart. That's declared as follows:
  379. SHARED_NAME[libfoo]=cygfoo-{- $config{shlibver} -}
  380. The example is from Cygwin, which has a required naming convention.
  381. Sometimes, it makes sense to rename an output file, for example a
  382. library:
  383. RENAME[libfoo]=libbar
  384. That line has "libfoo" renamed to "libbar". While it makes no
  385. sense at all to just have a rename like that (why not just use
  386. "libbar" everywhere?), it does make sense when it can be used
  387. conditionally. See a little further below for an example.
  388. In some cases, it's desirable to include some source files in the
  389. shared form of a library only:
  390. SHARED_SOURCE[libfoo]=dllmain.c
  391. For any file to be built, it's also possible to tell what extra
  392. include paths the build of their source files should use:
  393. INCLUDE[foo]=include
  394. In some cases, one might want to generate some source files from
  395. others, that's done as follows:
  396. GENERATE[foo.s]=asm/something.pl $(CFLAGS)
  397. GENERATE[bar.s]=asm/bar.S
  398. The value of each GENERATE line is a command line or part of it.
  399. Configure places no rules on the command line, except that the first
  400. item must be the generator file. It is, however, entirely up to the
  401. build file template to define exactly how those command lines should
  402. be handled, how the output is captured and so on.
  403. Sometimes, the generator file itself depends on other files, for
  404. example if it is a perl script that depends on other perl modules.
  405. This can be expressed using DEPEND like this:
  406. DEPEND[asm/something.pl]=../perlasm/Foo.pm
  407. There may also be cases where the exact file isn't easily specified,
  408. but an inclusion directory still needs to be specified. INCLUDE can
  409. be used in that case:
  410. INCLUDE[asm/something.pl]=../perlasm
  411. NOTE: GENERATE lines are limited to one command only per GENERATE.
  412. As a last resort, it's possible to have raw build file lines, between
  413. BEGINRAW and ENDRAW lines as follows:
  414. BEGINRAW[Makefile(unix)]
  415. haha.h: {- $builddir -}/Makefile
  416. echo "/* haha */" > haha.h
  417. ENDRAW[Makefile(unix)]
  418. The word within square brackets is the build_file configuration item
  419. or the build_file configuration item followed by the second word in the
  420. build_scheme configuration item for the configured target within
  421. parenthesis as shown above. For example, with the following relevant
  422. configuration items:
  423. build_file => "build.ninja"
  424. build_scheme => [ "unified", "unix" ]
  425. ... these lines will be considered:
  426. BEGINRAW[build.ninja]
  427. build haha.h: echo "/* haha */" > haha.h
  428. ENDRAW[build.ninja]
  429. BEGINRAW[build.ninja(unix)]
  430. build hoho.h: echo "/* hoho */" > hoho.h
  431. ENDRAW[build.ninja(unix)]
  432. Should it be needed because the recipes within a RAW section might
  433. clash with those generated by Configure, it's possible to tell it
  434. not to generate them with the use of OVERRIDES, for example:
  435. SOURCE[libfoo]=foo.c bar.c
  436. OVERRIDES=bar.o
  437. BEGINRAW[Makefile(unix)]
  438. bar.o: bar.c
  439. $(CC) $(CFLAGS) -DSPECIAL -c -o $@ $<
  440. ENDRAW[Makefile(unix)]
  441. See the documentation further up for more information on configuration
  442. items.
  443. Finally, you can have some simple conditional use of the build.info
  444. information, looking like this:
  445. IF[1]
  446. something
  447. ELSIF[2]
  448. something other
  449. ELSE
  450. something else
  451. ENDIF
  452. The expression in square brackets is interpreted as a string in perl,
  453. and will be seen as true if perl thinks it is, otherwise false. For
  454. example, the above would have "something" used, since 1 is true.
  455. Together with the use of Text::Template, this can be used as
  456. conditions based on something in the passed variables, for example:
  457. IF[{- $disabled{shared} -}]
  458. LIBS=libcrypto
  459. SOURCE[libcrypto]=...
  460. ELSE
  461. LIBS=libfoo
  462. SOURCE[libfoo]=...
  463. ENDIF
  464. or:
  465. # VMS has a cultural standard where all libraries are prefixed.
  466. # For OpenSSL, the choice is 'ossl_'
  467. IF[{- $config{target} =~ /^vms/ -}]
  468. RENAME[libcrypto]=ossl_libcrypto
  469. RENAME[libssl]=ossl_libssl
  470. ENDIF
  471. Build-file programming with the "unified" build system
  472. ======================================================
  473. "Build files" are called "Makefile" on Unix-like operating systems,
  474. "descrip.mms" for MMS on VMS, "makefile" for nmake on Windows, etc.
  475. To use the "unified" build system, the target configuration needs to
  476. set the three items 'build_scheme', 'build_file' and 'build_command'.
  477. In the rest of this section, we will assume that 'build_scheme' is set
  478. to "unified" (see the configurations documentation above for the
  479. details).
  480. For any name given by 'build_file', the "unified" system expects a
  481. template file in Configurations/ named like the build file, with
  482. ".tmpl" appended, or in case of possible ambiguity, a combination of
  483. the second 'build_scheme' list item and the 'build_file' name. For
  484. example, if 'build_file' is set to "Makefile", the template could be
  485. Configurations/Makefile.tmpl or Configurations/unix-Makefile.tmpl.
  486. In case both Configurations/unix-Makefile.tmpl and
  487. Configurations/Makefile.tmpl are present, the former takes
  488. precedence.
  489. The build-file template is processed with the perl module
  490. Text::Template, using "{-" and "-}" as delimiters that enclose the
  491. perl code fragments that generate configuration-dependent content.
  492. Those perl fragments have access to all the hash variables from
  493. configdata.pem.
  494. The build-file template is expected to define at least the following
  495. perl functions in a perl code fragment enclosed with "{-" and "-}".
  496. They are all expected to return a string with the lines they produce.
  497. generatesrc - function that produces build file lines to generate
  498. a source file from some input.
  499. It's called like this:
  500. generatesrc(src => "PATH/TO/tobegenerated",
  501. generator => [ "generatingfile", ... ]
  502. generator_incs => [ "INCL/PATH", ... ]
  503. generator_deps => [ "dep1", ... ]
  504. generator => [ "generatingfile", ... ]
  505. incs => [ "INCL/PATH", ... ],
  506. deps => [ "dep1", ... ],
  507. intent => one of "libs", "dso", "bin" );
  508. 'src' has the name of the file to be generated.
  509. 'generator' is the command or part of command to
  510. generate the file, of which the first item is
  511. expected to be the file to generate from.
  512. generatesrc() is expected to analyse and figure out
  513. exactly how to apply that file and how to capture
  514. the result. 'generator_incs' and 'generator_deps'
  515. are include directories and files that the generator
  516. file itself depends on. 'incs' and 'deps' are
  517. include directories and files that are used if $(CC)
  518. is used as an intermediary step when generating the
  519. end product (the file indicated by 'src'). 'intent'
  520. indicates what the generated file is going to be
  521. used for.
  522. src2obj - function that produces build file lines to build an
  523. object file from source files and associated data.
  524. It's called like this:
  525. src2obj(obj => "PATH/TO/objectfile",
  526. srcs => [ "PATH/TO/sourcefile", ... ],
  527. deps => [ "dep1", ... ],
  528. incs => [ "INCL/PATH", ... ]
  529. intent => one of "lib", "dso", "bin" );
  530. 'obj' has the intended object file *without*
  531. extension, src2obj() is expected to add that.
  532. 'srcs' has the list of source files to build the
  533. object file, with the first item being the source
  534. file that directly corresponds to the object file.
  535. 'deps' is a list of explicit dependencies. 'incs'
  536. is a list of include file directories. Finally,
  537. 'intent' indicates what this object file is going
  538. to be used for.
  539. obj2lib - function that produces build file lines to build a
  540. static library file ("libfoo.a" in Unix terms) from
  541. object files.
  542. called like this:
  543. obj2lib(lib => "PATH/TO/libfile",
  544. objs => [ "PATH/TO/objectfile", ... ]);
  545. 'lib' has the intended library file name *without*
  546. extension, obj2lib is expected to add that. 'objs'
  547. has the list of object files (also *without*
  548. extension) to build this library.
  549. libobj2shlib - function that produces build file lines to build a
  550. shareable object library file ("libfoo.so" in Unix
  551. terms) from the corresponding static library file
  552. or object files.
  553. called like this:
  554. libobj2shlib(shlib => "PATH/TO/shlibfile",
  555. lib => "PATH/TO/libfile",
  556. objs => [ "PATH/TO/objectfile", ... ],
  557. deps => [ "PATH/TO/otherlibfile", ... ]);
  558. 'lib' has the intended library file name *without*
  559. extension, libobj2shlib is expected to add that.
  560. 'shlib' has the corresponding shared library name
  561. *without* extension. 'deps' has the list of other
  562. libraries (also *without* extension) this library
  563. needs to be linked with. 'objs' has the list of
  564. object files (also *without* extension) to build
  565. this library.
  566. This function has a choice; it can use the
  567. corresponding static library as input to make the
  568. shared library, or the list of object files.
  569. obj2dso - function that produces build file lines to build a
  570. dynamic shared object file from object files.
  571. called like this:
  572. obj2dso(lib => "PATH/TO/libfile",
  573. objs => [ "PATH/TO/objectfile", ... ],
  574. deps => [ "PATH/TO/otherlibfile",
  575. ... ]);
  576. This is almost the same as libobj2shlib, but the
  577. intent is to build a shareable library that can be
  578. loaded in runtime (a "plugin"...). The differences
  579. are subtle, one of the most visible ones is that the
  580. resulting shareable library is produced from object
  581. files only.
  582. obj2bin - function that produces build file lines to build an
  583. executable file from object files.
  584. called like this:
  585. obj2bin(bin => "PATH/TO/binfile",
  586. objs => [ "PATH/TO/objectfile", ... ],
  587. deps => [ "PATH/TO/libfile", ... ]);
  588. 'bin' has the intended executable file name
  589. *without* extension, obj2bin is expected to add
  590. that. 'objs' has the list of object files (also
  591. *without* extension) to build this library. 'deps'
  592. has the list of library files (also *without*
  593. extension) that the programs needs to be linked
  594. with.
  595. in2script - function that produces build file lines to build a
  596. script file from some input.
  597. called like this:
  598. in2script(script => "PATH/TO/scriptfile",
  599. sources => [ "PATH/TO/infile", ... ]);
  600. 'script' has the intended script file name.
  601. 'sources' has the list of source files to build the
  602. resulting script from.
  603. In all cases, file file paths are relative to the build tree top, and
  604. the build file actions run with the build tree top as current working
  605. directory.
  606. Make sure to end the section with these functions with a string that
  607. you thing is appropriate for the resulting build file. If nothing
  608. else, end it like this:
  609. ""; # Make sure no lingering values end up in the Makefile
  610. -}
  611. Configure helper scripts
  612. ========================
  613. Configure uses helper scripts in this directory:
  614. Checker scripts
  615. ---------------
  616. These scripts are per platform family, to check the integrity of the
  617. tools used for configuration and building. The checker script used is
  618. either {build_platform}-{build_file}-checker.pm or
  619. {build_platform}-checker.pm, where {build_platform} is the second
  620. 'build_scheme' list element from the configuration target data, and
  621. {build_file} is 'build_file' from the same target data.
  622. If the check succeeds, the script is expected to end with a non-zero
  623. expression. If the check fails, the script can end with a zero, or
  624. with a `die`.